12/03/2018

Outline

Last lecture:

  • Shocks in a VAR and their identifications

  • Multivariate noises, stability of VAR

This lecture:

  • Model structure and Granger causality

  • Seasonality, VARMA and Seasonal VARMA

  • Bayesian method

Granger Causality

  • Recall the estimated system in the previous lecture: \[ \begin{align} \mbox{Inflation}_{t}=& -0.01 + 0.32 \mbox{Growth}_{t-1}+ 0.8 \mbox{Inflation}_{t-1}+\varepsilon_{1,t} \\ \mbox{Growth}_{t}=& 1.75 + 0.3 \mbox{Growth}_{t-1} +\varepsilon_{2,t} \end{align} \]

  • It shows that Growth does not depend on the past value of inflation, but inflation depends on the past value of growth.

  • Transfer function: we have a unidirectional relationship with growth acting as the input variable and inflation as the output variable. (It is useful in control, as one can adjust the value of input to influence the future value of output.)

Granger Causality

  • In econometrics, this concept implies the existence of Granger causality: input causing output but not being caused by output.

  • \(\phi_{12} = 0\) gives a triangular system: \[ \begin{align} Y_{1,t} =& \phi_{11}Y_{1,t-1} + \varepsilon_{1,t}\\ Y_{2,t} =& \phi_{21}Y_{1,t-1}+\phi_{22}Y_{2,t-1}+ \varepsilon_{2,t} \end{align} \]

  • We say that \(Y_1\) Granger causes \(Y_2\) or say that \(Y_2\) does not Granger cause \(Y_1\).

Granger Causality

  • In the bivariate model, testing \[H_{0}: Y_{2} \mbox{ does not Granger-Cause } Y_{1}.\]
  • It is equivalent to the testing \[H_{0}:\phi_{12}=0.\] from the linear regression \[\begin{align} Y_{1,t} =& \phi_{11}Y_{1,t-1}+\phi_{12}Y_{2,t-1} + \varepsilon_{1,t}\\ Y_{2,t} =& \phi_{21}Y_{1,t-1}+\phi_{22}Y_{2,t-1}+ \varepsilon_{2,t} \end{align}\]

Granger Causality

  • Granger causality provides a framework that uses predictability as opposed to correlation to identify causation between time-series variables.

  • Consider the bivariate series \((Y_{1,t}, Y_{2,t})\) and \(h\)-step ahead forecast. We can use VAR model and univariate models for individual components to produce forecasts.

  • Granger causality: \(Y_{1,t}\) (Granger) causes \(Y_{2,t}\) if the bivariate forecast for \(Y_{2,t}\) is more accurate than its univariate forecast.

  • The accurarcy of a forecast is measured by the variance of its forecast error.

VAR(1) Forecast

  • Use insights from AR(1) to study VAR(1). As in AR(1): \[ Y_{t+h} = \phi^{h} Y_t + \phi^{h-1}\varepsilon_{t+1} + \cdots + \phi \varepsilon_{t+h-1} +\varepsilon_{t+h}.\]

  • Similarly in VAR(1), there is \[\mathbf{Y}_{t+h}=\mathbf{\Phi}^{h}\mathbf{Y}_{t}+\mathbf{\Phi}^{h-1}\mathbf{C}\mathbf{w}_{t+1}+\cdots+\mathbf{\Phi} \mathbf{C} \mathbf{w}_{t+h-1}+ \mathbf{C}\mathbf{w}_{t+h}\]

  • Forecast: \(\mathbb{E}[\mathbf{Y}_{t+h} | \mathcal{F}_t] = \mathbf{\Phi}^h \mathbf{Y}_t\).

VAR(1) Forecast

  • Forecast error: \[\mathbf{Y}_{t+1} - \mathbb{E}[\mathbf{Y}_{t+1} | \mathcal{F}_t] = \mathbf{C} \mathbf{w}_{t+1}.\]

  • Forecast error variance: \[ \mbox{Var}(\mathbf{Y}_{t+1} | \mathcal{F}_t) = \mathbf{C} \mathbf{C}^{T}.\]

  • \(2\)-period ahead forecast error: \[\mathbf{Y}_{t+2} - \mathbb{E}[\mathbf{Y}_{t+2} | \mathcal{F}_t] = \mathbf{C} \mathbf{w}_{t+2} + \mathbf{\Phi}\mathbf{C} \mathbf{w}_{t+1}.\]

  • \(2\)-period ahead forecast error variance: \[ \mbox{Var}(\mathbf{Y}_{t+2} | \mathcal{F}_t) = \mathbf{C} \mathbf{C}^{T} + \mathbf{\Phi} \mathbf{C} \mathbf{C}^{T} \mathbf{\Phi}^{T}.\]

