examples/getInclusionProbs.R

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

Try the hypergsplines package in your browser

Any scripts or data that you put into this service are public.

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