Expand description
Combinators for rand::distr::Distribution objects
This module provides tools to compose and transform probability distributions in a functional style. It is designed to be generic and independent of any specific data structures.
Re-exports§
pub use histogram::Histogram;
Modules§
- histogram
- A convenience to analyze the distribution of generated values
Structs§
- Categorical
- A categorical distribution that selects from
elementsbased on an index distributioned. - Choice2
- A distribution that chooses between
dxanddybased on a boolean distributiondb. - Collected
- A distribution that samples from
d, maps usingpf, and retries ifpfreturnsNone. - Concentrated
- A stateful distribution that accumulates samples from
dxinto statezuntilfareturns a value. - Degenerate
- A constant distribution that always returns
element. - Dependent2
- A distribution where the choice of the second distribution depends on the value sampled from the first.
- Diluted
- A distribution that expands a single sample from
dxinto a sequence of values. - Filtered
- A distribution that samples from
dbut rejects values that do not satisfy predicatep. - Mapped
- A distribution that maps values sampled from
dusing functionf. - Product2
- A distribution that combines two independent distributions
dxanddyusing a functionf. - Repeated
- A distribution that generates a vector of items with length sampled from
lengthdand items fromitemd. - Sentinel
- A distribution that generates a vector of bytes by sampling from
mbduntilNoneis returned.
Functions§
- ratios
- Creates a categorical distribution where elements are chosen with probability proportional to their weights.