Problem 1

1(a)

library(Quandl)
## Loading required package: xts
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
library(zoo)
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2015). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2. http://CRAN.R-project.org/package=stargazer
library(vars)
## Warning: package 'vars' was built under R version 3.2.4
## Loading required package: MASS
## Loading required package: strucchange
## Warning: package 'strucchange' was built under R version 3.2.4
## Loading required package: sandwich
## Warning: package 'sandwich' was built under R version 3.2.4
## Loading required package: urca
## Warning: package 'urca' was built under R version 3.2.4
## Loading required package: lmtest
## Warning: package 'lmtest' was built under R version 3.2.4
library(boxr)
## Warning: package 'boxr' was built under R version 3.2.4
## Welcome to boxr 0.3.2!
## Bug reports: https://github.com/brendan-R/boxr/issues
## 
## See vignette('boxr') for a short guide on connecting your box.com account to R.
rgdp <- Quandl("FRED/GDPC1",api_key="5NyVfHfxdScCYsskDP59", type="zoo")
gdpd <- Quandl("FRED/GDPDEF",api_key="5NyVfHfxdScCYsskDP59", type="zoo")
sp500 <- Quandl("YAHOO/INDEX_GSPC",api_key="5NyVfHfxdScCYsskDP59", type="zoo")
sp500q <- aggregate(sp500[,4],as.yearqtr,tail,1)
dgdpd <- diff(log(gdpd))
dsp500 <- diff(log(sp500q[,4]))
y1t <- diff(log(rgdp))
y2t <- dsp500-dgdpd
plot(y1t, xlab="", ylab="", main="Growth Rate of GDP", col="blue")

plot(y2t, xlab="", ylab="", main="Inflation Adjusted Return", col="red", ylim=c(-0.14,0.14))

y<- cbind(y1t, y2t)
y<- window(y, start="1951 Q1", end="2014 Q4")
VARselect(y, lag.max=8, type="const")
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      2      2      1      2 
## 
## $criteria
##                    1             2             3             4
## AIC(n) -1.465126e+01 -1.470486e+01 -1.469229e+01 -1.466603e+01
## HQ(n)  -1.461704e+01 -1.464783e+01 -1.461245e+01 -1.456337e+01
## SC(n)  -1.456626e+01 -1.456319e+01 -1.449395e+01 -1.441102e+01
## FPE(n)  4.335513e-07  4.109277e-07  4.161332e-07  4.272205e-07
##                    5             6             7             8
## AIC(n) -1.464883e+01 -1.462725e+01 -1.461845e+01 -1.459013e+01
## HQ(n)  -1.452337e+01 -1.447897e+01 -1.444736e+01 -1.439622e+01
## SC(n)  -1.433716e+01 -1.425891e+01 -1.419344e+01 -1.410845e+01
## FPE(n)  4.346529e-07  4.441705e-07  4.481426e-07  4.610779e-07
var1 <- VAR(y, p=2, type="const")
summary(var1)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: y1t, y2t 
## 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, p = 2, type = "const")
## 
## 
## Estimation results for equation y1t: 
## ==================================== 
## y1t = y1t.l1 + y2t.l1 + y1t.l2 + y2t.l2 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)    
## y1t.l1 0.2450402  0.0614771   3.986 8.84e-05 ***
## y2t.l1 0.0230968  0.0064046   3.606 0.000375 ***
## y1t.l2 0.0793493  0.0595434   1.333 0.183872    
## y2t.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 y2t: 
## ==================================== 
## y2t = y1t.l1 + y2t.l1 + y1t.l2 + y2t.l2 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)  
## y1t.l1  0.256054   0.609111   0.420   0.6746  
## y2t.l1  0.106501   0.063457   1.678   0.0945 .
## y1t.l2 -0.819353   0.589953  -1.389   0.1661  
## y2t.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:
##          y1t      y2t
## y1t 6.46e-05 0.000087
## y2t 8.70e-05 0.006342
## 
## Correlation matrix of residuals:
##        y1t    y2t
## y1t 1.0000 0.1359
## y2t 0.1359 1.0000

After estimating the var model, based on AIC we can state that the lags are suppose to be 2. Therefore, reduced form VAR model at lag 2 has been estimated.

1(b)

From the VAR estimation, the correlation matrix suggests the correlation of residuals is 0.1349. This result indicates instantaneous causality. Hence, Granger causality test has been done.

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

The Granger causality test suggests that, y1t doesn’t granger cause y2t where as y2t granger causes y1t. Therefore, it is important to restrict the VAR estimation.

1(c)

Rmat<- matrix(1, nrow=2, ncol=5)
Rmat[1, c(2,4)] <- 0
rvarp<- restrict(var1, method="manual", resmat=Rmat)
summary(rvarp)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: y1t, y2t 
## Deterministic variables: const 
## Sample size: 254 
## Log Likelihood: 1139.086 
## Roots of the characteristic polynomial:
## 0.4867 0.2014 0.2014 0.1565
## Call:
## VAR(y = y, p = 2, type = "const")
## 
## 
## Estimation results for equation y1t: 
## ==================================== 
## y1t = y1t.l1 + y1t.l2 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)    
## y1t.l1 0.3301391  0.0628607   5.252 3.21e-07 ***
## y1t.l2 0.0761755  0.0628199   1.213    0.226    
## const  0.0044907  0.0007616   5.896 1.19e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.008497 on 251 degrees of freedom
## Multiple R-Squared: 0.4906,  Adjusted R-squared: 0.4845 
## F-statistic: 80.59 on 3 and 251 DF,  p-value: < 2.2e-16 
## 
## 
## Estimation results for equation y2t: 
## ==================================== 
## y2t = y1t.l1 + y2t.l1 + y1t.l2 + y2t.l2 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)  
## y1t.l1  0.256054   0.609111   0.420   0.6746  
## y2t.l1  0.106501   0.063457   1.678   0.0945 .
## y1t.l2 -0.819353   0.589953  -1.389   0.1661  
## y2t.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:
##           y1t      y2t
## y1t 7.278e-05 0.000087
## y2t 8.700e-05 0.006342
## 
## Correlation matrix of residuals:
##        y1t    y2t
## y1t 1.0000 0.1281
## y2t 0.1281 1.0000
rvarp$restrictions
##     y1t.l1 y2t.l1 y1t.l2 y2t.l2 const
## y1t      1      0      1      0     1
## y2t      1      1      1      1     1
Acoef(rvarp)
## [[1]]
##        y1t.l1    y2t.l1
## y1t 0.3301391 0.0000000
## y2t 0.2560542 0.1065012
## 
## [[2]]
##          y1t.l2      y2t.l2
## y1t  0.07617549  0.00000000
## y2t -0.81935297 -0.04057338
servarp<- restrict(var1, method="ser", thresh=2.0)
summary(servarp)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: y1t, y2t 
## Deterministic variables: const 
## Sample size: 254 
## Log Likelihood: 1150.599 
## Roots of the characteristic polynomial:
## 0.2734     0     0     0
## Call:
## VAR(y = y, p = 2, type = "const")
## 
## 
## Estimation results for equation y1t: 
## ==================================== 
## y1t = y1t.l1 + y2t.l1 + y2t.l2 + const 
## 
##         Estimate Std. Error t value Pr(>|t|)    
## y1t.l1 0.2734178  0.0577607   4.734 3.70e-06 ***
## y2t.l1 0.0226323  0.0064051   3.533 0.000488 ***
## y2t.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 y2t: 
## ==================================== 
## y2t = 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:
##           y1t       y2t
## y1t 6.506e-05 8.224e-05
## y2t 8.224e-05 6.477e-03
## 
## Correlation matrix of residuals:
##        y1t    y2t
## y1t 1.0000 0.1267
## y2t 0.1267 1.0000
servarp$restrictions
##     y1t.l1 y2t.l1 y1t.l2 y2t.l2 const
## y1t      1      1      0      1     1
## y2t      0      0      0      0     1
Acoef(servarp)
## [[1]]
##        y1t.l1     y2t.l1
## y1t 0.2734178 0.02263225
## y2t 0.0000000 0.00000000
## 
## [[2]]
##     y1t.l2     y2t.l2
## y1t      0 0.02662845
## y2t      0 0.00000000

The model is restricted first by eliminating the insignificant lags. The second restriction had been imposed by removing all the insignificant variables.

1(d)

m1 <- var1$varresult
mp <- rvarp$varresult
ms <- servarp$varresult
stargazer(m1$y1t, m1$y2t, mp$y1t, mp$y2t, type="text", title="", 
           align=TRUE, header=FALSE, model.numbers=TRUE,
           dep.var.caption="", result="asis", column.labels=c("VAR1(Y1t)","VAR1(Y2t)","VARP(Y1t)", "VARP(Y2t)"))
