bv_fcast {BVAR} | R Documentation |
Provide forecast settings to predict.bvar
. Allows adjusting
the horizon of forecasts, and for setting up conditional forecasts. See the
Details section for further information.
bv_fcast(horizon = 12, cond_path = NULL, cond_vars = NULL)
horizon |
Integer scalar. Horizon for which to compute forecasts. |
cond_path |
Optional numeric vector or matrix used for conditional
forecasts. Supply variable path(s) on which forecasts are conditioned on.
Unrestricted future realisations should be filled with |
cond_vars |
Optional character or numeric vector. Used to subset cond_path to specific variable(s) via name or position. Not needed when cond_path is constructed for all variables. |
Conditional forecasts are calculated using the algorithm by Waggoner and Zha (1999). They are set up by imposing a path on selected variables.
Returns a named list of class bv_fcast
with options for
bvar
or predict.bvar
.
Waggoner, D. F., & Zha, T. (1999). Conditional Forecasts in Dynamic Multivariate Models. Review of Economics and Statistics, 81:4, 639-651, https://doi.org/10.1162/003465399558508.
# Set forecast-horizon to 20 time periods for unconditional forecasts bv_fcast(horizon = 20) # Define a path for the second variable (in the initial six periods). bv_fcast(cond_path = c(1, 1, 1, 1, 1, 1), cond_var = 2) # Constrain the paths of the first and third variables. paths <- matrix(NA, nrow = 10, ncol = 2) paths[1:5, 1] <- 1 paths[1:10, 2] <- 2 bv_fcast(cond_path = paths, cond_var = c(1, 3))