compute_structural_shocks: Computes posterior draws of structural shocks

View source: R/compute_structural_shocks.R

compute_structural_shocksR Documentation

Computes posterior draws of structural shocks

Description

Each of the draws from the posterior estimation of models from packages bsvars or bsvarSIGNs is transformed into a draw from the posterior distribution of the structural shocks.

Usage

compute_structural_shocks(posterior)

Arguments

posterior

posterior estimation outcome obtained by running the estimate function. The interpretation depends on the normalisation of the shocks using function normalise(). Verify if the default settings are appropriate.

Value

An object of class PosteriorShocks, that is, an NxTxS array with attribute PosteriorShocks containing S draws of the structural shocks.

Author(s)

Tomasz Woźniak wozniak.tom@pm.me

See Also

estimate, normalise, summary

Examples

specification  = specify_bsvar$new(us_fiscal_lsuw, p = 1)
burn_in        = estimate(specification, 5)
posterior      = estimate(burn_in, 5)

# compute structural shocks
shocks         = compute_structural_shocks(posterior)

# workflow with the pipe |>
############################################################
us_fiscal_lsuw |>
  specify_bsvar$new(p = 1) |>
  estimate(S = 5) |> 
  estimate(S = 5) |> 
  compute_structural_shocks() -> ss


bsvars documentation built on Aug. 22, 2026, 5:09 p.m.