Problem 1

Obtain quarterly time series for real GDP FRED/GDPC1, GDP deflator FRED/GDPDEF and quarterly closing value of S&P 500 Index YAHOO/INDEX_GSPC. Use them to construct two time series: the log change in GDP y1,t = ∆ log GDPt (which approximates the growth rate of the GDP) and the real log return for S&P500 y = ∆ log SP 500 − ∆ log pGDP (which approximates the inflation adjusted return of S&P 500).

(a) Estimate a bivariate reduced form VAR for yt = (y1,t,y2,t)′ for the period 1951Q1-2014Q4, use information criteria to select number of lags. How large is the correlation of residuals in the model, and what are the implications?

## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      2      2      1      2 
## 
## $criteria
##                    1             2             3             4
## AIC(n) -1.463910e+01 -1.469547e+01 -1.468374e+01 -1.465705e+01
## HQ(n)  -1.460467e+01 -1.463809e+01 -1.460341e+01 -1.455377e+01
## SC(n)  -1.455360e+01 -1.455297e+01 -1.448424e+01 -1.440056e+01
## FPE(n)  4.388554e-07  4.148054e-07  4.197090e-07  4.310758e-07
##                    5             6             7             8
## AIC(n) -1.463954e+01 -1.461809e+01 -1.460876e+01 -1.458019e+01
## HQ(n)  -1.451332e+01 -1.446891e+01 -1.443664e+01 -1.438511e+01
## SC(n)  -1.432606e+01 -1.424761e+01 -1.418128e+01 -1.409571e+01
## FPE(n)  4.387108e-07  4.482597e-07  4.525082e-07  4.656889e-07
##                    9            10
## AIC(n) -1.456053e+01 -1.454311e+01
## HQ(n)  -1.434250e+01 -1.430214e+01
## SC(n)  -1.401905e+01 -1.394464e+01
## FPE(n)  4.750198e-07  4.834683e-07
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: dl.GDP, dl.SP500 
## Deterministic variables: const 
## Sample size: 254 
## Log Likelihood: 1154.493 
## Roots of the characteristic polynomial:
## 0.4454 0.4454 0.304 0.304
## Call:
## VAR(y = y, type = "const", lag.max = 2)
## 
## 
## Estimation results for equation dl.GDP: 
## ======================================= 
## dl.GDP = dl.GDP.l1 + dl.SP500.l1 + dl.GDP.l2 + dl.SP500.l2 + const 
## 
##              Estimate Std. Error t value Pr(>|t|)    
## dl.GDP.l1   0.2450402  0.0614771   3.986 8.84e-05 ***
## dl.SP500.l1 0.0230968  0.0064046   3.606 0.000375 ***
## dl.GDP.l2   0.0793493  0.0595434   1.333 0.183872    
## dl.SP500.l2 0.0263004  0.0065720   4.002 8.29e-05 ***
## const       0.0046278  0.0007233   6.398 7.75e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.008038 on 249 degrees of freedom
## Multiple R-Squared: 0.2309,  Adjusted R-squared: 0.2185 
## F-statistic: 18.68 on 4 and 249 DF,  p-value: 1.91e-13 
## 
## 
## Estimation results for equation dl.SP500: 
## ========================================= 
## dl.SP500 = dl.GDP.l1 + dl.SP500.l1 + dl.GDP.l2 + dl.SP500.l2 + const 
## 
##              Estimate Std. Error t value Pr(>|t|)  
## dl.GDP.l1    0.256054   0.609111   0.420   0.6746  
## dl.SP500.l1  0.106501   0.063457   1.678   0.0945 .
## dl.GDP.l2   -0.819353   0.589953  -1.389   0.1661  
## dl.SP500.l2 -0.040573   0.065115  -0.623   0.5338  
## const        0.013836   0.007167   1.931   0.0547 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.07964 on 249 degrees of freedom
## Multiple R-Squared: 0.02087, Adjusted R-squared: 0.00514 
## F-statistic: 1.327 on 4 and 249 DF,  p-value: 0.2605 
## 
## 
## 
## Covariance matrix of residuals:
##            dl.GDP dl.SP500
## dl.GDP   6.46e-05 0.000087
## dl.SP500 8.70e-05 0.006342
## 
## Correlation matrix of residuals:
##          dl.GDP dl.SP500
## dl.GDP   1.0000   0.1359
## dl.SP500 0.1359   1.0000

As can be seen above, the AIC is suggesting a lag length of 2. The correlation of the residuals is small suggesting some contemporaneous effects; small but still present. The implications of these contemporaneous effects is that the shocks between the two equations will be correlated.

(b) Run the Granger causality tests for both variables What do the results suggest about the predictive power of the two variables?

