Description Usage Arguments Value Author(s) Examples
Stochastic search for models with high posterior probability
1 2 3 4 5 6 | stochSearch(modelData,
modelPrior = c("flat", "exponential", "independent", "dependent", "dep.linear"),
startModel = rep(0, modelData$nCovs),
chainlength = 100000L, nCache = chainlength,
nModels = as.integer(max(nCache/100, 1)),
computation = getComputation())
|
modelData |
the data necessary for model estimation,
which is the result from |
modelPrior |
either “flat” (default),
“exponential”, “independent”,
“dependent”, or “dep.linear”, see
|
startModel |
model configuration where the MCMC
chain starts. Defaults to the null model. Checked for
coherency with |
chainlength |
length of the model sampling chain (default: 100,000) |
nCache |
maximum number of best models to be cached
at the same time during the model sampling (by default
equal to |
nModels |
how many best models should be saved?
(default: 1% of the total number of |
computation |
computation options produced by
|
a list with the data frame “models” comprising the model configurations, log marginal likelihoods / priors / posteriors and hits in the MCMC run, the inclusion probabilities matrix “inclusionProbs”, the number of total visited models “numVisited” and the log normalization constant “logNormConst”.
Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ## get some data
attach(longley)
## get large model data
md <- modelData(y=Employed,
X=
cbind(GNP,
Armed.Forces,
Population,
Year))
## do a stochastic search over the model space
res <- stochSearch(md)
res
## now the same, but with cubic splines:
## get large model data
md <- modelData(y=Employed,
X=
cbind(GNP,
Armed.Forces,
Population,
Year),
splineType="cubic")
## do a stochastic search over the model space,
## and choose a special start model
res <- stochSearch(md,
startModel=c(2, 2, 2, 2))
res
## and now for generalised response:
## get the model data
md <- glmModelData(y=as.numeric(Employed > 64),
X=
cbind(GNP,
Armed.Forces,
Population,
Year),
family=binomial)
## do a stochastic search over the model space,
## also with a special start model
res <- stochSearch(md,
startModel=c(0, 1, 2, 1),
chainlength=1000L,
computation=
getComputation(higherOrderCorrection=FALSE))
res
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.