Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Multivariate Time

Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Panel VAR Models
Specification

Estimation

Model selection Firmin Doko Tchatoka


Impulse-Response
Functions
The University of Adelaide
Stata Panel VAR
Estimation
Commands
firmin.dokotchatoka@adelaide.edu.au
END
Course outline
Multivariate Time
Series

Firmin Doko
Tchatoka
1 Introduction

Introduction
2 Panel VAR Specification
Panel VAR
Specification

Estimation 3 Estimation
Model selection

Impulse-Response 4 Model selection


Functions

Stata Panel VAR


Estimation 5 Impulse-Response Functions
Commands

END
6 Stata Panel VAR Estimation Commands

7 END
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection

Impulse-Response
Introduction
Functions

Stata Panel VAR


Estimation
Commands

END
Motivation
Multivariate Time
Series

Firmin Doko ◦ Panel vector autoregression (VAR) models have been increasingly used in
Tchatoka
applied research
Introduction

Panel VAR
◦ Chapter will briefly discuss model selection, estimation, and inference of
Specification homogeneous panel VAR models in a generalized method of moments
Estimation (GMM) framework
Model selection

Impulse-Response ◦ Illustration with pvar package in Stata (enable easy implementation)


Functions
compared with other statistical packages that require some programming
Stata Panel VAR
Estimation dexterity
Commands

END ◦ Stata’s built-in gmm command allows for use of all available gmm
options, addition of exogenous covariates to the VAR system, subroutines
to implement Granger (1969) causality tests, and optimal moment and
model selection criteria (MMSC)– Andrews and Lu (2001, Econometrica)
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection
Panel VAR Specification
Impulse-Response
Functions

Stata Panel VAR


Estimation
Commands

END
Model specification
Multivariate Time
Series
◦ A n-variate homogeneous panel VAR of order p with panel-specific fixed
Firmin Doko effects is represented by the following system of linear equations:
Tchatoka
Yit = A1 Yi,t−1 + . . . + Ap Yi,t−p + Xit B + αi + εit ,
Introduction

Panel VAR
i ∈ {1, 2, . . . , N}, t ∈ {1, . . . .T }, (1)
Specification

Estimation

Model selection
− Yit : n × 1 vector of dependent, Xit : k × 1 vector of exogenous covariates
Impulse-Response
Functions
− The n × n matrices A1 , . . . , Ap and the n × k matrix B contain unknown
parameters to be estimated
Stata Panel VAR
Estimation
Commands
− αi and εit are n × 1 vectors of dependent variable-specific panel fixed effects
END
and idiosyncratic errors, respectively
− Assumption. E(εit ) = 0, E(εit ε′it ) = Σ > 0, and E(εit ε′is ) = 0 for all t > s.
◦ Model (1) assumes that the cross-sectional units share the same
underlying data generating process, with common reduced-form
parameters A1 , . . . , Ap and B
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection

Impulse-Response
Estimation
Functions

Stata Panel VAR


Estimation
Commands

END
GMM estimation
Multivariate Time
Series
◦ Various GMM estimators have been proposed to consistently estimate
Firmin Doko
Tchatoka the above system, especially in fixed T and large N settings.
Introduction ◦ Under the assumption that errors are serially uncorrelated, the model in
Panel VAR
Specification
first difference (FD) may be consistently estimated equation by equation
Estimation
by instrumenting lagged differences with differences and levels of Yit from
Model selection
earlier periods (Anderson-Hsiao, 1982)
Impulse-Response
Functions − This estimator, however, has some problems:
Stata Panel VAR ⋆ The FD transformation magnifies the gap in unbalanced panels
Estimation
Commands ⋆ For instance, if some Yi,t−1 are not available, then the FDs at time t and
END t − 1 are likewise missing

⋆ Also, the necessary time periods each panel is observed gets larger with the
lag order of the panel VAR. As an example, for a second-order panel
VAR, instruments in levels require that Ti ≥ 5 realizations be observed
for each subject
GMM estimation (cont’d)
Multivariate Time
Series ◦ Arellano-Bover (1995): Forward orthogonal deviation (FOD) as an
Firmin Doko alternative transformation, which does not share the weaknesses of the
Tchatoka
FD transformation
Introduction

Panel VAR
− Instead of using deviations from past realizations, it subtracts the average
Specification of all available future observations, thereby minimizing data loss:
Estimation ⋆ Because past realizations are not included in this transformation, they
Model selection remain valid instruments
Impulse-Response
Functions
⋆ Potentially, only the most recent observation is not used in estimation. In a
second-order panel VAR, for instance, only Ti ≥ 4 realizations are necessary
Stata Panel VAR
Estimation to have instruments in levels
Commands

END − We can improve efficiency by including a longer set of lags as instruments


