RandomVariate
A random draw from a distribution, or a list of them -- Random over the distribution, by its Wolfram name.
RandomVariate(dist)one draw.RandomVariate(dist, n)a list of draws.Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, integer<0..>?) random -> any | statistics | always |
Details
- Seeded, not free-running — same convention as SeedRandom/
RandomIntegerin@enumeratio/combinatorics/collections: call SeedRandom(seed) first for a reproducible sequence; without it, a fixed default seed makes even a bare call reproducible run to run. This file's draws are their OWN stream, independent ofRandomInteger's, even after the same SeedRandom call — a follow-up once collections' own seededRandomIntegerlands is to unify both under one engine-level generator. - The generator is our own (mulberry32, the same algorithm
RandomIntegeruses), not Wolfram's — the same seed draws a different sequence. Only the shape and (forNormalDistribution/UniformDistribution/…) approximate range of the answer are guaranteed to match. - Sampling method by distribution — NormalDistribution/BinormalDistribution: Box–Muller; UniformDistribution: inverse CDF; PoissonDistribution: Knuth's algorithm; BinomialDistribution: a sum of Bernoulli draws; GammaDistribution/BetaDistribution: Marsaglia–Tsang; EmpiricalDistribution: uniform resampling with replacement.
Examples
Basic #
Properties & Relations #
About
| Examples | 5 |
|---|
See also: SeedRandom, Distributed