compute_historical_decompositions.PosteriorBSVARSIGN {bsvarSIGNs} | R Documentation |
Computes posterior draws of historical decompositions
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 historical decompositions. IMPORTANT! The historical decompositions are interpreted correctly for covariance stationary data. Application to unit-root non-stationary data might result in non-interpretable outcomes.
Usage
## S3 method for class 'PosteriorBSVARSIGN'
compute_historical_decompositions(posterior, show_progress = TRUE)
Arguments
posterior |
posterior estimation outcome - an object of class
|
show_progress |
a logical value, if |
Value
An object of class PosteriorHD
, that is, an NxNxTxS
array
with attribute PosteriorHD
containing S
draws of the historical
decompositions.
Author(s)
Xiaolei Wang adamwang15@gmail.com and Tomasz Woźniak wozniak.tom@pm.me
References
Kilian, L., & Lütkepohl, H. (2017). Structural VAR Tools, Chapter 4, In: Structural vector autoregressive analysis. Cambridge University Press.
See Also
estimate.BSVARSIGN
, summary
, plot
Examples
# upload data
data(optimism)
# specify the model and set seed
set.seed(123)
# + no effect on productivity (zero restriction)
# + positive effect on stock prices (positive sign restriction)
sign_irf = matrix(c(0, 1, rep(NA, 23)), 5, 5)
specification = specify_bsvarSIGN$new(optimism, sign_irf = sign_irf)
# estimate the model
posterior = estimate(specification, 10)
# compute historical decompositions
hd = compute_historical_decompositions(posterior)
# workflow with the pipe |>
############################################################
set.seed(123)
optimism |>
specify_bsvarSIGN$new(sign_irf = sign_irf) |>
estimate(S = 10) |>
compute_historical_decompositions() -> hd