⇒ unattractive property of reducing observations

◦ Holtz-Eakin+Newey+Rosen (1988): create instruments using available


data and substitute missing observations with zero based on the standard
assumption that the instruments are uncorrelated with the errors
GMM estimation (cont’d)
Multivariate Time
Series ◦ Holtz-Eakin+Newey+Rosen (1988): Overfitting may be an issue,
Firmin Doko especially when the time dimension is small, as the GMM estimates
Tchatoka
approach those from OLS
Introduction
◦ Roodman (2009) advocates reporting the number of instruments used and
Panel VAR
Specification checking how robust the results are to its reduction.
Estimation
− May not be an issue ln large N & large T settings: Nickell bias from OLS
Model selection
tends to zero as T → ∞ (Alvarez-Arellano 2003)
Impulse-Response
Functions ◦ Anderson-Hsiao (1982); Arellano-Bover (1995); other dynamic panel
Stata Panel VAR
Estimation
GMM estimators using similar moment restrictions (Arellano-Bond (1991),
Commands Blundell-Bond (1998)): designed for ‘small T , large N’ panels
END
− But simulations in Judson-Owen (1999) → Anderson-Hsiao &
Arellano–Bond estimators perform well even as T increases
− Alvarez-Arellano (2003) establish for the univariate first-order autoregressive
model that the GMM estimators based on orthogonal deviations are N
consistent when both N and T tend to infinity but T /N → c ∈ (0, 2].
GMM formula
Multivariate Time • Equation-by-equation GMM estimation yields consistent estimates of panel
Series
VAR but fitting the model as a system of equations may result in efficiency
Firmin Doko
Tchatoka gains (Holtz-Eakin, Newey, and Rosen 1988)
Introduction − Suppose the common set of L ≥ np + k instruments is given by the row
Panel VAR
vector Zit , Xit ∈ Zit and equations are indexed by a number in superscript
Specification
− Consider the following transformed of (1) (asterisk ≡ transformation of the
Estimation
original variable):
Model selection

Impulse-Response
Yit∗ ∗
= AỸi,t + ε∗it , (2)
Functions ∗ ∗ ∗
∗′ ∗′ ∗′ ′
Yit∗ = [yit1 , yit2 , . . . , yitn ]′ , ∗
Ỹi,t = [Yi,t−1 , Yi,t−2 , . . . , Yi,t−p , Xit∗ ]′
Stata Panel VAR
∗ ∗ ∗
Estimation
Commands ε∗it = [ε1it , ε2it , . . . , εnit ], A = [A′1 , A2 , . . . , A′p , B ′ ]′
END

• If we denote the original variable as mit , then the FD transformation implies


that mit∗ = mit − mi,t−1
p , while for the forward orthogonal deviation,
mit∗ = (mit − m̄i,t−1 ) Tit /(Tit + 1), where Tit ≡ number of available
future observations for panel i at time t; and m̄i,t−1 ≡ average of all
available future observations
GMM formula (cont’d)
Multivariate Time
Series • The GMM estimator is given by
Firmin Doko
′ ′
 = (Ỹ ∗ Z Ŵ Z ′ Ỹ ∗ )−1 Ỹ ∗ Z Ŵ Z ′ Y ∗ ,
Tchatoka
(3)
Introduction

Panel VAR where Ŵ : L × L is a weighting matrix (nonsingular, symmetric, and


Specification
positive semi-definite)
Estimation

Model selection − Assuming that E(Z ′ ε) = 0 and rank[E(Ỹ ∗ Z )] = np + k, then the GMM
Impulse-Response estimator is consistent
Functions

Stata Panel VAR


− Ŵ may be selected to maximize efficiency (Hansen, 1982)
Estimation
Commands − Joint estimation of the system of equations makes cross-equation
END hypothesis testing straightforward
− Wald tests about the parameters may be implemented based on the GMM
estimate of A and its covariance matrix. Granger causality tests, with the
hypothesis that all coefficients on the lag of variable m are jointly zero in
the equation for variable h, may likewise be carried out using this test.
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection

Impulse-Response
Model selection
Functions

Stata Panel VAR


Estimation
Commands

