| scenarios | R Documentation |
scenarios function (fully optimized with Rcpp) This function computes the mean and covariances to draw from the conditional forecast The actual draw is done in the simscen function
scenarios(
h = 3,
path = NULL,
obs = NULL,
free_shocks = NULL,
n_sample = NULL,
data_ = NULL,
g = NULL,
Sigma_g = NULL,
posterior = NULL,
matrices = NULL
)
h |
forecast horizon |
path |
conditional path of observables |
obs |
position of observable(s) |
free_shocks |
position of non-driving shocks (NA if all driving) |
n_sample |
Number of draws to sample (<= n_draws) |
data_ |
Optional matrix of data (default taken from matrices$Z). Note: the last observation in data_ is used as the starting point; it should not overlap with the scenario forecasting period. |
g |
Optional matrix of non-driving shocks |
Sigma_g |
Optional covariance matrix of non-driving shocks |
posterior |
Optional posterior object (default taken from calling environment) |
matrices |
Optional matrices object from gen_mats() (default taken from calling environment) |
list of mu_eps, Sigma_eps, mu_y, Sigma_y, big_b, big_M, draws_used
library(APRScenario)
data(NKdata)
# Minimal example with a toy specification
spec <- bsvarSIGNs::specify_bsvarSIGN$new(as.matrix(NKdata[,2:4]), p = 1)
posterior <- bsvars::estimate(spec, S = 10) # Use small S for fast test
matrices<-gen_mats(posterior = posterior, specification = spec)
# and having posterior object
scenario_result <- scenarios(h = 2,
path = c(1.0, 1.1),
obs = 1,
free_shocks = NA,
posterior = posterior,
matrices = matrices)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.