gen_mats: gen_mats function

View source: R/gen_mats.r

gen_matsR Documentation

gen_mats function

Description

this function returns the matrices necessary for forecasts

Usage

gen_mats(posterior = NULL, specification = NULL, max_cores = 1)

Arguments

posterior

Posterior estimation results (eg from BsvarSIGNs)

specification

Optional specification object (default taken from calling environment)

max_cores

maximum number of cores to use for parallel processing (default: 1 for Windows compatibility)

Value

Returns all objects necessary for scenario analysis (e.g., IRF matrix), including: M, M_inv, M_list, B, B_list, n_p, n_var, Y, X, and Z.

Examples


library(APRScenario)
data(NKdata)

# Minimal example with a toy specification
spec <- bsvarSIGNs::specify_bsvarSIGN$new(as.matrix(NKdata[,2:4]), p = 1)
est <- bsvars::estimate(spec, S = 10)  # Use small S for fast test
gen_mats(posterior = est, specification = spec)


APRScenario documentation built on Dec. 22, 2025, 1:06 a.m.