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.08773 1.758916    32.53032     38.35467
#> 
#> $B$equation2
#>             mean       sd 5% quantile 95% quantile
#> B[2,1] -0.679238 1.934894   -2.963047     3.332628
#> B[2,2] 39.713185 1.755591   36.911630    41.765456
#> 
#> $B$equation3
#>               mean       sd 5% quantile 95% quantile
#> B[3,1] -14.3842400 1.902854  -17.040966    -10.98104
#> B[3,2]   0.1637784 2.471842   -2.835244      4.39948
#> B[3,3]  96.1747125 4.945967   89.280074    103.26470
#> 
#> 
#> $A
#> $A$equation1
#>                    mean         sd 5% quantile 95% quantile
#> lag1_var1  0.9172540818 0.02194780  0.88728861   0.94503673
#> lag1_var2 -0.0004097986 0.01243653 -0.02265821   0.01458568
#> lag1_var3  0.1017874130 0.02780531  0.06399140   0.13972764
#> const     -0.0145288728 0.10016880 -0.20829325   0.10032816
#> 
#> $A$equation2
#>                  mean         sd  5% quantile 95% quantile
#> lag1_var1 -0.02393269 0.01914904 -0.058144563  -0.00459606
#> lag1_var2  0.95192073 0.01036179  0.937837593   0.96765373
#> lag1_var3  0.03545451 0.02381736  0.006204548   0.07312802
#> const     -0.43600024 0.08555523 -0.544058761  -0.31875692
#> 
#> $A$equation3
#>                   mean          sd  5% quantile 95% quantile
#> lag1_var1 -0.017273456 0.008281776 -0.027653235 -0.006335693
#> lag1_var2 -0.005209727 0.003049773 -0.009818577 -0.001968844
#> lag1_var3  1.020727278 0.010198660  1.005376398  1.036492598
#> const     -0.054869268 0.024676501 -0.086703840 -0.024959999
#> 
#> 
#> $hyper
#> $hyper$B
#>                            mean        sd 5% quantile 95% quantile
#> B[1,]_shrinkage        920.0554  631.5168    242.9323     2258.856
#> B[2,]_shrinkage        892.1252  726.2191    203.1311     1873.056
#> B[3,]_shrinkage       1844.2555 1189.3819    662.1813     4154.248
#> B[1,]_shrinkage_scale 8246.8191 7598.4992   1404.1106    21432.818
#> B[2,]_shrinkage_scale 7466.1058 5543.6684   1674.8716    16393.465
#> B[3,]_shrinkage_scale 9374.6374 7370.7459   2042.0064    19601.266
#> B_global_scale         787.6242  588.9231    159.5532     1549.593
#> 
#> $hyper$A
#>                            mean        sd 5% quantile 95% quantile
#> A[1,]_shrinkage       0.2952908 0.1755818  0.07769445    0.6539009
#> A[2,]_shrinkage       0.4351435 0.3645229  0.11757557    0.9623471
#> A[3,]_shrinkage       0.3226787 0.2034372  0.07120971    0.7499557
#> A[1,]_shrinkage_scale 3.6714253 1.5069793  1.56881446    5.8480080
#> A[2,]_shrinkage_scale 4.8400026 2.6598311  1.84483235    9.7674471
#> A[3,]_shrinkage_scale 4.0290767 2.5481605  1.21578511    6.1798450
#> A_global_scale        0.5186554 0.2339998  0.26082635    0.8621645
#> 
#> 

# 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.08773 1.758916    32.53032     38.35467
#> 
#> $B$equation2
#>             mean       sd 5% quantile 95% quantile
#> B[2,1] -0.679238 1.934894   -2.963047     3.332628
#> B[2,2] 39.713185 1.755591   36.911630    41.765456
#> 
#> $B$equation3
#>               mean       sd 5% quantile 95% quantile
#> B[3,1] -14.3842400 1.902854  -17.040966    -10.98104
#> B[3,2]   0.1637784 2.471842   -2.835244      4.39948
#> B[3,3]  96.1747125 4.945967   89.280074    103.26470
#> 
#> 
#> $A
#> $A$equation1
#>                    mean         sd 5% quantile 95% quantile
#> lag1_var1  0.9172540818 0.02194780  0.88728861   0.94503673
#> lag1_var2 -0.0004097986 0.01243653 -0.02265821   0.01458568
#> lag1_var3  0.1017874130 0.02780531  0.06399140   0.13972764
#> const     -0.0145288728 0.10016880 -0.20829325   0.10032816
#> 
#> $A$equation2
#>                  mean         sd  5% quantile 95% quantile
#> lag1_var1 -0.02393269 0.01914904 -0.058144563  -0.00459606
#> lag1_var2  0.95192073 0.01036179  0.937837593   0.96765373
#> lag1_var3  0.03545451 0.02381736  0.006204548   0.07312802
#> const     -0.43600024 0.08555523 -0.544058761  -0.31875692
#> 
#> $A$equation3
#>                   mean          sd  5% quantile 95% quantile
#> lag1_var1 -0.017273456 0.008281776 -0.027653235 -0.006335693
#> lag1_var2 -0.005209727 0.003049773 -0.009818577 -0.001968844
#> lag1_var3  1.020727278 0.010198660  1.005376398  1.036492598
#> const     -0.054869268 0.024676501 -0.086703840 -0.024959999
#> 
#> 
#> $hyper
#> $hyper$B
#>                            mean        sd 5% quantile 95% quantile
#> B[1,]_shrinkage        920.0554  631.5168    242.9323     2258.856
#> B[2,]_shrinkage        892.1252  726.2191    203.1311     1873.056
#> B[3,]_shrinkage       1844.2555 1189.3819    662.1813     4154.248
#> B[1,]_shrinkage_scale 8246.8191 7598.4992   1404.1106    21432.818
#> B[2,]_shrinkage_scale 7466.1058 5543.6684   1674.8716    16393.465
#> B[3,]_shrinkage_scale 9374.6374 7370.7459   2042.0064    19601.266
#> B_global_scale         787.6242  588.9231    159.5532     1549.593
#> 
#> $hyper$A
#>                            mean        sd 5% quantile 95% quantile
#> A[1,]_shrinkage       0.2952908 0.1755818  0.07769445    0.6539009
#> A[2,]_shrinkage       0.4351435 0.3645229  0.11757557    0.9623471
#> A[3,]_shrinkage       0.3226787 0.2034372  0.07120971    0.7499557
#> A[1,]_shrinkage_scale 3.6714253 1.5069793  1.56881446    5.8480080
#> A[2,]_shrinkage_scale 4.8400026 2.6598311  1.84483235    9.7674471
#> A[3,]_shrinkage_scale 4.0290767 2.5481605  1.21578511    6.1798450
#> A_global_scale        0.5186554 0.2339998  0.26082635    0.8621645
#> 
#>