+ All Categories
Home > Documents > Applied Econometrics assignment3

Applied Econometrics assignment3

Date post: 11-Apr-2017
Category:
Upload: chenguang-li
View: 108 times
Download: 0 times
Share this document with a friend
43
ECON 3P95 Assignment 3 Milan Doczy , Chenguang Li , Jordan Templeton June 26, 2016 1
Transcript
Page 1: Applied Econometrics assignment3

ECON 3P95

Assignment 3

Milan Doczy , Chenguang Li , Jordan Templeton

June 26, 2016

1

Page 2: Applied Econometrics assignment3

Contents

1 Stationarity and Unit Root Test 41.1 Correlogram of SPIndex . . . . . . . . . . . . . . . . . . . . . . . 41.2 LB test for SPIndex . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Correlogram for AtlantaHPIndex . . . . . . . . . . . . . . . . . . 61.4 Autocorrelation function for AtlantaHPIndex . . . . . . . . . . . 71.5 Lag selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.6 Unit Root Test for SPIndex . . . . . . . . . . . . . . . . . . . . . 91.7 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.8 Unit Root Test for AtlantaHPIndex . . . . . . . . . . . . . . . . 111.9 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.10 Time Series Plot AtlantaHPIndex & SPIndex . . . . . . . . . . . 13

2 Cointegrating Regression 142.1 Scatterplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2 Estimations of the Cointegration Residual . . . . . . . . . . . . . 152.3 Correlogram of the Cointegration Residual . . . . . . . . . . . . . 162.4 Autocorrelation function of cointegraion Residuals . . . . . . . . 17

3 Engle-Granger Test of Cointegration 183.1 Hypothesis test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4 Estimation of the VAR Model with the Optimal Lag Choice 204.1 Output for Optimal Lag Choice for VAR . . . . . . . . . . . . . . 20

5 VAR Estimation continue 215.1 The Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.2 Visual Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.2.1 Combined time series SPIndex VAR Atalanta VAR . . . 225.2.2 Correlogram . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.3 White Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.3.1 LB test for SPIndex . . . . . . . . . . . . . . . . . . . . . 255.3.2 LB test for AtalantaHPIndex . . . . . . . . . . . . . . . . 26

6 In-sample VAR forecasts 276.1 In-sample SPIndex VAR forecasts . . . . . . . . . . . . . . . . . . 276.2 In-sample AtlantaHPIndex VAR forecasts . . . . . . . . . . . . . 28

7 AR(1) in-sample forecasts 297.1 AR(1) for SPIndex . . . . . . . . . . . . . . . . . . . . . . . . . . 297.2 AR(1) for AtlantaHPIndex . . . . . . . . . . . . . . . . . . . . . 30

8 Out-of sample VAR forecasting 318.1 Out-of sample forecasting for SPIndex VAR . . . . . . . . . . . . 318.2 Out-of sample forecasting for AtlantaHPIndex . . . . . . . . . . . 32

2

Page 3: Applied Econometrics assignment3

9 Appendix 339.1 Leg Slection OLS regression for unit root test . . . . . . . . . . . 33

9.1.1 Gretl code for OLS regression (SPIndex 10 legs) . . . . . 339.1.2 Gretl code for OLS regression (AtlantaHPIndex 10 legs) . 34

9.2 cointegrating regression . . . . . . . . . . . . . . . . . . . . . . . 359.2.1 Gretl code . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

9.3 VAR in sample forecasting . . . . . . . . . . . . . . . . . . . . . . 369.3.1 In-sample VAR output . . . . . . . . . . . . . . . . . . . . 369.3.2 AR(1) In-sample forescast . . . . . . . . . . . . . . . . . . 38

9.4 Out-of sample VAR forecasting . . . . . . . . . . . . . . . . . . . 399.4.1 Out put of Out-of sample VAR forecasting . . . . . . . . 39

9.5 Gretl: command log . . . . . . . . . . . . . . . . . . . . . . . . . 41

