Description Usage Arguments Details Value Note Author(s) References See Also Examples
Samples from the structural contemporaneous parameter matrix A(0) of a Bayesian Structural Vector Autoregression (B-SVAR) model.
1 | gibbs.A0(varobj, N1, N2, thin=1, normalization="DistanceMLA")
|
varobj |
A structural BVAR object created by
|
N1 |
Number of burn-in iterations for the Gibbs sampler (should probably be greater than or equal to 1000). |
N2 |
Number of iterations in the posterior sample. |
thin |
Thinning parameter for the Gibbs sampler. |
normalization |
Normalization rule as defined in
|
Samples the posterior pdf of an A(0) matrix for a Bayesian
structural VAR using the algorithm described in Waggoner and Zha
(2003a). This function is meant to be called after
szbsvar
, so one should consult that function
for further information. The function draws N2 * thin
draws
from the sampler and returns the N2
draws that are the
thin
'th elements of the Gibbs sampler sequence.
The computations are done using compiled C++ code as of version 0.3.0. See the package source code for details about the implementation.
A list of class gibbs.A0
with five elements:
A0.posterior |
A list of three elements containing the results
of the |
W.posterior |
A list of three elements that describes the
vectorized W
matrices that characterize the covariance of the restricted
parameter space of each column of A(0).
|
ident |
|
thin |
|
N2 |
|
You must have called / loaded an szbsvar
object to
use this Gibbs sampler.
Patrick T. Brandt
Waggoner, Daniel F. and Tao A. Zha. 2003a. "A Gibbs sampler for structural vector autoregressions" Journal of Economic Dynamics \& Control. 28:349–366.
Waggoner, Daniel F. and Tao A. Zha, 2003b. "Likelihood Preserving Normalization in Multiple Equation Models" Journal of Econometrics, 114: 329–347
szbsvar
for estimation of the
posterior moments of the B-SVAR model,
normalize.svar
for a discussion of and references on
A(0) normalization.
posterior.fit
for computing the
marginal log likelihood for the model after sampling the posterior,
and plot
for a unique density plot of the
A(0) elements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # SZ, B-SVAR model for the Levant data
data(BCFdata)
m <- ncol(Y)
ident <- diag(m)
ident[1,] <- 1
ident[2,1] <- 1
# estimate the model's posterior moments
set.seed(123)
model <- szbsvar(Y, p=2, z=z2, lambda0=0.8, lambda1=0.1, lambda3=1,
lambda4=0.1, lambda5=0.05, mu5=0, mu6=5,
ident, qm=12)
# Set length of burn-in and size of posterior. These are only an
# example. Production runs should set these much higher.
N1 <- 1000
N2 <- 1000
A0.posterior.obj <- gibbs.A0(model, N1, N2, thin=1)
# Use coda to look at the posterior.
A0.free <- A02mcmc(A0.posterior.obj)
plot(A0.free)
|
##
## MSBVAR Package v.0.9-2
## Build date: Fri Oct 27 08:05:10 2017
## Copyright (C) 2005-2017, Patrick T. Brandt
## Written by Patrick T. Brandt
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0351179, SES-0351205, SES-0540816, and SES-0921051)
##
Estimating starting values for the numerical optimization
of the log posterior of A(0)
Estimating the final values for the numerical optimization
of the log posterior of A(0)
initial value 2.822710
final value 2.822710
converged
Normalization Method: DistanceMLA ( 0 )
Gibbs Burn-in 10 % Complete
Gibbs Burn-in 20 % Complete
Gibbs Burn-in 30 % Complete
Gibbs Burn-in 40 % Complete
Gibbs Burn-in 50 % Complete
Gibbs Burn-in 60 % Complete
Gibbs Burn-in 70 % Complete
Gibbs Burn-in 80 % Complete
Gibbs Burn-in 90 % Complete
Gibbs Burn-in 100 % Complete
Gibbs Sampling 10 % Complete (100 draws)
A0 log-det = 1.252114
Gibbs Sampling 20 % Complete (200 draws)
A0 log-det = 1.332632
Gibbs Sampling 30 % Complete (300 draws)
A0 log-det = 1.262974
Gibbs Sampling 40 % Complete (400 draws)
A0 log-det = 1.299021
Gibbs Sampling 50 % Complete (500 draws)
A0 log-det = 1.228201
Gibbs Sampling 60 % Complete (600 draws)
A0 log-det = 1.323406
Gibbs Sampling 70 % Complete (700 draws)
A0 log-det = 1.356263
Gibbs Sampling 80 % Complete (800 draws)
A0 log-det = 1.617471
Gibbs Sampling 90 % Complete (900 draws)
A0 log-det = 1.237286
Gibbs Sampling 100 % Complete (1000 draws)
A0 log-det = 1.307776
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.