Learn R Programming

BAS (version 0.90)

bayesglm.fit: Fitting Generalized Linear Models Bayesian marginal likelihood evaluation

Description

A version of glm.fit rewritten in C; also returns marginal likelihoods for Baysesian model comparison

Usage

bayesglm.fit(x, y, weights = rep(1, nobs),
            start = NULL, etastart = NULL, 
            mustart = NULL, offset = rep(0, nobs), family = binomial(),
            coefprior = bic.prior(nobs),
            control = glm.control(), intercept = TRUE)

Arguments

x
design matrix
y
response
weights
optional vector of weights to be used in the fitting process. SHould be NULL or a numeric vector.
start
starting value for coefficients in the linear predictor
etastart
starting values for the linear predictor
mustart
starting values for the vectors of means
offset
a priori known component to be included in the linear predictor
family
a description of the error distribution and link function for exponential family; currently only binomial() is coded.
coefprior
function specifying prior distribution on coefficients with optionlal hyperparamters leading to marginal likelihood calculations; options include bic.prior(),aic.prior(), and ic.prior()
control
a list of parameters that control convergence in the fitting process. See the documentation for glm.control()
intercept
should an intercept be included in the null model?

Value

  • coefficientsMLEs
  • seStandard errors of coefficients based on the sqrt of the diagonal of the inverse information matrix
  • mufitted mean
  • ranknumeric rank of the fitted linear model
  • devianceminus twice the log likelihood evaluated at the MLEs
  • gvalue of g in g-priors
  • shrinkagesrhinkage factor for coefficients in linear predictor
  • RegSSquadractic form beta'I(beta)beta used in shrinkage
  • logmarglikthe log marginal or integrated log likelihood (up to a constant)

Details

C version of glm-fit. For different prior choices returns, marginal likelihood of model using a Laplace approximation.

References

glm

See Also

bic.prior