Readit News logoReadit News
roughly · 8 months ago
I like this!

In the grand HN tradition of being triggered by a word in the post and going off on a not-quite-but-basically-totally-tangential rant:

There’s (at least) three areas here that are footguns with these kinds of calculations:

1) 95% is usually a lot wider than people think - people take 95% as “I’m pretty sure it’s this,” whereas it’s really closer to “it’d be really surprising if it were not this” - by and large people keep their mental error bars too close.

2) probability is rarely truly uncorrelated - call this the “Mortgage Derivatives” maxim. In the family example, rent is very likely to be correlated with food costs - so, if rent is high, food costs are also likely to be high. This skews the distribution - modeling with an unweighted uniform distribution will lead to you being surprised at how improbable the actual outcome was.

3) In general normal distributions are rarer than people think - they tend to require some kind of constraining factor on the values to enforce. We see them a bunch in nature because there tends to be negative feedback loops all over the place, but once you leave the relatively tidy garden of Mother Nature for the chaos of human affairs, normal distributions get pretty abnormal.

I like this as a tool, and I like the implementation, I’ve just seen a lot of people pick up statistics for the first time and lose a finger.

btilly · 8 months ago
I strongly agree with this, and particularly point 1. If you ask people to provide estimated ranges for answers that they are 90% confident in, people on average produce roughly 30% confidence intervals instead. Over 90% of people don't even get to 70% confidence intervals.

You can test yourself at https://blog.codinghorror.com/how-good-an-estimator-are-you/.

Nevermark · 8 months ago
From link:

> Heaviest blue whale ever recorded

I don't think estimation errors regarding things outside of someone's area of familiarity say much.

You could ask a much "easier"" question from the same topic area and still get terrible answers: "What percentage of blue whales are blue?" Or just "Are blue whales blue?"

Estimating something often encountered but uncounted seems like a better test. Like how many cars pass in front of my house every day. I could apply arithmetic, soft logic and intuition to that. But that would be a difficult question to grade, given it has no universal answer.

pertdist · 8 months ago
I did a project with non-technical stakeholders modeling likely completion dates for a big GANTT chart. Business stakeholders wanted probabilistic task completion times because some of the tasks were new and impractical to quantify with fixed times.

Stakeholders really liked specifying work times as t_i ~ PERT(min, mode, max) because it mimics their thinking and handles typical real-world asymmetrical distributions.

