ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Random Numbers

Functions

 random_number_generator::random_number_generator (const int seed)
 Constructor for random_number_generator class. More...
 
double random_number_generator::better_rand ()
 Random number generator. More...
 
void dvector::fill_randpoisson (double lambda, const random_number_generator &rng)
 Fill vector with Poisson pseudorandom numbers. More...
 
double randn (const random_number_generator &rng)
 Normal number generator. More...
 
double randu (const random_number_generator &rng)
 Uniform random number generator. More...
 
void random_number_generator::reinitialize (const int seed)
 Reinitialize random number seed. More...
 

Detailed Description

Function Documentation

random_number_generator::random_number_generator ( const int  seed)

Constructor for random_number_generator class.

Based on the C-program for MT19937, originally coded by Takuji Nishimura and Makoto Matsumoto.

Parameters
seedInteger used to initialize the random number generator. Using different values of seed will generat different series of random numbers.

Definition at line 70 of file rngen.cpp.

double random_number_generator::better_rand ( )

Random number generator.

Based on the Mersenne twister alorithm, MT19937, originally coded by Takuji Nishimura and Makoto Matsumoto.

See Nishimura, T. and M. Matusomoto (1998) Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Transactions on Modeling and Computer Simulation (TOMACS) 8(1):3-30.

Returns
double containing uniformly distributed pseudorandom number between zero and one.

Definition at line 134 of file rngen.cpp.

Referenced by bounded_multivariate_normal(), bounded_multivariate_uniform(), bounded_robust_multivariate_normal(), expdev(), gasdev(), function_minimizer::mcmc_routine(), new_probing_bounded_multivariate_normal(), new_probing_bounded_multivariate_normal_mcmc(), probing_bounded_multivariate_normal(), random_number_generator::random_number_generator(), random_number_generator::reinitialize(), function_minimizer::rwm_mcmc_routine(), and sgamma().

void dvector::fill_randpoisson ( double  lambda,
const random_number_generator rng 
)

Fill vector with Poisson pseudorandom numbers.

Parameters
lambdaExpected value of Poission distribution.
rngInstance of class random_number_generator.
Returns
dvector containing Poisson deviates

Definition at line 85 of file dranpois.cpp.

double randn ( const random_number_generator rng)
double randu ( const random_number_generator rng)

Uniform random number generator.

Returns
double containing uniformly distributed pseudorandom number between zero and one.

Definition at line 198 of file rngen.cpp.

Referenced by function_minimizer::build_tree(), function_minimizer::hybrid_mcmc_routine(), function_minimizer::nuts_mcmc_routine(), rgamma(), qfclib::rgamma(), runif(), sample(), and function_minimizer::shmc_mcmc_routine().

void random_number_generator::reinitialize ( const int  seed)

Reinitialize random number seed.

Based on the C-program for MT19937, originally coded by Takuji Nshimura and Makoto Matsumoto.

Parameters
seedInteger used to initialize the random number generator. Using different values of seed will generat different series of random numbers.

Definition at line 106 of file rngen.cpp.