3

Page 4: Applied Econometrics assignment3

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 fallingthrough time but is still pretty high after 20 lags, which indicates a nonstation-ary data set.

4

Page 5: Applied Econometrics assignment3

1.2 LB test for SPIndex

LAG ACF PACF Q-STAT. [p-value]1 0.9748 *** 0.0101629 *** -1.8636 0.06412 0.452030 *** 0.0702484 6.4347 0.00003 0.9241 *** -0.0130 481.6398 0.00004 0.8990 *** -0.0095 627.2279 0.00005 0.8746 *** 0.0014 465.8330 0.00006 0.8508 *** -0.0010 897.7754 0.00007 0.8275 *** -0.0030 1023.3324 0.00008 0.8044 *** -0.0082 1142.6946 0.00009 0.7814 *** -0.0101 1256.0196 0.000010 0.4585 *** -0.0112 1363.4503 0.000011 0.7357 *** -0.0103 1465.1438 0.000012 0.7131 *** -0.0035 1652.0594 0.000013 0.6909 *** -0.0035 1737.8513 0.000014 0.6695 *** 0.0026 1737.8513 0.000015 0.6488 *** 0.0009 1818.9225 0.000016 0.6287 *** 0.0006 1895.5384 0.000017 0.6094 *** 0.0022 1967.9673 0.000018 0.5904 *** -0.0033 2036.3975 0.000019 0.5904 *** -0.0033 2101.0093 0.000020 0.5538 *** -0.0013 2261.9961 0.000021 0.5362 *** -0.0018 2219.5375 0.000022 0.5189 *** -0.0032 2273.7922 0.0000

Furthermore, non-stationarity is proven by the LB test that all the P valuesare near 0. Indecates there is no white noise and still some dynamics for us tocapture. Therefore we need to use proper unit root test to determine whetherour data is stationary.

5

Page 6: Applied Econometrics assignment3

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

Page 7: Applied Econometrics assignment3

1.4 Autocorrelation function for AtlantaHPIndex

LAG ACF PACF Q-STAT. [p-value]1 0.9842 *** 0.9842 *** 171.4817 0.00002 0.9687 *** -0.0022 338.5430 0.00003 0.9553 *** -0.0005 501.2976 0.00004 0.9385 *** 0.0096 659.9632 0.00005 0.9238 *** -0.0052 814.5936 0.00006 0.9091 *** -0.0044 965.2503 0.00007 0.8943 *** -0.0115 111.9217 0.00008 0.8795 *** -0.0079 1254.6383 0.00009 0.8644 *** -0.0204 1393.3069 0.000010 0.8487 *** -0.0229 1527.8208 0.000011 0.8329 *** -0.0147 1658.1635 0.000012 0.8170 *** -0.0140 1784.3336 0.000013 0.8010 *** -0.0083 1906.3875 0.000014 0.7850 *** -0.0141 2024.3255 0.000015 0.7690 *** -0.0058 2138.2272 0.000016 0.7533 *** -0.0001 2248.2213 0.000017 0.7377 *** -0.0053 2354.3853 0.000018 0.7220 *** -0.0135 2456.7193 0.000019 0.7065 *** -0.0015 2555.3333 0.000020 0.6907 *** -0.0179 2650.1943 0.000021 0.6746 *** -0.0170 2741.2887 0.000022 0.6580 *** -0.0278 2828.5197 0.0000

Furthermore, non-stationarity is proven by the LB test that all the P valuesare near 0. Indecates there is no white noise and still some dynamics for us tocapture. Therefore we need to use proper unit root test to determine whetherour data is stationary.

7

Page 8: Applied Econometrics assignment3

1.5 Lag selections

Table 1: BIC results for different lag of SPIndex & AtlantaHPIndexLag S&P Atlanta1 -1725.376* -1539.4902 -1718.734 -1527.3823 -1719.351 -1547.213*4 -1714.473 -1540.9065 -1700.517 -1526.6336 -1685.497 -1524.2547 -1669.186 -1512.9898 -1656.754 -1502.4989 -1644.221 -1489.38310 -1631.732 -1490.806