Variance Decomposition

  • When the system is orthogonalized, we can decompose the forecast error variance by variables: what percent of the \(k\)-step ahead forecast error variance is due to a certain variable.

  • It is known that the forecast error variance: \[ \mbox{Var}(\mathbf{Y}_{t+1} | \mathcal{F}_t) = \mathbf{C} \mathbf{C}^{T}.\]

  • For 2-Vector AR, if we let \[ \mathbf{I}_1= \left[\begin{array}{cc} 1 & 0\\ 0 & 0 \end{array}\right], \, \mathbf{I}_2= \left[\begin{array}{cc} 0 & 0\\ 0 & 1 \end{array}\right],\] the variance forecast error can be decomposed as \[ \mbox{Var}(\mathbf{Y}_{t+1} | \mathcal{F}_t) = \mathbf{C} \mathbf{C}^{T} = \mathbf{C} \mathbf{I}_1 \mathbf{C}^{T} + \mathbf{C} \mathbf{I}_2 \mathbf{C}^{T} .\]

Forecast and Variance Decomposition

  • \(h\)-period ahead forecast error variance: \[\mbox{Var}(\mathbf{Y}_{t+h} | \mathcal{F}_t) = \sum_{j=0}^{h-1} \mathbf{\Phi}^{j} \mathbf{C} \mathbf{C}^{T} (\mathbf{\Phi}^{j})^{T}.\]

  • \(h\)-period ahead forecast error variance: \[\mbox{Var}(\mathbf{Y}_{t+h} | \mathcal{F}_t) = \sum_{j=0}^{h-1} \mathbf{\Phi}^{j} \mathbf{C} \mathbf{C}^{T} (\mathbf{\Phi}^{j})^{T} = \sum_{j=0}^{h-1} \mathbf{\Phi}^{j} \left( \mathbf{C} \mathbf{I}_1 \mathbf{C}^{T} + \mathbf{C} \mathbf{I}_2 \mathbf{C}^{T}\right) (\mathbf{\Phi}^{j})^{T}.\]

Belgian Economy

library(Quandl); library(xts); library(lubridate); library(forecast)
library(lattice);library(zoo); library(lmtest)
library(vars); library(tseries)
BE.econIndicators = c("GDP Per Capita" = "WWDI/BEL_NY_GDP_PCAP_KN",
                  "GDP Per Capita Growth" = "WWDI/BEL_NY_GDP_PCAP_KD_ZG",
                  "Real Interest Rate" = "WWDI/BEL_FR_INR_RINR",
                  "Exchange Rate" = "WWDI/BEL_PX_REX_REER",
                  "Inflation" = "WWDI/BEL_FP_CPI_TOTL_ZG",
                  "Labor Force Part Rate" = "WWDI/BEL_SL_TLF_ACTI_ZS")
BE = Quandl(BE.econIndicators, type="xts", start_date="1962-01-01",
            end_date="2018-01-01")
colnames(BE)= names(BE.econIndicators)

Belgian Economy

v2 = data.frame(BE$"Inflation", BE$"GDP Growth Rate")
BE.VAR = VAR(v2, p=1); plot(fevd(BE.VAR))

Belgian Economy

causality(BE.VAR, cause = c("Inflation"))$Granger
## 
##  Granger causality H0: Inflation do not Granger-cause
##  GDP.Growth.Rate
## 
## data:  VAR object BE.VAR
## F-Test = 0.48276, df1 = 1, df2 = 104, p-value = 0.4887
causality(BE.VAR, cause = c("GDP.Growth.Rate"))$Granger
## 
##  Granger causality H0: GDP.Growth.Rate do not Granger-cause
##  Inflation
## 
## data:  VAR object BE.VAR
## F-Test = 11.027, df1 = 1, df2 = 104, p-value = 0.001239

Seasonality

  • VAR(1) with the lagged operator: \[(\mathbf{I} - \mathbf{\Phi} \mathbb{L}) \mathbf{Y}_{t}= \mathbf{e}_t\]

  • Seasonal dummy (quarterly dummy variables): \[(\mathbf{I} - \mathbf{\Phi} \mathbb{L}) \mathbf{Y}_{t}= \mathbf{e}_t + \beta_1 \mathbf{I}_{2,t} + \beta_2 \mathbf{I}_{3,t} + \beta_4 \mathbf{I}_{4,t}\] where \(\mathbf{I}_{i,t} = [1,\cdots,1]^T\) if \(t\) is in quarter \(i\) and \([0,\dots,0]^T\) otherwise.

