SlideShare a Scribd company logo
ECON 3P95
Assignment 3
Milan Doczy , Chenguang Li , Jordan Templeton
June 26, 2016
1
Contents
1 Stationarity and Unit Root Test 4
1.1 Correlogram of SPIndex . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 LB test for SPIndex . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Correlogram for AtlantaHPIndex . . . . . . . . . . . . . . . . . . 6
1.4 Autocorrelation function for AtlantaHPIndex . . . . . . . . . . . 7
1.5 Lag selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Unit Root Test for SPIndex . . . . . . . . . . . . . . . . . . . . . 9
1.7 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.8 Unit Root Test for AtlantaHPIndex . . . . . . . . . . . . . . . . 11
1.9 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.10 Time Series Plot AtlantaHPIndex & SPIndex . . . . . . . . . . . 13
2 Cointegrating Regression 14
2.1 Scatterplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Estimations of the Cointegration Residual . . . . . . . . . . . . . 15
2.3 Correlogram of the Cointegration Residual . . . . . . . . . . . . . 16
2.4 Autocorrelation function of cointegraion Residuals . . . . . . . . 17
3 Engle-Granger Test of Cointegration 18
3.1 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4 Estimation of the VAR Model with the Optimal Lag Choice 20
4.1 Output for Optimal Lag Choice for VAR . . . . . . . . . . . . . . 20
5 VAR Estimation continue 21
5.1 The Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2 Visual Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.2.1 Combined time series SPIndex VAR Atalanta VAR . . . 22
5.2.2 Correlogram . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.3 White Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3.1 LB test for SPIndex . . . . . . . . . . . . . . . . . . . . . 25
5.3.2 LB test for AtalantaHPIndex . . . . . . . . . . . . . . . . 26
6 In-sample VAR forecasts 27
6.1 In-sample SPIndex VAR forecasts . . . . . . . . . . . . . . . . . . 27
6.2 In-sample AtlantaHPIndex VAR forecasts . . . . . . . . . . . . . 28
7 AR(1) in-sample forecasts 29
7.1 AR(1) for SPIndex . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.2 AR(1) for AtlantaHPIndex . . . . . . . . . . . . . . . . . . . . . 30
8 Out-of sample VAR forecasting 31
8.1 Out-of sample forecasting for SPIndex VAR . . . . . . . . . . . . 31
8.2 Out-of sample forecasting for AtlantaHPIndex . . . . . . . . . . . 32
2
9 Appendix 33
9.1 Leg Slection OLS regression for unit root test . . . . . . . . . . . 33
9.1.1 Gretl code for OLS regression (SPIndex 10 legs) . . . . . 33
9.1.2 Gretl code for OLS regression (AtlantaHPIndex 10 legs) . 34
9.2 cointegrating regression . . . . . . . . . . . . . . . . . . . . . . . 35
9.2.1 Gretl code . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3 VAR in sample forecasting . . . . . . . . . . . . . . . . . . . . . . 36
9.3.1 In-sample VAR output . . . . . . . . . . . . . . . . . . . . 36
9.3.2 AR(1) In-sample forescast . . . . . . . . . . . . . . . . . . 38
9.4 Out-of sample VAR forecasting . . . . . . . . . . . . . . . . . . . 39
9.4.1 Out put of Out-of sample VAR forecasting . . . . . . . . 39
9.5 Gretl: command log . . . . . . . . . . . . . . . . . . . . . . . . . 41
3
1 Stationarity and Unit Root Test
1.1 Correlogram of SPIndex
Figure 1: correlagram of S&P 500 Index
From the correlogram of SPIndex we can see ACF starts high and is falling
through time but is still pretty high after 20 lags, which indicates a nonstation-
ary data set.
4
1.2 LB test for SPIndex
LAG ACF PACF Q-STAT. [p-value]
1 0.9748 *** 0.0101629 *** -1.8636 0.0641
2 0.452030 *** 0.0702484 6.4347 0.0000
3 0.9241 *** -0.0130 481.6398 0.0000
4 0.8990 *** -0.0095 627.2279 0.0000
5 0.8746 *** 0.0014 465.8330 0.0000
6 0.8508 *** -0.0010 897.7754 0.0000
7 0.8275 *** -0.0030 1023.3324 0.0000
8 0.8044 *** -0.0082 1142.6946 0.0000
9 0.7814 *** -0.0101 1256.0196 0.0000
10 0.4585 *** -0.0112 1363.4503 0.0000
11 0.7357 *** -0.0103 1465.1438 0.0000
12 0.7131 *** -0.0035 1652.0594 0.0000
13 0.6909 *** -0.0035 1737.8513 0.0000
14 0.6695 *** 0.0026 1737.8513 0.0000
15 0.6488 *** 0.0009 1818.9225 0.0000
16 0.6287 *** 0.0006 1895.5384 0.0000
17 0.6094 *** 0.0022 1967.9673 0.0000
18 0.5904 *** -0.0033 2036.3975 0.0000
19 0.5904 *** -0.0033 2101.0093 0.0000
20 0.5538 *** -0.0013 2261.9961 0.0000
21 0.5362 *** -0.0018 2219.5375 0.0000
22 0.5189 *** -0.0032 2273.7922 0.0000
Furthermore, non-stationarity is proven by the LB test that all the P values
are near 0. Indecates there is no white noise and still some dynamics for us to
capture. Therefore we need to use proper unit root test to determine whether
our data is stationary.
5
1.3 Correlogram for AtlantaHPIndex
Figure 2: correlagram of Atlanta House Pricing Index
From the correlogram of specific AtlantaHPIndex we can see ACF is classic
“start high and stay high”, which indicates a nonstationary data set.
6
1.4 Autocorrelation function for AtlantaHPIndex
LAG ACF PACF Q-STAT. [p-value]
1 0.9842 *** 0.9842 *** 171.4817 0.0000
2 0.9687 *** -0.0022 338.5430 0.0000
3 0.9553 *** -0.0005 501.2976 0.0000
4 0.9385 *** 0.0096 659.9632 0.0000
5 0.9238 *** -0.0052 814.5936 0.0000
6 0.9091 *** -0.0044 965.2503 0.0000
7 0.8943 *** -0.0115 111.9217 0.0000
8 0.8795 *** -0.0079 1254.6383 0.0000
9 0.8644 *** -0.0204 1393.3069 0.0000
10 0.8487 *** -0.0229 1527.8208 0.0000
11 0.8329 *** -0.0147 1658.1635 0.0000
12 0.8170 *** -0.0140 1784.3336 0.0000
13 0.8010 *** -0.0083 1906.3875 0.0000
14 0.7850 *** -0.0141 2024.3255 0.0000
15 0.7690 *** -0.0058 2138.2272 0.0000
16 0.7533 *** -0.0001 2248.2213 0.0000
17 0.7377 *** -0.0053 2354.3853 0.0000
18 0.7220 *** -0.0135 2456.7193 0.0000
19 0.7065 *** -0.0015 2555.3333 0.0000
20 0.6907 *** -0.0179 2650.1943 0.0000
21 0.6746 *** -0.0170 2741.2887 0.0000
22 0.6580 *** -0.0278 2828.5197 0.0000
Furthermore, non-stationarity is proven by the LB test that all the P values
are near 0. Indecates there is no white noise and still some dynamics for us to
capture. Therefore we need to use proper unit root test to determine whether
our data is stationary.
7
1.5 Lag selections
Table 1: BIC results for different lag of SPIndex & AtlantaHPIndex
Lag S&P Atlanta
1 -1725.376* -1539.490
2 -1718.734 -1527.382
3 -1719.351 -1547.213*
4 -1714.473 -1540.906
5 -1700.517 -1526.633
6 -1685.497 -1524.254
7 -1669.186 -1512.989
8 -1656.754 -1502.498
9 -1644.221 -1489.383
10 -1631.732 -1490.806
From the unit root lag selections we choose the lowest BIC. Therefore it is
first lag for S&PIndex and third lag for AtlantaHPIndex
8
.
1.6 Unit Root Test for SPIndex
Table 2: Model 24: OLS, using observations 1991:03–2005:06 (T = 172)
Dependent variable: d l SPIndex
Coefficient Std. Error t-ratio p-value
const 0.000626609 0.00392999 0.1594 0.8735
time 1.53504e-005 7.1412e-006 2.5675 0.0111
l SPIndex 1 -0.000249928 0.000952091 -0.2625 0.7933
d l SPIndex 1 0.820463 0.044563 18.4195 0.0000
Mean dependent var 0.005683 S.D. dependent var 0.005705
Sum squared resid 0.000393 S.E. of regression 0.001530
R2
0.929369 Adjusted R2
0.928108
F(3,168) 736.8531 P-value(F) 2.07e-96
Log-likelihood 872.9830 Akaike criterion -1737.966
Schwarz criterion -1725.376 H-Q -1732.858
ˆp 0.162052 Durbin’s h 2.618554
In order to preform a proper unit root test we have to select the lag that has
the lowest SIC value as our optimal lag to model. After generating the model
in gretl (Appendix 9.3). From the output (Appendix 9.3.2) of our model we
choose lag one as our unit root test optimal lag. The results of the unit root
test are shown above. We can see the t-ratio of the log of the SPIndex value is
less than the absolute value of 3.9, this indicates non-stationarity for SPIndex.
9
1.7 Hypothesis test
H0: dlSPIndex = 1 → UnitRoot; non − stationary
H1: dlSPIndex < 1 → NoUnitRoot; stationary
∆SPIndex = β ∗ 0 + β1 ∗ (SPIndex)t−1 + ∆SPIndext−1 + +ut
10
1.8 Unit Root Test for AtlantaHPIndex
Model 1: OLS, using observations 1991:05–2005:06 (T = 170)
Dependent variable: d l AtlantaHPIndex
Coefficient Std. Error t-raio p-value
const 0.102789 0.0356068 2.8868 0.0044
l AtlantaHPIndex 1 -0.0242917 0.00853775 -2.8452 0.0050
time 0.000102817 3.35030e-005 3.0689 0.0025
d l AtlantaHPIndex 1 0.446385 0.0692713 6.4440 0.0000
d l AtlantaHPIndex 2 0.327009 0.0741171 4.4121 0.0000
d l AtlantaHPIndex 3 -0.395986 0.0682175 -5.8048 0.0000
Mean dependent var 0.003625 S.D. dependent var 0.003044
Sum squared resid 0.000908 S.E. of regression 0.002353
R2
0.419870 Adjusted R2
0.102183
F(5,164) 23.73902 P-value(F) 6.48e-18
Log-likelihood 790.6590 Akaike criterion -1569.318
Schwarz criterion -1550.503 H-Q -1561.683
ˆp 0.088891 Durbin’s h 2.700071
Same procedures for AtlantaHPIndex. After generating the model in gretl (Ap-
pendix 9.4). From the output (Appendix 9.4.2) of our model we choose lag three
as our unit root test optimal lag. The results of the unit root test are shown
above. We can see the t-ratio of the log of the AtlantaHPIndex value is less than
the absolute value of 3.9, this indicates non-stationary for AtlantaHPIndex.
11
1.9 Hypothesis test
H0: dlAtlantaHPIndex = 1 → UnitRoot; non − stationary
H1: dlAtlantaHPIndex < 1 → NoUnitRoot; stationary
∆AtlantaHPIndex = β∗0+β1∗(AtlantaHPIndex)t−1+∆AtlantaHPIndext−1+
∆AtlantaHPIndext−2 + ∆AtlantaHPIndext−3 + ut
12
1.10 Time Series Plot AtlantaHPIndex & SPIndex
Figure 3: Time series Plot AtlantaHPIndex & SPIndex
From the time series of both SPIndex and Atlanta houseing price index we
can see some correlations between the two. It seems both index are moving
towards a increasing trend. However For SPIndex appears a more qudratic
trend and Atlanta Index is more linear compare to SPIndex.
13
2 Cointegrating Regression
2.1 Scatterplot
Figure 4: scatterplot AtlantaHPIndex & SPIndex (with least squares fit)
The scatterplot shows that the Atlanta index moves with the ten city index.
The best fit line follows the general trend of the data and has a positive slope.
This means that according to our graph when x increases, y increases.
14
2.2 Estimations of the Cointegration Residual
Lag BIC
1 -1548.349
2 -1537.330
3 -1553.980*
4 -1548.994
5 -1534.946
6 -1531.406
7 -1520.662
8 -1509.729
9 -1496.274
10 -1498.845
In order to preform a proper cointegration regression we have to select the
lag that has the lowest SIC value as our optimal lag to model. After generating
the model in gretl . From the output of our model we choose lag three as our
engle-granger test optimal lag.
15
2.3 Correlogram of the Cointegration Residual
Figure 5: Correlogram of the cointgration residuals
ACF is falling over time and falls into the confidence interval and PACF
jumped to 0 after lag 1, which indicates stationary data.
16
2.4 Autocorrelation function of cointegraion Residuals
LAG ACF PACF Q-STAT. [p-value]
1 0.9721 *** 0.9721 *** 167.2790 0.0641
2 0.9358 *** -0.1664 ** 323.2093 0.0000
3 0.8927 *** -0.1243 465.9264 0.0000
4 0.8495 *** 0.0078 595.9203 0.0000
5 0.8059 *** -0.0220 713.6020 0.0000
6 0.7632 *** -0.0101 819.7695 0.0000
7 0.7259 *** 0.0765 916.4095 0.0000
8 0.6912 *** -0.0050 1004.5484 0.0000
9 0.6614 *** 0.0428 1085.7421 0.0000
10 0.6343 *** 0.0078 1160.8656 0.0000
11 0.6055 *** -0.0776 1229.7398 0.0000
12 0.5709 *** -0.1218 1291.3620 0.0000
13 0.5245 *** -0.2084 1343.6957 0.0000
14 0.4711 *** -0.0994 1386.1673 0.0000
15 0.4130 *** -0.0528 1419.0153 0.0000
16 0.3565 *** 0.0305 1443.6479 0.0000
17 0.3038 *** 0.0448 1461.6534 0.0000
18 0.2570 *** 0.0492 1474.6184 0.0000
19 0.2098 *** -0.1170 1483.3126 0.0000
20 0.1661 ** -0.0256 1488.8020 0.0000
21 0.1272 * -0.0036 1492.0410 0.0000
22 0.0978 0.1064 1493.9692 0.0000
However according to the LB test all the P values are near 0 which indicates
non-stationary data. This is beaucase gretl is interpreting the LB test results
strictly. Therefore we can say that the cointegration residuals are weakly sta-
tionary.
17
3 Engle-Granger Test of Cointegration
Model 11: OLS, using observations 1991:05–2005:06 (T = 170)
Dependent variable: d CointRe
Coefficient Std. Error t-raio p-value
const -0.00019022 0.0001854 -1.026 0.3065
Coint 1 -0.0189401 0.0101629 -1.855 0.0641
d CointRe 1 0.452030 0.0702484 6.4347 0.0000
d CointRe 2 0.331079 0.0753387 4.3945 0.0000
d CointRe 3 -0.369857 0.0698553 -5.2946 0.0000
Mean dependent var -0.000265 S.D. dependent var 0.002976
Sum squared resid 0.000945 S.E. of regression 0.002386
R2
0.373609 Adjusted R2
0.362288
F(4,166) 24.75252 P-value(F) 4.40e-16
Log-likelihood 787.2614 Akaike criterion -1566.523
Schwarz criterion -1553.980 H-Q -1561.433
ˆp 0.099597 Durbin’s h 3.235601
The results of the Engle-Granger test are shown above. We can see that the t-
ratio of the log of the cointegration residuals’ value is less than the absolute value
of 3.9, which indicates the residuals from the cointegration are not stationary.
Since the residuals are nonstationary. We need to estimate a VAR instead of a
VECM and lag selection.
18
3.1 Hypothesis test
H0: CointRe1 = 1 → UnitRoot; non − stationary
H1: CointRe1 < 1 → NoUnitRoot; stationary
∆CointRe1 = CointRe1 + CointRe1t + CointRe1t−1 + ut
19
4 Estimation of the VAR Model with the Opti-
mal Lag Choice
4.1 Output for Optimal Lag Choice for VAR
Lag BIC
1 -19.144385*
2 -19.023342
3 -19.106130
4 -19.063737
Useing gretl VAR lag slection to choose optimal lag choices for VAR. The lowest
BIC is lag 1 so that will be our optimal lag choice for VAR and the results are
shown below.
20
5 VAR Estimation continue
5.1 The Fit
In equation 1, the adjusted R2
is 0.923847 so 92.3847% of the variation in the
model is explained by the independent variables. Which is a very strong fit.
The SER is 0.001574 so the average distance between the actual data and our
fitted values is 0.1574% which is relatively small. Looking at the p-values we
can see that the lag of the composite index is significant, but the lag of the
Atlanta index is not. Overall equation 1 has a good fit.
For equation 2 the adjusted R2
is 0.246231 so only 24.6231% of the variation
in the model is explained. The SER is 0.002653 so the average distance between
actual data and our fitted value is 0.2653% much larger than equation 1. Finally
looking at the p-values we can see that the lag of the Atlanta index is significant
while the lag of the composite index is not at the 90% confidence level. Overall
the fit of equation 2 is not very strong.
21
5.2 Visual Diagnostics
5.2.1 Combined time series SPIndex VAR Atalanta VAR
Figure 6: Combined time series for SPIndex VAR & AtlantaHPIndex VAR
22
5.2.2 Correlogram
Figure 7: Correlogram of S&P VAR residuals
ACF are pretty much within confidence interval and only a little bit out of
it. Therefore we would say SPIndex are stationary.
23
Figure 8: Correlogram of AtlantaHPIndex VAR Residual
There are some ACF values are out of the confidence interval but it is not
too much to say it is non-stationary. Therefore we would say AtlantaHPIndex
are weakly stationary.
24
5.3 White Noise
5.3.1 LB test for SPIndex
LAG ACF PACF Q-STAT. [p-value]
1 0.1097 0.1097 2.1074 0.147
2 0.1275 0.1142 4.8502 0.088
3 -0.1195 -0.1478 * 7.3770 0.061
4 -0.1824 ** -0.1768 ** 13.3037 0.010
5 -0.1675 ** -0.1061 18.3308 0.003
6 -0.0913 -0.0387 19.8324 0.003
7 0.0880 0.1015 21.2367 0.003
8 0.0956 0.0431 22.9043 0.003
9 0.1542 ** 0.0654 27.2687 0.001
10 0.0189 *** -0.0394 27.3350 0.002
11 -0.1113 *** -0.1283 * 29.6391 0.002
12 -0.1640 ** -0.0973 34.6680 0.001
13 -0.1385 * -0.0354 38.2770 0.000
14 -0.0434 0.0114 38.6340 0.000
15 0.0650 0.0472 39.4390 0.001
16 0.1371 * 0.0425 43.0449 0.000
17 0.0440 -0.0751 43.4190 0.000
18 0.1735 ** 0.1373 * 49.2684 0.000
19 -0.0594 -0.0355 49.9592 0.000
20 0.0723 0.1359 * 50.9878 0.000
21 -0.0440 0.0450 51.3721 0.000
22 -0.0030 0.0062 51.3739 0.000
For SPIndex VAR, the P values of LB tests are pretty much all 0. This
indecates that SPIndex VAR is non-stationary. However from the correlogram
we know that gretl is being strict for the ACF that are out of the cofidence
interval. Therefore we could call SPIndex VAR is weakly stationary.
25
5.3.2 LB test for AtalantaHPIndex
LAG ACF PACF Q-STAT. [p-value]
1 -0.0583 -0.0583 0.5949 0.441
2 0.3143 *** 0.3120 *** 17.9880 0.000
3 -0.3621 *** -0.3683 *** 41.2057 0.000
4 0.1474 * 0.0766 4530768 0.000
5 -0.1310 * 0.0974 48.1499 0.000
6 -0.0060 -0.2608 *** 48.1564 0.000
7 -0.1571 ** -0.0548 52.6352 0.000
8 -0.0112 0.0734 52.6583 0.000
9 -0.0758 -0.1561 53.7125 0.000
10 0.0620 0.0395 ** 54.4235 0.000
11 0.1589 ** 0.3290 *** 59.1193 0.000
12 0.2521 *** 0.1488 * 71.0115 0.000
13 0.2439 *** 0.1653 ** 82.2055 0.000
14 0.0763 0.1605 ** 83.3123 0.000
15 -0.0040 -0.0570 83.3123 0.001
16 -0.1467 * -0.1614 ** 87.4399 0.000
17 -0.1007 -0.0479 89.3993 0.000
18 -0.0734 0.0325 90.4468 0.000
19 -0.0033 0.0158 90.4489 0.000
20 -0.1125 -0.1011 92.9404 0.000
21 -0.0708 -0.0365 93.9351 0.000
22 -0.0903 -0.0950 95.5607 0.000
The situation is the same for AtlantaHPIndex VAR. From its LB tests all the
P values are near 0, indicates non-stationary. However if we look at the correl-
ogram we can see almost all the ACF are within confidence interval. Therefore
we could call it weakly stationary as well.
26
6 In-sample VAR forecasts
6.1 In-sample SPIndex VAR forecasts
Figure 9: In-sample VAR Forescast for SPIndex
Mean Squared Error 0.00015244
Mean Absolute Error 0.0093385
Looking at the above graph we can see that our forecast drastically over-
estimate the SP Index. Clearly our model was unable to predict the financial
meltdown of 2007-2008. Once the market recovers by 2010 our forecast looks
better, but it still under and over predicts the SP Index. Our mean squared
error is only 0.00015244 and since the MSE is the average distance between the
actual values and forecasted values in square terms so our forecasting method
is accurate.
27
6.2 In-sample AtlantaHPIndex VAR forecasts
Figure 10: In-sample VAR Forescast for AtlantaHPIndex
Mean Squared Error 0.00027322
Mean Absolute Error 0.01179
Looking at the above graph we can see that our forecast is very different from
the actual values, however it does seem like our forecast accurately predicts the
average trend of the Atlanta index. We can also see some similarities between
Atlanta and the composite data. When Atlanta is mostly below zero so is the
composite, likewise when Atlanta is mostly above zero so is the composite. The
MSE of this forecast 0.00027322 is a little larger than our last MSE, but still
relatively small. Therefore Our forecast for Atlanta is not as accurate as our
forecast for the composite data.
28
7 AR(1) in-sample forecasts
7.1 AR(1) for SPIndex
Figure 11: AR(1) In-sample forescast for SPIndex
Mean Squared Error 0.00047428
Mean Absolute Error 0.020036
Looking at our forecast using AR(1) it’s clear that our predictions vastly
overestimate the actual values of the composite data. This is confirmed by the
fact that the MSE of this forecast is 0.00047428 which is over three times larger
than our MSE using the VAR approach. Therefore the VAR approach is more
accurate.
29
7.2 AR(1) for AtlantaHPIndex
Figure 12: AR(1) In-sample forescast for AtlantaHPIndex
Mean Squared Error 0.00028477
Mean Absolute Error 0.012239
Just like with the VAR approach we can see that our forecast regularly under
and over predicts the actual values for Atlanta, but does seem to capture the
average effectively. The MSE under this method is 0.00028477 which is only
slightly larger than 0.00027322 the MSE under the VAR approach. Therefore
we find the VAR approach to be more accurate, but only barely.
30
8 Out-of sample VAR forecasting
8.1 Out-of sample forecasting for SPIndex VAR
Figure 13: Out-of sample forecasting for SPIndex VAR
Our out of sample forecast for the composite data shows a gradual decline in
housing prices. Declining housing prices can lead to more consumers defaulting
on their morgages so banks will lose money. It will also lead to consumers having
less wealth which can lead to lower spending. Lower spending can decrease the
economic prosperity of the United States which can lead to a recession.
31
8.2 Out-of sample forecasting for AtlantaHPIndex
Figure 14: Out-of sample forecasting for AtlantaHPIndex
Our out of sample forecast for Atlanta show a very gradual increase in hous-
ing prices. Increasing housing prices increase the wealth of home owners which
can lead to higher consumption. This will help to encourage economic growth
in the United States.
32
9 Appendix
9.1 Leg Slection OLS regression for unit root test
9.1.1 Gretl code for OLS regression (SPIndex 10 legs)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -2)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -3)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -4)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -5)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -6)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -7)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -8)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -9)
ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -10)
33
9.1.2 Gretl code for OLS regression (AtlantaHPIndex 10 legs)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -2)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -3)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -4)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -5)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -6)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -7)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -8)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -9)
ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -10)
34
9.2 cointegrating regression
9.2.1 Gretl code
ols d_CointRe CointRe(-1) d_CointRe(-1)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -2)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -3)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -4)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -5)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -6)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -7)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -8)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -9)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -10)
35
9.3 VAR in sample forecasting
9.3.1 In-sample VAR output
VAR system, lag order 1
OLS estimates, observations 1991:03–2005:06 (T = 172)
Log-likelihood = 1645.37
Determinant of covariance matrix = 1.68288e–011
AIC = −19.0624
BIC = −18.9526
HQC = −19.0179
Portmanteau test: LB(43) = 290.434, df = 168 [0.0000]
Equation 1: d l SPIndex
Coefficient Std. Error t-ratio p-value
const 0.000362622 0.000200586 1.8078 0.0724
d l SPIndex 1 0.949869 0.0215352 44.1077 0.0000
d l AtlantaHPIndex 1 0.00473526 0.0401591 0.1179 0.9063
Mean dependent var 0.005683 S.D. dependent var 0.005705
Sum squared resid 0.000419 S.E. of regression 0.001574
R2
0.924738 Adjusted R2
0.923847
F(2,169) 1038.238 P-value(F) 1.18e95
ˆp 0.109826 Durbin-Watson 1.770112
F-tests of zero restrictions
All lags of dlSPIndex F(1, 169) = 1945.49 [0.0000]
All lags of dlAtlantaHPIndex F(1, 169) = 0.0139034 [0.9063]
36
Equation 2: d l AtlantaHPIndex
Coefficient Std. Error t-ratio p-value
const 0.00166369 0.000337961 4.9227 0.000
d l SPIndex 1 0.0589337 0.0362840 1.6242 0.1062
d l AtlantaHPIndex 1 0.459692 0.0676628 6.7939 0.0000
Mean dependent var 0.003602 S.D. dependent var 0.003055
Sum squared resid 0.001189 S.E. of regression 0.002653
R2
0.255047 Adjusted R2
0.246231
F(2,169) 28.92997 P-value(F) 1.57e-11
ˆp -0.059246 Durbin-Watson 2.100654
F-tests of zero restrictions
All lags of dlSPIndex F(1, 169) = 2.63813 [0.1062]
All lags of dlAtlantaHPIndex F(1, 169) = 46.1565 [0.0000]
37
9.3.2 AR(1) In-sample forescast
Model 13: OLS, using observations 1991:03–2005:06 (T = 172)
Dependent variable: d l SPIndex
Coefficient Std. Error t-ratio p-value
const -0.000402302 0.000284916 -1.4120 0.1598
time 1.70494e-005 5.13528e-006 3.3200 0.0011
d l SPIndex 1 0.819612 0.0443024 18.5004 0.0000
Mean dependent var 0.003602 S.D. dependent var 0.003055
Sum squared resid 0.001189 S.E. of regression 0.002653
R2
0.255047 Adjusted R2
0.246231
F(2,169) 28.92997 P-value(F) 1.57e-11
Log-likelihood 777.5473 Akaike criterion -1549.095
Schwarz criterion -1539.652 Hannan-Quinn -1545.263
ˆp 1539.652 Durbin-Watson 2.100654
Model 14: OLS, using observations 1991:03–2005:06 (T = 172)
Dependent variable: d l AtlantaHPIndex
Coefficient Std. Error t-ratio p-value
const 0.00142508 0.000444203 3.2082 0.0016
time 6.10844e-006 1.06303e-006 1.4673 0.1442
d l SPIndex 1 0.467432 0.0669743 6.9793 0.0000
Mean dependent var 0.003602 S.D. dependent var 0.003055
Sum squared resid 0.001193 S.E. of regression 0.002656
R2
0.252935 Adjusted R2
0.244094
F(2,169) 28.60935 P-value(F) 1.99e{11
Log-likelihood 777.5473 Akaike criterion -1549.095
Schwarz criterion -1539.652 Hannan-Quinn -1545.263
ˆp -0.064760 Durbin-Watson -1.776816
38
9.4 Out-of sample VAR forecasting
9.4.1 Out put of Out-of sample VAR forecasting
VAR system, lag order 1
OLS estimates, observations 1991:03–2015:12 (T = 298)
Log-likelihood = 2482.07
Determinant of covariance matrix = 1.99754e–010
AIC = −16.6179
BIC = −16.5435
HQC = −16.5881
Portmanteau test: LB(48) = 899.196, df = 188 [0.0000]
Equation 1: d l SPIndex
Coefficient Std. Error t-ratio p-value
const 0.000178243 0.000139241 1.2801 0.2015
d l SPIndex 1 0.957289 0.0181784 52.6607 0.0000
d l AtlantaHPIndex 1 -0.000291567 0.0132617 -0.0220 0.9825
Mean dependent var 0.003125 S.D. dependent var 0.007896
Sum squared resid 0.001479 S.E. of regression 0.002239
R2
0.920109 Adjusted R2
0.919568
F(2,169) 1698.775 P-value(F) 1.3e162
ˆp 0.116119 Durbin-Watson 1.763733
F-tests of zero restrictions
All lags of dlSPIndex F(1, 295) = 2773.15 [0.0000]
All lags of dlAtlantaHPIndex F(1, 295) = 0.000483369 [0.9825]
39
Equation 2: d l AtlantaHPIndex
Coefficient Std. Error t-ratio p-value
const 8.88034e-005 0.000399593 0.2222 0.8243
d l SPIndex 1 0.133320 0.0521682 2.5556 0.0111
d l AtlantaHPIndex 1 0.759362 0.0380583 19.9526 0.0000
Mean dependent var 0.002005 S.D. dependent var 0.010837
Sum squared resid 0.012183 S.E. of regression 0.006426
R2
0.650701 Adjusted R2
0.648333
F(2,169) 274.7739 P-value(F) 4.18e-68
ˆp 0.327013 Durbin-Watson 1.344706
F-tests of zero restrictions
All lags of dlSPIndex F(1, 295) = 6.53095 [0.0111]
All lags of dlAtlantaHPIndex F(1, 295) = 398.107 [0.0000]
40
9.5 Gretl: command log
Question 1
rename 1 SPIndex
logs SPIndex
logs AtlantaHPIndex
diff AtlantaHPIndex
diff SPIndex
genr time
smpl 1991:01 2005:06
gnuplot SPIndex AtlantaHPIndex --time-series --with-lines
Question 2
corrgm l_SPIndex 22
corrgm l_AtlantaHPIndex 22
# model 1
ols d_SPIndex 0 time l_SPIndex(-1) d_SPIndex(-1)
delete d_AtlantaHPIndex d_SPIndex
diff l_SPIndex
diff l_AtlantaHPIndex
delete d_SPIndex_1
# model 2
ols d_l_SPIndex 0 l_SPIndex(-1) time d_l_SPIndex(-1)
# model 3
ols d_l_AtlantaHPIndex 0 time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 _to -3)
Question 3
gnuplot l_AtlantaHPIndexx l_SPIndex
Question 4
ols l_SPIndex 0 l_AtlantaHPIndex(-1)
series CointRe = $CointRe$
gnuplot CointRe --time-series --with-lines
corrgm CointRe 22
Question 5
ols d_CointRe CointRe(-1) d_CointRe(-1)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -2)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -3)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -4)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -5)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -6)
41
ols d_CointRe CointRe(-1) d_CointRe(-1 to -7)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -8)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -9)
ols d_CointRe CointRe(-1) d_CointRe(-1 to -10)
Question 6
freq uhat11 --normal
corrgm uhat12 22
freq uhat12 --normal
var 3 d_l_SPIndex d_l_HomePriceIndex
smpl 1991:01 2015:12
var 3 d_l_SPIndex d_l_HomePriceIndex
var 3 d_l_SPIndex d_l_HomePriceIndex
var 3 d_l_SPIndex d_l_HomePriceIndex
var 3 d_l_SPIndex d_l_HomePriceIndex --lagselect
var 3 d_l_SPIndex d_l_HomePriceIndex
Question 7
smpl 1991:01 2015:12
diff l_SPIndex
diff l_HomePriceIndex
var 3 d_l_SPIndex d_l_HomePriceIndex
smpl 1991:01 2005:06
var 3 d_l_SPIndex d_l_HomePriceIndex
Question 9
smpl 1991:01 2015:12
var 1 d_l_SPIndex d_l_HomePriceIndex
smpl --full
diff l_HomePriceIndex
smpl 1991:01 2015:12
smpl 1991:01 2005:06
var 1 d_l_SPIndex d_l_HomePriceIndex
smpl --full
var 1 d_l_SPIndex d_l_HomePriceIndex
var 1 d_l_SPIndex d_l_HomePriceIndex
var 1 d_l_SPIndex d_l_HomePriceIndex
42
References
[1] The History of Recessions in the United States
http://useconomy.about.com/od/grossdomesticproduct/a/recession histo.htm
[2] A publication of the Board of Governors of the Federal Reserve System
http://www.federalreserve.gov/pf/pf.htm
43

