estimate_bsvar_sv {bsvars}R Documentation

Bayesian estimation of a Structural Vector Autoregression with Stochastic Volatility heteroskedasticity via Gibbs sampler


Estimates the SVAR with Stochastic Volatility (SV) heteroskedasticity proposed by Lütkepohl, Shang, Uzeda, and Woźniak (2022). Implements the Gibbs sampler proposed by Waggoner & Zha (2003) for the structural matrix B and the equation-by-equation sampler by Chan, Koop, & Yu (2021) for the autoregressive slope parameters A. Additionally, the parameter matrices A and B follow a Minnesota prior and generalised-normal prior distributions respectively with the matrix-specific overall shrinkage parameters estimated thanks to a 3-level hierarchical prior distribution. The SV model is estimated in a non-centred parameterisation using a range of techniques including: simulation smoother, auxiliary mixture, ancillarity-sufficiency interweaving strategy, and generalised inverse Gaussian distribution summarised by Kastner & Frühwirth-Schnatter (2014). See section Details for the model equations.


estimate_bsvar_sv(S, specification, thin = 10, show_progress = TRUE)



a positive integer, the number of posterior draws to be generated


an object of class BSVAR-SV generated using the specify_bsvar_sv$new() function.


a positive integer, specifying the frequency of MCMC output thinning


a logical value, if TRUE the estimation progress bar is visible


The heteroskedastic SVAR model is given by the reduced form equation:

Y = AX + E

where Y is an NxT matrix of dependent variables, X is a KxT matrix of explanatory variables, E is an NxT matrix of reduced form error terms, and A is an NxK matrix of autoregressive slope coefficients and parameters on deterministic terms in X.

The structural equation is given by

BE = U

where U is an NxT matrix of structural form error terms, and B is an NxN matrix of contemporaneous relationships.

Finally, the structural shocks, U, are temporally and contemporaneously independent and jointly normally distributed with zero mean. The conditional variance of the nth shock at time t is given by:

Var_{t-1}[u_{n.t}] = exp(w_n h_{n.t})

where w_n is the estimated conditional standard deviation of the log-conditional variance and the log-volatility process h_{n.t} follows an autoregressive process:

h_{n.t} = g_n h_{n.t-1} + v_{n.t}

where h_{n.0}=0, g_n is an autoregressive parameter and v_{n.t} is a standard normal error term.


An object of class PosteriorBSVAR-SV containing the Bayesian estimation output and containing two elements:

posterior a list with a collection of S draws from the posterior distribution generated via Gibbs sampler containing:


an NxKxS array with the posterior draws for matrix A


an NxNxS array with the posterior draws for matrix B


a 5xS matrix with the posterior draws for the hyper-parameters of the hierarchical prior distribution


an NxTxS array with the posterior draws of the log-volatility processes


an NxS matrix with the posterior draws of SV autoregressive parameters


an NxS matrix with the posterior draws of SV process conditional standard deviations


an NxTxS array with the posterior draws of the auxiliary mixture component indicators


an NxS matrix with the posterior draws of the variances of the zero-mean normal prior for omega


an S-vector with the posterior draws of the scale of the gamma prior of the hierarchical prior for sigma2_omega

last_draw an object of class BSVAR-SV with the last draw of the current MCMC run as the starting value to be passed to the continuation of the MCMC estimation using bsvar_sv().


Tomasz Woźniak


The model, prior distributions, and estimation algorithms were proposed by

Lütkepohl, H., Shang, F., Uzeda, L., and Woźniak, T. (2022) Partial Identification of Heteroskedastic Structural VARs: Theory and Bayesian Inference.

Sampling from the generalised-normal full conditional posterior distribution of matrix B is implemented using the Gibbs sampler by:

Waggoner, D.F., and Zha, T., (2003) A Gibbs sampler for structural vector autoregressions. Journal of Economic Dynamics and Control, 28, 349–366, doi:10.1016/S0165-1889(02)00168-9.

Sampling from the multivariate normal full conditional posterior distribution of each of the A matrix row is implemented using the sampler by:

Chan, J.C.C., Koop, G, and Yu, X. (2021) Large Order-Invariant Bayesian VARs with Stochastic Volatility.

Many of the techniques employed for the estimation of the Stochastic Volatility model are summarised by:

Kastner, G. and Frühwirth-Schnatter, S. (2014) Ancillarity-Sufficiency Interweaving Strategy (ASIS) for Boosting MCMC Estimation of Stochastic Volatility Models. Computational Statistics & Data Analysis, 76, 408–423, doi:10.1016/j.csda.2013.01.002.

See Also

specify_bsvar_sv, specify_posterior_bsvar_sv, normalise_posterior


# upload data

# specify the model and set seed
specification  = specify_bsvar_sv$new(us_fiscal_lsuw, p = 4)

# run the burn-in
burn_in        = estimate_bsvar_sv(10, specification)

# estimate the model
posterior      = estimate_bsvar_sv(50, burn_in$get_last_draw())

[Package bsvars version 1.0.0 Index]