logit.spike(formula,
niter,
data,
subset,
prior = NULL,
na.action = options("na.action"),
contrasts = NULL,
drop.unused.levels = TRUE,
initial.value = NULL,
ping = niter / 10,
nthreads = 0,
clt.threshold = 2,
mh.chunk.size = 10,
proposal.df = 3,
seed = NULL,
...)SpikeSlabPrior. If prior is supplied it
will be used. Otherwise a prior distribution will be built using
the remaining arguments. See NAs. The default is set by the
na.action setting of options, and is na.fail if
that is unset. The factory-freshcontrasts.arg of
model.matrix.default.glm object (from which the
coefficients will be used), or a logit.spike objeping MCMC iterations.NULL or an int. If NULL the seed value will
be taken from the global .Random.seed object.SpikeSlabPrior.logit.spike, which inherits from
lm.spike. The returned object is a list with the following
elementsniter by ncol(x) matrix of regression
coefficients, many of which may be zero. Each row corresponds to an
MCMC iteration.prior was
supplied as an argument it will be returned. Otherwise this will be
the automatically generated prior based on the other function
arguments. The second algorithm is a random walk Metropolis update based on a
multivariate T proposal with proposal.df degrees of freedom.
If proposal.df is nonpositive then a Gaussian proposal is used.
The variance of the proposal distribution is based on the Fisher
information matrix evaluated at the current draw of the coefficients.
The third algorithm is an independence Metropolis sampler centered on
the posterior mode with variance determined by posterior information
matrix (Fisher information plus prior information). If
proposal.df > 0 then the tails of the proposal are inflated so
that a multivariate T proposal is used instead.
For either of the two MH updates, at most mh.chunk.size
coefficients will be updated at a time. At each iteration, one of the
three algorithms is chosen at random. The auxiliary mixture sampler
is the only one that can change the dimension of the coefficient
vector. The MH algorithms only update the coefficients that are
currently nonzero.
lm.spike
SpikeSlabPrior,
plot.logit.spike,
PlotLogitSpikeFitSummary
PlotLogitSpikeResiduals
summary.logit.spike,
predict.logit.spike.data(Pima.tr)
data(Pima.te)
pima <- rbind(Pima.tr, Pima.te)
model <- logit.spike(type == "Yes" ~ ., data = pima, niter = 500)
plot(model)
plot(model, "fit")
plot(model, "residuals")
plot(model, "size")
summary(model)Run the code above in your browser using DataLab