posterior.fit: Estimates the marginal likelihood or log posterior...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

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

1
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

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.

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:

Note

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!

Author(s)

Patrick T. Brandt and W. Ryan Davis

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

1
2
3
4
5
6
7
8
## 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)

MSBVAR documentation built on May 30, 2017, 1:23 a.m.

Related to posterior.fit in MSBVAR...