Is there a crate that provides functionality similar to Haskell's probability library?
I am looking for a type that represents a collection of items, each associated with a probability. I want to be able to combine two such collections and have it compute the probability of each of the outcomes of some binary function that takes pairs of items from the two collections. Ideally, with support for both floating point and exact fractions as probabilities.
I’ve been experimenting with probability distributions in Rust, including monadic combinators for things like conditional probabilities, convolution, and more. You can check out the code here:
It models problems like Monty Hall, Sleeping Beauty, and others, and might be helpful. I think it can be extended to support some sort of rationals