Belgian Economy

Unemployment =  Quandl("ECB/STS_M_BE_N_UNEH_LTT000_4_000", type = "xts", 
              collapse = "quarterly",  
                      start_date="1997-12-31", end_date="2016-12-31")
GNP =  Quandl("ECB/RDF_Q_BE_EUR_4F_CR_DCGDPG_RO", type = "xts", 
              collapse = "quarterly",  
                      start_date="1997-12-31", end_date="2016-12-31")
New.v2 = data.frame(Unemployment, GNP)

Belgian Economy

Belgian Economy

BE.VAR2 = VAR(New.v2, p=1); coef(BE.VAR2)
## $Unemployment
##                    Estimate  Std. Error   t value     Pr(>|t|)
## Unemployment.l1   0.6681447  0.09049832  7.382951 2.018633e-10
## GNP.l1           -0.7078979  0.42387537 -1.670061 9.919003e-02
## const           127.1225652 35.38145015  3.592916 5.902319e-04
## 
## $GNP
##                    Estimate  Std. Error   t value     Pr(>|t|)
## Unemployment.l1 -0.01366029 0.008915145 -1.532257 1.297815e-01
## GNP.l1           0.91980717 0.041756692 22.027779 5.638438e-34
## const            5.50866706 3.485487480  1.580458 1.183255e-01

Belgian Economy

BE.sVAR2 = VAR(New.v2, p=1, season=4); coef(BE.sVAR2)
## $Unemployment
##                    Estimate  Std. Error    t value     Pr(>|t|)
## Unemployment.l1   0.8351504  0.07293641 11.4503920 1.060999e-17
## GNP.l1           -0.2364043  0.32497277 -0.7274587 4.693712e-01
## const            62.0363711 28.48785834  2.1776425 3.280500e-02
## sd1             -36.3664759  7.25314339 -5.0138918 3.865948e-06
## sd2             -36.6059784  7.16966252 -5.1056766 2.718443e-06
## sd3             -54.0406125  7.04002464 -7.6761965 7.206287e-11
## 
## $GNP
##                    Estimate  Std. Error    t value     Pr(>|t|)
## Unemployment.l1 -0.01789919 0.009693423 -1.8465293 6.904287e-02
## GNP.l1           0.90911286 0.043189661 21.0493168 5.381247e-32
## const            7.15087180 3.786104725  1.8887147 6.307357e-02
## sd1              1.06199588 0.963960159  1.1017010 2.743654e-01
## sd2              0.99534915 0.952865351  1.0445853 2.998086e-01
## sd3              0.28545058 0.935636165  0.3050872 7.612051e-01

Belgian Economy

acf(resid(BE.sVAR2))

Belgian Economy

irf.un = irf(BE.sVAR2, impulse = "Unemployment", n.ahead = 24, ci = 0.95)
plot(irf.un)

Belgian Economy

irf.gnp = irf(BE.sVAR2, impulse = "GNP", n.ahead = 24, ci = 0.95)
plot(irf.gnp)

Belgian Economy

plot(fevd(BE.sVAR2))

Belgian Economy

causality(BE.sVAR2, cause = c("Unemployment"))$Granger
## 
##  Granger causality H0: Unemployment do not Granger-cause GNP
## 
## data:  VAR object BE.sVAR2
## F-Test = 3.4097, df1 = 1, df2 = 140, p-value = 0.06693
causality(BE.sVAR2, cause = c("GNP"))$Granger
## 
##  Granger causality H0: GNP do not Granger-cause Unemployment
## 
## data:  VAR object BE.sVAR2
## F-Test = 0.5292, df1 = 1, df2 = 140, p-value = 0.4682

Integration and Seasonality

  • One can extend the formulation of ARIMA(p,d,q) to vector ARIMA.

  • VARMA model with integration (p,d,q):\[(\mathbf{I} - \mathbf{\Phi} (\mathbb{L}) )(\mathbf{I} - \mathbb{L}^d) \mathbf{Y}_{t}= (\mathbf{I} - \mathbf{\Theta} (\mathbb{L}) ) \mathbf{e}_t\] where \(\mathbf{\Phi} (\mathbb{L})\) and \(\mathbf{\Theta} (\mathbb{L})\) are matrix polynomials of order \(p\) and \(q\).

  • Similar as the seasonal ARIMA models, one can specify a seasonal VARMA (p,d,q)(P,D,Q): \[(\mathbf{I} - \mathbf{\Phi}_1 (\mathbb{L}))(\mathbf{I} - \mathbf{\Phi}_2 (\mathbb{L}^{P}))(\mathbf{I} - \mathbb{L}^d)(\mathbf{I} - \mathbb{L}^D) \mathbf{Y}_{t}= \\ (\mathbf{I} - \mathbf{\Theta}_1 (\mathbb{L}) ) (\mathbf{I} - \mathbf{\Theta}_2 (\mathbb{L}^Q) ) \mathbf{e}_t\]

