Monte Carlo in GSL

Przemyslaw Sliwa
Wed Feb 18 13:08:00 GMT 2004

Dear All,

I am planning to do a Monte Carlo simulation using the GSL random number
generators. Therefore I would like to ask you something:

I have to simulate a function of one variable. This is a stochastic
process. Therefore I have to use the random number generator
gsl_ran_gaussian (const gsl_rng * r, double sigma).

Additionally I have to solve certain nonlinear equation which depends on
one variable and the nonlinear function is a stochastic process mentioned
above. Therefore I have to simulate the value of this functio couple of

The question is: Do I have to execute the statement


  T = gsl_rng_default;
  r = gsl_rng_alloc (T);

each time I compute the value of my function or just once at the beginning
of the process where I solve the equation.

My problem is: I want that the random numbers I generate are purelly
random and not that the series of the numbers repeats.

Thanks a lot for your help,


More information about the Gsl-discuss mailing list