Skip to main content

Module random

Module random 

Source
Expand description

Random number generation builtins: set.seed, runif, rnorm, rbinom, sample, etc. Uses the per-interpreter RNG state via BuiltinContext.

StructsΒ§

RnormArgs πŸ”’
Random normal deviates.

EnumsΒ§

RandomError

StaticsΒ§

__BUILTIN_REG_TRAIT_RNORMARGS πŸ”’
__INTERP_REG_INTERP_RBETA πŸ”’
__INTERP_REG_INTERP_RBINOM πŸ”’
__INTERP_REG_INTERP_RCAUCHY πŸ”’
__INTERP_REG_INTERP_RCHISQ πŸ”’
__INTERP_REG_INTERP_REXP πŸ”’
__INTERP_REG_INTERP_RF πŸ”’
__INTERP_REG_INTERP_RFRECHET πŸ”’
__INTERP_REG_INTERP_RGAMMA πŸ”’
__INTERP_REG_INTERP_RGEOM πŸ”’
__INTERP_REG_INTERP_RGUMBEL πŸ”’
__INTERP_REG_INTERP_RHYPER πŸ”’
__INTERP_REG_INTERP_RINVGAUSS πŸ”’
__INTERP_REG_INTERP_RLNORM πŸ”’
__INTERP_REG_INTERP_RNG_KIND πŸ”’
__INTERP_REG_INTERP_RPARETO πŸ”’
__INTERP_REG_INTERP_RPERT πŸ”’
__INTERP_REG_INTERP_RPOIS πŸ”’
__INTERP_REG_INTERP_RSKEWNORM πŸ”’
__INTERP_REG_INTERP_RT πŸ”’
__INTERP_REG_INTERP_RTRIANGULAR πŸ”’
__INTERP_REG_INTERP_RUNIF πŸ”’
__INTERP_REG_INTERP_RWEIBULL πŸ”’
__INTERP_REG_INTERP_RZETA πŸ”’
__INTERP_REG_INTERP_SAMPLE πŸ”’
__INTERP_REG_INTERP_SET_SEED πŸ”’

FunctionsΒ§

extract_n πŸ”’
Extract a positive integer n from args[0].
extract_param πŸ”’
Extract an optional f64 parameter from named args or positional index.
interp_rbeta πŸ”’
Random beta deviates.
interp_rbinom πŸ”’
Random binomial deviates.
interp_rcauchy πŸ”’
Random Cauchy deviates.
interp_rchisq πŸ”’
Random chi-squared deviates.
interp_rexp πŸ”’
Random exponential deviates.
interp_rf πŸ”’
Random F deviates.
interp_rfrechet πŸ”’
Random Frechet (Type II extreme value) deviates.
interp_rgamma πŸ”’
Random gamma deviates.
interp_rgeom πŸ”’
Random geometric deviates.
interp_rgumbel πŸ”’
Random Gumbel (Type I extreme value) deviates.
interp_rhyper πŸ”’
Random hypergeometric deviates.
interp_rinvgauss πŸ”’
Random inverse Gaussian (Wald) deviates.
interp_rlnorm πŸ”’
Random log-normal deviates.
interp_rng_kind πŸ”’
Query or set the RNG algorithm.
interp_rpareto πŸ”’
Random Pareto deviates.
interp_rpert πŸ”’
Random PERT deviates.
interp_rpois πŸ”’
Random Poisson deviates.
interp_rskewnorm πŸ”’
Random skew-normal deviates.
interp_rt πŸ”’
Random Student’s t deviates.
interp_rtriangular πŸ”’
Random triangular deviates.
interp_runif πŸ”’
Random uniform deviates.
interp_rweibull πŸ”’
Random Weibull deviates.
interp_rzeta πŸ”’
Random Zeta deviates.
interp_sample πŸ”’
Random sampling with or without replacement.
interp_set_seed πŸ”’
Set the random number generator seed for reproducibility.
require_param πŸ”’
Extract a required f64 parameter from named args or positional index.
weighted_sample_with_replacement πŸ”’
Weighted sampling with replacement using cumulative probability + binary search.
weighted_sample_without_replacement πŸ”’
Weighted sampling without replacement: sequential weighted draws, removing selected items.