Crate rand_distr

Source
Expand description

Generating random samples from probability distributions.

§Re-exports

This crate is a super-set of the rand::distr module. See the rand::distr module documentation for an overview of the core Distribution trait and implementations.

The following are re-exported:

§Distributions

This crate provides the following probability distributions:

Re-exports§

pub use num_traits;

Modules§

uniform
A distribution uniformly sampling numbers within a given range.
weighted
Weighted (index) sampling

Structs§

Alphanumeric
Sample a u8, uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9.
Bernoulli
The Bernoulli distribution Bernoulli(p).
Beta
The Beta distribution Beta(α, β).
Binomial
The binomial distribution Binomial(n, p).
Cauchy
The Cauchy distribution Cauchy(x₀, γ).
ChiSquared
The chi-squared distribution χ²(k).
Dirichlet
The Dirichlet distribution Dirichlet(α₁, α₂, ..., αₖ).
Exp
The exponential distribution Exp(λ).
Exp1
The standard exponential distribution Exp(1).
FisherF
The Fisher F-distribution F(m, n).
Frechet
The Fréchet distribution Fréchet(α, μ, σ).
Gamma
The Gamma distribution Gamma(k, θ).
Geometric
The geometric distribution Geometric(p).
Gumbel
The Gumbel distribution Gumbel(μ, β).
Hypergeometric
The hypergeometric distribution Hypergeometric(N, K, n).
InverseGaussian
The inverse Gaussian distribution IG(μ, λ).
Iter
An iterator over a Distribution
LogNormal
The log-normal distribution ln N(μ, σ²).
Normal
The Normal distribution N(μ, σ²).
NormalInverseGaussian
The normal-inverse Gaussian distribution NIG(α, β).
Open01
A distribution to sample floating point numbers uniformly in the open interval (0, 1), i.e. not including either endpoint.
OpenClosed01
A distribution to sample floating point numbers uniformly in the half-open interval (0, 1], i.e. including 1 but not 0.
Pareto
The Pareto distribution Pareto(xₘ, α).
Pert
The PERT distribution PERT(min, max, mode, shape).
PertBuilder
Struct used to build a Pert
Poisson
The Poisson distribution Poisson(λ).
SkewNormal
The skew normal distribution SN(ξ, ω, α).
StandardGeometric
The standard geometric distribution Geometric(0.5).
StandardNormal
The standard Normal distribution N(0, 1).
StandardUniform
The Standard Uniform distribution
StudentT
The Student t-distribution t(ν).
Triangular
The triangular distribution Triangular(min, max, mode).
Uniform
Sample values uniformly between two bounds.
UnitBall
Samples uniformly from the volume of the unit ball in three dimensions.
UnitCircle
Samples uniformly from the circumference of the unit circle in two dimensions.
UnitDisc
Samples uniformly from the unit disc in two dimensions.
UnitSphere
Samples uniformly from the surface of the unit sphere in three dimensions.
Weibull
The Weibull distribution Weibull(λ, k).
Zeta
The Zeta distribution Zeta(s).
Zipf
The Zipf (Zipfian) distribution Zipf(n, s).

Enums§

BernoulliError
Error type returned from Bernoulli::new.
BetaError
Error type returned from Beta::new.
BinomialError
Error type returned from Binomial::new.
CauchyError
Error type returned from Cauchy::new.
ChiSquaredError
Error type returned from ChiSquared::new and StudentT::new.
DirichletError
Error type returned from Dirichlet::new.
ExpError
Error type returned from Exp::new.
FisherFError
Error type returned from FisherF::new.
FrechetError
Error type returned from Frechet::new.
GammaError
Error type returned from Gamma::new.
GeoError
Error type returned from Geometric::new.
GumbelError
Error type returned from Gumbel::new.
HyperGeoError
Error type returned from Hypergeometric::new.
InverseGaussianError
Error type returned from InverseGaussian::new
NormalError
Error type returned from Normal::new and LogNormal::new.
NormalInverseGaussianError
Error type returned from NormalInverseGaussian::new
ParetoError
Error type returned from Pareto::new.
PertError
Error type returned from Pert constructors.
PoissonError
Error type returned from Poisson::new.
SkewNormalError
Error type returned from SkewNormal::new.
TriangularError
Error type returned from Triangular::new.
WeibullError
Error type returned from Weibull::new.
ZetaError
Error type returned from Zeta::new.
ZipfError
Error type returned from Zipf::new.

Traits§

Distribution
Types (distributions) that can be used to create a random instance of T.