Expand description

Re-export rand_distr for version compatibility

Modules

A distribution uniformly sampling numbers within a given range.

Weighted index sampling

Structs

Sample a char, uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9.

The Bernoulli distribution.

The Beta distribution with shape parameters alpha and beta.

The binomial distribution Binomial(n, p).

The Cauchy distribution Cauchy(median, scale).

The chi-squared distribution χ²(k), where k is the degrees of freedom.

The dirichelet distribution Dirichlet(alpha).

An iterator that generates random values of T with distribution D, using R as the source of randomness.

The exponential distribution Exp(lambda).

Samples floating-point numbers according to the exponential distribution, with rate parameter λ = 1. This is equivalent to Exp::new(1.0) or sampling with -rng.gen::<f64>().ln(), but faster.

The Fisher F distribution F(m, n).

The Gamma distribution Gamma(shape, scale) distribution.

The log-normal distribution ln N(mean, std_dev**2).

The normal distribution N(mean, std_dev**2).

A distribution to sample floating point numbers uniformly in the open interval (0, 1), i.e. not including either endpoint.

A distribution to sample floating point numbers uniformly in the half-open interval (0, 1], i.e. including 1 but not 0.

Samples floating-point numbers according to the Pareto distribution

The PERT distribution.

The Poisson distribution Poisson(lambda).

A generic random value distribution, implemented for many primitive types. Usually generates values with a numerically uniform distribution, and with a range appropriate to the type.

Samples floating-point numbers according to the normal distribution N(0, 1) (a.k.a. a standard normal, or Gaussian). This is equivalent to Normal::new(0.0, 1.0) but faster.

The Student t distribution, t(nu), where nu is the degrees of freedom.

The triangular distribution.

Sample values uniformly between two bounds.

Samples uniformly from the unit ball (surface and interior) in three dimensions.

Samples uniformly from the edge of the unit circle in two dimensions.

Samples uniformly from the unit disc in two dimensions.

Samples uniformly from the surface of the unit sphere in three dimensions.

Samples floating-point numbers according to the Weibull distribution

Enums

Error type returned from Beta::new.

Error type returned from Binomial::new.

Error type returned from Cauchy::new.

Error type returned from ChiSquared::new and StudentT::new.

Error type returned from Dirchlet::new.

Error type returned from Exp::new.

Error type returned from FisherF::new.

Error type returned from Gamma::new.

Error type returned from Normal::new and LogNormal::new.

Error type returned from Pareto::new.

Error type returned from Pert constructors.

Error type returned from Poisson::new.

Error type returned from Triangular::new.

Error type returned from Weibull::new.

Traits

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

Trait for floating-point scalar types