More Related Content

Viewers also liked

The Law School Bubble
The Law School BubbleThe Law School Bubble
The Law School Bubble
Gaetan Lion
 
Regresion lineal multiple_3
Regresion lineal multiple_3Regresion lineal multiple_3
Regresion lineal multiple_3
karinita12
 
Unrestricted var out
Unrestricted var outUnrestricted var out
Unrestricted var out
Gaetan Lion
 
Deep Learning
Deep LearningDeep Learning
Deep Learning
Gaetan Lion
 
Quantitative method intro variable_levels_measurement
Quantitative method intro variable_levels_measurementQuantitative method intro variable_levels_measurement
Quantitative method intro variable_levels_measurement
Keiko Ono
 
Lecture notes on Johansen cointegration
Lecture notes on Johansen cointegrationLecture notes on Johansen cointegration
Lecture notes on Johansen cointegration
Moses sichei
 
Causality detection
Causality detectionCausality detection
Causality detection
Tushar Mehndiratta
 
STATA - Merge or Drop Data
STATA - Merge or Drop DataSTATA - Merge or Drop Data
STATA - Merge or Drop Data
stata_org_uk
 
Regression topics
Regression topicsRegression topics
Regression topics
Gaetan Lion
 
Multiple Linear Regression
Multiple Linear RegressionMultiple Linear Regression
Multiple Linear Regression
Nadzirah Hanis
 
