quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
152 stars 23 forks source link

Beta distribution seems to break with small parameters. #2043

Open OAGr opened 1 year ago

OAGr commented 1 year ago

beta(1, 0.2)

image
NunoSempere commented 1 year ago

My guess is that this is going to come from calculating beta samples as:

sample_beta(a,b) = sample_gamma(a)/(sample_gamma(a) + sample_gamma(b))

and then getting a division by zero due to luck of the draw.

Added: Mmh, not finding this in stdlib, I was probably wrong.