jtobin / mwc-probability

A probability distribution type layered on top of mwc-random.
https://hackage.haskell.org/package/mwc-probability
MIT License
8 stars 7 forks source link

Allow weighted probability distribution #16

Closed Boarders closed 5 years ago

Boarders commented 5 years ago

In the functions multinomial and categorical there is the following condition:

Note that ps is a vector of probabilities and should sum to one.

This generalises multinomial and categorical to accept arbitrary weighted inputs of non-negative values.