From the unit root lag selections we choose the lowest BIC. Therefore it isfirst lag for S&PIndex and third lag for AtlantaHPIndex

8

Page 9: Applied Econometrics assignment3

.

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-valueconst 0.000626609 0.00392999 0.1594 0.8735time 1.53504e-005 7.1412e-006 2.5675 0.0111l SPIndex 1 -0.000249928 0.000952091 -0.2625 0.7933d l SPIndex 1 0.820463 0.044563 18.4195 0.0000

Mean dependent var 0.005683 S.D. dependent var 0.005705Sum squared resid 0.000393 S.E. of regression 0.001530R2 0.929369 Adjusted R2 0.928108F(3,168) 736.8531 P-value(F) 2.07e-96Log-likelihood 872.9830 Akaike criterion -1737.966Schwarz criterion -1725.376 H-Q -1732.858p̂ 0.162052 Durbin’s h 2.618554

In order to preform a proper unit root test we have to select the lag that hasthe lowest SIC value as our optimal lag to model. After generating the modelin gretl (Appendix 9.3). From the output (Appendix 9.3.2) of our model wechoose lag one as our unit root test optimal lag. The results of the unit roottest are shown above. We can see the t-ratio of the log of the SPIndex value isless than the absolute value of 3.9, this indicates non-stationarity for SPIndex.

9

Page 10: Applied Econometrics assignment3

1.7 Hypothesis test

H0: dlSPIndex = 1→ UnitRoot;non− stationaryH1: dlSPIndex < 1→ NoUnitRoot; stationary∆SPIndex = β ∗ 0 + β1 ∗ (SPIndex)t−1 + ∆SPIndext−1 + +ut

10

Page 11: Applied Econometrics assignment3

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-valueconst 0.102789 0.0356068 2.8868 0.0044l AtlantaHPIndex 1 -0.0242917 0.00853775 -2.8452 0.0050time 0.000102817 3.35030e-005 3.0689 0.0025d l AtlantaHPIndex 1 0.446385 0.0692713 6.4440 0.0000d l AtlantaHPIndex 2 0.327009 0.0741171 4.4121 0.0000d l AtlantaHPIndex 3 -0.395986 0.0682175 -5.8048 0.0000

Mean dependent var 0.003625 S.D. dependent var 0.003044Sum squared resid 0.000908 S.E. of regression 0.002353R2 0.419870 Adjusted R2 0.102183F(5,164) 23.73902 P-value(F) 6.48e-18Log-likelihood 790.6590 Akaike criterion -1569.318Schwarz criterion -1550.503 H-Q -1561.683p̂ 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 threeas our unit root test optimal lag. The results of the unit root test are shownabove. We can see the t-ratio of the log of the AtlantaHPIndex value is less thanthe absolute value of 3.9, this indicates non-stationary for AtlantaHPIndex.

11

Page 12: Applied Econometrics assignment3

1.9 Hypothesis test

H0: dlAtlantaHPIndex = 1→ UnitRoot;non− stationaryH1: dlAtlantaHPIndex < 1→ NoUnitRoot; stationary∆AtlantaHPIndex = β∗0+β1∗(AtlantaHPIndex)t−1+∆AtlantaHPIndext−1+∆AtlantaHPIndext−2 + ∆AtlantaHPIndext−3 + ut

12

Page 13: Applied Econometrics assignment3

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 wecan see some correlations between the two. It seems both index are movingtowards a increasing trend. However For SPIndex appears a more qudratictrend and Atlanta Index is more linear compare to SPIndex.

13

Page 14: Applied Econometrics assignment3

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

Page 15: Applied Econometrics assignment3

2.2 Estimations of the Cointegration Residual

Lag BIC1 -1548.3492 -1537.3303 -1553.980*4 -1548.9945 -1534.9466 -1531.4067 -1520.6628 -1509.7299 -1496.27410 -1498.845

