random number generation

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

rbriceno
Posts: 14
Joined: Wed Dec 08, 2010 1:46 pm

random number generation

Postby rbriceno » Thu Mar 17, 2011 1:55 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13312
Joined: Tue Sep 16, 2008 5:38 pm

Re: random number generation

Postby EViews Gareth » Thu Mar 17, 2011 2:03 pm

Code: Select all

series y= 0 + @sqrt(9)*nrnd


i.e. de-standardise the normal variable.
Follow us on Twitter @IHSEViews

rbriceno
Posts: 14
Joined: Wed Dec 08, 2010 1:46 pm

Re: random number generation

Postby rbriceno » Fri Mar 18, 2011 9:36 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13312
Joined: Tue Sep 16, 2008 5:38 pm

Re: random number generation

Postby EViews Gareth » Fri Mar 18, 2011 9:39 am

Yep.

Code: Select all

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 17 guests