Presentation on GMM
Presentation on GMMPresentation on GMM
Presentation on GMM
Moses sichei
 
Econometric modelling
Econometric modellingEconometric modelling
Econometric modelling
CAPE ECONOMICS
 
Linear Regression
Linear RegressionLinear Regression
Linear Regression
nep_test_account
 
Granger Causality
Granger CausalityGranger Causality
Granger Causality
Gaetan Lion
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
Avjinder (Avi) Kaler
 
Gini coefficient vs economic growth
Gini coefficient vs economic growthGini coefficient vs economic growth
Gini coefficient vs economic growth
Gaetan Lion
 
STATA - Linear Regressions
STATA - Linear RegressionsSTATA - Linear Regressions
STATA - Linear Regressions
stata_org_uk
 
Intro to econometrics
Intro to econometricsIntro to econometrics
Intro to econometrics
Gaetan Lion
 
Nonparametric hypothesis testing methods
Nonparametric hypothesis testing methodsNonparametric hypothesis testing methods
Nonparametric hypothesis testing methods
Gaetan Lion
 
Qualitative data analysis
Qualitative data analysisQualitative data analysis
Qualitative data analysis
Shankar Talwar
 

Viewers also liked (20)

The Law School Bubble
The Law School BubbleThe Law School Bubble
The Law School Bubble
 