[Background: PERT is just a re-parameterized beta distribution that's more user-friendly and intuitive https://rpubs.com/Kraj86186/985700]

kqr · 8 months ago
This looks like a much more sophisticated version of PERT than I have seen used. When people around me have claimed to use PERT, they have just added together all the small numbers, all the middle numbers, and all the big numbers. That results in a distribution that is too extreme in both lower and upper bound.
baq · 8 months ago
arguably this is how it should always be done, fixed durations for any tasks are little more than wishful thinking.
jrowen · 8 months ago
This jives with my general reaction to the post, which was that the added complexity and difficulty of reasoning about the ranges actually made me feel less confident in the result of their example calculation. I liked the $50 result, you can tack on a plus or minus range but generally feel like you're about breakeven. On the other hand, "95% sure the real balance will fall into the -$60 to +$220 range" feels like it's creating a false sense of having more concrete information when you've really just added compounding uncertainties at every step (if we don't know that each one is definitely 95%, or the true min/max, we're just adding more guesses to be potentially wrong about). That's why I don't like the Drake equation, every step is just compounding wild-ass guesses, is it really producing a useful number?
kqr · 8 months ago
It is producing a useful number. As more truly independent terms are added, error grows with the square root while the point estimation grows linearly. In the aggregate, the error makes up less of the point estimation.

This is the reason Fermi estimation works. You can test people on it, and almost universally they get more accurate with this method.

If you got less certain of the result in the example, that's probably a good thing. People are default overconfident with their estimated error bars.

roughly · 8 months ago
I think the point is to create uncertainty, though, or to at least capture it. You mention tacking a plus/minus range to $50, but my suspicion is that people's expected plus/minus would be narrower than the actual - I think the primary value of the example is that it makes it clear there's a very real possibility of the outcome being negative, which I don't think most people would acknowledge when they got the initial positive result. The increased uncertainty and the decreased confidence in the result is a feature, not a bug.
dawnofdusk · 8 months ago
>rent is very likely to be correlated with food costs - so, if rent is high, food costs are also likely to be high

Not sure I agree with this. It's reasonable to have a model where the mean rent may be correlated with the mean food cost, but given those two parameters we can model the fluctuations about the mean as uncorrelated. In any case at the point when you want to consider something like this you need to do proper Bayesian statistics anyways.

>In general normal distributions are rarer than people think - they tend to require some kind of constraining factor on the values to enforce.

I don't know where you're getting this from. One needs uncorrelated errors, but this isn't a "constraint" or "negative feedback".

roughly · 8 months ago
The family example is a pat example, but take something like project planning - two tasks, each one takes between 2 and 4 weeks - except that they’re both reliant on Jim, and if Jim takes the “over” on task 1, what’s the odds he takes the “under” on task 2?

This is why I joked about it as the mortgage derivatives maxim - what happened in 2008 (mathematically, at least - the parts of the crisis that aren’t covered by the famous Upton Sinclair quote) was that the mortgage backed derivatives were modeled as an aggregate of a thousand uncorrelated outcomes (a mortgage going bust), without taking into account that at least a subset of the conditions leading to one mortgage going bust would also lead to a separate unrelated mortgage going bust - the results were not uncorrelated, and treating them as such meant the “1 in a million” outcome was substantially more likely in reality than the model allowed.

Re: negative feedback - that’s a separate point from the uncorrelated errors problem above, and a critique of using the normal distribution at all for modeling many different scenarios. Normal distributions rely on some kind of, well, normal scattering of the outcomes, which means there’s some reason why they’d tend to clump around a central value. We see it in natural systems because there’s some constraints on things like height and weight of an organism, etc, but without some form of constraint, you can’t rely on a normal distribution - the classic examples being wealth, income, sales, etc, where the outliers tend to be so much larger than average that they’re effectively precluded by a normal distribution, and yet there they are.

To be clear, I’m not saying there are not statistical methods for handling all of the above, I’m noting that the naive approach of modeling several different uncorrelated normally distributed outcomes, which is what the posted tool is doing, has severe flaws which are likely to lead to it underestimating the probability of outlier outcomes.

youainti · 8 months ago
> I’ve just seen a lot of people pick up statistics for the first time and lose a finger.

I love this. I've never though of statistics like a power tool or firearm, but the analogy fits really well.

ninalanyon · 8 months ago
Unfortunately it's usually someone else who loses a finger, not the person wielding the statistics.
rssoconnor · 8 months ago
Normal distributions are the maximum entropy distributions for a given mean and variance. Therefore, in accordance with the principle of maximum entropy, unless you have some reason to not pick a normal distribution (e.g. you know your values must be non-negative), you should be using a normal distribution.
tgv · 8 months ago
At least also accept a log-normal distribution. Sometimes you need a factor like .2 ~ 5, but that isn't the same as N(2.6, 1.2).
kqr · 8 months ago
> you should be using a normal distribution.

...if the only things you know about an uncertain value are its expectation and variance, yes.

Often you know other things. Often you don't know expectation and variance with any certainty.

jbjbjbjb · 8 months ago
I think to do all that you’d need a full on DSL rather than something pocket calculator like. I think adding a triangular distribution would be good though.
gamerDude · 8 months ago
Great points. I think the idea of this calculator could just be simply extended to specific use cases to make the statistical calculation simple and take into account additional variables. Moving being one example.
larodi · 8 months ago
Actually using it already after finding it few days ago on HN
JKCalhoun · 8 months ago
> 2) probability is rarely truly uncorrelated

Without having fully digested how the Unsure Calculator computes, it seems to me you could perhaps "weight" the ranges you pass to the calculator. Rather than a standard bell curve the Calculator could apply a more tightly focused — or perhaps skewed curve for that term.

If you think your salary will be in the range of 10 to 20, but more likely closer to 10 you could:

10<~20 (not to be confused with less-than)

or: 10!~20 (not to be confused with factorial)

or even: 10~12~20 to indicate a range of 10 to 20 ... leaning toward 12.

roughly · 8 months ago
The correlation in this case isn't about the distribution for the individual event, it's about the interactions between them - so, for instance, Rent could be anywhere between 1200 and 1800, and Food could be anywhere between 100 and 150, but if Rent is 1200, it means Food is more likely to be 100, and if Food is 150, it means Rent is more likely to be 1800. Basically, there's a shared factor that's influencing both (local cost of living) that's the actual thing you need to model.

So, a realistic modeling isn't 1200~1500 + 100~150, it's (1~1.5)*(1200 + 150) - the "cost of living" distribution applies to both factors.

NunoSempere · 8 months ago
I have written similar tools

