coef.bma {BMS}R Documentation

Posterior Inclusion Probabilities and Coefficients from a 'bma' Object

Description

Returns a matrix with aggregate covariate-specific Bayesian model Averaging: posterior inclusion probabilites (PIP), post. exepected values and standard deviations of coefficents, as well as sign probabilites

Usage

 ## S3 method for class 'bma'
coef(object, exact = FALSE, order.by.pip = TRUE, include.constant = FALSE, 
    incl.possign = TRUE, std.coefs = FALSE, condi.coef = FALSE, ...) 

#equivalent: 
 estimates.bma(bmao, exact = FALSE, order.by.pip = TRUE, include.constant = FALSE, 
    incl.possign = TRUE, std.coefs = FALSE, condi.coef = FALSE)

Arguments

object, bmao

a 'bma' object (cf. bms)

exact

if exact=FALSE, then PIPs, coefficents, etc. will be based on aggregate information from the sampling chain with posterior model distributions based on MCMC frequencies (except in case of enumeration - cf. 'Details');
if exact=TRUE, estimates will be based on the nmodel best models encountered by the sampling chain, with the posterior model distribution based on their exact marginal likelihoods - cf. 'Details' below.

order.by.pip

order.by.pip=TRUE orders the resulting matrix according to posteriorr inclusion probabilites, order.by.pip=FALSE ranks them according to the original data (order of the covariates as in provided in X.data to bms), default TRUE

include.constant

If include.constant=TRUE then the resulting matrix includes the expected value of the constant in its last row. Default FALSE

incl.possign

If incl.possign=FALSE, then the sign probabilites column (cf. 'Values' below) is omitted from the result. Default TRUE

std.coefs

If std.coefs=TRUE then the expected values and standard deviations are returned in standardized form, i.e. as if the original data all had mean zero and variance 1. If std.coefs=FALSE (default) then both expected values and standard deviations are returned 'as is'.

condi.coef

If condi.coef=FALSE (default) then coefficients β_i and standard deviations are unconditional posterior expected values, as in standard model averaging; if condi.coef=FALSE then they are given as conditional on inclusion (equivalent to β_i / PIP_i).

...

further arguments for other coef methods

Details

More on the argument exact:
In case the argument exact=TRUE, the PIPs, coefficent statistics and conditional sign probabilities are computed on the basis of the (500) best models the sampling chain encoutered (cf. argument nmodel in bms). Here, the weights for Bayesian model averaging (BMA) are the posterior marginal likelihoods of these best models.
In case exact=FALSE, then these statistics are based on all accepted models (except burn-ins): If mcmc="enumerate" then this are simply all models of the traversed model space, with their marginal likelihoods providing the weights for BMA.
If, however, the bma object bmao was based on an MCMC sampler (e.g. when bms argument mcmc="bd"), then BMA statistics are computed differently: In contrast to above, the weights for BMA are MCMC frequencies, i.e. how often the respective models were encountered by the MCMC sampler. (cf. a comparison of MCMC frequencies and marginal likelihoods for the best models via the function pmp.bma).

Value

A matrix with five columns (or four if incl.possign=FALSE)

Column 'PIP'

Posterior inclusion probabilities ∑ p(γ|i \in γ, Y) / sum p(γ|Y)

Column 'Post Mean'

posterior expected value of coefficients, unconditional E(β|Y)=∑ p(γ|Y) E(β|γ,Y), where E(β_i|γ,i \notin γ, Y)=0 if condi.coef=FALSE, or conditional on inclusion (E(β|Y) / ∑ p(γ|Y, i \in γ) ) if condi.coef=TRUE

Column 'Post SD'

posterior standard deviation of coefficients, unconditional or conditional on inclusion, depending on condi.coef

Column 'Cond.Pos.Sign'

The ratio of how often the coefficients' expected values were positive conditional on inclusion. (over all visited models in case exact=FALSE, over the best models in case exact=TRUE)

Column 'Idx'

the original order of covariates as the were used for sampling. (if included, the constant has index 0)

Author(s)

Martin Feldkircher and Stefan Zeugner

See Also

bms for creating bma objects, pmp.bma for comparing MCMC frequencies and marginal likelihoods.

Check http://bms.zeugner.eu for additional help.

Examples

#sample, with keeping the best 200 models:
data(datafls)
mm=bms(datafls,burn=1000,iter=5000,nmodel=200)

#standard BMA PIPs and coefficients from the MCMC sampling chain, based on how frequently th emodels were drawn
coef(mm)

#standardized coefficents, ordered by index
coef(mm,std.coefs=TRUE,order.by.pip=FALSE)

#coefficents conditional on inclusion:
coef(mm,condi.coef=TRUE)

#same as
ests=coef(mm,condi.coef=FALSE)
ests[,2]/ests[,1]

#PIPs, coefficients, and signs based on the best 200 models
estimates.bma(mm,exact=TRUE)

#... and based on the 50 best models
coef(mm[1:50],exact=TRUE)




[Package BMS version 0.3.1 Index]