Regresion lineal multiple_3
Regresion lineal multiple_3Regresion lineal multiple_3
Regresion lineal multiple_3
 
Unrestricted var out
Unrestricted var outUnrestricted var out
Unrestricted var out
 
Deep Learning
Deep LearningDeep Learning
Deep Learning
 
Quantitative method intro variable_levels_measurement
Quantitative method intro variable_levels_measurementQuantitative method intro variable_levels_measurement
Quantitative method intro variable_levels_measurement
 
Lecture notes on Johansen cointegration
Lecture notes on Johansen cointegrationLecture notes on Johansen cointegration
Lecture notes on Johansen cointegration
 
Causality detection
Causality detectionCausality detection
Causality detection
 
STATA - Merge or Drop Data
STATA - Merge or Drop DataSTATA - Merge or Drop Data
STATA - Merge or Drop Data
 
Regression topics
Regression topicsRegression topics
Regression topics
 
Multiple Linear Regression
Multiple Linear RegressionMultiple Linear Regression
Multiple Linear Regression
 
Presentation on GMM
Presentation on GMMPresentation on GMM
Presentation on GMM
 
Econometric modelling
Econometric modellingEconometric modelling
Econometric modelling
 
Linear Regression
Linear RegressionLinear Regression
Linear Regression
 
Granger Causality
Granger CausalityGranger Causality
Granger Causality
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
 
Gini coefficient vs economic growth
Gini coefficient vs economic growthGini coefficient vs economic growth
Gini coefficient vs economic growth
 
STATA - Linear Regressions
STATA - Linear RegressionsSTATA - Linear Regressions
STATA - Linear Regressions
 
Intro to econometrics
Intro to econometricsIntro to econometrics
Intro to econometrics
 
Nonparametric hypothesis testing methods
Nonparametric hypothesis testing methodsNonparametric hypothesis testing methods
Nonparametric hypothesis testing methods
 
Qualitative data analysis
Qualitative data analysisQualitative data analysis
Qualitative data analysis
 

Similar to Applied Econometrics assignment3

Applied Econometrics assigment 2
Applied Econometrics assigment 2Applied Econometrics assigment 2
Applied Econometrics assigment 2
Chenguang Li
 
Time series analysis on The daily closing price of bitcoin from the 27th of A...
Time series analysis on The daily closing price of bitcoin from the 27th of A...Time series analysis on The daily closing price of bitcoin from the 27th of A...
Time series analysis on The daily closing price of bitcoin from the 27th of A...
ShuaiGao3
 
Q46C4C-4-Electrode-Concentration-Monitor.pdf
Q46C4C-4-Electrode-Concentration-Monitor.pdfQ46C4C-4-Electrode-Concentration-Monitor.pdf
Q46C4C-4-Electrode-Concentration-Monitor.pdf
ENVIMART
 
ADS1256 library documentation
ADS1256 library documentationADS1256 library documentation
ADS1256 library documentation
CuriousScientist
 
Cd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronics
Cd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronicsCd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronics
Cd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronics
vu CAO
 
DPRSG IC Design
DPRSG IC DesignDPRSG IC Design
DPRSG IC Design
Rashad Alsaffar
 
Esp with thepic16f877
Esp with thepic16f877Esp with thepic16f877
Esp with thepic16f877
ravi shankar ambati
 
Sokkia set6 manual
Sokkia set6 manualSokkia set6 manual
bachelors-thesis
bachelors-thesisbachelors-thesis
bachelors-thesis
Vishal Gawade
 
PLC: Introducción al PLC
PLC: Introducción al PLC PLC: Introducción al PLC
PLC: Introducción al PLC
SANTIAGO PABLO ALBERTO
 
