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
)

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

Value

  1. data: data.frame with endogenous variables and 'date' column.

  2. 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

  3. 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

  4. residuals: list of data.frames per horizon; data.frame of residuals

  5. structure: string denoting which structural identification strategy will be used in analysis (or NA)

  6. instrument: data.frame with 'date' column and 'instrument' column (or NULL)

  7. instrumented: string denoting which column will be instrumted in 'IV' and 'IV-short' strategies (or NA)

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:

  1. short-term impact restrictions via Cholesky decomposition, see Christiano et al (1999) for details (structure = 'short')

  2. external instrument identification, i.e. a Proxy-SVAR strategy, see Mertens and Ravn (2013) for details (structure = 'IV')

  3. 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.

References

  1. 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.

  2. Lunsford, Kurt "Identifying Structural VARs with a Proxy Variable and a Test for a Weak Proxy" 2015.

  3. Mertens, Karel and Morten Ravn "The Dynamic Effects of Personal and Corporate Income Tax Changes in the United States" 2013.

  4. Sims, Christopher "Macroeconomics and Reality" 1980.

See also

Examples

# \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
# 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) # }