In order to preform a proper cointegration regression we have to select thelag that has the lowest SIC value as our optimal lag to model. After generatingthe model in gretl . From the output of our model we choose lag three as ourengle-granger test optimal lag.

15

Page 16: Applied Econometrics assignment3

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 PACFjumped to 0 after lag 1, which indicates stationary data.

16

Page 17: Applied Econometrics assignment3

2.4 Autocorrelation function of cointegraion Residuals

LAG ACF PACF Q-STAT. [p-value]1 0.9721 *** 0.9721 *** 167.2790 0.06412 0.9358 *** -0.1664 ** 323.2093 0.00003 0.8927 *** -0.1243 465.9264 0.00004 0.8495 *** 0.0078 595.9203 0.00005 0.8059 *** -0.0220 713.6020 0.00006 0.7632 *** -0.0101 819.7695 0.00007 0.7259 *** 0.0765 916.4095 0.00008 0.6912 *** -0.0050 1004.5484 0.00009 0.6614 *** 0.0428 1085.7421 0.000010 0.6343 *** 0.0078 1160.8656 0.000011 0.6055 *** -0.0776 1229.7398 0.000012 0.5709 *** -0.1218 1291.3620 0.000013 0.5245 *** -0.2084 1343.6957 0.000014 0.4711 *** -0.0994 1386.1673 0.000015 0.4130 *** -0.0528 1419.0153 0.000016 0.3565 *** 0.0305 1443.6479 0.000017 0.3038 *** 0.0448 1461.6534 0.000018 0.2570 *** 0.0492 1474.6184 0.000019 0.2098 *** -0.1170 1483.3126 0.000020 0.1661 ** -0.0256 1488.8020 0.000021 0.1272 * -0.0036 1492.0410 0.000022 0.0978 0.1064 1493.9692 0.0000

However according to the LB test all the P values are near 0 which indicatesnon-stationary data. This is beaucase gretl is interpreting the LB test resultsstrictly. Therefore we can say that the cointegration residuals are weakly sta-tionary.

17

Page 18: Applied Econometrics assignment3

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-valueconst -0.00019022 0.0001854 -1.026 0.3065Coint 1 -0.0189401 0.0101629 -1.855 0.0641d CointRe 1 0.452030 0.0702484 6.4347 0.0000d CointRe 2 0.331079 0.0753387 4.3945 0.0000d CointRe 3 -0.369857 0.0698553 -5.2946 0.0000

Mean dependent var -0.000265 S.D. dependent var 0.002976Sum squared resid 0.000945 S.E. of regression 0.002386R2 0.373609 Adjusted R2 0.362288F(4,166) 24.75252 P-value(F) 4.40e-16Log-likelihood 787.2614 Akaike criterion -1566.523Schwarz criterion -1553.980 H-Q -1561.433p̂ 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 valueof 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 aVECM and lag selection.

18

Page 19: Applied Econometrics assignment3

3.1 Hypothesis test

H0: CointRe1 = 1→ UnitRoot;non− stationaryH1: CointRe1 < 1→ NoUnitRoot; stationary∆CointRe1 = CointRe1 + CointRe1t + CointRe1t−1 + ut

19

Page 20: Applied Econometrics assignment3

4 Estimation of the VAR Model with the Opti-mal Lag Choice

4.1 Output for Optimal Lag Choice for VAR

Lag BIC1 -19.144385*2 -19.0233423 -19.1061304 -19.063737

Useing gretl VAR lag slection to choose optimal lag choices for VAR. The lowestBIC is lag 1 so that will be our optimal lag choice for VAR and the results areshown below.

20

Page 21: Applied Econometrics assignment3

5 VAR Estimation continue

5.1 The Fit