## 
## ============================================================================================================
##                                                                y                                            
##                            VAR1(Y1t)             VAR1(Y2t)             VARP(Y1t)             VARP(Y2t)      
##                               (1)                   (2)                   (3)                   (4)         
## ------------------------------------------------------------------------------------------------------------
## y1t.l1                     0.245***                0.256               0.330***                0.256        
##                             (0.061)               (0.609)               (0.063)               (0.609)       
##                                                                                                             
## y2t.l1                     0.023***               0.107*                                       0.107*       
##                             (0.006)               (0.063)                                     (0.063)       
##                                                                                                             
## y1t.l2                       0.079                -0.819                 0.076                 -0.819       
##                             (0.060)               (0.590)               (0.063)               (0.590)       
##                                                                                                             
## y2t.l2                     0.026***               -0.041                                       -0.041       
##                             (0.007)               (0.065)                                     (0.065)       
##                                                                                                             
## const                      0.005***               0.014*               0.004***                0.014*       
##                             (0.001)               (0.007)               (0.001)               (0.007)       
##                                                                                                             
## ------------------------------------------------------------------------------------------------------------
## Observations                  254                   254                   254                   254         
## R2                           0.231                 0.021                 0.491                 0.037        
## Adjusted R2                  0.219                 0.005                 0.485                 0.017        
## Residual Std. Error    0.008 (df = 249)      0.080 (df = 249)      0.008 (df = 251)       0.080 (df = 249)  
## F Statistic         18.685*** (df = 4; 249) 1.327 (df = 4; 249) 80.588*** (df = 3; 251) 1.890* (df = 5; 249)
## ============================================================================================================
## Note:                                                                            *p<0.1; **p<0.05; ***p<0.01
## 
## ====
## asis
## ----
stargazer(ms$y1t, ms$y2t, type="text", title="", 
           align=TRUE, header=FALSE, model.numbers=TRUE,
           dep.var.caption="", result="asis", column.labels=c("SerVARP(Y1t)","SerVARP(Y2t)"))
## 
## =================================================================
##                                           y                      
##                          SerVARP(Y1t)           SerVARP(Y2t)     
##                               (1)                    (2)         
## -----------------------------------------------------------------
## y1t.l1                     0.273***                              
##                             (0.058)                              
##                                                                  
## y2t.l1                     0.023***                              
##                             (0.006)                              
##                                                                  
## y2t.l2                     0.027***                              
##                             (0.007)                              
##                                                                  
## const                      0.005***                0.010**       
##                             (0.001)                (0.005)       
##                                                                  
## -----------------------------------------------------------------
## Observations                  254                    254         
## R2                           0.545                  0.016        
## Adjusted R2                  0.537                  0.012        
## Residual Std. Error    0.008 (df = 250)       0.080 (df = 253)   
## F Statistic         74.756*** (df = 4; 250) 4.119** (df = 1; 253)
## =================================================================
## Note:                                 *p<0.1; **p<0.05; ***p<0.01
## 
## ====
## asis
## ----

1(e)

IRFs:

varp.irfs <- irf(var1, n.ahead=20)
par(mfcol=c(2,2), cex=0.6)
plot(varp.irfs, plot.type="single")

FEVD:

varp.fevd <- fevd(var1, n.ahead=40)
varp.fevd[[1]][c(1,4,8,40),]
##            y1t       y2t
## [1,] 1.0000000 0.0000000
## [2,] 0.8607464 0.1392536
## [3,] 0.8591922 0.1408078
## [4,] 0.8591882 0.1408118
varp.fevd[[2]][c(1,4,8,40),]
##             y1t       y2t
## [1,] 0.01847382 0.9815262
## [2,] 0.02623100 0.9737690
## [3,] 0.02642786 0.9735721
## [4,] 0.02642813 0.9735719

Note: Choleski Decomposition had been used

Reverse order:

y2 <- cbind(y2t, y1t)
y2 <- window(y2, start="1951 Q1", end="2014 Q4")
Varord2 <- VAR(y2, p=2, type="const")
varp.irfs <- irf(Varord2, n.ahead=10)
par(mfcol=c(2,2), cex=0.6)
plot(varp.irfs, plot.type="single")

