
Provides posterior summary of country-specific Forecasts
Source:R/summary.R
summary.ForecastsPANEL.Rd
Provides posterior summary of the forecasts including their mean, standard deviations, as well as 5 and 95 percentiles.
Usage
# S3 method for class 'ForecastsPANEL'
summary(object, which_c, ...)
Arguments
- object
an object of class
ForecastsPANEL
obtained using theforecast()
function containing draws the predictive density.- 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, standard deviations, as well as 5 and 95 percentiles of the forecasts for each of the variables and forecast horizons.
Author
Tomasz Woźniak wozniak.tom@pm.me
Examples
# specify the model
specification = specify_bvarPANEL$new(
ilo_dynamic_panel,
exogenous = ilo_exogenous_variables)
burn_in = estimate(specification, 10) # run the burn-in
#> **************************************************|
#> 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
#> **************************************************|
posterior = estimate(burn_in, 10) # estimate the model
#> **************************************************|
#> 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
#> **************************************************|
# forecast 6 years ahead
predictive = forecast(
posterior,
5,
exogenous_forecast = ilo_exogenous_forecasts)
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs |
#> **************************************************|
#> Progress of sampling 10 draws from
#> the predictive density for 189 countries
#> Press Esc to interrupt the computations
#> **************************************************|
summary(predictive, which_c = "POL")
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#> Posterior summary of forecasts |
#> **************************************************|
#> $variable1
#> mean sd 5% quantile 95% quantile
#> 1 27.23526 0.01765706 27.21149 27.26160
#> 2 27.25520 0.03355331 27.21019 27.29431
#> 3 27.28259 0.03841605 27.23807 27.33743
#> 4 27.30341 0.04774847 27.24788 27.36275
#> 5 27.32025 0.05311183 27.25015 27.38142
#>
#> $variable2
#> mean sd 5% quantile 95% quantile
#> 1 2.935940 1.935211 0.3069085 5.592461
#> 2 3.508744 3.669288 -1.1016958 8.114505
#> 3 3.562780 3.472347 -1.8308395 7.426665
#> 4 4.044392 3.357040 -0.9912429 8.414191
#> 5 4.158390 3.546699 -0.7080652 9.120057
#>
#> $variable3
#> mean sd 5% quantile 95% quantile
#> 1 56.89141 0.910773 55.59045 57.91899
#> 2 56.61765 1.713509 54.43775 58.68358
#> 3 56.47884 1.752389 54.31187 58.91346
#> 4 56.23710 1.925526 53.65835 58.79852
#> 5 56.21405 2.141917 53.17912 58.99277
#>
#> $variable4
#> mean sd 5% quantile 95% quantile
#> 1 58.61335 0.3863732 58.03485 59.05772
#> 2 58.68542 0.6505752 57.81035 59.64509
#> 3 58.57302 0.7368109 57.76759 59.62746
#> 4 58.60957 0.8799574 57.46751 59.62418
#> 5 58.65753 0.8040811 57.37326 59.65575
#>
# workflow with the pipe |>
############################################################
ilo_dynamic_panel |>
specify_bvarPANEL$new() |>
estimate(S = 10) |>
estimate(S = 20) |>
forecast(horizon = 5, exogenous_forecast = ilo_exogenous_forecasts) |>
summary(which_c = "POL")
#> **************************************************|
#> 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
#> **************************************************|
#> **************************************************|
#> bpvars: Forecasting with Bayesian Panel VARs |
#> **************************************************|
#> Progress of sampling 20 draws from
#> the predictive density for 189 countries
#> Press Esc to interrupt the computations
#> **************************************************|
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#> Posterior summary of forecasts |
#> **************************************************|
#> $variable1
#> mean sd 5% quantile 95% quantile
#> 1 27.24376 0.02425341 27.21596 27.28908
#> 2 27.27268 0.03884231 27.21937 27.34028
#> 3 27.30357 0.05159511 27.22597 27.38782
#> 4 27.33591 0.06178842 27.25865 27.43235
#> 5 27.36122 0.06291402 27.28317 27.46765
#>
#> $variable2
#> mean sd 5% quantile 95% quantile
#> 1 2.981215 1.660503 1.2447601 5.669062
#> 2 2.983305 2.689008 0.1378545 7.432309
#> 3 3.139564 2.343151 0.7367719 7.034533
#> 4 2.896960 3.145941 -0.8026929 8.428901
#> 5 3.260810 3.876841 -0.9991839 8.698804
#>
#> $variable3
#> mean sd 5% quantile 95% quantile
#> 1 57.02694 0.8853717 55.77246 58.22089
#> 2 57.09913 1.4835397 54.91607 58.64706
#> 3 57.15472 1.2548057 55.29637 58.60185
#> 4 57.34543 1.6130461 55.09063 59.53814
#> 5 57.24610 1.9411444 54.07534 59.90406
#>
#> $variable4
#> mean sd 5% quantile 95% quantile
#> 1 58.79368 0.4577458 58.30155 59.55146
#> 2 58.88317 0.7088804 57.74656 59.89343
#> 3 59.04071 0.8203358 57.65844 60.13711
#> 4 59.09418 0.9930882 56.95650 60.34998
#> 5 59.21184 1.0078881 57.46338 60.19090
#>