END
Model selection
Multivariate Time
Series
◦ Panel VAR analysis is predicated upon choosing the optimal lag order in
Firmin Doko both panel VAR specification and moment condition:
Tchatoka
− Can be done with Andrews-Lu’s (2001) MMSC for GMM models based on
Introduction
Hansen’s (1982) J-statistic of overidentifying restrictions
Panel VAR
Specification
− MMSC is analogous to various commonly used maximum likelihood-based
Estimation
model-selection criteria: the Akaike information criteria (AIC) (Akaike
Model selection 1969), the Bayesian information criteria (BIC) (Schwarz 1978; Rissanen
Impulse-Response 1978; Akaike 1977), and the Hannan–Quinn information criteria (HQIC)
Functions
(Hannan and Quinn 1979)
Stata Panel VAR
Estimation
Commands − If we apply Andrews-Lu’s (2001) MMSC to the GMM estimator in (3), their
END proposed criteria select the pair of vectors (p, q) that minimizes
MMSCBIC ,N (n, p, q) = JBIC ,N (n2 p, n2 q) − n2 (|q| − |p|)ln(N) (4)
2 2 2
MMSCAIC ,N (n, p, q) = JAIC ,N (n p, n q) − 2n (|q| − |p|) (5)
2 2 2
MMSCHQIC ,N (n, p, q) = JHQIC ,N (n p, n q) − Rn (|q| − |p|)lnln(N) (6)
R>2
Model selection– Comments
Multivariate Time
Series

Firmin Doko ◦ JN (n, p, q) ≡ J-statistic of overidentifying restriction for a n-variate panel


Tchatoka
VAR of order p and moment conditions based on q lags of the dependent
Introduction variables with sample size N
Panel VAR
Specification − By construction, MMSC are available only when q > p (overidentifying GM
Estimation models)
Model selection

Impulse-Response
− As an alternative criterion, the overall coefficient of determination (CD)
Functions may be calculated even with just-identified GMM models:
Stata Panel VAR
Estimation
det(Σ̂)
Commands
CD = 1− , (7)
END det(Ψ̂)

Ψ̂ ≡ unconstrained covariance matrix of the dependent variables


− CD captures the proportion of variation explained by the panel VAR model
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection
Impulse-Response Functions
Impulse-Response
Functions

Stata Panel VAR


Estimation
Commands

END
IRFs
Multivariate Time
Series
◦ Without loss of generality, we drop the exogenous variables in our
Firmin Doko notation and focus on the autoregressive structure of the panel VAR in (1)
Tchatoka
◦ Lütkepohl (2005) and Hamilton (1994) both show that a VAR model is
Introduction

Panel VAR
stable if all moduli of the companion matrix A are strictly less than one,
Specification where the companion matrix is formed by
Estimation

Model selection
 
A1 A2 . . . Ap−1 Ap
Impulse-Response
Functions

 In 0n ... 0n 0n 
Stata Panel VAR Ā = 
 0n In ... 0n 0n  (8)
Estimation
Commands
 .. .. .. .. .. 
 . . . . . 
END
0n 0n ... In 0n

− Stability implies that the panel VAR is invertible and has an infinite-order
vector moving average (VMA) representation
− This provides known interpretation to estimated IRFs and FEVDs
IRFs (cont’d)
Multivariate Time
Series

Firmin Doko ◦ The simple IRF Φj may be computed by rewriting the model as an infinite
Tchatoka
VMA, where Φj are the VMA parameters:
Introduction

Panel VAR
Specification In
 if j = 0
Estimation Φj = (9)
Model selection Pj

h=1 Ah Φt−h if j = 1, 2, . . .
Impulse-Response
Functions

Stata Panel VAR


Estimation
− Simple IRFs in (9) have no causal interpretation because the innovations εit
Commands are correlated contemporaneously so that a shock on one variable is likely to
END be accompanied by shocks in other variables
− Orthogonalized IRFs, Θ̃j are obtained through Cholesky decomposition, i.e.,
Θ̃j = Φj P, where P ′ P = Σ
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection

Impulse-Response
Stata Panel VAR Estimation Commands
Functions

Stata Panel VAR


Estimation
Commands

END
STATA syntax

Multivariate Time
Series ◦ Syntax: xtset your data to declare them time series
Firmin Doko
Tchatoka
− Model selection, estimation, and inference about the homogeneous panel
Introduction VAR model are implemented with the new commands: pvar, pvarsoc,
Panel VAR
pvargranger, pvarstable, pvarirf, pvarfevd
Specification

Estimation
− Syntax and outputs are closely patterned after Stata’s built-in var
Model selection
commands to easily switch between panel and time-series VAR
Impulse-Response
Functions
− pvarsoc depvarlist [if] [in][, options]
Stata Panel VAR − pvar depvarlist [if] [in][, options]
Estimation
Commands

