Gsl_ran_gaussian

Greetings everyone!

Im trying to implement the gsl_ran_gaussian function to my dataset. I need random numbers with a 3% variation from my data but I’m getting the following message:

gauss.mod, line 6 (offset 130):
	Function gsl_ran_gaussian is random.
context:  function  >>> gsl_ran_gaussian; <<<

I’m not really sure what this means.
Thanks in advance.

You need to define gsl_ran_gaussian like this:

function gsl_ran_gaussian random;

This lets AMPL know that gsl_ran_gaussian is a “random” function: when it is called more than once, even with exactly the same argument, it will return different values. Data from a random function has to be handled specially when AMPL processes a model.