controlNB {WALS}R Documentation

Control function for initial NB fit

Description

Defines controllable parameters of initial NB fit in walsNB.

Usage

controlNB(
  start = list(mu = NULL, logTheta = NULL),
  method = "BFGS",
  controlOptim = list(maxit = 100),
  initThetaMASS = FALSE,
  initMASS = TRUE,
  restricted = FALSE,
  eps = .Machine$double.eps^0.25,
  epsilonMASS = 1e-08
)

Arguments

start

Optional starting values for fitNB2. Only used if initMASS = FALSE.

method

Optimization method used in optim. Only used if initMASS = FALSE.

controlOptim

List with parameters controlling optimization process of optim. Only used if initMASS = FALSE.

initThetaMASS

If TRUE, then initial \log{\theta} of fitNB2 is estimated using theta.ml (ML-estimation over 1 variable) based on regression coefficients from Poisson regression. If FALSE, then initial \log{\theta} = 0 is used.

initMASS

If TRUE (default), then initial fit in fitNB2 is estimated via glm.nb and initThetaMASS is ignored. If FALSE, then the initial fit is estimated by minimizing the log-likelihood using optim.

restricted

If TRUE, then initial fit in fitNB2 only considers the focus regressors. By default FALSE, then the unrestricted model is estimated in fitNB2 (i.e. all regressors).

eps

Controls argument eps in fitNB2 for generating starting value for logTheta (\log{\theta}) via theta.ml.

epsilonMASS

Sets epsilon in control argument of glm.nb.

Value

Returns a list containing the parameters specified in the arguments to be used in walsNB (and walsNBfitIterate).

See Also

walsNB, walsNBfitIterate.

Examples

data("NMES1988", package = "AER")
walsNB(visits ~ health + chronic + age + gender | I((age^2)/10) +
       married + region, data = NMES1988, prior = weibull(),
       controlInitNB = controlNB(initMASS = FALSE, restricted = TRUE))


[Package WALS version 0.2.5 Index]