R6 class representing draws from the predictive density of a Bayesian Structural Vector Autoregression model.
Details
The class contains the following objects:
forecastsAn
N x horizon x Sarray containing draws from the predictive density.forecast_meanAn
N x horizon x Sarray containing the conditional means of the predictive density.forecast_covarianceAn
N x N x horizon x Sarray containing the conditional covariance matrices of the predictive density.YAn
N x Tmatrix containing the data on the dependent variables used for estimation.
The method as_list() returns the contents of the Forecasts
object as a list.
Public fields
forecastsAn
N x horizon x Snumeric array containing draws from the predictive density.forecast_meanAn
N x horizon x Snumeric array containing the conditional means of the predictive density.forecast_covarianceAn
N x N x horizon x Snumeric array containing the conditional covariance matrices of the predictive density.YAn
N x Tnumeric matrix containing the data on the dependent variables used for estimation.
Methods
Forecasts$new()
Creates a new Forecasts object from the output of the forecasting
procedure.
Examples
spec = specify_bsvar$new(us_fiscal_lsuw)
#> The identification is set to the default option of lower-triangular structural matrix.
burn = estimate(spec, 5)
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#> Gibbs sampler for the SVAR model |
#> **************************************************|
#> Progress of the MCMC simulation for 5 draws
#> Every draw is saved via MCMC thinning
#> Press Esc to interrupt the computations
#> **************************************************|
post = estimate(burn, 5)
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#> Gibbs sampler for the SVAR model |
#> **************************************************|
#> Progress of the MCMC simulation for 5 draws
#> Every draw is saved via MCMC thinning
#> Press Esc to interrupt the computations
#> **************************************************|
fore = forecast(post, 4)
apply(fore$forecasts, 1:2, mean) # compute mean forecasts
#> [,1] [,2] [,3] [,4]
#> [1,] -8.888228 -8.932025 -8.956138 -8.960784
#> [2,] -9.705272 -9.521921 -9.485589 -9.430052
#> [3,] -7.081218 -7.174442 -7.199131 -7.224809
