getInclusionProbs: Extract posterior inclusion probabilities from the models...

Description Usage Arguments Value Author(s) Examples

Description

Extract posterior inclusion probabilities from the models table

Usage

1
2
3
  getInclusionProbs(models, modelData,
    logMargLiks = models$logMargLik,
    logPriors = models$logPrior)

Arguments

models

the models table (a data frame), the result from exhaustive

modelData

data used for model estimation

logMargLiks

vector of log marginal likelihoods (defaults to the logMargLik column of models)

logPriors

vector of log prior model probabilities (defaults to the logPrior column of models)

Value

a nice matrix with the probabilities for exclusion, linear and non-linear inclusion of the covariates

Author(s)

Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## get some data
attach(longley)

## get model data
md <- modelData(y=Employed,
                X=cbind(GNP, Armed.Forces))

## get a list of all possible models with this data
models <- exhaustive(md,
                     modelPrior="exponential")$models

## attach log prior probabilities
models$logPrior2 <- apply(models[, 1:2],
                          1L,
                          getLogModelPrior,
                          type="exponential",
                          modelData=md)

stopifnot(all.equal(models$logPrior,
                    models$logPrior2))

## then we can compute the inclusion probabilities
getInclusionProbs(models=models,
                  modelData=md)

hypergsplines documentation built on May 2, 2019, 6:14 p.m.