In equation 1, the adjusted R2 is 0.923847 so 92.3847% of the variation in themodel 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 ourfitted values is 0.1574% which is relatively small. Looking at the p-values wecan see that the lag of the composite index is significant, but the lag of theAtlanta 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 variationin the model is explained. The SER is 0.002653 so the average distance betweenactual data and our fitted value is 0.2653% much larger than equation 1. Finallylooking at the p-values we can see that the lag of the Atlanta index is significantwhile the lag of the composite index is not at the 90% confidence level. Overallthe fit of equation 2 is not very strong.

21

Page 22: Applied Econometrics assignment3

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

Page 23: Applied Econometrics assignment3

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 ofit. Therefore we would say SPIndex are stationary.

23

Page 24: Applied Econometrics assignment3

Figure 8: Correlogram of AtlantaHPIndex VAR Residual

There are some ACF values are out of the confidence interval but it is nottoo much to say it is non-stationary. Therefore we would say AtlantaHPIndexare weakly stationary.

24

Page 25: Applied Econometrics assignment3

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.1472 0.1275 0.1142 4.8502 0.0883 -0.1195 -0.1478 * 7.3770 0.0614 -0.1824 ** -0.1768 ** 13.3037 0.0105 -0.1675 ** -0.1061 18.3308 0.0036 -0.0913 -0.0387 19.8324 0.0037 0.0880 0.1015 21.2367 0.0038 0.0956 0.0431 22.9043 0.0039 0.1542 ** 0.0654 27.2687 0.00110 0.0189 *** -0.0394 27.3350 0.00211 -0.1113 *** -0.1283 * 29.6391 0.00212 -0.1640 ** -0.0973 34.6680 0.00113 -0.1385 * -0.0354 38.2770 0.00014 -0.0434 0.0114 38.6340 0.00015 0.0650 0.0472 39.4390 0.00116 0.1371 * 0.0425 43.0449 0.00017 0.0440 -0.0751 43.4190 0.00018 0.1735 ** 0.1373 * 49.2684 0.00019 -0.0594 -0.0355 49.9592 0.00020 0.0723 0.1359 * 50.9878 0.00021 -0.0440 0.0450 51.3721 0.00022 -0.0030 0.0062 51.3739 0.000

For SPIndex VAR, the P values of LB tests are pretty much all 0. Thisindecates that SPIndex VAR is non-stationary. However from the correlogramwe know that gretl is being strict for the ACF that are out of the cofidenceinterval. Therefore we could call SPIndex VAR is weakly stationary.

25

Page 26: Applied Econometrics assignment3

5.3.2 LB test for AtalantaHPIndex

LAG ACF PACF Q-STAT. [p-value]1 -0.0583 -0.0583 0.5949 0.4412 0.3143 *** 0.3120 *** 17.9880 0.0003 -0.3621 *** -0.3683 *** 41.2057 0.0004 0.1474 * 0.0766 4530768 0.0005 -0.1310 * 0.0974 48.1499 0.0006 -0.0060 -0.2608 *** 48.1564 0.0007 -0.1571 ** -0.0548 52.6352 0.0008 -0.0112 0.0734 52.6583 0.0009 -0.0758 -0.1561 53.7125 0.00010 0.0620 0.0395 ** 54.4235 0.00011 0.1589 ** 0.3290 *** 59.1193 0.00012 0.2521 *** 0.1488 * 71.0115 0.00013 0.2439 *** 0.1653 ** 82.2055 0.00014 0.0763 0.1605 ** 83.3123 0.00015 -0.0040 -0.0570 83.3123 0.00116 -0.1467 * -0.1614 ** 87.4399 0.00017 -0.1007 -0.0479 89.3993 0.00018 -0.0734 0.0325 90.4468 0.00019 -0.0033 0.0158 90.4489 0.00020 -0.1125 -0.1011 92.9404 0.00021 -0.0708 -0.0365 93.9351 0.00022 -0.0903 -0.0950 95.5607 0.000

The situation is the same for AtlantaHPIndex VAR. From its LB tests all theP 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. Thereforewe could call it weakly stationary as well.