- for command line, fermi: https://git.nunosempere.com/NunoSempere/fermi

- for android, a distribution calculator: https://f-droid.org/en/packages/com.nunosempere.distribution...

People might also be interested in https://www.squiggle-language.com/, which is a more complex version (or possibly <https://git.nunosempere.com/personal/squiggle.c>, which is a faster but much more verbose version in C)

NunoSempere · 8 months ago
Fermi in particular has the following syntax

```

5M 12M # number of people living in Chicago

beta 1 200 # fraction of people that have a piano

30 180 # minutes it takes to tune a piano, including travel time

/ 48 52 # weeks a year that piano tuners work for

/ 5 6 # days a week in which piano tuners work

/ 6 8 # hours a day in which piano tuners work

/ 60 # minutes to an hour

```

multiplication is implied as the default operation, fits are lognormal.

NunoSempere · 8 months ago
Here is a thread with some fun fermi estimates made with that tool: e.g., number of calories NK gets from Russia: https://x.com/NunoSempere/status/1857135650404966456

900K 1.5M # tonnes of rice per year NK gets from Russia

* 1K # kg in a tone

* 1.2K 1.4K # calories per kg of rice

/ 1.9K 2.5K # daily caloric intake

/ 25M 28M # population of NK

/ 365 # years of food this buys

/ 1% # as a percentage

kqr · 8 months ago
Oh, this is very similar to what I have with Precel, less syntax. Thanks for sharing!
NunoSempere · 8 months ago
Another tool in this spirit is <https://carlo.app/>, which allows you to do this kind of calculation on google sheets.
joshlemer · 8 months ago
Their pricing is absolutely out of this world though. Their BASIC plan is $2990 USD per year, the pro plan is $9990/year. https://carlo.app/pricing
dariosalvi78 · 8 months ago
notpushkin · 8 months ago
Would be a nice touch if Squiggle supported the `a~b` syntax :^)
antman · 8 months ago
I tried the unsure calc and the android app and they seem to produce different results?
NunoSempere · 8 months ago
The android app fits lognormals, and 90% rather than 95% confidence intervals. I think they are a more parsimonious distribution for doing these kinds of estimates. One hint might be that, per the central limit theorem, sums of independent variables will tend to normals, which means that products will tend to be lognormals, and for the decompositions quick estimates are most useful, multiplications are more common
OisinMoran · 8 months ago
This is neat! If you enjoy the write up, you might be interested in the paper “Dissolving the Fermi Paradox” which goes even more on-depth into actually multiplying the probability density functions instead of the common point estimates. It has the somewhat surprising result that we may just be alone.

https://arxiv.org/abs/1806.02404

drewvlaz · 8 months ago
This was quite a fun read, thanks!
baq · 8 months ago
a bit depressing TBH... but ~everyone on this site should read this for the methodology
kqr · 8 months ago
I have made a similar tool but for the command line[1] with similar but slightly more ambitious motivation[2].

I really like that more people are thinking in these terms. Reasoning about sources of variation is a capability not all people are trained in or develop, but it is increasingly important.[3]

[1]: https://git.sr.ht/~kqr/precel

[2]: https://entropicthoughts.com/precel-like-excel-for-uncertain...

[3]: https://entropicthoughts.com/statistical-literacy

gregschlom · 8 months ago
The ASCII art (well technically ANSI art) histogram is neat. Cool hack to get something done quickly. I'd have spent 5x the time trying various chart libraries and giving up.
Retr0id · 8 months ago
On a similar note, I like the crude hand-drawn illustrations a lot. Fits the "napkin" theme.
smartmic · 8 months ago
Here [1] is a nice implementation written in Awk. A bit rough around the edges, but could be easily extended.

[1] https://github.com/stefanhengl/histogram

trieloff · 8 months ago
https://www.getguesstimate.com/ is this, as a spreadsheet
peeters · 8 months ago
Is there a way to do non-scalar multiplication? E.g if I want to say "what is the sum of three dice rolls" (ignoring the fact that that's not a normal distro) I want to do 1~6 * 3 = 1~6 + 1~6 + 1~6 = 6~15. But instead it does 1~6 * 3 = 3~18. It makes it really difficult to do something like "how long will it take to complete 1000 tasks that each take 10-100 days?"
ttoinou · 8 months ago
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 the uncertainty is on the scale of each probability, and the final probability is the product of exponential of the log probabilities. And we wouldnt have this negative issue

hatthew · 8 months ago
The default example `100 / 4~6` gives the output `17~25`
ttoinou · 8 months ago
Amazing, thank you !