varp.fevd <- fevd(Varord2, n.ahead=40)
varp.fevd[[1]][c(1,4,8,40),]
##            y2t         y1t
## [1,] 1.0000000 0.000000000
## [2,] 0.9935239 0.006476147
## [3,] 0.9934082 0.006591832
## [4,] 0.9934079 0.006592058
varp.fevd[[2]][c(1,4,8,40),]
##             y2t       y1t
## [1,] 0.01847382 0.9815262
## [2,] 0.18059627 0.8194037
## [3,] 0.18207471 0.8179253
## [4,] 0.18207906 0.8179209
plot(varp.fevd)

Based on the different results on IRFs and FEVD for the reverse order, we can state that, changing in order causes change in estimation of VAR model.

Problem 2

library(tseries)
library(vars)
ind <- Quandl("FRED/INDPRO",api_key="5NyVfHfxdScCYsskDP59",type = "zoo")
cpi <- Quandl("FRED/CPIAUCSL",api_key="5NyVfHfxdScCYsskDP59", type = "zoo")
lind <- log(ind)
lcpi <- log(cpi)
adf.test(lind)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  lind
## Dickey-Fuller = -2.7713, Lag order = 10, p-value = 0.2518
## alternative hypothesis: stationary
adf.test(lcpi)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  lcpi
## Dickey-Fuller = -1.2868, Lag order = 9, p-value = 0.8802
## alternative hypothesis: stationary

Here, the adf tests suggest that log value of industrial and cpi data are non-stationary. Therefore, let’s take difference of both the log transformed data sets and check the adf test.

dlind <- diff(lind)
dlcpi <- diff(lcpi)
adf.test(dlind)
## Warning in adf.test(dlind): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  dlind
## Dickey-Fuller = -8.9515, Lag order = 10, p-value = 0.01
## alternative hypothesis: stationary
adf.test(dlcpi)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  dlcpi
## Dickey-Fuller = -3.9607, Lag order = 9, p-value = 0.01096
## alternative hypothesis: stationary

Here, the adf tests suggest that both the differenced datasets are stationary.

y1t <- cbind(dlind, dlcpi)
y1t <- na.trim(y1t) 
VARselect(y1t, lag.max = 15, type = "const")
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##     12     12      2     12 
## 
## $criteria
##                    1             2             3             4
## AIC(n) -2.133297e+01 -2.138031e+01 -2.139030e+01 -2.139497e+01
## HQ(n)  -2.131967e+01 -2.135814e+01 -2.135925e+01 -2.135506e+01
## SC(n)  -2.129832e+01 -2.132255e+01 -2.130943e+01 -2.129099e+01
## FPE(n)  5.435098e-10  5.183815e-10  5.132313e-10  5.108399e-10
##                    5             6             7             8
## AIC(n) -2.140686e+01 -2.141954e+01 -2.142219e+01 -2.142175e+01
## HQ(n)  -2.135808e+01 -2.136189e+01 -2.135567e+01 -2.134636e+01
## SC(n)  -2.127978e+01 -2.126935e+01 -2.124889e+01 -2.122535e+01
## FPE(n)  5.048006e-10  4.984421e-10  4.971261e-10  4.973456e-10
##                    9            10            11            12
## AIC(n) -2.142510e+01 -2.143421e+01 -2.142649e+01 -2.148164e+01
## HQ(n)  -2.134084e+01 -2.134109e+01 -2.132450e+01 -2.137078e+01
## SC(n)  -2.120559e+01 -2.119160e+01 -2.116077e+01 -2.119282e+01
## FPE(n)  4.956857e-10  4.911904e-10  4.950034e-10  4.684453e-10
##                   13            14            15
## AIC(n) -2.147749e+01 -2.147552e+01 -2.148095e+01
## HQ(n)  -2.135777e+01 -2.134692e+01 -2.134348e+01
## SC(n)  -2.116557e+01 -2.114049e+01 -2.112281e+01
## FPE(n)  4.703964e-10  4.713304e-10  4.687856e-10

Based on AIC, the suggested lags are 15

