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.
Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator
31–40 of 170 posts
Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator
#32An 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.
Although fuzzy-number can be used to model many different kinds of uncertainties.
Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator
#33But 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...
Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator
#34Earlier quoted context omitted.
Yes it is.
Can you explain how? I'm an (aspiring)
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
#35Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator
#36If 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…
> 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
#37I really don't known how good it is.
Re: Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator
#38Would 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…