ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
Functions
Random Numbers.

Functions

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

Function Documentation

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.

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(), 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::hybrid_mcmc_routine(), rgamma(), runif(), and sample().

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.

Referenced by test_mcmc_options_window().