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:
- The
Distributiontrait andIterhelper type - The
StandardUniform,Alphanumeric,Uniform,OpenClosed01,Open01,Bernoullidistributions - The
weightedmodule
§Distributions
This crate provides the following probability distributions:
- Related to real-valued quantities that grow linearly
(e.g. errors, offsets):
Normaldistribution, andStandardNormalas a primitiveSkewNormaldistributionCauchydistribution
- Related to Bernoulli trials (yes/no events, with a given probability):
BinomialdistributionGeometricdistributionHypergeometricdistribution
- Related to positive real-valued quantities that grow exponentially
(e.g. prices, incomes, populations):
LogNormaldistribution
- Related to the occurrence of independent events at a given rate:
- Gamma and derived distributions:
GammadistributionChiSquareddistributionStudentTdistributionFisherFdistribution
- Triangular distribution:
BetadistributionTriangulardistribution
- Multivariate probability distributions
DirichletdistributionUnitSpheredistributionUnitBalldistributionUnitCircledistributionUnitDiscdistribution
- Misc. distributions
InverseGaussiandistributionNormalInverseGaussiandistribution
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). - Inverse
Gaussian - The inverse Gaussian distribution
IG(μ, λ). - Iter
- An iterator over a
Distribution - LogNormal
- The log-normal distribution
ln N(μ, σ²). - Normal
- The Normal distribution
N(μ, σ²). - Normal
Inverse Gaussian - 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. - Open
Closed01 - 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). - Pert
Builder - Struct used to build a
Pert - Poisson
- The Poisson distribution
Poisson(λ). - Skew
Normal - The skew normal distribution
SN(ξ, ω, α). - Standard
Geometric - The standard geometric distribution
Geometric(0.5). - Standard
Normal - The standard Normal distribution
N(0, 1). - Standard
Uniform - 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.
- Unit
Ball - Samples uniformly from the volume of the unit ball in three dimensions.
- Unit
Circle - Samples uniformly from the circumference of the unit circle in two dimensions.
- Unit
Disc - Samples uniformly from the unit disc in two dimensions.
- Unit
Sphere - 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§
- Bernoulli
Error - Error type returned from
Bernoulli::new. - Beta
Error - Error type returned from
Beta::new. - Binomial
Error - Error type returned from
Binomial::new. - Cauchy
Error - Error type returned from
Cauchy::new. - ChiSquared
Error - Error type returned from
ChiSquared::newandStudentT::new. - Dirichlet
Error - Error type returned from
Dirichlet::new. - ExpError
- Error type returned from
Exp::new. - FisherF
Error - Error type returned from
FisherF::new. - Frechet
Error - Error type returned from
Frechet::new. - Gamma
Error - Error type returned from
Gamma::new. - GeoError
- Error type returned from
Geometric::new. - Gumbel
Error - Error type returned from
Gumbel::new. - Hyper
GeoError - Error type returned from
Hypergeometric::new. - Inverse
Gaussian Error - Error type returned from
InverseGaussian::new - Normal
Error - Error type returned from
Normal::newandLogNormal::new. - Normal
Inverse Gaussian Error - Error type returned from
NormalInverseGaussian::new - Pareto
Error - Error type returned from
Pareto::new. - Pert
Error - Error type returned from
Pertconstructors. - Poisson
Error - Error type returned from
Poisson::new. - Skew
Normal Error - Error type returned from
SkewNormal::new. - Triangular
Error - Error type returned from
Triangular::new. - Weibull
Error - Error type returned from
Weibull::new. - Zeta
Error - Error type returned from
Zeta::new. - Zipf
Error - Error type returned from
Zipf::new.
Traits§
- Distribution
- Types (distributions) that can be used to create a random instance of
T.