
Provides posterior summary of forecast error variance decompositions
Source:R/summary.R
summary.PosteriorFEVDPANEL.Rd
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 thecompute_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.0000000 0.000000 0.0000000
#> 1 97.03697 0.4847088 1.518522 0.9597987
#> 2 95.34517 0.7584265 2.376438 1.5199707
#> 3 93.78743 1.0088876 3.161608 2.0420739
#> 4 92.31474 1.2451095 3.902111 2.5380447
#>
#> $variable2
#> shock1 shock2 shock3 shock4
#> 0 99.62378 0.3762223 0.00000 0.00000
#> 1 20.11515 13.1705702 40.22715 26.48714
#> 2 13.94443 14.0925667 43.38606 28.57695
#> 3 12.22324 14.3335555 44.28138 29.16182
#> 4 11.76080 14.3897993 44.53373 29.31567
#>
#> $variable3
#> shock1 shock2 shock3 shock4
#> 0 72.69945 5.778323 21.52223 0.00000
#> 1 18.35542 12.990360 40.35848 28.29573
#> 2 16.99441 13.272942 41.30213 28.43051
#> 3 17.20748 13.270424 41.32048 28.20162
#> 4 17.74561 13.204232 41.12573 27.92442
#>
#> $variable4
#> shock1 shock2 shock3 shock4
#> 0 9.837151 13.06493 42.56752 34.53039
#> 1 8.468550 14.02433 44.70647 32.80065
#> 2 9.186762 14.12269 44.75037 31.94018
#> 3 10.128953 14.08463 44.48723 31.29919
#> 4 11.204239 13.98473 44.07982 30.73122
#>
# 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.0000000
#> 1 98.23948 0.3828597 0.8108574 0.5668059
#> 2 96.76259 0.7035535 1.4913491 1.0425121
#> 3 95.68187 0.9376651 1.9894352 1.3910265
#> 4 94.87884 1.1112533 2.3596306 1.6502763
#>
#> $variable2
#> shock1 shock2 shock3 shock4
#> 0 99.93969 0.06030879 0.00000 0.00000
#> 1 40.74977 12.64693914 27.31852 19.28477
#> 2 38.78921 13.08694286 28.19233 19.93152
#> 3 40.90847 12.64698629 27.19935 19.24520
#> 4 42.45663 12.33603851 26.47708 18.73025
#>
#> $variable3
#> shock1 shock2 shock3 shock4
#> 0 79.46871 6.570957 13.96034 0.00000
#> 1 46.15127 11.762589 24.91799 17.16815
#> 2 45.84653 11.810928 25.02799 17.31455
#> 3 45.51779 11.877298 25.17183 17.43308
#> 4 44.82050 12.030185 25.49367 17.65565
#>
#> $variable4
#> shock1 shock2 shock3 shock4
#> 0 16.07694 16.81985 37.54500 29.55821
#> 1 40.04925 12.85326 27.42159 19.67590
#> 2 39.90001 13.10298 27.65480 19.34221
#> 3 37.75721 13.64237 28.69637 19.90405
#> 4 36.68252 13.90623 29.20914 20.20211
#>