this is my first time working with R and utilizing bootstrapped CIs. My project entails plotting IRFs for an interest rate differential(Norwegian interbank versus Eurozone interbank rate), the price of brent oil in Euros, and the Norwegian krone to EUR exchange rate.
I have identified the structural shocks via an unconditional, variance-regime switching technique as developed by Rigobon (2003). I have achieved estimates, but currently, one of the IRFs, the oil shock on the EUR/NOK exchange rate, has a confidence interval not covering the IRF. I have followed the r package SVARs which recommended the wild bootstrap. I then also tried the bias correction procedure, but this does not really change the results. Any tips on how to fix this?
Kind regards,
Elias
Picture:current IRFS
Code:
##############################grabbing data and #####making timeseries
selectedcolumns <- merged %>%
select(date, diffbrentineur,diffeurinnok, diffintdiff)
subset2015 <- selectedcolumns[-(1:4747),]
row.names(subset2015) <- NULL
ts2015 <- ts(subset2015[, -1], start = c(2015, as.numeric(format(subset2015$date[1], "%j"))), frequency = 365.25)
#################################################################################testing lags
optimal_lag <- VARselect(ts2015, lag.max = 30, type = "const")
print(optimal_lag)
######################################### svar #############estimated with restrictions
plainvar <- vars::VAR(ts2015, p = 3, type = 'const')
B_matrix <- matrix(c(NA,NA,NA,
NA,NA,NA,
NA,NA,NA),
nrow = 3, byrow = TRUE)
restrictedsvar <-id.cv(plainvar, SB=c(2022,1),restriction_matrix=B_matrix)
summary(restrictedsvar)
irfrestricted <- vars::irf(restrictedsvar)
plot(irfrestricted,n.ahead=10)
########################################################bootstrapping
cores <- parallel::detectCores() - 1
set.seed(231)
restrictedboot <- wild.boot(restrictedsvar, design = "fixed", distr="gaussian",nboot = 500, n.ahead = 10, nc = cores)
bb2 <- ba.boot(restrictedboot, nc=1)
plot(bb2, lowerq = 0.16, upperq = 0.84)
Including the the bias correction ba.boot function and also trying an mb.boot function instead of wild.boot did not change much.
Elias is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.