VAR {sovereign} | R Documentation |
Estimate VAR, SVAR, or Proxy-SVAR
Description
Estimate VAR, SVAR, or Proxy-SVAR
Usage
VAR(
data,
horizon = 10,
freq = "month",
type = "const",
p = 1,
lag.ic = NULL,
lag.max = NULL,
structure = "short",
instrument = NULL,
instrumented = NULL
)
Arguments
data |
data.frame, matrix, ts, xts, zoo: Endogenous regressors |
horizon |
int: forecast horizons |
freq |
string: frequency of data ('day', 'week', 'month', 'quarter', or 'year') |
type |
string: type of deterministic terms to add ('none', 'const', 'trend', or 'both') |
p |
int: lags |
lag.ic |
string: information criterion to choose the optimal number of lags ('AIC' or 'BIC') |
lag.max |
int: maximum number of lags to test in lag selection |
structure |
string: type of structural identification strategy to use in model analysis (NA, 'short', 'IV', or 'IV-short') |
instrument |
string: name of instrumental variable contained in the data matrix |
instrumented |
string: name of variable to be instrumented in IV and IV-short procedure; default is the first non-date variable in data |
Details
See Sims (1980) for details regarding the baseline vector-autoregression (VAR) model. The VAR may be augmented to become a structural VAR (SVAR) with one of three different structural identification strategies:
short-term impact restrictions via Cholesky decomposition, see Christiano et al (1999) for details (structure = 'short')
external instrument identification, i.e. a Proxy-SVAR strategy, see Mertens and Ravn (2013) for details (structure = 'IV')
or a combination of short-term and IV identification via Lunsford (2015) (structure = 'IV-short')
Note that including structure does not change the estimation of model coefficients or forecasts, but does change impulse response functions, forecast error variance decomposition, and historical decompositions. Historical decompositions will not be available for models using the 'IV' structure. Additionally note that only one instrument may be used in this estimation routine.
Value
data: data.frame with endogenous variables and 'date' column.
model: list with data.frame of model coefficients (in psuedo-companion form), data.frame of coefficient standard errors, integer of lags p, integer of horizons, string of frequency, string of deterministic term type, numeric of log-likelihood
forecasts: list of data.frames per horizon; data.frame with column for date (day the forecast was made), forecast.date (the date being forecasted), target (variable forecasted), and forecast
residuals: list of data.frames per horizon; data.frame of residuals
structure: string denoting which structural identification strategy will be used in analysis (or NA)
instrument: data.frame with 'date' column and 'instrument' column (or NULL)
instrumented: string denoting which column will be instrumted in 'IV' and 'IV-short' strategies (or NA)
References
Christiano, Lawrence, Martin Eichenbaum, and Charles Evans "Monetary policy shocks: What have we learned and to what end?" Handbook of Macroeconomics, Vol 1, Part A, 1999.
Lunsford, Kurt "Identifying Structural VARs with a Proxy Variable and a Test for a Weak Proxy" 2015.
Mertens, Karel and Morten Ravn "The Dynamic Effects of Personal and Corporate Income Tax Changes in the United States" 2013.
Sims, Christopher "Macroeconomics and Reality" 1980.
See Also
Examples
# simple time series
AA = c(1:100) + rnorm(100)
BB = c(1:100) + rnorm(100)
CC = AA + BB + rnorm(100)
date = seq.Date(from = as.Date('2000-01-01'), by = 'month', length.out = 100)
Data = data.frame(date = date, AA, BB, CC)
# estimate VAR
var =
sovereign::VAR(
data = Data,
horizon = 10,
freq = 'month',
lag.ic = 'BIC',
lag.max = 4)
# impulse response functions
var.irf = sovereign::var_irf(var)
# forecast error variance decomposition
var.fevd = sovereign::var_fevd(var)
# historical shock decomposition
var.hd = sovereign::var_hd(var)