Learn R Programming

MSBVAR (version 0.9-2)

posterior.fit: Estimates the marginal likelihood or log posterior probability for BVAR, BSVAR, and MSBVAR models

Description

Computes the marginal log likelihood other posterior fit measures for BVAR, BSVAR, and MSBVAR models fit with szbvar, szbsvar and, msbvar (and their posterior samplers).

Usage

posterior.fit(varobj, A0.posterior.obj=NULL, maxiterbs=500)

Arguments

varobj
Varies for BVAR, BSVAR, or MSBVAR models. For a BVAR model, varobj = output from a call to szbvar. For a BSVAR model, varobj = output from a call to szbsvar. For MSBVAR models, varobj = output from a call to gibbs.msbvar.
A0.posterior.obj
MCMC Gibbs object for the B-SVAR model $A(0)$ from gibbs.A0
maxiterbs
Number of iterations for the bridge sampler for computing the marginal likelihood for MSBVAR models

Value

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.post
Contribution to the posterior fit from the pdf of the coefficients.
BSVAR:A list of the class "posterior.fit.BSVAR" that includes the following elements:
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.
MSBVAR:A list of the class "posterior.fit.MSBVAR" that includes the following elements:

Details

Estimates the marginal log likelihood, also known as a log marginal data density for the various models. For the BVAR models, this can be computed in closed form. For the BSVAR models the MCMC data augmentation method of Chib (1995) is employed. For the MSBVAR models, the importance sampler, reciprocal importance sampler, and bridge sampler methods of Fruwirth-Schnatter (2006) are used. Consult these references for details (or look at the source code).

The computations are done using compiled C++ and Fortran code as of version 0.3.0. See the package source code for details about the implementation.

References

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.

Fruhwirth-Schnatter, Sylvia. 2006. Finite Mixture and Markov Switching Models. Springer Series in Statistics New York: Springer., esp. Sections 5.4 and 5.5.

See Also

szbvar, szbsvar, gibbs.A0, gibbs.msbvar, and print.posterior.fit for a print method.

Examples

Run this code
## Not run: 
# varobj <- szbsvar(Y, p, z = NULL, lambda0, lambda1, lambda3, lambda4,
#                   lambda5, mu5, mu6, ident, qm = 4)
# A0.posterior <- gibbs.A0(varobj, N1, N2)
# fit <- posterior.fit(varobj, A0.posterior)
# print(fit)
# ## End(Not run)

Run the code above in your browser using DataLab