## $Granger
## 
##  Granger causality H0: dl.GDP do not Granger-cause dl.SP500
## 
## data:  VAR object var1
## F-Test = 0.96654, df1 = 2, df2 = 498, p-value = 0.3811
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: dl.GDP and dl.SP500
## 
## data:  VAR object var1
## Chi-squared = 4.6072, df = 1, p-value = 0.03184
## $Granger
## 
##  Granger causality H0: dl.SP500 do not Granger-cause dl.GDP
## 
## data:  VAR object var1
## F-Test = 15.762, df1 = 2, df2 = 498, p-value = 2.305e-07
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: dl.SP500 and dl.GDP
## 
## data:  VAR object var1
## Chi-squared = 4.6072, df = 1, p-value = 0.03184

In the above Granger Causality Test for growth rate of GDP (y1) granger causing inflation adjusted SP500 returns (y2) we see that we Fail to Reject the null that y1 does not Granger-cause y2. So the interpretation I make is that y1 may not granger cause y2. This is confirmed when we reverse the test and we reject the null. This result can give clues about the predictive power of y2 on y1 meaning that y2 may contain useful information that helps to predict future values of y1.

**(c) Estimate two restricted VAR models - in first remove lags based on the Granger causality test from “b”“, in the second one remove all variables which have t-statistics lower than 2.**

##      [,1] [,2] [,3] [,4] [,5]
## [1,]    0    1    0    1    1
## [2,]    1    1    1    1    1
## 
## VAR Estimation Results:
## ======================= 
## 
## Estimated coefficients for equation dl.GDP: 
## =========================================== 
## Call:
## dl.GDP = dl.SP500.l1 + dl.SP500.l2 + const 
## 
## dl.SP500.l1 dl.SP500.l2       const 
## 0.025631942 0.034319202 0.007004295 
## 
## 
## Estimated coefficients for equation dl.SP500: 
## ============================================= 
## Call:
## dl.SP500 = dl.GDP.l1 + dl.SP500.l1 + dl.GDP.l2 + dl.SP500.l2 + const 
## 
##   dl.GDP.l1 dl.SP500.l1   dl.GDP.l2 dl.SP500.l2       const 
##  0.25605423  0.10650115 -0.81935297 -0.04057338  0.01383567
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: dl.GDP, dl.SP500 
## Deterministic variables: const 
## Sample size: 254 
## Log Likelihood: 1142.478 
## Roots of the characteristic polynomial:
## 0.444 0.444 0.3776 0.3776
## Call:
## VAR(y = y, type = "const", lag.max = 2)
## 
## 
## Estimation results for equation dl.GDP: 
## ======================================= 
## dl.GDP = dl.SP500.l1 + dl.SP500.l2 + const 
## 
##              Estimate Std. Error t value Pr(>|t|)    
## dl.SP500.l1 0.0256319  0.0066399   3.860 0.000144 ***
## dl.SP500.l2 0.0343192  0.0066400   5.169 4.82e-07 ***
## const       0.0070043  0.0005335  13.129  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.008386 on 251 degrees of freedom
## Multiple R-Squared: 0.5038,  Adjusted R-squared: 0.4979 
## F-statistic: 84.96 on 3 and 251 DF,  p-value: < 2.2e-16 
## 
## 
## Estimation results for equation dl.SP500: 
## ========================================= 
## dl.SP500 = dl.GDP.l1 + dl.SP500.l1 + dl.GDP.l2 + dl.SP500.l2 + const 
## 
##              Estimate Std. Error t value Pr(>|t|)  
## dl.GDP.l1    0.256054   0.609111   0.420   0.6746  
## dl.SP500.l1  0.106501   0.063457   1.678   0.0945 .
## dl.GDP.l2   -0.819353   0.589953  -1.389   0.1661  
## dl.SP500.l2 -0.040573   0.065115  -0.623   0.5338  
## const        0.013836   0.007167   1.931   0.0547 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.07964 on 249 degrees of freedom
## Multiple R-Squared: 0.03656, Adjusted R-squared: 0.01721 
## F-statistic:  1.89 on 5 and 249 DF,  p-value: 0.09665 
## 
## 
## 
## Covariance matrix of residuals:
##             dl.GDP dl.SP500
## dl.GDP   7.089e-05 0.000087
## dl.SP500 8.700e-05 0.006342
## 
## Correlation matrix of residuals:
##          dl.GDP dl.SP500
## dl.GDP   1.0000   0.1297
## dl.SP500 0.1297   1.0000
##          dl.GDP.l1 dl.SP500.l1 dl.GDP.l2 dl.SP500.l2 const
## dl.GDP           0           1         0           1     1
## dl.SP500         1           1         1           1     1
## [[1]]
##          dl.GDP.l1 dl.SP500.l1
## dl.GDP   0.0000000  0.02563194
## dl.SP500 0.2560542  0.10650115
## 
## [[2]]
##          dl.GDP.l2 dl.SP500.l2
## dl.GDP    0.000000  0.03431920
## dl.SP500 -0.819353 -0.04057338
## 
## VAR Estimation Results:
## ======================= 
## 
## Estimated coefficients for equation dl.GDP: 
## =========================================== 
## Call:
## dl.GDP = dl.GDP.l1 + dl.SP500.l1 + dl.SP500.l2 + const 
## 
##   dl.GDP.l1 dl.SP500.l1 dl.SP500.l2       const 
## 0.273417790 0.022632255 0.026628453 0.005019793 
## 
## 
## Estimated coefficients for equation dl.SP500: 
## ============================================= 
## Call:
## dl.SP500 = const 
## 
##      const 
## 0.01016792
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: dl.GDP, dl.SP500 
## Deterministic variables: const 
## Sample size: 254 
## Log Likelihood: 1150.599 
## Roots of the characteristic polynomial:
## 0.2734     0     0     0
## Call:
## VAR(y = y, type = "const", lag.max = 2)
## 
## 
## Estimation results for equation dl.GDP: 
## ======================================= 
## dl.GDP = dl.GDP.l1 + dl.SP500.l1 + dl.SP500.l2 + const 
## 
##              Estimate Std. Error t value Pr(>|t|)    
## dl.GDP.l1   0.2734178  0.0577607   4.734 3.70e-06 ***
## dl.SP500.l1 0.0226323  0.0064051   3.533 0.000488 ***
## dl.SP500.l2 0.0266285  0.0065775   4.048 6.88e-05 ***
## const       0.0050198  0.0006618   7.585 6.55e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.00805 on 250 degrees of freedom
## Multiple R-Squared: 0.5446,  Adjusted R-squared: 0.5374 
## F-statistic: 74.76 on 4 and 250 DF,  p-value: < 2.2e-16 
## 
## 
## Estimation results for equation dl.SP500: 
## ========================================= 
## dl.SP500 = const 
## 
##       Estimate Std. Error t value Pr(>|t|)  
## const  0.01017    0.00501    2.03   0.0434 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.07984 on 253 degrees of freedom
## Multiple R-Squared: 0.01602, Adjusted R-squared: 0.01213 
## F-statistic: 4.119 on 1 and 253 DF,  p-value: 0.04344 
## 
## 
## 
## Covariance matrix of residuals:
##             dl.GDP  dl.SP500
## dl.GDP   6.506e-05 8.224e-05
## dl.SP500 8.224e-05 6.477e-03
## 
## Correlation matrix of residuals:
##          dl.GDP dl.SP500
## dl.GDP   1.0000   0.1267
## dl.SP500 0.1267   1.0000
##          dl.GDP.l1 dl.SP500.l1 dl.GDP.l2 dl.SP500.l2 const
## dl.GDP           1           1         0           1     1
## dl.SP500         0           0         0           0     1
## [[1]]
##          dl.GDP.l1 dl.SP500.l1
## dl.GDP   0.2734178  0.02263225
## dl.SP500 0.0000000  0.00000000
## 
## [[2]]
##          dl.GDP.l2 dl.SP500.l2
## dl.GDP           0  0.02662845
## dl.SP500         0  0.00000000

