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 'PosteriorBSVAR'
summary(object, ...)

Arguments

object

an object of class PosteriorBSVAR obtained using the estimate() function applied to homoskedastic Bayesian Structural VAR model specification set by function specify_bsvar$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$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 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 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] 35.32538 1.947888    33.09898     38.70744
#> 
#> $B$equation2
#>               mean       sd 5% quantile 95% quantile
#> B[2,1] -0.05852654 2.843507   -3.726388     3.690433
#> B[2,2] 38.94786643 1.660281   36.734287    41.535125
#> 
#> $B$equation3
#>               mean       sd 5% quantile 95% quantile
#> B[3,1] -14.5480841 2.261452  -17.895784   -11.699688
#> B[3,2]   0.1312712 2.361383   -3.534906     3.248789
#> B[3,3]  97.2979148 4.528059   90.756673   104.811816
#> 
#> 
#> $A
#> $A$equation1
#>                   mean         sd 5% quantile 95% quantile
#> lag1_var1  0.920190075 0.01441084  0.89950336   0.94319345
#> lag1_var2 -0.005591443 0.01196487 -0.02339119   0.01506146
#> lag1_var3  0.098478727 0.02036251  0.06484857   0.12566029
#> const     -0.063115679 0.08169851 -0.18504180   0.05531243
#> 
#> $A$equation2
#>                  mean          sd  5% quantile 95% quantile
#> lag1_var1 -0.02323996 0.018520487 -0.048256216  0.008186634
#> lag1_var2  0.95215098 0.009809733  0.939435853  0.966784505
#> lag1_var3  0.03578900 0.024604704 -0.002976879  0.073164535
#> const     -0.42391277 0.071763253 -0.526056673 -0.304736378
#> 
#> $A$equation3
#>                   mean          sd 5% quantile  95% quantile
#> lag1_var1 -0.017362618 0.007730085 -0.02988272 -0.0072613594
#> lag1_var2 -0.008104517 0.005490463 -0.01797774 -0.0004099355
#> lag1_var3  1.020411446 0.009475792  1.00831129  1.0335312705
#> const     -0.086899362 0.039083110 -0.14983130 -0.0386766815
#> 
#> 
#> $hyper
#> $hyper$B
#>                            mean        sd 5% quantile 95% quantile
#> B[1,]_shrinkage        872.8997  589.0555    231.6637     1643.238
#> B[2,]_shrinkage        860.0352  650.9305    154.7441     1970.938
#> B[3,]_shrinkage       1919.9001  982.6652    842.8577     3230.207
#> B[1,]_shrinkage_scale 6675.5621 3414.0366   1621.3829    12502.300
#> B[2,]_shrinkage_scale 6761.7691 3863.8927   1299.0476    12104.986
#> B[3,]_shrinkage_scale 8390.7483 4714.5816   2638.2289    15641.244
#> B_global_scale         694.4179  389.2128    143.5536     1260.961
#> 
#> $hyper$A
#>                            mean        sd 5% quantile 95% quantile
#> A[1,]_shrinkage       0.4784737 0.2572436   0.2040746    0.9230891
#> A[2,]_shrinkage       0.5644127 0.3321284   0.1954102    1.2070394
#> A[3,]_shrinkage       0.5290319 0.3258285   0.2505474    1.1667932
#> A[1,]_shrinkage_scale 5.9970296 2.5309162   2.7721883    9.5767841
#> A[2,]_shrinkage_scale 6.6696716 2.9826810   3.2781065   11.6577191
#> A[3,]_shrinkage_scale 6.8789758 3.3335960   3.2577226   11.0041419
#> A_global_scale        0.7800935 0.2211279   0.5554428    1.3068948
#> 
#> 

# workflow with the pipe |>
############################################################
set.seed(123)
us_fiscal_lsuw |>
  specify_bsvar$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 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 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] 35.32538 1.947888    33.09898     38.70744
#> 
#> $B$equation2
#>               mean       sd 5% quantile 95% quantile
#> B[2,1] -0.05852654 2.843507   -3.726388     3.690433
#> B[2,2] 38.94786643 1.660281   36.734287    41.535125
#> 
#> $B$equation3
#>               mean       sd 5% quantile 95% quantile
#> B[3,1] -14.5480841 2.261452  -17.895784   -11.699688
#> B[3,2]   0.1312712 2.361383   -3.534906     3.248789
#> B[3,3]  97.2979148 4.528059   90.756673   104.811816
#> 
#> 
#> $A
#> $A$equation1
#>                   mean         sd 5% quantile 95% quantile
#> lag1_var1  0.920190075 0.01441084  0.89950336   0.94319345
#> lag1_var2 -0.005591443 0.01196487 -0.02339119   0.01506146
#> lag1_var3  0.098478727 0.02036251  0.06484857   0.12566029
#> const     -0.063115679 0.08169851 -0.18504180   0.05531243
#> 
#> $A$equation2
#>                  mean          sd  5% quantile 95% quantile
#> lag1_var1 -0.02323996 0.018520487 -0.048256216  0.008186634
#> lag1_var2  0.95215098 0.009809733  0.939435853  0.966784505
#> lag1_var3  0.03578900 0.024604704 -0.002976879  0.073164535
#> const     -0.42391277 0.071763253 -0.526056673 -0.304736378
#> 
#> $A$equation3
#>                   mean          sd 5% quantile  95% quantile
#> lag1_var1 -0.017362618 0.007730085 -0.02988272 -0.0072613594
#> lag1_var2 -0.008104517 0.005490463 -0.01797774 -0.0004099355
#> lag1_var3  1.020411446 0.009475792  1.00831129  1.0335312705
#> const     -0.086899362 0.039083110 -0.14983130 -0.0386766815
#> 
#> 
#> $hyper
#> $hyper$B
#>                            mean        sd 5% quantile 95% quantile
#> B[1,]_shrinkage        872.8997  589.0555    231.6637     1643.238
#> B[2,]_shrinkage        860.0352  650.9305    154.7441     1970.938
#> B[3,]_shrinkage       1919.9001  982.6652    842.8577     3230.207
#> B[1,]_shrinkage_scale 6675.5621 3414.0366   1621.3829    12502.300
#> B[2,]_shrinkage_scale 6761.7691 3863.8927   1299.0476    12104.986
#> B[3,]_shrinkage_scale 8390.7483 4714.5816   2638.2289    15641.244
#> B_global_scale         694.4179  389.2128    143.5536     1260.961
#> 
#> $hyper$A
#>                            mean        sd 5% quantile 95% quantile
#> A[1,]_shrinkage       0.4784737 0.2572436   0.2040746    0.9230891
#> A[2,]_shrinkage       0.5644127 0.3321284   0.1954102    1.2070394
#> A[3,]_shrinkage       0.5290319 0.3258285   0.2505474    1.1667932
#> A[1,]_shrinkage_scale 5.9970296 2.5309162   2.7721883    9.5767841
#> A[2,]_shrinkage_scale 6.6696716 2.9826810   3.2781065   11.6577191
#> A[3,]_shrinkage_scale 6.8789758 3.3335960   3.2577226   11.0041419
#> A_global_scale        0.7800935 0.2211279   0.5554428    1.3068948
#> 
#>