How to simulate the Augmented Dickey-Fuller Test

For questions regarding programming in the EViews programming language.

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

paxkwon
Posts: 1
Joined: Fri Dec 04, 2009 3:31 am

How to simulate the Augmented Dickey-Fuller Test

Postby paxkwon » Sat Dec 05, 2009 9:58 pm

How to simulate the Augmented Dickey-Fuller Test.

I would like to know how to simulate the DF test for unit roots.
For now, I want to ascertain whether the following languages are right or not.
---
'Create an "undated" workfile, 10,000 observations.
new workfile UR u 10000
'Create a non-stationary AR(1) model : from (1) to (6).
'(1) sets the sample to be the first observation only.
smpl 1 1'
(2) generates a new variable yt with the value of 0.
genr yt=0
'(3) sets the sample to be from the 2nd to the 10,000th observation.
smpl 2 10000
'(4) Creats yt as an AR(1) model with alpha=1.0 ; nrnd is Normal Random Number Generator. More specifically, when used in a series expression, nrnd generates (pseudo) random draws from a normal distribution with zero mean an unit variance.
genr yt=1.0*yt(-1)+nrnd
'(5) Sets the sample back to the full sample.
smpl 1 10000
'(6) Provides a plot of the yt series.
plot yt
'Conduct a Augmented Dickey-Fuller test.
uroot(adf, none) yt
'Creates "uroot(adf, none) yt" from a view ; the none don't include a constant or time trend in the test equation.
freeze yt.uroot(adf, none)
'Carry out a ADF test with a constant or drift in the test equation.
uroot(adf, const) yt
'Creates "uroot(adf, const) yt" from a view ; the const includes a constant in the test equation.
freeze yt.uroot(adf, const)
''Execute a ADF test with a trend ; the trend includes a constant and a linear time trend in the test equaion.
uroot(adf, trend) yt
'Creates "uroot(adf, trend) yt" from a view.
freeze yt.uroot(adf, trend)
---
Could I borrow your hands with this?
Thank you in advance for your support.

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 29 guests