Learn R Programming

brglm2 (version 0.5.1)

brglmControl: Auxiliary function for glm fitting using the brglmFit method.

Description

Typically only used internally by brglmFit, but may be used to construct a control argument.

Usage

brglmControl(epsilon = 1e-08, maxit = 100, trace = FALSE,
  type = c("AS_mixed", "AS_mean", "AS_median", "correction", "ML"),
  transformation = "identity", slowit = 1, max_step_factor = 12)

brglm_control(epsilon = 1e-08, maxit = 100, trace = FALSE, type = c("AS_mixed", "AS_mean", "AS_median", "correction", "ML"), transformation = "identity", slowit = 1, max_step_factor = 12)

Arguments

epsilon

positive convergence tolerance epsilon.

maxit

integer giving the maximal number of iterations allowed.

trace

logical indicating if output should be produced for each iteration.

type

the type of fitting method to be used. The options are AS_mean (mean-bias reducing adjusted scores), AS_median (median-bias reducting adjusted scores), AS_mixed (bias reduction using mixed score adjustents; default), correction (asymptotic bias correction) and ML (maximum likelihood).

transformation

the transformation of the dispersion to be estimated. Default is identity. See Details.

slowit

a positive real used as a multiplier for the stepsize. The smaller it is the smaller the steps are.

max_step_factor

the maximum number of step halving steps to consider.

Value

a list with components named as the arguments, including symbolic expressions for the dispersion transformation (Trans) and its inverse (inverseTrans)

Details

brglmControl provides default values and sanity checking for the various constants that control the iteration and generally the behaviour of brglmFit.

When trace is true, calls to cat produce the output for each iteration. Hence, options(digits = *) can be used to increase the precision.

transformation sets the transformation of the dispersion parameter for which the bias reduced estimates are computed. Can be one of "identity", "sqrt", "inverse", "log" and "inverseSqrt". Custom transformations are accommodated by supplying a list of two expressions (transformation and inverse transformation). See the examples for more details.

brglm_control is an alias to brglmControl.

See Also

brglmFit and glm.fit

Examples

Run this code
# NOT RUN {
data("coalition", package = "brglm2")
## The maximum likelihood fit with log link
coalitionML <- glm(duration ~ fract + numst2, family = Gamma, data = coalition)

## Bias reduced estimation of the dispersion parameter
coalitionBRi <- glm(duration ~ fract + numst2, family = Gamma, data = coalition,
                    method = "brglmFit")
coef(coalitionBRi, model = "dispersion")

## Bias reduced estimation of log(dispersion)
coalitionBRl <- glm(duration ~ fract + numst2, family = Gamma, data = coalition,
                    method = "brglmFit", transformation = "log")
coef(coalitionBRl, model = "dispersion")

## Just for illustration: Bias reduced estimation of dispersion^0.25
my_transformation <- list(expression(dispersion^0.25), expression(transformed_dispersion^4))
coalitionBRc <- update(coalitionBRi, transformation = my_transformation)
coef(coalitionBRc, model = "dispersion")

# }

Run the code above in your browser using DataLab