vary1t <- VAR(y1t, lag.max = 15, ic="AIC", type="const")
vary1t
## 
## VAR Estimation Results:
## ======================= 
## 
## Estimated coefficients for equation dlind: 
## ========================================== 
## Call:
## dlind = dlind.l1 + dlcpi.l1 + dlind.l2 + dlcpi.l2 + dlind.l3 + dlcpi.l3 + dlind.l4 + dlcpi.l4 + dlind.l5 + dlcpi.l5 + dlind.l6 + dlcpi.l6 + dlind.l7 + dlcpi.l7 + dlind.l8 + dlcpi.l8 + dlind.l9 + dlcpi.l9 + dlind.l10 + dlcpi.l10 + dlind.l11 + dlcpi.l11 + dlind.l12 + dlcpi.l12 + const 
## 
##     dlind.l1     dlcpi.l1     dlind.l2     dlcpi.l2     dlind.l3 
##  0.304273343  0.234243097  0.084518945 -0.059361296  0.081635323 
##     dlcpi.l3     dlind.l4     dlcpi.l4     dlind.l5     dlcpi.l5 
##  0.028560277  0.042678149 -0.066681041 -0.080363960 -0.001430117 
##     dlind.l6     dlcpi.l6     dlind.l7     dlcpi.l7     dlind.l8 
##  0.003775864 -0.152389355  0.008698812 -0.123935243  0.036246354 
##     dlcpi.l8     dlind.l9     dlcpi.l9    dlind.l10    dlcpi.l10 
##  0.011185041  0.031803363 -0.011593875 -0.015642748 -0.162405542 
##    dlind.l11    dlcpi.l11    dlind.l12    dlcpi.l12        const 
##  0.037850244  0.106091969 -0.191202886 -0.189513857  0.002703497 
## 
## 
## Estimated coefficients for equation dlcpi: 
## ========================================== 
## Call:
## dlcpi = dlind.l1 + dlcpi.l1 + dlind.l2 + dlcpi.l2 + dlind.l3 + dlcpi.l3 + dlind.l4 + dlcpi.l4 + dlind.l5 + dlcpi.l5 + dlind.l6 + dlcpi.l6 + dlind.l7 + dlcpi.l7 + dlind.l8 + dlcpi.l8 + dlind.l9 + dlcpi.l9 + dlind.l10 + dlcpi.l10 + dlind.l11 + dlcpi.l11 + dlind.l12 + dlcpi.l12 + const 
## 
##      dlind.l1      dlcpi.l1      dlind.l2      dlcpi.l2      dlind.l3 
## -0.0049607212  0.4241226620  0.0302072664  0.0470790308  0.0097594881 
##      dlcpi.l3      dlind.l4      dlcpi.l4      dlind.l5      dlcpi.l5 
##  0.0365321543 -0.0011144333  0.0485875795 -0.0120975512  0.0554133925 
##      dlind.l6      dlcpi.l6      dlind.l7      dlcpi.l7      dlind.l8 
##  0.0192185259  0.0003051517 -0.0016149781  0.1001690712  0.0143655325 
##      dlcpi.l8      dlind.l9      dlcpi.l9     dlind.l10     dlcpi.l10 
##  0.0230141066 -0.0156854127  0.0826714199  0.0152335972  0.1255120964 
##     dlind.l11     dlcpi.l11     dlind.l12     dlcpi.l12         const 
##  0.0038751973  0.0477895960 -0.0142099143 -0.1596538738  0.0003405908
summary(vary1t)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: dlind, dlcpi 
## Deterministic variables: const 
## Sample size: 817 
## Log Likelihood: 6485.962 
## Roots of the characteristic polynomial:
## 0.9284 0.9081 0.9081 0.9012 0.9012 0.8947 0.8947 0.8902 0.8902 0.8863 0.8863 0.8789 0.8789 0.8772 0.8772 0.8464 0.8464 0.8442 0.8442 0.8146 0.8146 0.794 0.794 0.7076
## Call:
## VAR(y = y1t, type = "const", lag.max = 15, ic = "AIC")
## 
## 
## Estimation results for equation dlind: 
## ====================================== 
## dlind = dlind.l1 + dlcpi.l1 + dlind.l2 + dlcpi.l2 + dlind.l3 + dlcpi.l3 + dlind.l4 + dlcpi.l4 + dlind.l5 + dlcpi.l5 + dlind.l6 + dlcpi.l6 + dlind.l7 + dlcpi.l7 + dlind.l8 + dlcpi.l8 + dlind.l9 + dlcpi.l9 + dlind.l10 + dlcpi.l10 + dlind.l11 + dlcpi.l11 + dlind.l12 + dlcpi.l12 + const 
## 
##             Estimate Std. Error t value Pr(>|t|)    
## dlind.l1   0.3042733  0.0348583   8.729  < 2e-16 ***
## dlcpi.l1   0.2342431  0.1192271   1.965   0.0498 *  
## dlind.l2   0.0845189  0.0364826   2.317   0.0208 *  
## dlcpi.l2  -0.0593613  0.1290045  -0.460   0.6455    
## dlind.l3   0.0816353  0.0367275   2.223   0.0265 *  
## dlcpi.l3   0.0285603  0.1281176   0.223   0.8237    
## dlind.l4   0.0426781  0.0368531   1.158   0.2472    
## dlcpi.l4  -0.0666810  0.1265653  -0.527   0.5984    
## dlind.l5  -0.0803640  0.0368654  -2.180   0.0296 *  
## dlcpi.l5  -0.0014301  0.1238984  -0.012   0.9908    
## dlind.l6   0.0037759  0.0369304   0.102   0.9186    
## dlcpi.l6  -0.1523894  0.1237590  -1.231   0.2186    
## dlind.l7   0.0086988  0.0368993   0.236   0.8137    
## dlcpi.l7  -0.1239352  0.1235940  -1.003   0.3163    
## dlind.l8   0.0362464  0.0368138   0.985   0.3251    
## dlcpi.l8   0.0111850  0.1237425   0.090   0.9280    
## dlind.l9   0.0318034  0.0368247   0.864   0.3880    
## dlcpi.l9  -0.0115939  0.1231158  -0.094   0.9250    
## dlind.l10 -0.0156427  0.0366720  -0.427   0.6698    
## dlcpi.l10 -0.1624055  0.1226143  -1.325   0.1857    
## dlind.l11  0.0378502  0.0365476   1.036   0.3007    
## dlcpi.l11  0.1060920  0.1213539   0.874   0.3823    
## dlind.l12 -0.1912029  0.0347142  -5.508 4.91e-08 ***
## dlcpi.l12 -0.1895139  0.1130228  -1.677   0.0940 .  
## const      0.0027035  0.0005242   5.157 3.17e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.008563 on 792 degrees of freedom
## Multiple R-Squared: 0.2313,  Adjusted R-squared: 0.208 
## F-statistic: 9.929 on 24 and 792 DF,  p-value: < 2.2e-16 
## 
## 
## Estimation results for equation dlcpi: 
## ====================================== 
## dlcpi = dlind.l1 + dlcpi.l1 + dlind.l2 + dlcpi.l2 + dlind.l3 + dlcpi.l3 + dlind.l4 + dlcpi.l4 + dlind.l5 + dlcpi.l5 + dlind.l6 + dlcpi.l6 + dlind.l7 + dlcpi.l7 + dlind.l8 + dlcpi.l8 + dlind.l9 + dlcpi.l9 + dlind.l10 + dlcpi.l10 + dlind.l11 + dlcpi.l11 + dlind.l12 + dlcpi.l12 + const 
## 
##             Estimate Std. Error t value Pr(>|t|)    
## dlind.l1  -0.0049607  0.0102428  -0.484 0.628297    
## dlcpi.l1   0.4241227  0.0350338  12.106  < 2e-16 ***
## dlind.l2   0.0302073  0.0107201   2.818 0.004955 ** 
## dlcpi.l2   0.0470790  0.0379068   1.242 0.214615    
## dlind.l3   0.0097595  0.0107920   0.904 0.366098    
## dlcpi.l3   0.0365322  0.0376462   0.970 0.332139    
## dlind.l4  -0.0011144  0.0108289  -0.103 0.918058    
## dlcpi.l4   0.0485876  0.0371900   1.306 0.191773    
## dlind.l5  -0.0120976  0.0108326  -1.117 0.264428    
## dlcpi.l5   0.0554134  0.0364064   1.522 0.128388    
## dlind.l6   0.0192185  0.0108517   1.771 0.076941 .  
## dlcpi.l6   0.0003052  0.0363654   0.008 0.993307    
## dlind.l7  -0.0016150  0.0108425  -0.149 0.881632    
## dlcpi.l7   0.1001691  0.0363170   2.758 0.005946 ** 
## dlind.l8   0.0143655  0.0108174   1.328 0.184559    
## dlcpi.l8   0.0230141  0.0363606   0.633 0.526955    
## dlind.l9  -0.0156854  0.0108206  -1.450 0.147569    
## dlcpi.l9   0.0826714  0.0361764   2.285 0.022563 *  
## dlind.l10  0.0152336  0.0107757   1.414 0.157844    
## dlcpi.l10  0.1255121  0.0360290   3.484 0.000522 ***
## dlind.l11  0.0038752  0.0107392   0.361 0.718310    
## dlcpi.l11  0.0477896  0.0356587   1.340 0.180567    
## dlind.l12 -0.0142099  0.0102005  -1.393 0.163990    
## dlcpi.l12 -0.1596539  0.0332107  -4.807 1.83e-06 ***
## const      0.0003406  0.0001540   2.211 0.027310 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.002516 on 792 degrees of freedom
## Multiple R-Squared: 0.4562,  Adjusted R-squared: 0.4397 
## F-statistic: 27.69 on 24 and 792 DF,  p-value: < 2.2e-16 
## 
## 
## 
## Covariance matrix of residuals:
##           dlind     dlcpi
## dlind 7.333e-05 5.486e-07
## dlcpi 5.486e-07 6.332e-06
## 
## Correlation matrix of residuals:
##         dlind   dlcpi
## dlind 1.00000 0.02546
## dlcpi 0.02546 1.00000
svary1t <- BQ(vary1t)
svary1t
## 
## SVAR Estimation Results:
## ======================== 
## 
## 
## Estimated contemporaneous impact matrix:
##           dlind    dlcpi
## dlind  0.007058 0.004849
## dlcpi -0.001372 0.002110
## 
## Estimated identified long run impact matrix:
##          dlind   dlcpi
## dlind  0.01353 0.00000
## dlcpi -0.00469 0.01252
summary(svary1t)
## 
## SVAR Estimation Results:
## ======================== 
## 
## Call:
## BQ(x = vary1t)
## 
## Type: Blanchard-Quah 
## Sample size: 817 
## Log Likelihood: 6460.571 
## 
## Estimated contemporaneous impact matrix:
##           dlind    dlcpi
## dlind  0.007058 0.004849
## dlcpi -0.001372 0.002110
## 
## Estimated identified long run impact matrix:
##          dlind   dlcpi
## dlind  0.01353 0.00000
## dlcpi -0.00469 0.01252
## 
## Covariance matrix of reduced form residuals (*100):
##           dlind     dlcpi
## dlind 7.333e-03 5.486e-05
## dlcpi 5.486e-05 6.332e-04

