topmodels.bma {BMS} | R Documentation |

## Model Binaries and their Posterior model Probabilities

### Description

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.

### Usage

```
topmodels.bma(bmao)
```

### Arguments

`bmao` |
an object of class 'bma' - see |

### Details

Each bma class (the result of bms) contains 'top models', the x models with tthe best analytical likelihood that bms had encountered while sampling

See `pmp.bma`

for an explanation of likelihood vs. MCMC
frequency concepts

### Value

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))

### See Also

`topmod`

for creating topmod objects, `bms`

for their typical use, `pmp.bma`

for comparing posterior model
probabilities

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

### Examples

```
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()
```

*BMS*version 0.3.5 Index]