Running an AR(p) simulation

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Marc
Posts: 4
Joined: Wed May 09, 2012 2:25 am

Running an AR(p) simulation

Postby Marc » Wed May 09, 2012 2:38 am

Dear and beloved Board members,

I am completely new to Eviews and am trying to run a simulation of an AR(1) model as an example. The idea is
to find the distribution of the AR(1) coefficient, which should be asymptotically normal for finite samples ( around 50 ) according to the theory, however
when I run the simulation I don't get this. I use a burn-in period of 100 samples and then store the coefficients estimated from the last
50 samples. Basically, simulation of 150 y-values ( for an y=0.5*y(-1)+nrnd model ) removing the first 100 samples and then estimating the AR coefficient based
on the last 50 samples. This should be simple.

Code: Select all

create examp24 u 1 1000 series coef1 series coef2 smpl 1 150 for !k = 1 to 1000 smpl 1 1 genr y=0 smpl 2 150 genr y = .5*y(-1)+nrnd smpl 101 150 equation eq_a.ls y c AR(1) coef1(!k) = c(1) coef2(!k) = c(2) next
The histogram of coef1 that I get is not what I expect. It should be much more nicely normally distributed. It isn't. What is wrong with the code ?

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

Re: Running an AR(p) simulation

Postby startz » Wed May 09, 2012 5:57 am

Did you smpl @all before you made the histogram?

Marc
Posts: 4
Joined: Wed May 09, 2012 2:25 am

Re: Running an AR(p) simulation

Postby Marc » Wed May 09, 2012 1:46 pm

I will proceed to trow myself off a cliff now.

Thanks for the answer. It was helpful and it is a mistake that I will never make again.

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

Re: Running an AR(p) simulation

Postby startz » Wed May 09, 2012 1:48 pm

I will proceed to trow myself off a cliff now.

Thanks for the answer. It was helpful and it is a mistake that I will never make again.
Let's just say that I do make the same mistake over and over :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest