How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Thanh Ha
Posts: 2
Joined: Mon Aug 09, 2021 1:35 am

How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation

Postby Thanh Ha » Mon Aug 09, 2021 7:28 pm

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.

EViews Gareth
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

Postby EViews Gareth » Mon Aug 09, 2021 7:47 pm

Open up your Y series
Follow us on Twitter @IHSEViews

startz
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

Postby startz » Mon Aug 09, 2021 8:08 pm

And think about what y(-1) is for the first observation.

Thanh Ha
Posts: 2
Joined: Mon Aug 09, 2021 1:35 am

Re: How to find critical value of t in the regression of two AR(1) process using Monte Carlo Simulation

Postby Thanh Ha » Tue Aug 10, 2021 12:20 am

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.

startz
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

Postby startz » Tue Aug 10, 2021 6:47 am

It usually turns out to be a good idea to listen to Gareth's advice.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 39 guests