NAG C Library Manual

## g05 – Random Number Generators

g05 Chapter Introduction
 RoutineName Mark ofIntroduction Purpose g05cacExample Text 1 nag_random_continuous_uniformPseudo-random real numbers, uniform distribution over (0,1) g05cbcExample Text 1 nag_random_init_repeatableInitialize random number generating functions to give repeatable sequence g05cccExample Text 1 nag_random_init_nonrepeatableInitialize random number generating functions to give non-repeatable sequence g05cfcExample Text 1 nag_save_random_stateSave state of random number generating functions g05cgcExample Text 1 nag_restore_random_stateRestore state of random number generating functions g05dacExample Text 1 nag_random_continuous_uniform_abPseudo-random real numbers, uniform distribution over (a,b) g05dbcExample Text 1 nag_random_expPseudo-random real numbers, (negative) exponential distribution g05ddcExample Text 1 nag_random_normalPseudo-random real numbers, Normal distribution g05dycExample Text 1 nag_random_discrete_uniformPseudo-random integer from uniform distribution g05eacExample Text 2 nag_ref_vec_multi_normalSet up reference vector for multivariate Normal distribution g05eccExample Text 2 nag_ref_vec_poissonSet up reference vector for generating pseudo-random integers, Poisson distribution g05edcExample Text 2 nag_ref_vec_binomialSet up reference vector for generating pseudo-random integers, binomial distribution g05ehcExample Text 3 nag_ran_permut_vecPseudo-random permutation of an integer vector g05ejcExample Text 3 nag_ran_sample_vecPseudo-random sample without replacement from an integer vector g05excExample Text 2 nag_ref_vec_discrete_pdf_cdfSet up reference vector from supplied cumulative distribution function or probability distribution function g05eycExample Text 2 nag_return_discretePseudo-random integer from reference vector g05ezcExample Text 2 nag_return_multi_normalPseudo-random multivariate Normal vector from reference vector g05fecExample Text 2 nag_random_betaPseudo-random real numbers from the beta distribution g05ffcExample Text 2 nag_random_gammaPseudo-random real numbers from the gamma distribution g05hacExample Text 3 nag_arma_time_seriesARMA time series of n terms g05hkc 6 nag_generate_agarchIUnivariate time series, generate n terms of either a symmetric GARCH process or a GARCH process with asymmetry of the form (εt-1+γ)2 g05hlc 6 nag_generate_agarchIIUnivariate time series, generate n terms of a GARCH process with asymmetry of the form (|εt-1|+γεt-1)2 g05hmc 6 nag_generate_garchGJRUnivariate time series, generate n terms of an asymmetric Glosten, Jagannathan and Runkle (GJR) GARCH process g05kacExample Text 7 nag_rngs_basicPseudo-random real numbers, uniform distribution over (0,1), seeds and generator number passed explicitly g05kbcExample Text 7 nag_rngs_init_repeatableInitialize seeds of a given generator for random number generating functions (that pass seeds explicitly) to give a repeatable sequence g05kccExample Text 7 nag_rngs_init_nonrepeatableInitialize seeds of a given generator for random number generating functions (that pass seeds expicitly) to give non-repeatable sequence g05kecExample Text 7 nag_rngs_logicalPseudo-random logical (boolean) value, seeds and generator number passed explicitly g05lacExample Text 7 nag_rngs_normalGenerates a vector of random numbers from a Normal distribution, seeds and generator number passed explicitly g05lbcExample Text 7 nag_rngs_students_tGenerates a vector of random numbers from a Student's t-distribution, seeds and generator number passed explicitly g05lccExample Text 7 nag_rngs_chi_sqGenerates a vector of random numbers from a χ2 distribution, seeds and generator number passed explicitly g05ldcExample Text 7 nag_rngs_fGenerates a vector of random numbers from an F-distribution, seeds and generator number passed explicitly g05lecExample Text 7 nag_rngs_betaGenerates a vector of random numbers from a β distribution, seeds and generator number passed explicitly g05lfcExample Text 7 nag_rngs_gammaGenerates a vector of random numbers from a γ distribution, seeds and generator number passed explicitly g05lgcExample Text 7 nag_rngs_uniformGenerates a vector of random numbers from a uniform distribution, seeds and generator number passed explicitly g05lhcExample Text 7 nag_rngs_triangularGenerates a vector of random numbers from a triangular distribution, seeds and generator number passed explicitly g05ljcExample Text 7 nag_rngs_expGenerates a vector of random numbers from an exponential distribution, seeds and generator number passed explicitly g05lkcExample Text 7 nag_rngs_lognormalGenerates a vector of random numbers from a lognormal distribution, seeds and generator number passed explicitly g05llcExample Text 7 nag_rngs_cauchyGenerates a vector of random numbers from a Cauchy distribution, seeds and generator number passed explicitly g05lmcExample Text 7 nag_rngs_weibullGenerates a vector of random numbers from a Weibull distribution, seeds and generator number passed explicitly g05lncExample Text 7 nag_rngs_logisticGenerates a vector of random numbers from a logistic distribution, seeds and generator number passed explicitly g05lpcExample Text 7 nag_rngs_von_misesGenerates a vector of random numbers from a von Mises distribution, seeds and generator number passed explicitly g05lqcExample Text 7 nag_rngs_exp_mixGenerates a vector of random numbers from an exponential mixture distribution, seeds and generator number passed explicitly g05lxcExample Text 8 nag_rngs_matrix_multi_students_tGenerates a matrix of random numbers from a multivariate Student's t-distribution, seeds and generator passed explicitly g05lycExample Text 8 nag_rgsn_matrix_multi_normalGenerates a matrix of random numbers from a multivariate Normal distribution, seeds and generator passed explicitly g05lzcExample Text 7 nag_rngs_multi_normalGenerates a vector of random numbers from a multivariate Normal distribution, seeds and generator number passed explicitly g05macExample Text 7 nag_rngs_discrete_uniformGenerates a vector of random integers from a uniform distribution, seeds and generator number passed explicitly g05mbcExample Text 7 nag_rngs_geomGenerates a vector of random integers from a geometric distribution, seeds and generator number passed explicitly g05mccExample Text 7 nag_rngs_neg_binGenerates a vector of random integers from a negative binomial distribution, seeds and generator number passed explicitly g05mdcExample Text 7 nag_rngs_logarithmicGenerates a vector of random integers from a logarithmic distribution, seeds and generator number passed explicitly g05mecExample Text 7 nag_rngs_compd_poissonGenerates a vector of random integers from a Poisson distribution with varying mean, seeds and generator number passed explicitly g05mjcExample Text 7 nag_rngs_binomialGenerates a vector of random integers from a binomial distribution, seeds and generator number passed explicitly g05mkcExample Text 7 nag_rngs_poissonGenerates a vector of random integers from a Poisson distribution, seeds and generator number passed explicitly g05mlcExample Text 7 nag_rngs_hypergeometricGenerates a vector of random integers from a hypergeometric distribution, seeds and generator number passed explicitly g05mrcExample Text 7 nag_rngs_gen_multinomialGenerates a vector of random integers from a multinomial distribution, seeds and generator number passed explicitly g05mzcExample Text 7 nag_rngs_gen_discreteGenerates a vector of random integers from a general discrete distribution, seeds and generator number passed explicitly g05nacExample Text 7 nag_rngs_permutePseudo-random permutation of an integer vector g05nbcExample Text 7 nag_rngs_samplePseudo-random sample from an integer vector g05pacExample Text 7 nag_rngs_arma_time_seriesGenerates a realisation of a time series from an ARMA model g05pccExample TextExample Data 7 nag_rngs_varma_time_seriesGenerates a realisation of a multivariate time series from a VARMA model g05qacExample Text 7 nag_rngs_orthog_matrixComputes a random orthogonal matrix g05qbcExample TextExample Data 7 nag_rngs_corr_matrixComputes a random correlation matrix g05qdcExample Text 7 nag_rngs_2_way_tableGenerates a random table matrix g05racExample Text 8 nag_rngs_copula_normalGenerates a matrix of random numbers from a Gaussian Copula, seeds and generator passed explicitly g05rbcExample Text 8 nag_rngs_copula_students_tGenerates a matrix of random numbers from a Student's t-Copula, seeds and generator passed explicitly g05yacExample Text 7 nag_quasi_random_uniformMulti-dimensional quasi-random number generator with a uniform probability distribution g05ybcExample Text 7 nag_quasi_random_normalMulti-dimensional quasi-random number generator with a Gaussian or log-normal probability distribution