26

Page 27: Applied Econometrics assignment3

6 In-sample VAR forecasts

6.1 In-sample SPIndex VAR forecasts

Figure 9: In-sample VAR Forescast for SPIndex

Mean Squared Error 0.00015244Mean 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 financialmeltdown of 2007-2008. Once the market recovers by 2010 our forecast looksbetter, but it still under and over predicts the SP Index. Our mean squarederror is only 0.00015244 and since the MSE is the average distance between theactual values and forecasted values in square terms so our forecasting methodis accurate.

27

Page 28: Applied Econometrics assignment3

6.2 In-sample AtlantaHPIndex VAR forecasts

Figure 10: In-sample VAR Forescast for AtlantaHPIndex

Mean Squared Error 0.00027322Mean Absolute Error 0.01179

Looking at the above graph we can see that our forecast is very different fromthe actual values, however it does seem like our forecast accurately predicts theaverage trend of the Atlanta index. We can also see some similarities betweenAtlanta and the composite data. When Atlanta is mostly below zero so is thecomposite, likewise when Atlanta is mostly above zero so is the composite. TheMSE of this forecast 0.00027322 is a little larger than our last MSE, but stillrelatively small. Therefore Our forecast for Atlanta is not as accurate as ourforecast for the composite data.

28

Page 29: Applied Econometrics assignment3

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.00047428Mean Absolute Error 0.020036

Looking at our forecast using AR(1) it’s clear that our predictions vastlyoverestimate the actual values of the composite data. This is confirmed by thefact that the MSE of this forecast is 0.00047428 which is over three times largerthan our MSE using the VAR approach. Therefore the VAR approach is moreaccurate.

29

Page 30: Applied Econometrics assignment3

7.2 AR(1) for AtlantaHPIndex

Figure 12: AR(1) In-sample forescast for AtlantaHPIndex

Mean Squared Error 0.00028477Mean Absolute Error 0.012239

Just like with the VAR approach we can see that our forecast regularly underand over predicts the actual values for Atlanta, but does seem to capture theaverage effectively. The MSE under this method is 0.00028477 which is onlyslightly larger than 0.00027322 the MSE under the VAR approach. Thereforewe find the VAR approach to be more accurate, but only barely.

30

Page 31: Applied Econometrics assignment3

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 inhousing prices. Declining housing prices can lead to more consumers defaultingon their morgages so banks will lose money. It will also lead to consumers havingless wealth which can lead to lower spending. Lower spending can decrease theeconomic prosperity of the United States which can lead to a recession.

31

Page 32: Applied Econometrics assignment3

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 whichcan lead to higher consumption. This will help to encourage economic growthin the United States.

32

Page 33: Applied Econometrics assignment3

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

Page 34: Applied Econometrics assignment3

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

Page 35: Applied Econometrics assignment3

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

Page 36: Applied Econometrics assignment3

9.3 VAR in sample forecasting

9.3.1 In-sample VAR output

VAR system, lag order 1OLS estimates, observations 1991:03–2005:06 (T = 172)

Log-likelihood = 1645.37Determinant of covariance matrix = 1.68288e–011

AIC = −19.0624BIC = −18.9526HQC = −19.0179

Portmanteau test: LB(43) = 290.434, df = 168 [0.0000]

Equation 1: d l SPIndex

Coefficient Std. Error t-ratio p-valueconst 0.000362622 0.000200586 1.8078 0.0724d l SPIndex 1 0.949869 0.0215352 44.1077 0.0000d l AtlantaHPIndex 1 0.00473526 0.0401591 0.1179 0.9063

Mean dependent var 0.005683 S.D. dependent var 0.005705Sum squared resid 0.000419 S.E. of regression 0.001574R2 0.924738 Adjusted R2 0.923847F(2,169) 1038.238 P-value(F) 1.18e95p̂ 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

Page 37: Applied Econometrics assignment3

Equation 2: d l AtlantaHPIndex

