Random Variates from Statistical Distributions

Generation of pseudo-random numbers from over 20 continuous and discrete distributions using the Mulberry32 PRNG.

Statusvalidated
Version1.0.0
Minitab equivalentCalc > Random Data

Description

This module implements reproducible random number generation using the Mulberry32 PRNG (32-bit, deterministic). Continuous distributions are generated via inversion, Box-Muller, and Marsaglia & Tsang methods. The normal distribution uses the SinhArcSinh transform (Jones & Pewsey 2009), which enables a flexible family of asymmetric distributions via skewness (ε) and tailweight (δ) parameters.

Formulas

Mulberry32
Deterministic PRNG: same seed always produces the same sequence of uniformly distributed U(0,1) values.
Box-Muller
Generation of standard normal pairs (Z₁, Z₂) from uniform U₁, U₂ with S = U₁² + U₂² < 1.
SinhArcSinh
Jones & Pewsey transform (2009): ε controls skewness, δ controls tailweight. With ε=0, δ=1 this reduces to the standard normal.
Gamma (Marsaglia–Tsang)
Marsaglia & Tsang method for gamma variates with shape α ≥ 1. For α < 1, uses the identity Gamma(α) = Gamma(α+1) · U^(1/α).
Chi-Quadrat
Chi-square as special case of the Gamma distribution.
F-Verteilung
Ratio of two scaled chi-square variates.
t-Verteilung
Ratio of standard normal to scaled chi-square root.
Beta
Beta variate as ratio of two independent gamma variates.
Exponential (Inversion)
Inversion method for the exponential distribution.
Weibull (Inversion)
Inversion method for the Weibull distribution with shape α and scale β.
Lognormal
Exponential transform of a normally distributed variable.
Cauchy (Inversion)
Inversion method. Mean and variance do not exist.
Laplace
Inversion method for the Laplace distribution.
Gumbel Max
Inversion method for the Gumbel maximum distribution (Type I extreme value).
Logistic (Inversion)
Inversion method via the logit function.
Dreieck
Inversion method for the triangular distribution with minimum a, maximum b, and mode c.
Binomial
Direct simulation as sum of n Bernoulli trials.
Poisson
Knuth algorithm for λ < 30; normal approximation for λ ≥ 30.
Neg. Binomial
Gamma-Poisson mixture: first generate gamma variate, then Poisson variate with that mean.
Hypergeometrisch
Sequential simulation: drawing without replacement from finite population.

Assumptions

  • PRNG is deterministic — same seed produces identical sequences
  • Mulberry32 has a period of 2³² — sufficient for samples up to ~10⁵
  • All distribution parameters must be within their valid range

Limitations

  • Mulberry32 is not a cryptographically secure generator
  • Binomial distribution with large n is computationally expensive (O(n) per value)
  • Cauchy distribution: empirical mean and variance are unstable

References

  • Jones, M. C. & Pewsey, A. (2009). Sinh-arcsinh distributions. Biometrika, 96(4), 761–780.
  • Marsaglia, G. & Tsang, W. W. (2000). A simple method for generating gamma variables. ACM TOMS, 26(3), 363–372.
  • Knuth, D. E. (1997). The Art of Computer Programming, Vol. 2: Seminumerical Algorithms. 3rd Ed. — Chapter 3.4