Page 1 of 1

random number generation

Posted: Thu Mar 17, 2011 1:55 pm
by rbriceno
Dear users of the list. I am using Eviews 7. I would like to know how can I generate a series with 100 values, generated by normal with (0,9) parameters. I have read about how to generate random numbers with a normal distribution, but there is no mention about how to include specific parameters into this generation.

Anaybody can help? thanks.

Re: random number generation

Posted: Thu Mar 17, 2011 2:03 pm
by EViews Gareth

Code: Select all

series y= 0 + @sqrt(9)*nrnd
i.e. de-standardise the normal variable.

Re: random number generation

Posted: Fri Mar 18, 2011 9:36 am
by rbriceno
Thanks for your reply Gareth. One additional question: if I need to create 100 diff series following the same distribution, do I have to run a loop? I'm not clear about how to do it.
Thanks for your help.

Re: random number generation

Posted: Fri Mar 18, 2011 9:39 am
by EViews Gareth
Yep.

Code: Select all

!mean = 0 !var = 9 !n = 100 for !i = 1 to !n series x!i = !mean + @sqrt(!var)*nrnd next