# NOT RUN {
# 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 function
var.irf = sovereign::IRF(var)
# local projection forecasts
lp =
sovereign::LP(
data = Data,
horizon = c(1:10),
lag.ic = 'AIC',
lag.max = 4,
type = 'both',
freq = 'month')
# LP impulse response function
lp.irf = sovereign::IRF(lp)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab