Skip to contents

Provides posterior mean, standard deviations, as well as 5 and 95 percentiles of the parameters: the structural matrix \(B\), autoregressive parameters \(A\), and hyper parameters.

Usage

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

Arguments

object

an object of class PosteriorBSVARMIX obtained using the estimate() function applied to non-normal Bayesian Structural VAR model specification set by function specify_bsvar_mix$new() containing draws from the posterior distribution of the parameters.

...

additional arguments affecting the summary produced.

Value

A list reporting the posterior mean, standard deviations, as well as 5 and 95 percentiles of the parameters: the structural matrix \(B\), autoregressive parameters \(A\), and hyper-parameters.

Author

Tomasz Woźniak wozniak.tom@pm.me

Examples

# upload data
data(us_fiscal_lsuw)

# specify the model and set seed
set.seed(123)
specification  = specify_bsvar_mix$new(us_fiscal_lsuw)
#> The identification is set to the default option of lower-triangular structural matrix.

# run the burn-in
burn_in        = estimate(specification, 10)
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#>  Gibbs sampler for the SVAR-finiteMIX model             |
#> **************************************************|
#>  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)
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#>  Gibbs sampler for the SVAR-finiteMIX model             |
#> **************************************************|
#>  Progress of the MCMC simulation for 20 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|
summary(posterior)
#>  **************************************************|
#>  bsvars: Bayesian Structural Vector Autoregressions|
#>  **************************************************|
#>    Posterior summary of the parameters             |
#>  **************************************************|
#> $B
#> $B$equation1
#>             mean          sd 5% quantile 95% quantile
#> B[1,1] 0.1449162 0.007267542   0.1332178    0.1570438
#> 
#> $B$equation2
#>             mean       sd 5% quantile 95% quantile
#> B[2,1] -8.811002 0.667645    -9.86811    -7.760265
#> B[2,2] 28.537240 2.153693    25.09124    32.001655
#> 
#> $B$equation3
#>              mean        sd 5% quantile 95% quantile
#> B[3,1] -24.690383 1.8342985  -26.610586   -21.458429
#> B[3,2]  -7.327384 0.9657082   -9.080312    -5.999524
#> B[3,3]  40.788738 2.9525925   35.306957    44.475450
#> 
#> 
#> $A
#> $A$equation1
#>                  mean         sd 5% quantile 95% quantile
#> lag1_var1  1.24723723 0.02141285   1.2095415   1.27167157
#> lag1_var2 -0.08246796 0.01946051  -0.1183488  -0.06319558
#> lag1_var3 -1.13138785 0.02980704  -1.1605588  -1.08368406
#> const     -0.26567963 0.17096640  -0.6224231  -0.12523768
#> 
#> $A$equation2
#>                  mean         sd 5% quantile 95% quantile
#> lag1_var1  0.06527148 0.01336794  0.04742533   0.08510973
#> lag1_var2  0.94069406 0.01154040  0.91688973   0.95407024
#> lag1_var3 -0.33045704 0.01847202 -0.36086491  -0.31071541
#> const     -0.38216543 0.10583374 -0.62261447  -0.28211094
#> 
#> $A$equation3
#>                  mean         sd 5% quantile  95% quantile
#> lag1_var1  0.18450003 0.01186940  0.16856667  0.2015697401
#> lag1_var2 -0.04881106 0.01253461 -0.07107985 -0.0348609222
#> lag1_var3  0.22501189 0.01695013  0.20250675  0.2469733430
#> const     -0.12510036 0.11223426 -0.33737876  0.0006134041
#> 
#> 
#> $hyper
#> $hyper$B
#>                            mean        sd 5% quantile 95% quantile
#> B[1,]_shrinkage        306.7015  351.2104    50.54474     839.8371
#> B[2,]_shrinkage        410.9587  346.0439   101.99288     997.1704
#> B[3,]_shrinkage        449.0158  238.1776   206.51944     755.1564
#> B[1,]_shrinkage_scale 2423.2192 2126.3985   596.89629    6679.3929
#> B[2,]_shrinkage_scale 2878.5042 2747.6859   606.11469    8372.1182
#> B[3,]_shrinkage_scale 2561.5384 1824.8129   959.14927    6818.2078
#> B_global_scale         242.7689  201.3279    68.82274     661.8064
#> 
#> $hyper$A
#>                            mean        sd 5% quantile 95% quantile
#> A[1,]_shrinkage       0.9376393 0.5131084   0.3834680     1.756917
#> A[2,]_shrinkage       0.5714414 0.2891398   0.2821778     1.147262
#> A[3,]_shrinkage       0.8381269 0.5843654   0.4141772     1.779891
#> A[1,]_shrinkage_scale 9.3859226 3.9571496   4.6932003    16.244926
#> A[2,]_shrinkage_scale 6.7373966 1.5709598   4.3621147     9.249969
#> A[3,]_shrinkage_scale 9.6816221 3.6609981   6.1683380    17.267315
#> A_global_scale        1.0246142 0.3259178   0.6207570     1.517074
#> 
#> 

