Readit News logoReadit News
filiph commented on Implementing Unsure Calculator in 100 lines of Haskell   alt-romes.github.io/posts... · Posted by u/romes
filiph · 10 months ago
Hi, I'm the original author of unsure calculator. Let me just say thank you! I love the code and the fact that people are having a go at this stuff.
filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
NotAnOtter · 10 months ago
This is super cool.

It seems to break for ranges including 0 though

100 / -1~1 = -3550~3500

I think the most correct answer here is -inf~inf

filiph · 10 months ago
I'd argue this is WAI.

It's hard for me to imagine _dividing_ by -1~1 in a real-world scenario, but let's say we divide by 0~10, which also includes zero. For example, we are dividing the income between 0 to 10 shareholders (still forced, but ok).

Clearly, it's possible to have a division by zero here, so "0 sharehodlers would each get infinity". And in fact, if you try to compute 500 / 0, or even 500~1000 / 0, it will correctly show infinity.

But if you divide by a range that merely _includes_ zero, I don't think it should give you infinity. Ask yourself this: does 95% of results of 500 / 0~10 become infinity?

filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
Recursing · 10 months ago
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

filiph · 10 months ago
Wow, this is fantastic! I did not know about squiggle language, and it's basically what I was trying to get to from my unsure calculator through my next project (https://filiph.github.io/napkin/). Squiggle looks and works much better.

Thanks for the link!

filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
constantcrying · 10 months ago
No. It assumes the numbers aren't random at all.

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

filiph · 10 months ago
I'm familiar with fuzzy numbers (e.g. see my https://filiph.net/fuzzy/ toy) but I didn't know there's arithmetic with fuzzy numbers. How is it done? Do you have a link?
filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
hatthew · 10 months ago
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.

filiph · 10 months ago
Part of the confusion here is likely that the tool, as seen on the web, probably lags significantly behind the code. I've started using a related but different tool (https://filiph.github.io/napkin/).

The HN mods gave me an opportunity to resubmit the link, so I did. If I had more time, I'd have also upgraded the tool to the latest version and fix the wording. But unfortunately, I didn't find the time to do this.

Apologies for the confusion!

filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
kccqzy · 10 months ago
I actually stumbled upon this a while ago from social media and the web version has a somewhat annoying latency, so I wrote my own version in Python. It uses numpy so it's faster. https://gist.github.com/kccqzy/d3fa7cdb064e03b16acfbefb76645... Thank you filiph for this brilliant idea!
filiph · 10 months ago
Nice! Are you using your python script often?

The reason I'm asking: unsure also has a CLI version (which is leaps and bounds faster and in some ways easier to use) but I rarely find myself using it. (Nowadays, I use https://filiph.github.io/napkin/, anyway, but it's still a web app rather than a CLI tool.)

filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
nritchie · 10 months ago
Here (https://uncertainty.nist.gov/) is another similar Monte Carlo-style calculator designed by the statisticians at NIST. It is intended for propagating uncertainties in measurements and can handle various different assumed input distributions.
filiph · 10 months ago
I think I was looking at this and several other similar calculators when creating the linked tool. This is what I mean when I say "you'll want to use something more sophisticated".

The problem with similar tools is that of the very high barrier to entry. This is what my project was trying to address, though imperfectly (the user still needs to understand, at the very least, the concept of probability distributions).

filiph commented on Show HN: Unsure Calculator – back-of-a-napkin probabilistic calculator   filiph.github.io/unsure/... · Posted by u/filiph
Aachen · 10 months ago
https://qalculate.github.io can do this also for as long as I've used it (only a couple years to be fair). I've got it on my phone, my laptop, even my server with apt install qalc. Super convenient, supports everything from unit conversion to uncertainty tracking

The histogram is neat, I don't think qalc has that. On the other hand, it took 8 seconds to calculate the default (exceedingly trivial) example. Is that JavaScript, or is the server currently very busy?

filiph · 10 months ago
It's all computed in the browser so yeah, it's JavaScript. Still, 8 seconds is a lot -- I was targeting sub-second computation times (which I find alright).

u/filiph

KarmaCake day788January 9, 2016View Original