Usage
bas.glm(formula, data, a, b, s=0,
family = binomial(link = "logit"),
n.models = NULL, modelprior = beta.binomial(1, 1),
initprobs = "Uniform", method = "MCMC", update = NULL,
bestmodel = NULL, bestmarg = NULL, prob.rw = 0.5,
Burnin.iterations = NULL, control = glm.control(),
offset = rep(0, nobs), weights = rep(1, nobs), laplace=FALSE)
Arguments
formula
generalized linear model formula for the full model with all
predictors, Y ~ X. All code assumes that an intercept will be
included in each model.
a
hyperparameter a for the CH-g prior. Suggested values 1 or 2.
b
hyperparameter b for the CH-g prior. Recommended choice
should be a function of n, the sample size, for
consistency. e.g. b=n or b=n/2 have worked well in simulation studies.
s
hyperparameter s for the CH-g prior; default is 0.
family
a description of the error distribution and link
function for exponential family;
currently only binomial() with the logitistic linke is available in
this version.
n.models
number of models to sample. If NULL, BAS will
attempt to enumerate unless p > 35 or method="MCMC".
initprobs
vector of length p with the initial inclusion
probabilities used for sampling without replacement (the intercwept
should be included with probability one) or a character
string giving the method used to construct the sampling probabilities
method
A character variable indicating which sampling method to
use: method="BAS" uses Bayesian Adaptive Sampling (without
replacement) using the sampling probabilities given in initprobs;
method="MCMC" combines a random walk Metropolis Hastings (as
update
number of iterations between potential updates of the
sampling probabilities in the "BAS" method. If NULL do not update,
otherwise the algorithm will update using the marginal inclusion
probabilities as they change while sampling takes place.
bestmodel
optional binary vector representing a model to
initialize the sampling. If NULL sampling starts with the null
model
bestmarg
optional value for the log marginal associated with
the bestmodel
prob.rw
For any of the MCMC methods, probability of using the
random-walk proposal; otherwise use a random "flip" move to propose
a new model.
Burnin.iterations
Number of iterations to discard when using any of the MCMC options
control
a list of parameters that control convergence in the
fitting process. See the documentation for
glm.control()
offset
a priori known component to be included in the linear
predictor
weights
optional vector of weights to be used in the fitting
process. SHould be NULL or a numeric vector.
laplace
logical variable for whether to use a Laplace
approximate for integration with respect to g to obtain the marginal
likelihood. If FALSE the Cephes library is used which may be
inaccurate for large n or large values of the Wald Chisquared stat