END
◦ Options. lags(#): maximum lag order # ; exog(varlist): exogenous
covariates; fod/fd: specify how the panel-specific fixed effects will be
removed. fod (default): → panel-specific fixed effects is removed using
forward orthogonal deviation or Helmert transformation; fod:
panel-specific fixed effects is removed using first difference; and so on.
STATA syntax (cont’d)

Multivariate Time
Series
◦ Syntax
Firmin Doko
Tchatoka − pvargranger [, estimates(estname)]
Introduction − pvarstable [, estimates(estname)]
Panel VAR
Specification − pvarirf [, options]
Estimation

Model selection ◦ options. estimates(estname): requests that pvarstable use the


Impulse-Response previously obtained set of panel VAR estimates saved as estname;
Functions

Stata Panel VAR ◦ options for pvarirf. estep(#): specifies the step (forecast) horizon–
Estimation
Commands default is 10 periods; impulse(impulsevars) and
END response(responsevars): specify the impulse and response variables;
oirf: orthogonalized IRFs; dm: dynamic multipliers for exogenous
variables instead of IRFs; cumulative: cumulative IRFs– option may be
combined with oirf ; and so on.
Example 1: Panel study of income dynamics

Multivariate Time
Series
◦ Use psidextract data accessible from Stata. Replicate the reduced-form
Firmin Doko panel VAR in Holtz-Eakin, Newey, and Rosen (1988) using observations
Tchatoka
from 528 males over 1976-1982 from the Panel Study of Income and
Introduction Dynamics (PSID)
Panel VAR
Specification ◦ command/options
Estimation − webuse psidextract
Model selection
− generate lwks = ln(wks)
Impulse-Response
Functions
− pvar lwks lwage if fem == 0, lags(3)
Stata Panel VAR
Estimation
Commands ◦ Standard output table
END
− A header containing summary of GMM criterion and pvar data
− A table showing the standard Stata outputs (coefficients, standard
errors, and confidence intervals)

◦ Can do: pvargranger , pvarstable, pvarirf , pvarfevd, pvarsoc


Example 1 (cont’d): PVAR after pvarsoc

Multivariate Time
Series
◦ command
Firmin Doko
Tchatoka − pvarsoc lwks lwage if fem == 0, pvaropts(instlags(1/4))
Introduction − pvar lwks lwage if fem == 0, lags(1)
Panel VAR
Specification ◦ Can do: pvargranger , pvarstable, pvarirf , pvarfevd, pvarsoc
Estimation

Model selection
◦ Above specifications assume that all the endogenous variables are
Impulse-Response stationary– GMM estimator used in pvar suffers from weak instrument
Functions
problems when the variable being modeled is near unit root
Stata Panel VAR
Estimation
Commands − command for panel unit-root tes: xtunitroot ht lwks if fem == 0 and
END xtunitroot ht lwage if fem == 0. We that only lwage has unit root
− We mitigate this issue by using the growth rates of weeks worked, gwks,
and of wage rate, gwage, in the panel VAR
− pvar gwks gwage if fem == 0, lags(1)
Example 2: National Longitudinal Survey

Multivariate Time
Series ◦ Panel VAR models in the previous example are fit using FODs to remove
Firmin Doko the individual fixed effects. Another way to remove the FEs is to use FDs
Tchatoka
◦ Use the subsample of women aged 14–26 years in 1968 from the
Introduction
1968–1975 NLS of Youth available from Stata– Holtz-Eakin, Newey, and
Panel VAR
Specification Rosen (1988) analyzed the 1966–1975 NLS of Men
Estimation ◦ Assuming stationarity, we run first-order panel VAR models using either
Model selection the fd or the fod option and using different numbers of lags as
Impulse-Response instruments
Functions
− Present results with two lag options for each model– using one lag (that is,
Stata Panel VAR
Estimation the second in FD and the first in FOD) and using two lags (that is, lags two
Commands
and three in FD and lags one and two in FOD).
END
− Note that by construction, first differencing introduces serial correlation in
the model; thus only further lags are valid instruments
− Problem of missing observations when using longer lags as instruments may
be circumvented by using GMM-style instruments, where missing
observations are substituted with zero: Holtz-Eakin, Newey, & Rosen (1988)
Example 2 (cont’d)

Multivariate Time
Series
◦ Stata code
Firmin Doko
Tchatoka webuse nlswork2, clear
Introduction
ln−wks = ln(wks−wks )
Panel VAR
pvar ln−wks ln−wage , fd
Specification
estimates store fd2
Estimation
pvar ln−wks ln−wage , fd instlags(2/3)
Model selection
estimates store fd2t3
Impulse-Response
Functions pvar ln−wks ln−wage , fod
Stata Panel VAR estimates store fod1
Estimation
Commands pvar ln−wks ln−wage , fod instlags(1/2)
END estimates store fod1t2
estimates table fd2 fd2t3 fod1 fod1t2 , b(%3.2f) se(%3.2f) stats(N J
J−pval ) modelwidth(8)
◦ Can do: pvargranger , pvarstable, pvarirf , pvarfevd, pvarsoc
Multivariate Time
Series

Firmin Doko
Tchatoka

Introduction

Panel VAR
Specification

Estimation

Model selection

Impulse-Response
END
Functions

Stata Panel VAR


Estimation
Commands

END

You might also like