# workflow with the pipe |>
############################################################
set.seed(123)
us_fiscal_lsuw |>
  specify_bsvar_mix$new() |>
  estimate(S = 10) |> 
  estimate(S = 20) |> 
  summary()
#> The identification is set to the default option of lower-triangular structural matrix.
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#>  Gibbs sampler for the SVAR-finiteMIX model             |
#> **************************************************|
#>  Progress of the MCMC simulation for 10 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#>  Gibbs sampler for the SVAR-finiteMIX model             |
#> **************************************************|
#>  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 summary of the parameters             |
#>  **************************************************|
#> $B
#> $B$equation1
#>             mean          sd 5% quantile 95% quantile
#> B[1,1] 0.1449162 0.007267542   0.1332178    0.1570438
#> 
#> $B$equation2
#>             mean       sd 5% quantile 95% quantile
#> B[2,1] -8.811002 0.667645    -9.86811    -7.760265
#> B[2,2] 28.537240 2.153693    25.09124    32.001655
#> 
#> $B$equation3
#>              mean        sd 5% quantile 95% quantile
#> B[3,1] -24.690383 1.8342985  -26.610586   -21.458429
#> B[3,2]  -7.327384 0.9657082   -9.080312    -5.999524
#> B[3,3]  40.788738 2.9525925   35.306957    44.475450
#> 
#> 
#> $A
#> $A$equation1
#>                  mean         sd 5% quantile 95% quantile
#> lag1_var1  1.24723723 0.02141285   1.2095415   1.27167157
#> lag1_var2 -0.08246796 0.01946051  -0.1183488  -0.06319558
#> lag1_var3 -1.13138785 0.02980704  -1.1605588  -1.08368406
#> const     -0.26567963 0.17096640  -0.6224231  -0.12523768
#> 
#> $A$equation2
#>                  mean         sd 5% quantile 95% quantile
#> lag1_var1  0.06527148 0.01336794  0.04742533   0.08510973
#> lag1_var2  0.94069406 0.01154040  0.91688973   0.95407024
#> lag1_var3 -0.33045704 0.01847202 -0.36086491  -0.31071541
#> const     -0.38216543 0.10583374 -0.62261447  -0.28211094
#> 
#> $A$equation3
#>                  mean         sd 5% quantile  95% quantile
#> lag1_var1  0.18450003 0.01186940  0.16856667  0.2015697401
#> lag1_var2 -0.04881106 0.01253461 -0.07107985 -0.0348609222
#> lag1_var3  0.22501189 0.01695013  0.20250675  0.2469733430
#> const     -0.12510036 0.11223426 -0.33737876  0.0006134041
#> 
#> 
#> $hyper
#> $hyper$B
#>                            mean        sd 5% quantile 95% quantile
#> B[1,]_shrinkage        306.7015  351.2104    50.54474     839.8371
#> B[2,]_shrinkage        410.9587  346.0439   101.99288     997.1704
#> B[3,]_shrinkage        449.0158  238.1776   206.51944     755.1564
#> B[1,]_shrinkage_scale 2423.2192 2126.3985   596.89629    6679.3929
#> B[2,]_shrinkage_scale 2878.5042 2747.6859   606.11469    8372.1182
#> B[3,]_shrinkage_scale 2561.5384 1824.8129   959.14927    6818.2078
#> B_global_scale         242.7689  201.3279    68.82274     661.8064
#> 
#> $hyper$A
#>                            mean        sd 5% quantile 95% quantile
#> A[1,]_shrinkage       0.9376393 0.5131084   0.3834680     1.756917
#> A[2,]_shrinkage       0.5714414 0.2891398   0.2821778     1.147262
#> A[3,]_shrinkage       0.8381269 0.5843654   0.4141772     1.779891
#> A[1,]_shrinkage_scale 9.3859226 3.9571496   4.6932003    16.244926
#> A[2,]_shrinkage_scale 6.7373966 1.5709598   4.3621147     9.249969
#> A[3,]_shrinkage_scale 9.6816221 3.6609981   6.1683380    17.267315
#> A_global_scale        1.0246142 0.3259178   0.6207570     1.517074
#> 
#>