posterior.fit {MSBVAR} | R Documentation |
Computes the marginal log likelihood
other posterior fit measures for VAR, BVAR, and BSVAR models fit with
szbsvar
and szbvar
.
posterior.fit(varobj, A0.posterior.obj=NULL) posterior.fit.BVAR(varobj) posterior.fit.BSVAR(varobj, A0.posterior.obj)
varobj |
Bayesian BVAR or BSVAR object from fitting a model with
szbsvar or szbvar |
A0.posterior.obj |
MCMC Gibbs sample object for the B-SVAR model A(0)
from gibbs.A0.BSVAR |
Estimates the marginal log likelihood, log prior, log posterior for the A_0 and A_1,...,A_p parameters of the model, and the log data density for the sample (after integrating out the model parameters). The approach used is that of Chib (1995).
The computations are done using compiled C++ code as of version 0.3.0. See the package source code for details about the implementation.
BVAR:
A list of the class "posterior.fit.VAR" that includes the following
elements:
data.marg.llf |
Log marginal density, the probability of the data after integrating out the parameters in the model. |
data.marg.post |
Predictive marginal posterior density |
Coefficient log likelihood |
|
log.prior |
Log prior probability |
log.llf |
T x 1 list of the log probabilities for each observation conditional on the parameters. |
log.posterior.Aplus |
Log marginal probability of A(1),...,A(p) conditional on the data and A(0) |
log.marginal.data.density |
Log data density or marginal log likelihood, the probability of the data after integrating out the parameters in the model. |
log.marginal.A0k |
m x 1 list of the log probabilities of each column (corresponding to the equations) of A(0) conditional on the other columns. |
The log Bayes factor for two model can be computed using the log.marginal.data.density:
log BF = log.marginal.data.density.1 - log.marginal.data.density.2
Note that at present, the scale factors for the BVAR and B-SVAR models
are different (one used the concentrated likelihood, the other does
NOT). Thus, one cannot compare fit measures across the two
functions. To compare a recursive B-SVAR to a non-recursive B-SVAR
model, one should estimate the recursive model with szbsvar
using the appropriate ident
matrix and then call
posterior.fit
on the two B-SVAR models!
Patrick T. Brandt
Chib, Siddartha. 1995. "Marginal Likelihood from the Gibbs Output." Journal of the American Statistical Association. 90(432): 1313–1321.
Waggoner, Daniel F. and Tao A. Zha. 2003. "A Gibbs sampler for structural vector autoregressions" Journal of Economic Dynamics & Control. 28:349–366.
szbvar
,
szbsvar
,
gibbs.A0.BSVAR
,
mc.irf
,
print.posterior.fit
## Not run: varobj <- szbsvar(Y, p, z = NULL, lambda0, lambda1, lambda3, lambda4, lambda5, mu5, mu6, ident, qm = 4) A0.posterior <- gibbs.A0.BSVAR(varobj, N1, N2) fit <- posterior.fit(varobj, A0.posterior) print(fit) ## End(Not run)