The contemporaneous impact matrix shows a positive one standard deviation technology shock increases the industrial index by 0.007058% and lowers the consumer index by 0.001372%.

A negative one standard deviation non-technology shock increases industrial index by 0.004849%, increases the consumer index by 0.002110%.

long run cumulative effect of non technology shock on industrial index is 0, and a single positive one standard deviation technology shocks on it is an increase by 0.01252%

irfy1t <- irf(svary1t, n.ahead= 40)
summary(irfy1t)
##            Length Class  Mode     
## irf        2      -none- list     
## Lower      2      -none- list     
## Upper      2      -none- list     
## response   2      -none- character
## impulse    2      -none- character
## ortho      1      -none- logical  
## cumulative 1      -none- logical  
## runs       1      -none- numeric  
## ci         1      -none- numeric  
## boot       1      -none- logical  
## model      1      -none- character
irfy1tcum <- irf(svary1t, n.ahead = 40, cumulative = TRUE)
summary(irfy1tcum)
##            Length Class  Mode     
## irf        2      -none- list     
## Lower      2      -none- list     
## Upper      2      -none- list     
## response   2      -none- character
## impulse    2      -none- character
## ortho      1      -none- logical  
## cumulative 1      -none- logical  
## runs       1      -none- numeric  
## ci         1      -none- numeric  
## boot       1      -none- logical  
## model      1      -none- character
svary1t.irfs <- irf(svary1t, n.ahead=50)
plot(svary1t.irfs, plot.type= "single")

The impulse response functions are converging to zero. Now if we check the FEVD we can see:

fevd <- fevd(svary1t, n.ahead=40)
summary(fevd)
##       Length Class  Mode   
## dlind 80     -none- numeric
## dlcpi 80     -none- numeric
plot(fevd)

Therefore, nontechnological shocks have effect on industrial index.