Live data from Hacker News

Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

filiph.github.io

31–40 of 170 posts

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#31

An alternative approach is using fuzzy-numbers. If evaluated with interval arithmetic you can do very long calculations involving uncertain numbers very fast and with strong mathematical guarantees. It would especially outperform the Monte-Carlo approach drastically.

This assumes the inputs are uniform distributions, or perhaps normals depending on what exactly fuzzy numbers mean. M-C is not so limited.

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#32
post #31

An alternative approach is using fuzzy-numbers. If evaluated with interval arithmetic you can do very long calculations involving uncertain numbers very fast and with strong mathematical guarantees. It would especially outperform the Monte-Carlo approach drastically.

This assumes the inputs are uniform distributions, or perhaps normals depending on what exactly fuzzy numbers mean. M-C is not so limited.

No. It assumes the numbers aren't random at all.

Although fuzzy-number can be used to model many different kinds of uncertainties.

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#33
If I am reading this right, a range is expressed as a distance between the minimum and maximum values, and in the Monte Carlo part a number is generated from a uniform distribution within that range[1].

But if I just ask the calculator "1~2" (i.e. just a range without any operators), the histogram shows what looks like a normal distribution centered around 1.5[2].

Shouldn't the histogram be flat if the distribution is uniform?

[1] https://github.com/filiph/unsure/blob/123712482b7053974cbef9...

[2] https://filiph.github.io/unsure/#f=1~2

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#34
post #5

Earlier quoted context omitted.

Yes it is.

Can you explain how? I'm an (aspiring)

It's dead simple. Here is the simplified version that returns the quantiles for '100 / 2 ~ 4'.

  import numpy as np
  
  def monte_carlo(formula, iterations=100000):
    res = [formula() for _ in range(iterations)]
    return np.percentile(res, [0, 2.5, \*range(10, 100, 10), 
    97.5, 100])

  def uncertain_division():
    return 100 / np.random.uniform(2, 4)

  monte_carlo(uncertain_division, iterations=100000)

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#35
post #28

Earlier quoted context omitted.

How do you process this equation ? 100 divided by something from one to ...?

> 100 / 4~6 Means "100 divided by some number between 4 and 6"

"...some number with a 95% probability of falling between 4.0 and 6.0 inclusive," I believe.

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#36

If I am reading this right, a range is expressed as a distance between the minimum and maximum values, and in the Monte Carlo part a number is generated from a uniform distribution within that range[1]. But if I just ask the calculator "1~2" (i.e. just a range without any operators), the histogram shows what looks like a normal distribution centered around 1.5[2]. Shouldn't the histogram be flat if the distribution i…

Under the "Limitations" section:

> Range is always a normal distribution, with the lower number being two standard deviations below the mean, and the upper number two standard deviations above. Nothing fancier is possible, in terms of input probability distributions.

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#38
post #30

Would be nice to retransform the output into an interval / gaussian distribution Note: If you're curious why there is a negative number (-5) in the histogram, that's just an inevitable downside of the simplicity of the Unsure Calculator. Without further knowledge, the calculator cannot know that a negative number is impossible Drake Equation or equation multiplying probabilities can also be seen in log space, where t…

The default example `100 / 4~6` gives the output `17~25`

Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator

#40

This reminds me of https://www.getguesstimate.com/ , a probabilistic spreadsheet.

The authors of Guesstimate are now working on https://www.squiggle-language.com/ Someone also turned it into the https://github.com/rethinkpriorities/squigglepy python library

[dead]
Post reply on HN