Estimate VAR, SVAR, or Proxy-SVAR
VAR( data, horizon = 10, freq = "month", type = "const", p = 1, lag.ic = NULL, lag.max = NULL, structure = "short", instrument = NULL, instrumented = NULL )
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 |
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)
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.
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.
# \donttest{ # 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)#> Warning: NAs introduced by coercion#> Warning: NAs introduced by coercion#> Warning: NAs introduced by coercion#> Warning: NAs introduced by coercion