Professional Documents
Culture Documents
1. Nonstochastic Processes
EView’s Command
smpl 1 1
genr y1=0
genr y2=0
smpl 1 200
genr u=nrnd
smpl 2 200
series y1=y1(-1)+u
series y2=0.5+y2(-1)+u
smpl 1 200
plot y1 y2
120
100
80
60
40
20
-20
25 50 75 100 125 150 175 200
Y1 Y2
By Tatre Jantarakolica
Page 76
EView’s Command
smpl 1 1
genr y1=0
genr y2=0
genr y3=0
genr y4=0
genr y5=0
smpl 1 200
genr u=nrnd
genr t=@trend
smpl 2 200
series y1=y1(-1)+u
series y2=0.5+y2(-1)+u
series y3=0.5+0.5*t+u
series y4=0.5+0.5*t+y4(-1)+u
series y5=0.5+0.5*t+0.9*y5(-1)+u
smpl 1 200
genr yhat = 0.5+0.5*t
plot y1 y2 y3 yhat
plot y1 y4 y5
By Tatre Jantarakolica
Page 77
120
100
80
60
40
20
-20
25 50 75 100 125 150 175 200
Y1 Y3
Y2 YHAT
12000
10000
8000
6000
4000
2000
-2000
25 50 75 100 125 150 175 200
Y1 Y4 Y5
By Tatre Jantarakolica
Page 78
3. Spurious Regression
Yt = Yt −1 + ut
X t = X t −1 + vt
If Xt and Yt are uncorrelated I(1) processes, regression Yt = β1 + β 2 X t + ε t can
lead to spurious problem.
EView’s Command
smpl 1 1
genr y=0
genr x=0
smpl 1 500
genr u=nrnd
genr v=nrnd
smpl 2 500
series y=y(-1)+u
series x=x(-1)+v
smpl 1 500
equation eq_21_7.ls y c x
Dependent Variable: Y
Method: Least Squares
Sample: 1 200
Included observations: 200
Variable Coefficient Std. Error t-Statistic Prob.
C -4.282010 0.418138 -10.24067 0.0000
X 0.492647 0.043581 11.30409 0.0000
R-squared 0.392232 Mean dependent var -0.287086
Adjusted R-squared 0.389163 S.D. dependent var 4.043829
S.E. of regression 3.160498 Akaike info criterion 5.149286
Sum squared resid 1977.772 Schwarz criterion 5.182269
Log likelihood -512.9286 F-statistic 127.7824
Durbin-Watson stat 0.122278 Prob(F-statistic) 0.000000
By Tatre Jantarakolica
Page 79
EView’s Command
smpl 1 1
genr x1 = 0
genr x2 = 0
genr x3 = 0
smpl 1 200
genr u1 = nrnd
genr u2 = nrnd
genr u3 = nrnd
smpl 2 200
series x1 = 0.05+0.95*x1(-1)+u1
series x2 = 0.05+x2(-1)+u2
series x3 = 0.05+1.05*x3(-1)+u3
plot x1
plot x2
plot x3
Graphical Plot
4
-1
-2
-3
25 50 75 100 125 150 175 200
X1
By Tatre Jantarakolica
Page 80
35
30
25
20
15
10
-5
25 50 75 100 125 150 175 200
X2
25000
20000
15000
10000
5000
0
25 50 75 100 125 150 175 200
X3
By Tatre Jantarakolica
Page 81
By Tatre Jantarakolica
Page 82
By Tatre Jantarakolica
Page 83
From Unit Root Test Window, choose Test type (in this case, Augmented Dickey-Fuller),
level of test or Test for unit root in (in this case, Level), equation form or Include in test
equation (in this case, Trend and intercept), and Lag length (in this case, 1) or
suggested by Schwartz Information Criterion by choose Automatic selection.
By Tatre Jantarakolica
Page 84
By Tatre Jantarakolica
Page 85
5. Cointegration Test
Example:
PCEt = β1 + β2PDIt + ut
where PCEt and PDIt are both nonstationary and I(1) processes.
Then, if PCEt and PDIt are cointegrated series, ut = PCEt - β1 - β1PDIt must
be stationary.
By Tatre Jantarakolica
Page 86
Cointegrating Equation
EView’s Command
equation eq1.ls pce c pdi
genr uhat=resid
By Tatre Jantarakolica
Page 87
EView’s Command
equation eq2.ls d(pce) c d(pdi) uhat(-1)
By Tatre Jantarakolica
Page 88
Example
MA(1)
Y1t = 0.1 + u1t+ 0.5 u1t-1
AR(1)
Y2t = 0.1 + 0.5 Y2t-1 + u2t
ARMA(1,1)
Y3t = 0.1 + 0.5 Y3t-1 + u3t + 0.5 u3t-1
ARIMA(1,1,1)
ΔY4t = 0.1 + 0.5 ΔY4t-1 + u4t + 0.5 u4t-1
EView’s Command
smpl 1 1
genr y1 = 0
genr y2 = 0
genr y3 = 0
genr y4 = 0
genr dy4 =0
smpl 1 200
genr u1 = nrnd
genr u2 = nrnd
genr u3 = nrnd
genr u4 = nrnd
smpl 2 200
series y1 = 0.1+ u1 + 0.5*u1(-1)
series y2 = 0.1 + 0.5*y2(-1) + u2
series y3 = 0.1 + 0.5*y3(-1) + u3 + 0.5*u3(-1)
series y4 = 0.1 + y4(-1) + u4 + 0.5*u4(-1)
genr dy4 = y4 – y4(-1)
series y4 = 0.1 + y4(-1) + 0.5*dy4(-1) + u4 + 0.5*u4(-1)
plot y1 y2 y3 y4
By Tatre Jantarakolica
Page 89
70
60
50
40
30
20
10
-10
25 50 75 100 125 150 175 200
Y1 Y3
Y2 Y4
Correlogram of MA(1)
By Tatre Jantarakolica
Page 90
Correlogram of AR(1)
By Tatre Jantarakolica
Page 91
Correlogram of ARMA(1,1)
By Tatre Jantarakolica
Page 92
Correlogram of ARIMA(1,1,1)
By Tatre Jantarakolica
Page 93
By Tatre Jantarakolica
Page 94
Identify p and q
Next step is to identify order p and q of the model. We should first specify the
maximum lags length to limit the combination of specification of the models to be tested
(for example, in this case, we set maximum lags length = 2). Then, the combinations of
the models to be tested include ARIMA(0,1,1), ARIMA(1,1,0), ARIMA(1,1,1),
ARIMA(1,1,2), ARIMA(2,1,0), ARIMA(2,1,1), and ARIMA(2,1,2). To identify the optimal
order of the lags number of the ARIMA model, Schwarz Information Criteria (SIC) and
Akaike Information Criteria (AIC) can be used by choose the model with the lowest
value of SIC of AIC (in this case, we use SIC as our choosing criteria).
From EViews, click Estimate model, specify the order of ARIMA model. For
example, if the model to be estimated is ARIMA(2,1,2), the command is:
D(CMI) C AR(1) AR(2) MA(1) MA(2)
If the model is ARIMA(1,1,1), the command is:
D(CMI) C AR(1) MA(1)
If the model is ARIMA(1,0,0), the command is:
CMI C AR(1)
For example, if we estimate ARIMA(2,1,2), we can specify the command as
follows:
By Tatre Jantarakolica
Page 95
By Tatre Jantarakolica
Page 96
After estimate all combination of the models, then, compare SIC (or AIC) indices
to identify the optimal lags length (in this case, ARIMA(2,1,1) provide the lowest lags
length).
*In this example, since there is price war in the market in February, 2002. To eliminate this
effect, we use dummy variable by setting DUM=1 in February, 2002 and DUM=0 in all others.
By Tatre Jantarakolica
Page 97
Step 3:
Diagnostic Checking: Since residual terms of ARIMA model are assumed to
be white-noise, we can diagnostically check the estimated model by testing the property
of the estimated residual of the estimated model – using Correlogram.
In this example, correlogram result shows that residual terms of the model are
white-noise process.
Step 4:
Forecasting: The last step is forecasting process. To ensure that the
estimated model provides accurate prediction, forecasting error index, such as, Root
Mean Squares Error (RMSE), or Theil’s Inequality Coefficient, is used. In EViews’
estimated result Windows, from menu bar click Forecast.
By Tatre Jantarakolica
Page 98
In Forecast Window, fills in Series to forecast (in this case, CMI), names the
forecasted series (in this case, cmif), choose the forecasting Method (in this case,
Dynamic forecast), and Forecast sample (in this case, 1997m01 2005m05).
180
Forecast: CMIF
Actual: CMI
160
Forecast sample: 1997M01 2005M05
Adjusted sample: 1997M04 2005M05
140 Included observations: 98
60
1997 1998 1999 2000 2001 2002 2003 2004
CMIF
By Tatre Jantarakolica
Page 99
Example
SETt = β 0 + β1 IBR + β 2GOLDB + β 3USDS + ε t
EView’s Command
equation modelols.ls set c ibr goldb usds
By Tatre Jantarakolica
Page 100
Then, in Lag Specification Window, specify the lag number to be tested in Lags to
include: (in this case, Lags to include: = 1).
ARCH Test:
Test Equation:
Dependent Variable: RESID^2
Method: Least Squares
Sample (adjusted): 12/03/2003 5/13/2004
Included observations: 117 after adjustments
In this case, since p-value of the ARCH effect test (F-statistic or Chi-Square
(Obs*R-squared = (117*0.538907) = 63.05211)) is less than level of significance 0.05,
thus, null hypothesis that there is no ARCH effect is rejected, thus, there exists
significant ARCH effect in this model with 0.05 significant level.
By Tatre Jantarakolica
Page 101
By Tatre Jantarakolica
Page 102
From estimated results of GARCH models with different orders, choose the model with
the lowest AIC or SIC (in this case, the most appropriated model is GARCH(0,1) or
ARCH(1) model).
GARCH 0,1 1,1 1,2 2,1 2,2
AIC 8.8701 9.0228 8.9792 8.9430 8.9438
SIC 9.0110 9.1872 9.1670 9.1308 9.1551
By Tatre Jantarakolica
Page 103
Variance Equation
By Tatre Jantarakolica
Page 104
6000
5000
4000
3000
2000
1000
0
2003M12 2004M01 2004M02 2004M03 2004M04 2004M05
GARCH01
By Tatre Jantarakolica