[][src]Module geng::prelude::distributions

Structs

Alphanumeric

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

Bernoulli

The Bernoulli distribution.

BetaDeprecated

The Beta distribution with shape parameters alpha and beta.

BinomialDeprecated

The binomial distribution Binomial(n, p).

CauchyDeprecated

The Cauchy distribution Cauchy(median, scale).

ChiSquaredDeprecated

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

DirichletDeprecated

The dirichelet distribution Dirichlet(alpha).

DistIter

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

ExpDeprecated

The exponential distribution Exp(lambda).

Exp1Deprecated

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.

FisherFDeprecated

The Fisher F distribution F(m, n).

GammaDeprecated

The Gamma distribution Gamma(shape, scale) distribution.

LogNormalDeprecated

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

NormalDeprecated

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

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.

ParetoDeprecated

Samples floating-point numbers according to the Pareto distribution

PoissonDeprecated

The Poisson distribution Poisson(lambda).

Standard

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.

StandardNormalDeprecated

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.

StudentTDeprecated

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

TriangularDeprecated

The triangular distribution.

Uniform

Sample values uniformly between two bounds.

UnitCircleDeprecated

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

UnitCircleInside
UnitSphereSurfaceDeprecated

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

WeibullDeprecated

Samples floating-point numbers according to the Weibull distribution

WeightedIndex

A distribution using weighted sampling to pick a discretely selected item.

Enums

BernoulliError

Error type returned from Bernoulli::new.

WeightedError

Error type returned from WeightedIndex::new.

Traits

Distribution

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