gibbs.A0(varobj, N1, N2, thin=1, normalization="DistanceMLA")
szbsvar
normalize.svar
. Default is "DistanceMLA"
as recommended in Waggoner and Zha (2003b).gibbs.A0
with five elements:
N2
$A(0)$ draws. The list contains a vector
storing all of the draws, the location of the drawn elements in and
the dimension of $A(0)$. A0.posterior$A0
is a vector
of length equal to the number of parameters in $A(0)$ times N2.
A0.posterior$struct
is a vector of length equal to the number of
free parameters in $A(0)$ that gives the index positions
of the elements in $A(0)$. A0.posterior$m
is
$m$, an integer, the number of equations in the system.
W.posterior$W
is a vector of the elements of all the sampled
$W$ matrices. W.posterior$W.index
is a cumulative index
of the elements of
$W$ that defines how the $W$ matrices for each iteration
of the sampler are stored in the vector.
W.posterior$m
is $m$, an integer, the number of equations
in the system.ident
matrix from the varobj
of binary
elements that defined the free and restricted parameters, as
specified in szbsvar
thin
value that was input into the function for
thinning the Gibbs sampler.N2
, size of the posterior sample.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.
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.
# 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)
Run the code above in your browser using DataLab