Page 1 of 1

Running an AR(p) simulation

Posted: Wed May 09, 2012 2:38 am
by Marc
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 ?

Re: Running an AR(p) simulation

Posted: Wed May 09, 2012 5:57 am
by startz
Did you smpl @all before you made the histogram?

Re: Running an AR(p) simulation

Posted: Wed May 09, 2012 1:46 pm
by Marc
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.

Re: Running an AR(p) simulation

Posted: Wed May 09, 2012 1:48 pm
by startz
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