Useful class demonstration program

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

startz
Non-normality and collinearity are NOT problems!
Posts: 3499
Joined: Wed Sep 17, 2008 2:25 pm

Useful class demonstration program

Postby startz » Wed Aug 28, 2013 9:26 am

Here's a little program I wrote to show the Monte Carlo distribution of an estimator. What's neat about doing this in EViews is that students get to see the histogram change dynamically as the simulations are done and then see the distribution settle down as the number of simulations grows.

Code: Select all

'meanSim.prg
'simulate sample mean
'Dick Startz
'August 2013
!sampleSize =1000
!trials = 1000 'must be greater than or equal to sample size
!mu = 12
!sigma = 2.85
workfile tryit u !trials
vector (!trials) muHat = na

smpl 1 !sampleSize
for !i=1 to !trials
series y = !mu + !sigma*nrnd ' substitute whatever DGP you want
muHat (!i) = @mean(y) ' substitute whatever estimator you want
muHat.distplot
next

Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 2 guests