Coefficient Std. Error t-ratio p-valueconst 0.00166369 0.000337961 4.9227 0.000d l SPIndex 1 0.0589337 0.0362840 1.6242 0.1062d l AtlantaHPIndex 1 0.459692 0.0676628 6.7939 0.0000

Mean dependent var 0.003602 S.D. dependent var 0.003055Sum squared resid 0.001189 S.E. of regression 0.002653R2 0.255047 Adjusted R2 0.246231F(2,169) 28.92997 P-value(F) 1.57e-11p̂ -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

Page 38: Applied Econometrics assignment3

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-valueconst -0.000402302 0.000284916 -1.4120 0.1598time 1.70494e-005 5.13528e-006 3.3200 0.0011d l SPIndex 1 0.819612 0.0443024 18.5004 0.0000

Mean dependent var 0.003602 S.D. dependent var 0.003055Sum squared resid 0.001189 S.E. of regression 0.002653R2 0.255047 Adjusted R2 0.246231F(2,169) 28.92997 P-value(F) 1.57e-11Log-likelihood 777.5473 Akaike criterion -1549.095Schwarz criterion -1539.652 Hannan-Quinn -1545.263p̂ 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-valueconst 0.00142508 0.000444203 3.2082 0.0016time 6.10844e-006 1.06303e-006 1.4673 0.1442d l SPIndex 1 0.467432 0.0669743 6.9793 0.0000

Mean dependent var 0.003602 S.D. dependent var 0.003055Sum squared resid 0.001193 S.E. of regression 0.002656R2 0.252935 Adjusted R2 0.244094F(2,169) 28.60935 P-value(F) 1.99e{11Log-likelihood 777.5473 Akaike criterion -1549.095Schwarz criterion -1539.652 Hannan-Quinn -1545.263p̂ -0.064760 Durbin-Watson -1.776816

38

Page 39: Applied Econometrics assignment3

9.4 Out-of sample VAR forecasting

9.4.1 Out put of Out-of sample VAR forecasting

VAR system, lag order 1OLS estimates, observations 1991:03–2015:12 (T = 298)

Log-likelihood = 2482.07Determinant of covariance matrix = 1.99754e–010

AIC = −16.6179BIC = −16.5435HQC = −16.5881

Portmanteau test: LB(48) = 899.196, df = 188 [0.0000]

Equation 1: d l SPIndex

Coefficient Std. Error t-ratio p-valueconst 0.000178243 0.000139241 1.2801 0.2015d l SPIndex 1 0.957289 0.0181784 52.6607 0.0000d l AtlantaHPIndex 1 -0.000291567 0.0132617 -0.0220 0.9825

Mean dependent var 0.003125 S.D. dependent var 0.007896Sum squared resid 0.001479 S.E. of regression 0.002239R2 0.920109 Adjusted R2 0.919568F(2,169) 1698.775 P-value(F) 1.3e162p̂ 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

Page 40: Applied Econometrics assignment3

Equation 2: d l AtlantaHPIndex

Coefficient Std. Error t-ratio p-valueconst 8.88034e-005 0.000399593 0.2222 0.8243d l SPIndex 1 0.133320 0.0521682 2.5556 0.0111d l AtlantaHPIndex 1 0.759362 0.0380583 19.9526 0.0000

Mean dependent var 0.002005 S.D. dependent var 0.010837Sum squared resid 0.012183 S.E. of regression 0.006426R2 0.650701 Adjusted R2 0.648333F(2,169) 274.7739 P-value(F) 4.18e-68p̂ 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

Page 41: Applied Econometrics assignment3

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

Page 42: Applied Econometrics assignment3

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

Page 43: Applied Econometrics assignment3

References

[1] The History of Recessions in the United Stateshttp://useconomy.about.com/od/grossdomesticproduct/a/recession histo.htm

[2] A publication of the Board of Governors of the Federal Reserve Systemhttp://www.federalreserve.gov/pf/pf.htm

43


Recommended