Uniform Random Variables
📐 Definition
Section titled “📐 Definition”Uniform random variables assign equal probability to any value within a closed interval, often used as the base source for transformed distributions.
For , the density is
Domain and Codomain
Section titled “Domain and Codomain”Inputs are random seeds or generator states; outputs lie within the interval ([a,b]) with constant density.
⚙️ Key Properties
Section titled “⚙️ Key Properties”Independent uniforms are standard primitives for Monte Carlo sampling and for inverse-transform samplers.
is the canonical base distribution. If , the distribution collapses to a deterministic constant. Affine maps generate any ; applying or trigonometric maps seeds Box–Muller and inverse-transform samplers.
🎯 Special Cases and Limits
Section titled “🎯 Special Cases and Limits”- is the canonical base distribution.
- collapses to a point mass.
🔗 Related Functions
Section titled “🔗 Related Functions”Box–Muller Gaussian transforms and Laplace inverse-CDF sampling start from uniforms; Bernoulli or categorical variables arise from thresholding uniforms; low-discrepancy sequences provide quasi-uniform alternatives.
Usage in Oakfield
Section titled “Usage in Oakfield”Oakfield uses uniform RNG streams as the base for several higher-level stochastic features:
- Integrator noise hooks use
integrator_rng_uniform()as the base RNG inintegrators/integrator.c, withintegrator_noise_uniform()/ Box–Muller Gaussian / inverse-CDF Laplace built on top. - Distribution selection is exposed by name (
"uniform","gaussian","laplace") and mapped onto the integrator noise function pointers. - Seeded stochastic operators like
stimulus_white_noise,stimulus_fbm, andstimulus_random_fouriercarry aseedparameter to produce reproducible realizations.
Historical Foundations
Section titled “Historical Foundations”📜 Random Sampling
Section titled “📜 Random Sampling”Uniform sampling is the standard starting point for pseudorandom generation and for transforming randomness into other distributions.
🌍 Modern Perspective
Section titled “🌍 Modern Perspective”Uniform(0,1) variates are the common interface exposed by RNG libraries and underpin a wide range of stochastic simulation pipelines.
📚 References
Section titled “📚 References”- Devroye, Non-Uniform Random Variate Generation
- Knuth, The Art of Computer Programming, Vol. 2: Seminumerical Algorithms