Belgian Economy

library(MTS)
BE.sVARMA = sVARMA(New.v2, order=c(1,0,0), sorder=c(1,0,0), s=4)
## Number of parameters:  10 
## initial estimates:  154.3298 3.919555 0.723349 -0.448974 -0.01938563 0.9575472 0.512132 0.4553656 -0.004846663 -0.1314297 
## 
## Coefficient(s):
##               Estimate  Std. Error  t value Pr(>|t|)    
## Unemployment 75.863183   29.369932    2.583  0.00979 ** 
## GNP           6.562568    2.358193    2.783  0.00539 ** 
##               0.653384    0.090495    7.220 5.20e-13 ***
##               0.362327    0.528751    0.685  0.49319    
##              -0.027791    0.009175   -3.029  0.00246 ** 
##               0.956980    0.041363   23.136  < 2e-16 ***
##               0.417284    0.106717    3.910 9.22e-05 ***
##              -2.053844    1.198342   -1.714  0.08655 .  
##              -0.001712    0.011008   -0.156  0.87641    
##              -0.091634    0.125100   -0.732  0.46388    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## --- 
## Estimates in matrix form: 
## Constant term:  
## Estimates:  75.86318 6.562568 
## Regular AR coefficient matrix 
## AR( 1 )-matrix 
##         [,1]  [,2]
## [1,]  0.6534 0.362
## [2,] -0.0278 0.957
## Seasonal AR coefficient matrix 
## AR( 4 )-matrix 
##          [,1]    [,2]
## [1,]  0.41728 -2.0538
## [2,] -0.00171 -0.0916
##   
## Residuals cov-matrix: 
##           resi       resi
## resi 601.04275 -12.577515
## resi -12.57752   6.702499
## ---- 
## aic=  8.5208 
## bic=  8.8252

Belgian Economy

Bayesian Method

  • In a nutshell, the Bayesian way is to adapt the model to the uncertainty.

  • So far, all the parameters/coefficients are assumed to be constant.

  • But what if those parameters can change? And what if the changes of those parameters are somehow “random”?

  • Bayesian method considers the unknown parameters as random variables.

Bayesian Method

  • Because the parameters are random, they come with some probability distributions.

  • One constructs one’s own beliefs over those distributions.

  • The observations simply drive you to update your beliefs.

  • That is, your prior belief and your observations together give your a posterior belief. This is a Bayesian/probabilistic approach.

Bayesian Method

  • The method relies on the Bayes’ Theorem which is about conditional probability. For event \(A\) and \(B\): \[\Pr(A|B) = \frac{\Pr(A\cap B)}{\Pr(B)}\]

  • For parameter \(\theta\) and data \(x\):
    \[\begin{eqnarray*} \Pr(\theta|x) & = & \frac{\Pr(x|\theta)\Pr(\theta)}{\Pr(x)} \\ && \\ & \propto & \Pr(x|\theta)\Pr(\theta) \end{eqnarray*}\] where \(\Pr(\theta)\) is called the prior and \(\Pr(x|\theta)\) is the likelihood.

Bayesian Method

  • Why in econometrics?

  • It provides a probabilistic modeling alternative.

  • The estimated parameters can induce adaptive models.

  • A more fundamental argument: the logic of human’s decision may follow some kinds of probabilistic structure (A Treatise on Probability by John Maynard Keynes).

Bayesian Method

C=0.1*diag(rep(1,3)); V0=diag(rep(1,2)); BE.BVAR = BVAR(v2, p=1, C, V0)
## Bayesian estimate: 
##               Est       s.e.      t-ratio
## [1,]  0.001272246 0.36254196  0.003509238
## [2,]  0.807371826 0.06792128 11.886876709
## [3,]  0.323095797 0.09331603  3.462382592
## [4,]  1.711645224 0.48417399  3.535186213
## [5,] -0.064438903 0.09070871 -0.710393751
## [6,]  0.302346170 0.12462335  2.426079582
## Covariance matrix:  
##                 Inflation GDP.Growth.Rate
## Inflation        1.936734        0.423144
## GDP.Growth.Rate  0.423144        3.454270

Summary

  • Causality and forecast

  • Other specifications of VAR.

  • A Bayesian/probabilistic view.