Learn R Programming

MSBVAR (version 0.2.2)

posterior.fit: Estimates the marginal likelihood and posterior probability for VAR, BVAR, and BSVAR models

Description

Computes the marginal log likelihood other posterior fit measures for VAR, BVAR, and BSVAR models fit with szbsvar and szbvar.

Usage

posterior.fit(varobj, A0.posterior.obj=NULL)posterior.fit.BVAR(varobj)
posterior.fit.BSVAR(varobj, A0.posterior.obj)

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 log likelihoodBSVAR: 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.

Details

Estimates the marginal log likelihood, log prior, log posterior for the $A_0$ and $A_1,\ldots,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)

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.

See Also

szbvar, szbsvar, gibbs.A0.BSVAR, mc.irf, print.posterior.fit

Examples

Run this code
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)

Run the code above in your browser using DataLab