haskell-numerics / random-fu

A suite of Haskell libraries for representing, manipulating, and sampling random variables
42 stars 21 forks source link

generalBernoulli has true/false flipped #22

Open dschulman opened 9 years ago

dschulman commented 9 years ago

In Data.Random.Distribution.Bernoulli, the documentation says the arguments are: "generalBernoulli t f p" where value t is chosen with probability p and f with probability 1-p.

However, in the implementation, the order is reversed (f before t). generalBernoulliCDF has the same issue.

Not sure if you'd prefer to update the documentation or the implementation.