topmodels.bma {BMS} | R Documentation |
Returns a matrix whose columns show which covariates were included in the best models in a 'bma' object. The last two columns detail posterior model probabilities.
topmodels.bma(bmao)
bmao |
an object of class 'bma' - see |
Each column in the resulting matrix corresponds to one of the 'best' models in bmao
: the first column for the best model, the second for the second-best model, etc.
The model binaries have elements 1 if the regressor given by the row name was included in the respective models, and 0 otherwise.
The second-last row shows the model's posterior model probability based on marginal likelihoods (i.e. its marginal likelihood over the sum of likelihoods of all best models)
The last row shows the model's posterior model probability based on MCMC frequencies (i.e. how often the model was accepted vs sum of acceptance of all models)
Note that the column names are hexcode representations of the model binaries (e.g. "03" for c(0,0,0,1,0,0)
)
Martin Feldkircher and Stefan Zeugner
topmod
for accessing model binaries, pmp.bma
for posterior model probabilities
Check http://bms.zeugner.eu for additional help.
data(datafls) #sample with a limited data set for demonstration mm=bms(datafls[,1:12],nmodel=20) #show binaries for all topmodels.bma(mm) #show binaries for 2nd and 3rd best model, without the model probs topmodels.bma(mm[2:3])[1:11,] #access model binaries directly mm$topmod$bool_binary()