help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] random number generators


From: X Statistics
Subject: Re: [Help-gsl] random number generators
Date: Mon, 18 Apr 2011 09:53:33 -0300

>
> Question still is. If I have different random variables, should I use the
> same random number generator or should I have a new one for every random
> variable. If I should use a new one. How do I obtain the deterministic
> sequence of initial seeds such that the different generators produce good
> independent sequences?
>

You do not need different RNGs for differing random variables. For example,
you can generate from a normal distribution and from a gamma distribution
using the same RNG.

For instance, people working with Bayesian statistics run a Markov chain
Monte Carlo algorithm, such as the Gibbs sampler, with a single RNG (eg.
gsl_rng_mt19937). In that algorithm, you may sample from different
conditional distributions (normal, gamma, beta, multivariate normal,
Student-t, Wishart, etc) using the same RNG.

That being said, if you use GSL, then initialize your RNG and use it in your
whole program. (The same happens in R and Matlab.) Thus, you only need to
save one RNG SEED.

Ralph.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]