| gprior-class {BMS} | R Documentation |
An object pertaining to a coefficient prior
A gprior object holds descriptions and subfunctions pertaining to coefficent priors. Functions such as bms or zlm
rely on this class to 'convert' the output of OLS results into posterior expressions for a Bayesian Linear Model. Post-processing functions such as density.bma also resort to gprior objects.
There are currently three coefficient prior structures built into the BMS package, generated by the following functions (cf. Feldkircher and Zeugner, 2009) :
gprior.constg.init: creates a Zellner's g-prior object with constant g.
gprior.eblocal.init: creates an Empricial Bayes Zellner's g-prior.
gprior.hyperg.init: creates a hyper g-prior with a Beta-prior on the shrinakge parameter.
The following describes the necessary slots
gtype:is.constant:g (that is not dependent on a model) return.g.stats:g:g when is.constant==TRUE.lprobcalc:just.loglik(ymy, k, ...):ymy and number of parameters k lprob.all(ymy, k, bhat, diag.inverse, ...):bhat: OLS coefficients, diag.inverse: diagonal of the matrix inv(t(X)*X)), and returns a list with log-likelihood and posterior moments.
As for now, there are no methods defined with class "gprior" in the signature.
Martin Feldkircher and Stefan Zeugner
Feldkircher, M. and S. Zeugner (2009): Benchmark Priors Revisited: On Adaptive Shrinkage and the Supermodel Effect in Bayesian Model Averaging, IMF Working Paper 09/202.
bms and zlm for creating bma or zlm objects.
Check the appendix of vignette(BMS) for a more detailed description of built-in priors.
Check http://bms.zeugner.eu/custompriors.php for examples.
data(datafls) mm1=bms(datafls[,1:10], g="EBL") gg=mm1$gprior.info # is the g-prior object, augmented with some posterior statistics mm2=bms(datafls[,1:10], g=gg) #produces the same result mm3=bms(datafls[,1:10], g=.gprior.eblocal.init)