estimates.bma | R Documentation |
Returns a matrix with aggregate covariate-specific Bayesian model Averaging: posterior inclusion probabilites (PIP), post. expected values and standard deviations of coefficients, as well as sign probabilites
estimates.bma( bmao, exact = FALSE, order.by.pip = TRUE, include.constant = FALSE, incl.possign = TRUE, std.coefs = FALSE, condi.coef = FALSE ) ## 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, ... )
exact |
if |
order.by.pip |
|
include.constant |
If |
incl.possign |
If |
std.coefs |
If |
condi.coef |
If |
object, bmao |
a 'bma' object (cf. |
... |
further arguments for other |
More on the argument exact
:
In case the argument
exact=TRUE
, the PIPs, coefficient statistics and conditional sign
probabilities are computed on the basis of the (500) best models the
sampling chain encountered (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
).
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 |
Column 'Post SD' |
posterior standard deviation
of coefficients, unconditional or conditional on inclusion, depending on
|
Column 'Cond.Pos.Sign' |
The ratio of how often the
coefficients' expected values were positive conditional on inclusion. (over
all visited models in case |
Column 'Idx' |
the original order of covariates as the were used for sampling. (if included, the constant has index 0) |
bms
for creating bma objects, pmp.bma
for comparing MCMC frequencies and marginal likelihoods.
Check http://bms.zeugner.eu for additional help.
#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 the models were drawn coef(mm) #standardized coefficients, ordered by index coef(mm,std.coefs=TRUE,order.by.pip=FALSE) #coefficients 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.