Learn R Programming

MSBVAR (version 0.7-0)

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

Value

BVAR:

A list of the class "posterior.fit.VAR" that includes the following elements:data.marg.llfLog marginal density, the probability of the data after integrating out the parameters in the model.data.marg.postPredictive marginal posterior densitycoefficient.postContribution 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.priorLog prior probabilitylog.llf$T \times 1$ list of the log probabilities for each observation conditional on the parameters.log.posterior.AplusLog marginal probability of $A_1,\ldots,A_p$ conditional on the data and $A_0$log.marginal.data.densityLog data density or marginal log likelihood, the probability of the data after integrating out the parameters in the model.log.marginal.A0k$m \times 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
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)

Run the code above in your browser using DataLab