Skip to contents

For each country, each of the draws from the posterior estimation of the model is transformed into a draw from the posterior distribution of the forecast error variance decomposition.

Usage

# S3 method for class 'PosteriorBVARs'
compute_variance_decompositions(posterior, horizon)

Arguments

posterior

posterior estimation outcome - an object of class PosteriorBVARs obtained by running the estimate function.

horizon

a positive integer number denoting the forecast horizon for the forecast error variance decompositions.

Value

An object of class PosteriorFEVDPANEL, that is, a list with C elements containing NxNx(horizon+1)xS arrays of class PosteriorFEVD with S draws of country-specific forecast error variance decompositions.

References

Lütkepohl, H. (2017). Structural VAR Tools, Chapter 4, In: Structural vector autoregressive analysis. Cambridge University Press.

Author

Tomasz Woźniak wozniak.tom@pm.me

Examples

# specify the model and set seed
specification  = specify_bvars$new(ilo_dynamic_panel[1:5]) # specify the model

# run the burn-in
burn_in        = estimate(specification, 5)
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs      |
#> **************************************************|
#>  Progress of the MCMC simulation for 5 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|

# estimate the model
posterior      = estimate(burn_in, 5)
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs      |
#> **************************************************|
#>  Progress of the MCMC simulation for 5 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|

# compute forecast error variance decomposition 4 years ahead
fevd           = compute_variance_decompositions(posterior, horizon = 4)