Skip to contents

Normalises the sign of rows of matrix \(B\) MCMC draws, provided as the first argument posterior_B, relative to matrix B_hat, provided as the second argument of the function. The implemented procedure proposed by Waggoner, Zha (2003) normalises the MCMC output in an optimal way leading to the unimodal posterior. Only normalised MCMC output is suitable for the computations of the posterior characteristics of the \(B\) matrix elements and their functions such as the impulse response functions and other economically interpretable values.

Usage

normalise_posterior(posterior, B_hat)

Arguments

posterior

posterior estimation outcome - an object of either of classes: PosteriorBSVAR, PosteriorBSVARMSH, PosteriorBSVARMIX, or PosteriorBSVARSV containing, amongst other draws, the S draws from the posterior distribution of the NxN matrix of contemporaneous relationships \(B\). These draws are to be normalised with respect to:

B_hat

an NxN matrix specified by the user to have the desired row signs

Value

Nothing. The normalised elements overwrite the corresponding elements of the first argument posterior_B by reference.

References

Waggoner, D.F., and Zha, T., (2003) Likelihood Preserving Normalization in Multiple Equation Models. Journal of Econometrics, 114(2), 329–47, doi:10.1016/S0304-4076(03)00087-3 .

See also

Author

Tomasz Woźniak wozniak.tom@pm.me

Examples

# upload data
data(us_fiscal_lsuw)

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

# run the burn-in
burn_in        = estimate(specification, 10)
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#>  Gibbs sampler for the SVAR-SV model              |
#>    Non-centred SV model is estimated              |
#> **************************************************|
#>  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, 10, thin = 1)
#> **************************************************|
#> bsvars: Bayesian Structural Vector Autoregressions|
#> **************************************************|
#>  Gibbs sampler for the SVAR-SV model              |
#>    Non-centred SV model is estimated              |
#> **************************************************|
#>  Progress of the MCMC simulation for 10 draws
#>     Every draw is saved via MCMC thinning
#>  Press Esc to interrupt the computations
#> **************************************************|

# normalise the posterior
BB            = posterior$last_draw$starting_values$B      # get the last draw of B
B_hat         = diag((-1) * sign(diag(BB))) %*% BB         # set negative diagonal elements
normalise_posterior(posterior, B_hat)                      # draws in posterior are normalised