Hello,
I have two series y,x which follow AR(1) process. The error
terms are drawn from a normal distribution. After y is regressed on x, I want to calculate the critical value of t. I provide the code:
rndseed 12345
!nrep=1000
smpl @first @last
series y
series x
vector(1000) t
y = 6
x=2
for !i=1 to !nrep
series y = 3 + 2*y(-1)+4*nrnd
series x=2+1.5*x(-1)+0.5*nrnd
equation eq.ls y c x
t(!i)=@tstats(2)
next
scalar crictical5=@quantile(t,0.95)
scalar crictical10=@quantile(t,0.9)
scalar crictical1=@quantile(t,0.99)
show crictical5
show crictical10
show crictical1
But after running the program, I received Error Message:" Insufficient number of observations in Equation"
Would you please help me check and rewrite the correct code for me?Thank you very much.
How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation
Moderators: EViews Gareth, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation
Open up your Y series
Follow us on Twitter @IHSEViews
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation
And think about what y(-1) is for the first observation.
Re: How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation
EViews Gareth wrote:Open up your Y series
Series y and x have not imported. I create the start-up of y is 6 and the start-up of x is 4. And my idea is that knowing the start-up, we then calculate the series y = 3 + 2*y(-1)+4*nrnd or the series x =2+1.5*x(-1)+0.5*nrnd. Ater that, series y is regressed on x. I write the code:
rndseed 12345
!nrep=1000
smpl @first @last
series y
series x
vector(1000) t
for !i=1 to !nrep
y = 6
x=2
series y = 3 + 2*y(-1)+4*nrnd
series x=2+1.5*x(-1)+0.5*nrnd
equation eq.ls y c x
t(!i)=@tstats(2)
next
scalar crictical5=@quantile(t,0.95)
scalar crictical10=@quantile(t,0.9)
scalar crictical1=@quantile(t,0.99)
show crictical5
show crictical10
show crictical1
But after running the program, I received Error Message:" Insufficient number of observations in Equation"
Would you please help me check and rewrite the correct code for me?Thank you very much.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation
It usually turns out to be a good idea to listen to Gareth's advice.
Who is online
Users browsing this forum: No registered users and 39 guests