Skip to contents

Provides posterior means of the forecast error variance decompositions of each variable at all horizons.

Usage

# S3 method for class 'PosteriorFEVDPANEL'
summary(object, which_c, ...)

Arguments

object

an object of class PosteriorFEVDPANEL obtained using the compute_variance_decompositions() function containing draws from the posterior distribution of the forecast error variance decompositions.

which_c

a positive integer or a character string specifying the country for which the forecast should be plotted.

...

additional arguments affecting the summary produced.

Value

A list reporting the posterior mean of the forecast error variance decompositions of each variable at all horizons.

Author

Tomasz Woźniak wozniak.tom@pm.me

Examples

# specify the model and set seed
specification  = specify_bvarPANEL$new(ilo_dynamic_panel, p = 1)

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

# estimate the model
posterior      = estimate(burn_in, 20)
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs      |
#> **************************************************|
#>  Progress of the MCMC simulation for 20 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)
summary(fevd, which_c = "POL")
#>  **************************************************|
#>  bsvars: Bayesian Structural Vector Autoregressions|
#>  **************************************************|
#>    Posterior means of forecast error               |
#>      variance decompositions                       |
#>  **************************************************|
#> $variable1
#>      shock1     shock2    shock3     shock4
#> 0 100.00000 0.00000000 0.0000000 0.00000000
#> 1  99.79993 0.03210705 0.1028280 0.06513631
#> 2  99.45773 0.08686033 0.2783946 0.17701898
#> 3  99.04161 0.15331417 0.4915882 0.31349043
#> 4  98.58972 0.22539280 0.7228407 0.46204241
#> 
#> $variable2
#>     shock1    shock2   shock3   shock4
#> 0 99.73065 0.2693518  0.00000  0.00000
#> 1 55.29319 7.2341947 23.03395 14.43866
#> 2 54.62936 7.2856680 23.36082 14.72415
#> 3 55.31070 7.1505908 22.98098 14.55773
#> 4 56.52390 6.9496573 22.33989 14.18656
#> 
#> $variable3
#>     shock1   shock2   shock3   shock4
#> 0 81.84026 3.407535 14.75220  0.00000
#> 1 62.38075 6.078133 19.37605 12.16507
#> 2 60.18669 6.436276 20.52465 12.85238
#> 3 60.82342 6.333447 20.18305 12.66008
#> 4 62.04571 6.134445 19.54332 12.27652
#> 
#> $variable4
#>     shock1    shock2   shock3   shock4
#> 0 17.93212 12.108468 39.30618 30.65323
#> 1 29.75670 10.571473 34.09986 25.57197
#> 2 38.29078  9.401316 30.22552 22.08238
#> 3 46.22176  8.266550 26.52685 18.98484
#> 4 52.77477  7.316060 23.45140 16.45777
#> 

# workflow with the pipe |>
############################################################
ilo_dynamic_panel |>
  specify_bvarPANEL$new(p = 1) |>
  estimate(S = 10) |> 
  estimate(S = 20) |> 
  compute_variance_decompositions(horizon = 4) |> 
  summary(which_c = "COL")
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs      |
#> **************************************************|
#>  Progress of the MCMC simulation for 10 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs      |
#> **************************************************|
#>  Progress of the MCMC simulation for 20 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|
#>  **************************************************|
#>  bsvars: Bayesian Structural Vector Autoregressions|
#>  **************************************************|
#>    Posterior means of forecast error               |
#>      variance decompositions                       |
#>  **************************************************|
#> $variable1
#>      shock1    shock2    shock3   shock4
#> 0 100.00000 0.0000000 0.0000000 0.000000
#> 1  98.64342 0.2928631 0.6244213 0.439293
#> 2  97.43743 0.5534665 1.1796192 0.829489
#> 3  96.57303 0.7402989 1.5775927 1.109082
#> 4  95.96785 0.8710975 1.8562204 1.304832
#> 
#> $variable2
#>     shock1      shock2   shock3   shock4
#> 0 99.94804  0.05195506  0.00000  0.00000
#> 1 58.72581  9.06306030 18.91455 13.29658
#> 2 52.62106 10.41311717 21.72269 15.24314
#> 3 49.63837 11.06163832 23.09223 16.20776
#> 4 48.41385 11.31226572 23.65970 16.61419
#> 
#> $variable3
#>     shock1    shock2   shock3   shock4
#> 0 81.41116  6.027111 12.56173  0.00000
#> 1 42.50298 12.558327 26.66844 18.27025
#> 2 40.67584 12.905261 27.42690 18.99199
#> 3 40.45484 12.940235 27.50255 19.10237
#> 4 41.69952 12.704722 26.95453 18.64123
#> 
#> $variable4
#>     shock1   shock2   shock3   shock4
#> 0 16.11723 16.77777 37.64082 29.46418
#> 1 38.43299 13.09103 28.12480 20.35118
#> 2 40.93690 12.76450 27.11311 19.18550
#> 3 41.20593 12.82933 27.06475 18.89999
#> 4 40.19174 13.11694 27.57566 19.11566
#>