Schneider light control pricelist wef 1st nov 2018
Schneider light control pricelist wef 1st nov  2018Schneider light control pricelist wef 1st nov  2018
Schneider light control pricelist wef 1st nov 2018
Maxpromotion
 
Ks 50-1-ks-52-1-manual-english
Ks 50-1-ks-52-1-manual-englishKs 50-1-ks-52-1-manual-english
Ks 50-1-ks-52-1-manual-english
jeferson tadeu
 
Q46P-pH-Monitor O&M Manual.pdf
Q46P-pH-Monitor O&M Manual.pdfQ46P-pH-Monitor O&M Manual.pdf
Q46P-pH-Monitor O&M Manual.pdf
ENVIMART
 
Bidm assignment airtrip data
Bidm assignment   airtrip dataBidm assignment   airtrip data
Bidm assignment airtrip data
Sanmeet Dhokay
 
Drive berger lahr
Drive berger lahr Drive berger lahr
Drive berger lahr
jguillermo91
 
Brl arpa doploc satellite detection complex
Brl arpa doploc satellite detection complexBrl arpa doploc satellite detection complex
Brl arpa doploc satellite detection complex
Clifford Stone
 
MS-Thesis
MS-ThesisMS-Thesis
MS-Thesis
Thomas Suchyta
 
A High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADCA High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADC
Pushpak Dagade
 
A High Speed Successive Approximation Pipelined ADC.pdf
A High Speed Successive Approximation Pipelined ADC.pdfA High Speed Successive Approximation Pipelined ADC.pdf
A High Speed Successive Approximation Pipelined ADC.pdf
Kathryn Patel
 
8S003F3_STMicroelectronics.pdf
8S003F3_STMicroelectronics.pdf8S003F3_STMicroelectronics.pdf
8S003F3_STMicroelectronics.pdf
qFilipeSilva
 

Similar to Applied Econometrics assignment3 (20)

Applied Econometrics assigment 2
Applied Econometrics assigment 2Applied Econometrics assigment 2
Applied Econometrics assigment 2
 
Time series analysis on The daily closing price of bitcoin from the 27th of A...
Time series analysis on The daily closing price of bitcoin from the 27th of A...Time series analysis on The daily closing price of bitcoin from the 27th of A...
Time series analysis on The daily closing price of bitcoin from the 27th of A...
 
Q46C4C-4-Electrode-Concentration-Monitor.pdf
Q46C4C-4-Electrode-Concentration-Monitor.pdfQ46C4C-4-Electrode-Concentration-Monitor.pdf
Q46C4C-4-Electrode-Concentration-Monitor.pdf
 
ADS1256 library documentation
ADS1256 library documentationADS1256 library documentation
ADS1256 library documentation
 
Cd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronics
Cd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronicsCd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronics
Cd00004444 understanding-and-minimising-adc-conversion-errors-stmicroelectronics
 
DPRSG IC Design
DPRSG IC DesignDPRSG IC Design
DPRSG IC Design
 
Esp with thepic16f877
Esp with thepic16f877Esp with thepic16f877
Esp with thepic16f877
 
Sokkia set6 manual
Sokkia set6 manualSokkia set6 manual
Sokkia set6 manual
 
bachelors-thesis
bachelors-thesisbachelors-thesis
bachelors-thesis
 
PLC: Introducción al PLC
PLC: Introducción al PLC PLC: Introducción al PLC
PLC: Introducción al PLC
 
Schneider light control pricelist wef 1st nov 2018
Schneider light control pricelist wef 1st nov  2018Schneider light control pricelist wef 1st nov  2018
Schneider light control pricelist wef 1st nov 2018
 
Ks 50-1-ks-52-1-manual-english
Ks 50-1-ks-52-1-manual-englishKs 50-1-ks-52-1-manual-english
Ks 50-1-ks-52-1-manual-english
 
Q46P-pH-Monitor O&M Manual.pdf
Q46P-pH-Monitor O&M Manual.pdfQ46P-pH-Monitor O&M Manual.pdf
Q46P-pH-Monitor O&M Manual.pdf
 
Bidm assignment airtrip data
Bidm assignment   airtrip dataBidm assignment   airtrip data
Bidm assignment airtrip data
 
Drive berger lahr
Drive berger lahr Drive berger lahr
Drive berger lahr
 
Brl arpa doploc satellite detection complex
Brl arpa doploc satellite detection complexBrl arpa doploc satellite detection complex
Brl arpa doploc satellite detection complex
 
MS-Thesis
MS-ThesisMS-Thesis
MS-Thesis
 
A High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADCA High Speed Successive Approximation Pipelined ADC
A High Speed Successive Approximation Pipelined ADC
 
A High Speed Successive Approximation Pipelined ADC.pdf
A High Speed Successive Approximation Pipelined ADC.pdfA High Speed Successive Approximation Pipelined ADC.pdf
A High Speed Successive Approximation Pipelined ADC.pdf
 
8S003F3_STMicroelectronics.pdf
8S003F3_STMicroelectronics.pdf8S003F3_STMicroelectronics.pdf
8S003F3_STMicroelectronics.pdf
 

