covid_volatility_correction {sovereign} | R Documentation |
Lenza-Primiceri Covid Shock Correction
Description
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.
Usage
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
# 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)
# correct VAR for COVID shock
var = sovereign::covid_volatility_correction(var)
# 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)
[Package sovereign version 1.2.1 Index]