Implement the deterministic volatility correction method of Lenza, Michele and Giorgio Primiceri "How to Estimate a VAR after March 2020" (2020) [NBER Working Paper]. Correction factors are estimated via maximum likelihood.

covid_volatility_correction(var, theta_initial = c(5, 2, 1.5, 0.8))

Arguments

var

VAR object

theta_initial

double: four element vector with scaling parameters, theta in Lenza and Primiceri (2020)

Value

var object

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('2018-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)
#> Error in n.lag(., lags = p): could not find function "n.lag"
# correct VAR for COVID shock var = sovereign::covid_volatility_correction(var)
#> Error in var$model: object of type 'closure' is not subsettable
# impulse response functions var.irf = sovereign::var_irf(var)
#> Error in var$model: object of type 'closure' is not subsettable
# forecast error variance decomposition var.fevd = sovereign::var_fevd(var)
#> Error in var$model: object of type 'closure' is not subsettable
# historical shock decomposition var.hd = sovereign::var_hd(var)
#> Error in var$model: object of type 'closure' is not subsettable
# }