Applied Econometrics assignment3

  • 1. ECON 3P95 Assignment 3 Milan Doczy , Chenguang Li , Jordan Templeton June 26, 2016 1
  • 2. Contents 1 Stationarity and Unit Root Test 4 1.1 Correlogram of SPIndex . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 LB test for SPIndex . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3 Correlogram for AtlantaHPIndex . . . . . . . . . . . . . . . . . . 6 1.4 Autocorrelation function for AtlantaHPIndex . . . . . . . . . . . 7 1.5 Lag selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.6 Unit Root Test for SPIndex . . . . . . . . . . . . . . . . . . . . . 9 1.7 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.8 Unit Root Test for AtlantaHPIndex . . . . . . . . . . . . . . . . 11 1.9 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.10 Time Series Plot AtlantaHPIndex & SPIndex . . . . . . . . . . . 13 2 Cointegrating Regression 14 2.1 Scatterplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2 Estimations of the Cointegration Residual . . . . . . . . . . . . . 15 2.3 Correlogram of the Cointegration Residual . . . . . . . . . . . . . 16 2.4 Autocorrelation function of cointegraion Residuals . . . . . . . . 17 3 Engle-Granger Test of Cointegration 18 3.1 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4 Estimation of the VAR Model with the Optimal Lag Choice 20 4.1 Output for Optimal Lag Choice for VAR . . . . . . . . . . . . . . 20 5 VAR Estimation continue 21 5.1 The Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2 Visual Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2.1 Combined time series SPIndex VAR Atalanta VAR . . . 22 5.2.2 Correlogram . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3 White Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.3.1 LB test for SPIndex . . . . . . . . . . . . . . . . . . . . . 25 5.3.2 LB test for AtalantaHPIndex . . . . . . . . . . . . . . . . 26 6 In-sample VAR forecasts 27 6.1 In-sample SPIndex VAR forecasts . . . . . . . . . . . . . . . . . . 27 6.2 In-sample AtlantaHPIndex VAR forecasts . . . . . . . . . . . . . 28 7 AR(1) in-sample forecasts 29 7.1 AR(1) for SPIndex . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7.2 AR(1) for AtlantaHPIndex . . . . . . . . . . . . . . . . . . . . . 30 8 Out-of sample VAR forecasting 31 8.1 Out-of sample forecasting for SPIndex VAR . . . . . . . . . . . . 31 8.2 Out-of sample forecasting for AtlantaHPIndex . . . . . . . . . . . 32 2
  • 3. 9 Appendix 33 9.1 Leg Slection OLS regression for unit root test . . . . . . . . . . . 33 9.1.1 Gretl code for OLS regression (SPIndex 10 legs) . . . . . 33 9.1.2 Gretl code for OLS regression (AtlantaHPIndex 10 legs) . 34 9.2 cointegrating regression . . . . . . . . . . . . . . . . . . . . . . . 35 9.2.1 Gretl code . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 9.3 VAR in sample forecasting . . . . . . . . . . . . . . . . . . . . . . 36 9.3.1 In-sample VAR output . . . . . . . . . . . . . . . . . . . . 36 9.3.2 AR(1) In-sample forescast . . . . . . . . . . . . . . . . . . 38 9.4 Out-of sample VAR forecasting . . . . . . . . . . . . . . . . . . . 39 9.4.1 Out put of Out-of sample VAR forecasting . . . . . . . . 39 9.5 Gretl: command log . . . . . . . . . . . . . . . . . . . . . . . . . 41 3
  • 4. 1 Stationarity and Unit Root Test 1.1 Correlogram of SPIndex Figure 1: correlagram of S&P 500 Index From the correlogram of SPIndex we can see ACF starts high and is falling through time but is still pretty high after 20 lags, which indicates a nonstation- ary data set. 4
  • 5. 1.2 LB test for SPIndex LAG ACF PACF Q-STAT. [p-value] 1 0.9748 *** 0.0101629 *** -1.8636 0.0641 2 0.452030 *** 0.0702484 6.4347 0.0000 3 0.9241 *** -0.0130 481.6398 0.0000 4 0.8990 *** -0.0095 627.2279 0.0000 5 0.8746 *** 0.0014 465.8330 0.0000 6 0.8508 *** -0.0010 897.7754 0.0000 7 0.8275 *** -0.0030 1023.3324 0.0000 8 0.8044 *** -0.0082 1142.6946 0.0000 9 0.7814 *** -0.0101 1256.0196 0.0000 10 0.4585 *** -0.0112 1363.4503 0.0000 11 0.7357 *** -0.0103 1465.1438 0.0000 12 0.7131 *** -0.0035 1652.0594 0.0000 13 0.6909 *** -0.0035 1737.8513 0.0000 14 0.6695 *** 0.0026 1737.8513 0.0000 15 0.6488 *** 0.0009 1818.9225 0.0000 16 0.6287 *** 0.0006 1895.5384 0.0000 17 0.6094 *** 0.0022 1967.9673 0.0000 18 0.5904 *** -0.0033 2036.3975 0.0000 19 0.5904 *** -0.0033 2101.0093 0.0000 20 0.5538 *** -0.0013 2261.9961 0.0000 21 0.5362 *** -0.0018 2219.5375 0.0000 22 0.5189 *** -0.0032 2273.7922 0.0000 Furthermore, non-stationarity is proven by the LB test that all the P values are near 0. Indecates there is no white noise and still some dynamics for us to capture. Therefore we need to use proper unit root test to determine whether our data is stationary. 5
  • 6. 1.3 Correlogram for AtlantaHPIndex Figure 2: correlagram of Atlanta House Pricing Index From the correlogram of specific AtlantaHPIndex we can see ACF is classic “start high and stay high”, which indicates a nonstationary data set. 6
  • 7. 1.4 Autocorrelation function for AtlantaHPIndex LAG ACF PACF Q-STAT. [p-value] 1 0.9842 *** 0.9842 *** 171.4817 0.0000 2 0.9687 *** -0.0022 338.5430 0.0000 3 0.9553 *** -0.0005 501.2976 0.0000 4 0.9385 *** 0.0096 659.9632 0.0000 5 0.9238 *** -0.0052 814.5936 0.0000 6 0.9091 *** -0.0044 965.2503 0.0000 7 0.8943 *** -0.0115 111.9217 0.0000 8 0.8795 *** -0.0079 1254.6383 0.0000 9 0.8644 *** -0.0204 1393.3069 0.0000 10 0.8487 *** -0.0229 1527.8208 0.0000 11 0.8329 *** -0.0147 1658.1635 0.0000 12 0.8170 *** -0.0140 1784.3336 0.0000 13 0.8010 *** -0.0083 1906.3875 0.0000 14 0.7850 *** -0.0141 2024.3255 0.0000 15 0.7690 *** -0.0058 2138.2272 0.0000 16 0.7533 *** -0.0001 2248.2213 0.0000 17 0.7377 *** -0.0053 2354.3853 0.0000 18 0.7220 *** -0.0135 2456.7193 0.0000 19 0.7065 *** -0.0015 2555.3333 0.0000 20 0.6907 *** -0.0179 2650.1943 0.0000 21 0.6746 *** -0.0170 2741.2887 0.0000 22 0.6580 *** -0.0278 2828.5197 0.0000 Furthermore, non-stationarity is proven by the LB test that all the P values are near 0. Indecates there is no white noise and still some dynamics for us to capture. Therefore we need to use proper unit root test to determine whether our data is stationary. 7
  • 8. 1.5 Lag selections Table 1: BIC results for different lag of SPIndex & AtlantaHPIndex Lag S&P Atlanta 1 -1725.376* -1539.490 2 -1718.734 -1527.382 3 -1719.351 -1547.213* 4 -1714.473 -1540.906 5 -1700.517 -1526.633 6 -1685.497 -1524.254 7 -1669.186 -1512.989 8 -1656.754 -1502.498 9 -1644.221 -1489.383 10 -1631.732 -1490.806 From the unit root lag selections we choose the lowest BIC. Therefore it is first lag for S&PIndex and third lag for AtlantaHPIndex 8
  • 9. . 1.6 Unit Root Test for SPIndex Table 2: Model 24: OLS, using observations 1991:03–2005:06 (T = 172) Dependent variable: d l SPIndex Coefficient Std. Error t-ratio p-value const 0.000626609 0.00392999 0.1594 0.8735 time 1.53504e-005 7.1412e-006 2.5675 0.0111 l SPIndex 1 -0.000249928 0.000952091 -0.2625 0.7933 d l SPIndex 1 0.820463 0.044563 18.4195 0.0000 Mean dependent var 0.005683 S.D. dependent var 0.005705 Sum squared resid 0.000393 S.E. of regression 0.001530 R2 0.929369 Adjusted R2 0.928108 F(3,168) 736.8531 P-value(F) 2.07e-96 Log-likelihood 872.9830 Akaike criterion -1737.966 Schwarz criterion -1725.376 H-Q -1732.858 ˆp 0.162052 Durbin’s h 2.618554 In order to preform a proper unit root test we have to select the lag that has the lowest SIC value as our optimal lag to model. After generating the model in gretl (Appendix 9.3). From the output (Appendix 9.3.2) of our model we choose lag one as our unit root test optimal lag. The results of the unit root test are shown above. We can see the t-ratio of the log of the SPIndex value is less than the absolute value of 3.9, this indicates non-stationarity for SPIndex. 9
  • 10. 1.7 Hypothesis test H0: dlSPIndex = 1 → UnitRoot; non − stationary H1: dlSPIndex < 1 → NoUnitRoot; stationary ∆SPIndex = β ∗ 0 + β1 ∗ (SPIndex)t−1 + ∆SPIndext−1 + +ut 10
  • 11. 1.8 Unit Root Test for AtlantaHPIndex Model 1: OLS, using observations 1991:05–2005:06 (T = 170) Dependent variable: d l AtlantaHPIndex Coefficient Std. Error t-raio p-value const 0.102789 0.0356068 2.8868 0.0044 l AtlantaHPIndex 1 -0.0242917 0.00853775 -2.8452 0.0050 time 0.000102817 3.35030e-005 3.0689 0.0025 d l AtlantaHPIndex 1 0.446385 0.0692713 6.4440 0.0000 d l AtlantaHPIndex 2 0.327009 0.0741171 4.4121 0.0000 d l AtlantaHPIndex 3 -0.395986 0.0682175 -5.8048 0.0000 Mean dependent var 0.003625 S.D. dependent var 0.003044 Sum squared resid 0.000908 S.E. of regression 0.002353 R2 0.419870 Adjusted R2 0.102183 F(5,164) 23.73902 P-value(F) 6.48e-18 Log-likelihood 790.6590 Akaike criterion -1569.318 Schwarz criterion -1550.503 H-Q -1561.683 ˆp 0.088891 Durbin’s h 2.700071 Same procedures for AtlantaHPIndex. After generating the model in gretl (Ap- pendix 9.4). From the output (Appendix 9.4.2) of our model we choose lag three as our unit root test optimal lag. The results of the unit root test are shown above. We can see the t-ratio of the log of the AtlantaHPIndex value is less than the absolute value of 3.9, this indicates non-stationary for AtlantaHPIndex. 11
  • 12. 1.9 Hypothesis test H0: dlAtlantaHPIndex = 1 → UnitRoot; non − stationary H1: dlAtlantaHPIndex < 1 → NoUnitRoot; stationary ∆AtlantaHPIndex = β∗0+β1∗(AtlantaHPIndex)t−1+∆AtlantaHPIndext−1+ ∆AtlantaHPIndext−2 + ∆AtlantaHPIndext−3 + ut 12
  • 13. 1.10 Time Series Plot AtlantaHPIndex & SPIndex Figure 3: Time series Plot AtlantaHPIndex & SPIndex From the time series of both SPIndex and Atlanta houseing price index we can see some correlations between the two. It seems both index are moving towards a increasing trend. However For SPIndex appears a more qudratic trend and Atlanta Index is more linear compare to SPIndex. 13
  • 14. 2 Cointegrating Regression 2.1 Scatterplot Figure 4: scatterplot AtlantaHPIndex & SPIndex (with least squares fit) The scatterplot shows that the Atlanta index moves with the ten city index. The best fit line follows the general trend of the data and has a positive slope. This means that according to our graph when x increases, y increases. 14
  • 15. 2.2 Estimations of the Cointegration Residual Lag BIC 1 -1548.349 2 -1537.330 3 -1553.980* 4 -1548.994 5 -1534.946 6 -1531.406 7 -1520.662 8 -1509.729 9 -1496.274 10 -1498.845 In order to preform a proper cointegration regression we have to select the lag that has the lowest SIC value as our optimal lag to model. After generating the model in gretl . From the output of our model we choose lag three as our engle-granger test optimal lag. 15
  • 16. 2.3 Correlogram of the Cointegration Residual Figure 5: Correlogram of the cointgration residuals ACF is falling over time and falls into the confidence interval and PACF jumped to 0 after lag 1, which indicates stationary data. 16
  • 17. 2.4 Autocorrelation function of cointegraion Residuals LAG ACF PACF Q-STAT. [p-value] 1 0.9721 *** 0.9721 *** 167.2790 0.0641 2 0.9358 *** -0.1664 ** 323.2093 0.0000 3 0.8927 *** -0.1243 465.9264 0.0000 4 0.8495 *** 0.0078 595.9203 0.0000 5 0.8059 *** -0.0220 713.6020 0.0000 6 0.7632 *** -0.0101 819.7695 0.0000 7 0.7259 *** 0.0765 916.4095 0.0000 8 0.6912 *** -0.0050 1004.5484 0.0000 9 0.6614 *** 0.0428 1085.7421 0.0000 10 0.6343 *** 0.0078 1160.8656 0.0000 11 0.6055 *** -0.0776 1229.7398 0.0000 12 0.5709 *** -0.1218 1291.3620 0.0000 13 0.5245 *** -0.2084 1343.6957 0.0000 14 0.4711 *** -0.0994 1386.1673 0.0000 15 0.4130 *** -0.0528 1419.0153 0.0000 16 0.3565 *** 0.0305 1443.6479 0.0000 17 0.3038 *** 0.0448 1461.6534 0.0000 18 0.2570 *** 0.0492 1474.6184 0.0000 19 0.2098 *** -0.1170 1483.3126 0.0000 20 0.1661 ** -0.0256 1488.8020 0.0000 21 0.1272 * -0.0036 1492.0410 0.0000 22 0.0978 0.1064 1493.9692 0.0000 However according to the LB test all the P values are near 0 which indicates non-stationary data. This is beaucase gretl is interpreting the LB test results strictly. Therefore we can say that the cointegration residuals are weakly sta- tionary. 17
  • 18. 3 Engle-Granger Test of Cointegration Model 11: OLS, using observations 1991:05–2005:06 (T = 170) Dependent variable: d CointRe Coefficient Std. Error t-raio p-value const -0.00019022 0.0001854 -1.026 0.3065 Coint 1 -0.0189401 0.0101629 -1.855 0.0641 d CointRe 1 0.452030 0.0702484 6.4347 0.0000 d CointRe 2 0.331079 0.0753387 4.3945 0.0000 d CointRe 3 -0.369857 0.0698553 -5.2946 0.0000 Mean dependent var -0.000265 S.D. dependent var 0.002976 Sum squared resid 0.000945 S.E. of regression 0.002386 R2 0.373609 Adjusted R2 0.362288 F(4,166) 24.75252 P-value(F) 4.40e-16 Log-likelihood 787.2614 Akaike criterion -1566.523 Schwarz criterion -1553.980 H-Q -1561.433 ˆp 0.099597 Durbin’s h 3.235601 The results of the Engle-Granger test are shown above. We can see that the t- ratio of the log of the cointegration residuals’ value is less than the absolute value of 3.9, which indicates the residuals from the cointegration are not stationary. Since the residuals are nonstationary. We need to estimate a VAR instead of a VECM and lag selection. 18
  • 19. 3.1 Hypothesis test H0: CointRe1 = 1 → UnitRoot; non − stationary H1: CointRe1 < 1 → NoUnitRoot; stationary ∆CointRe1 = CointRe1 + CointRe1t + CointRe1t−1 + ut 19
  • 20. 4 Estimation of the VAR Model with the Opti- mal Lag Choice 4.1 Output for Optimal Lag Choice for VAR Lag BIC 1 -19.144385* 2 -19.023342 3 -19.106130 4 -19.063737 Useing gretl VAR lag slection to choose optimal lag choices for VAR. The lowest BIC is lag 1 so that will be our optimal lag choice for VAR and the results are shown below. 20
  • 21. 5 VAR Estimation continue 5.1 The Fit In equation 1, the adjusted R2 is 0.923847 so 92.3847% of the variation in the model is explained by the independent variables. Which is a very strong fit. The SER is 0.001574 so the average distance between the actual data and our fitted values is 0.1574% which is relatively small. Looking at the p-values we can see that the lag of the composite index is significant, but the lag of the Atlanta index is not. Overall equation 1 has a good fit. For equation 2 the adjusted R2 is 0.246231 so only 24.6231% of the variation in the model is explained. The SER is 0.002653 so the average distance between actual data and our fitted value is 0.2653% much larger than equation 1. Finally looking at the p-values we can see that the lag of the Atlanta index is significant while the lag of the composite index is not at the 90% confidence level. Overall the fit of equation 2 is not very strong. 21
  • 22. 5.2 Visual Diagnostics 5.2.1 Combined time series SPIndex VAR Atalanta VAR Figure 6: Combined time series for SPIndex VAR & AtlantaHPIndex VAR 22
  • 23. 5.2.2 Correlogram Figure 7: Correlogram of S&P VAR residuals ACF are pretty much within confidence interval and only a little bit out of it. Therefore we would say SPIndex are stationary. 23
  • 24. Figure 8: Correlogram of AtlantaHPIndex VAR Residual There are some ACF values are out of the confidence interval but it is not too much to say it is non-stationary. Therefore we would say AtlantaHPIndex are weakly stationary. 24
  • 25. 5.3 White Noise 5.3.1 LB test for SPIndex LAG ACF PACF Q-STAT. [p-value] 1 0.1097 0.1097 2.1074 0.147 2 0.1275 0.1142 4.8502 0.088 3 -0.1195 -0.1478 * 7.3770 0.061 4 -0.1824 ** -0.1768 ** 13.3037 0.010 5 -0.1675 ** -0.1061 18.3308 0.003 6 -0.0913 -0.0387 19.8324 0.003 7 0.0880 0.1015 21.2367 0.003 8 0.0956 0.0431 22.9043 0.003 9 0.1542 ** 0.0654 27.2687 0.001 10 0.0189 *** -0.0394 27.3350 0.002 11 -0.1113 *** -0.1283 * 29.6391 0.002 12 -0.1640 ** -0.0973 34.6680 0.001 13 -0.1385 * -0.0354 38.2770 0.000 14 -0.0434 0.0114 38.6340 0.000 15 0.0650 0.0472 39.4390 0.001 16 0.1371 * 0.0425 43.0449 0.000 17 0.0440 -0.0751 43.4190 0.000 18 0.1735 ** 0.1373 * 49.2684 0.000 19 -0.0594 -0.0355 49.9592 0.000 20 0.0723 0.1359 * 50.9878 0.000 21 -0.0440 0.0450 51.3721 0.000 22 -0.0030 0.0062 51.3739 0.000 For SPIndex VAR, the P values of LB tests are pretty much all 0. This indecates that SPIndex VAR is non-stationary. However from the correlogram we know that gretl is being strict for the ACF that are out of the cofidence interval. Therefore we could call SPIndex VAR is weakly stationary. 25
  • 26. 5.3.2 LB test for AtalantaHPIndex LAG ACF PACF Q-STAT. [p-value] 1 -0.0583 -0.0583 0.5949 0.441 2 0.3143 *** 0.3120 *** 17.9880 0.000 3 -0.3621 *** -0.3683 *** 41.2057 0.000 4 0.1474 * 0.0766 4530768 0.000 5 -0.1310 * 0.0974 48.1499 0.000 6 -0.0060 -0.2608 *** 48.1564 0.000 7 -0.1571 ** -0.0548 52.6352 0.000 8 -0.0112 0.0734 52.6583 0.000 9 -0.0758 -0.1561 53.7125 0.000 10 0.0620 0.0395 ** 54.4235 0.000 11 0.1589 ** 0.3290 *** 59.1193 0.000 12 0.2521 *** 0.1488 * 71.0115 0.000 13 0.2439 *** 0.1653 ** 82.2055 0.000 14 0.0763 0.1605 ** 83.3123 0.000 15 -0.0040 -0.0570 83.3123 0.001 16 -0.1467 * -0.1614 ** 87.4399 0.000 17 -0.1007 -0.0479 89.3993 0.000 18 -0.0734 0.0325 90.4468 0.000 19 -0.0033 0.0158 90.4489 0.000 20 -0.1125 -0.1011 92.9404 0.000 21 -0.0708 -0.0365 93.9351 0.000 22 -0.0903 -0.0950 95.5607 0.000 The situation is the same for AtlantaHPIndex VAR. From its LB tests all the P values are near 0, indicates non-stationary. However if we look at the correl- ogram we can see almost all the ACF are within confidence interval. Therefore we could call it weakly stationary as well. 26
  • 27. 6 In-sample VAR forecasts 6.1 In-sample SPIndex VAR forecasts Figure 9: In-sample VAR Forescast for SPIndex Mean Squared Error 0.00015244 Mean Absolute Error 0.0093385 Looking at the above graph we can see that our forecast drastically over- estimate the SP Index. Clearly our model was unable to predict the financial meltdown of 2007-2008. Once the market recovers by 2010 our forecast looks better, but it still under and over predicts the SP Index. Our mean squared error is only 0.00015244 and since the MSE is the average distance between the actual values and forecasted values in square terms so our forecasting method is accurate. 27
  • 28. 6.2 In-sample AtlantaHPIndex VAR forecasts Figure 10: In-sample VAR Forescast for AtlantaHPIndex Mean Squared Error 0.00027322 Mean Absolute Error 0.01179 Looking at the above graph we can see that our forecast is very different from the actual values, however it does seem like our forecast accurately predicts the average trend of the Atlanta index. We can also see some similarities between Atlanta and the composite data. When Atlanta is mostly below zero so is the composite, likewise when Atlanta is mostly above zero so is the composite. The MSE of this forecast 0.00027322 is a little larger than our last MSE, but still relatively small. Therefore Our forecast for Atlanta is not as accurate as our forecast for the composite data. 28
  • 29. 7 AR(1) in-sample forecasts 7.1 AR(1) for SPIndex Figure 11: AR(1) In-sample forescast for SPIndex Mean Squared Error 0.00047428 Mean Absolute Error 0.020036 Looking at our forecast using AR(1) it’s clear that our predictions vastly overestimate the actual values of the composite data. This is confirmed by the fact that the MSE of this forecast is 0.00047428 which is over three times larger than our MSE using the VAR approach. Therefore the VAR approach is more accurate. 29
  • 30. 7.2 AR(1) for AtlantaHPIndex Figure 12: AR(1) In-sample forescast for AtlantaHPIndex Mean Squared Error 0.00028477 Mean Absolute Error 0.012239 Just like with the VAR approach we can see that our forecast regularly under and over predicts the actual values for Atlanta, but does seem to capture the average effectively. The MSE under this method is 0.00028477 which is only slightly larger than 0.00027322 the MSE under the VAR approach. Therefore we find the VAR approach to be more accurate, but only barely. 30
  • 31. 8 Out-of sample VAR forecasting 8.1 Out-of sample forecasting for SPIndex VAR Figure 13: Out-of sample forecasting for SPIndex VAR Our out of sample forecast for the composite data shows a gradual decline in housing prices. Declining housing prices can lead to more consumers defaulting on their morgages so banks will lose money. It will also lead to consumers having less wealth which can lead to lower spending. Lower spending can decrease the economic prosperity of the United States which can lead to a recession. 31
  • 32. 8.2 Out-of sample forecasting for AtlantaHPIndex Figure 14: Out-of sample forecasting for AtlantaHPIndex Our out of sample forecast for Atlanta show a very gradual increase in hous- ing prices. Increasing housing prices increase the wealth of home owners which can lead to higher consumption. This will help to encourage economic growth in the United States. 32
  • 33. 9 Appendix 9.1 Leg Slection OLS regression for unit root test 9.1.1 Gretl code for OLS regression (SPIndex 10 legs) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -2) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -3) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -4) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -5) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -6) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -7) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -8) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -9) ols d_l_SPIndex 0 time l_SPIndex(-1) d_l_SPIndex(-1 to -10) 33
  • 34. 9.1.2 Gretl code for OLS regression (AtlantaHPIndex 10 legs) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -2) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -3) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -4) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -5) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -6) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -7) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -8) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -9) ols d_l_AtlantaHPIndex time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 to -10) 34
  • 35. 9.2 cointegrating regression 9.2.1 Gretl code ols d_CointRe CointRe(-1) d_CointRe(-1) ols d_CointRe CointRe(-1) d_CointRe(-1 to -2) ols d_CointRe CointRe(-1) d_CointRe(-1 to -3) ols d_CointRe CointRe(-1) d_CointRe(-1 to -4) ols d_CointRe CointRe(-1) d_CointRe(-1 to -5) ols d_CointRe CointRe(-1) d_CointRe(-1 to -6) ols d_CointRe CointRe(-1) d_CointRe(-1 to -7) ols d_CointRe CointRe(-1) d_CointRe(-1 to -8) ols d_CointRe CointRe(-1) d_CointRe(-1 to -9) ols d_CointRe CointRe(-1) d_CointRe(-1 to -10) 35
  • 36. 9.3 VAR in sample forecasting 9.3.1 In-sample VAR output VAR system, lag order 1 OLS estimates, observations 1991:03–2005:06 (T = 172) Log-likelihood = 1645.37 Determinant of covariance matrix = 1.68288e–011 AIC = −19.0624 BIC = −18.9526 HQC = −19.0179 Portmanteau test: LB(43) = 290.434, df = 168 [0.0000] Equation 1: d l SPIndex Coefficient Std. Error t-ratio p-value const 0.000362622 0.000200586 1.8078 0.0724 d l SPIndex 1 0.949869 0.0215352 44.1077 0.0000 d l AtlantaHPIndex 1 0.00473526 0.0401591 0.1179 0.9063 Mean dependent var 0.005683 S.D. dependent var 0.005705 Sum squared resid 0.000419 S.E. of regression 0.001574 R2 0.924738 Adjusted R2 0.923847 F(2,169) 1038.238 P-value(F) 1.18e95 ˆp 0.109826 Durbin-Watson 1.770112 F-tests of zero restrictions All lags of dlSPIndex F(1, 169) = 1945.49 [0.0000] All lags of dlAtlantaHPIndex F(1, 169) = 0.0139034 [0.9063] 36
  • 37. Equation 2: d l AtlantaHPIndex Coefficient Std. Error t-ratio p-value const 0.00166369 0.000337961 4.9227 0.000 d l SPIndex 1 0.0589337 0.0362840 1.6242 0.1062 d l AtlantaHPIndex 1 0.459692 0.0676628 6.7939 0.0000 Mean dependent var 0.003602 S.D. dependent var 0.003055 Sum squared resid 0.001189 S.E. of regression 0.002653 R2 0.255047 Adjusted R2 0.246231 F(2,169) 28.92997 P-value(F) 1.57e-11 ˆp -0.059246 Durbin-Watson 2.100654 F-tests of zero restrictions All lags of dlSPIndex F(1, 169) = 2.63813 [0.1062] All lags of dlAtlantaHPIndex F(1, 169) = 46.1565 [0.0000] 37
  • 38. 9.3.2 AR(1) In-sample forescast Model 13: OLS, using observations 1991:03–2005:06 (T = 172) Dependent variable: d l SPIndex Coefficient Std. Error t-ratio p-value const -0.000402302 0.000284916 -1.4120 0.1598 time 1.70494e-005 5.13528e-006 3.3200 0.0011 d l SPIndex 1 0.819612 0.0443024 18.5004 0.0000 Mean dependent var 0.003602 S.D. dependent var 0.003055 Sum squared resid 0.001189 S.E. of regression 0.002653 R2 0.255047 Adjusted R2 0.246231 F(2,169) 28.92997 P-value(F) 1.57e-11 Log-likelihood 777.5473 Akaike criterion -1549.095 Schwarz criterion -1539.652 Hannan-Quinn -1545.263 ˆp 1539.652 Durbin-Watson 2.100654 Model 14: OLS, using observations 1991:03–2005:06 (T = 172) Dependent variable: d l AtlantaHPIndex Coefficient Std. Error t-ratio p-value const 0.00142508 0.000444203 3.2082 0.0016 time 6.10844e-006 1.06303e-006 1.4673 0.1442 d l SPIndex 1 0.467432 0.0669743 6.9793 0.0000 Mean dependent var 0.003602 S.D. dependent var 0.003055 Sum squared resid 0.001193 S.E. of regression 0.002656 R2 0.252935 Adjusted R2 0.244094 F(2,169) 28.60935 P-value(F) 1.99e{11 Log-likelihood 777.5473 Akaike criterion -1549.095 Schwarz criterion -1539.652 Hannan-Quinn -1545.263 ˆp -0.064760 Durbin-Watson -1.776816 38
  • 39. 9.4 Out-of sample VAR forecasting 9.4.1 Out put of Out-of sample VAR forecasting VAR system, lag order 1 OLS estimates, observations 1991:03–2015:12 (T = 298) Log-likelihood = 2482.07 Determinant of covariance matrix = 1.99754e–010 AIC = −16.6179 BIC = −16.5435 HQC = −16.5881 Portmanteau test: LB(48) = 899.196, df = 188 [0.0000] Equation 1: d l SPIndex Coefficient Std. Error t-ratio p-value const 0.000178243 0.000139241 1.2801 0.2015 d l SPIndex 1 0.957289 0.0181784 52.6607 0.0000 d l AtlantaHPIndex 1 -0.000291567 0.0132617 -0.0220 0.9825 Mean dependent var 0.003125 S.D. dependent var 0.007896 Sum squared resid 0.001479 S.E. of regression 0.002239 R2 0.920109 Adjusted R2 0.919568 F(2,169) 1698.775 P-value(F) 1.3e162 ˆp 0.116119 Durbin-Watson 1.763733 F-tests of zero restrictions All lags of dlSPIndex F(1, 295) = 2773.15 [0.0000] All lags of dlAtlantaHPIndex F(1, 295) = 0.000483369 [0.9825] 39
  • 40. Equation 2: d l AtlantaHPIndex Coefficient Std. Error t-ratio p-value const 8.88034e-005 0.000399593 0.2222 0.8243 d l SPIndex 1 0.133320 0.0521682 2.5556 0.0111 d l AtlantaHPIndex 1 0.759362 0.0380583 19.9526 0.0000 Mean dependent var 0.002005 S.D. dependent var 0.010837 Sum squared resid 0.012183 S.E. of regression 0.006426 R2 0.650701 Adjusted R2 0.648333 F(2,169) 274.7739 P-value(F) 4.18e-68 ˆp 0.327013 Durbin-Watson 1.344706 F-tests of zero restrictions All lags of dlSPIndex F(1, 295) = 6.53095 [0.0111] All lags of dlAtlantaHPIndex F(1, 295) = 398.107 [0.0000] 40
  • 41. 9.5 Gretl: command log Question 1 rename 1 SPIndex logs SPIndex logs AtlantaHPIndex diff AtlantaHPIndex diff SPIndex genr time smpl 1991:01 2005:06 gnuplot SPIndex AtlantaHPIndex --time-series --with-lines Question 2 corrgm l_SPIndex 22 corrgm l_AtlantaHPIndex 22 # model 1 ols d_SPIndex 0 time l_SPIndex(-1) d_SPIndex(-1) delete d_AtlantaHPIndex d_SPIndex diff l_SPIndex diff l_AtlantaHPIndex delete d_SPIndex_1 # model 2 ols d_l_SPIndex 0 l_SPIndex(-1) time d_l_SPIndex(-1) # model 3 ols d_l_AtlantaHPIndex 0 time l_AtlantaHPIndex(-1) d_l_AtlantaHPIndex(-1 _to -3) Question 3 gnuplot l_AtlantaHPIndexx l_SPIndex Question 4 ols l_SPIndex 0 l_AtlantaHPIndex(-1) series CointRe = $CointRe$ gnuplot CointRe --time-series --with-lines corrgm CointRe 22 Question 5 ols d_CointRe CointRe(-1) d_CointRe(-1) ols d_CointRe CointRe(-1) d_CointRe(-1 to -2) ols d_CointRe CointRe(-1) d_CointRe(-1 to -3) ols d_CointRe CointRe(-1) d_CointRe(-1 to -4) ols d_CointRe CointRe(-1) d_CointRe(-1 to -5) ols d_CointRe CointRe(-1) d_CointRe(-1 to -6) 41
  • 42. ols d_CointRe CointRe(-1) d_CointRe(-1 to -7) ols d_CointRe CointRe(-1) d_CointRe(-1 to -8) ols d_CointRe CointRe(-1) d_CointRe(-1 to -9) ols d_CointRe CointRe(-1) d_CointRe(-1 to -10) Question 6 freq uhat11 --normal corrgm uhat12 22 freq uhat12 --normal var 3 d_l_SPIndex d_l_HomePriceIndex smpl 1991:01 2015:12 var 3 d_l_SPIndex d_l_HomePriceIndex var 3 d_l_SPIndex d_l_HomePriceIndex var 3 d_l_SPIndex d_l_HomePriceIndex var 3 d_l_SPIndex d_l_HomePriceIndex --lagselect var 3 d_l_SPIndex d_l_HomePriceIndex Question 7 smpl 1991:01 2015:12 diff l_SPIndex diff l_HomePriceIndex var 3 d_l_SPIndex d_l_HomePriceIndex smpl 1991:01 2005:06 var 3 d_l_SPIndex d_l_HomePriceIndex Question 9 smpl 1991:01 2015:12 var 1 d_l_SPIndex d_l_HomePriceIndex smpl --full diff l_HomePriceIndex smpl 1991:01 2015:12 smpl 1991:01 2005:06 var 1 d_l_SPIndex d_l_HomePriceIndex smpl --full var 1 d_l_SPIndex d_l_HomePriceIndex var 1 d_l_SPIndex d_l_HomePriceIndex var 1 d_l_SPIndex d_l_HomePriceIndex 42
  • 43. References [1] The History of Recessions in the United States http://useconomy.about.com/od/grossdomesticproduct/a/recession histo.htm [2] A publication of the Board of Governors of the Federal Reserve System http://www.federalreserve.gov/pf/pf.htm 43