(d) Use stargazer package to show estimation results from all three models in “a”, “b”, “c”.

Dependent variable:
var1 dl.GDP var1 dl.SP500 var1.r dl.GDP var1.r dl.SP500 var1.r.ser dl.GDP var1.r.ser dl.SP500
(1) (2) (3) (4) (5) (6)
dl.GDP.l1 0.245*** 0.256 0.256 0.273***
(0.061) (0.609) (0.609) (0.058)
dl.SP500.l1 0.023*** 0.107* 0.026*** 0.107* 0.023***
(0.006) (0.063) (0.007) (0.063) (0.006)
dl.GDP.l2 0.079 -0.819 -0.819
(0.060) (0.590) (0.590)
dl.SP500.l2 0.026*** -0.041 0.034*** -0.041 0.027***
(0.007) (0.065) (0.007) (0.065) (0.007)
const 0.005*** 0.014* 0.007*** 0.014* 0.005*** 0.010**
(0.001) (0.007) (0.001) (0.007) (0.001) (0.005)
Observations 254 254 254 254 254 254
R2 0.231 0.021 0.504 0.037 0.545 0.016
Adjusted R2 0.219 0.005 0.498 0.017 0.537 0.012
Residual Std. Error 0.008 (df = 249) 0.080 (df = 249) 0.008 (df = 251) 0.080 (df = 249) 0.008 (df = 250) 0.080 (df = 253)
F Statistic 18.685*** (df = 4; 249) 1.327 (df = 4; 249) 84.959*** (df = 3; 251) 1.890* (df = 5; 249) 74.756*** (df = 4; 250) 4.119** (df = 1; 253)
Note: p<0.1; p<0.05; p<0.01

(e) Plot IRFs and FEVD for the VAR model based on Choleski decomposition. Afterwards reverse the order of the variables in the VAR and plot IRFs and FEVD based on Choleski decomposition for the alternative order. Does the order matter much in this particular case? In general the ordering of variable in the VAR(p) model matter. In this particular case, since the correlation between \(e_{1,t}\) and \(e_{2,t}\) is small the order does not seem to matter much.