glm.CMP {DGLMExtPois} | R Documentation |
Fit a COM-Poisson Double Generalized Linear Model
Description
The glm.CMP
function is used to fit a COM-Poisson double generalized
linear model with a log-link for the mean (mu
) and the dispersion
parameter (nu
).
Usage
glm.CMP(
formula.mu,
formula.nu,
init.beta = NULL,
init.delta = NULL,
data,
weights,
subset,
na.action,
maxiter_series = 1000,
tol = 0,
offset,
opts = NULL,
model.mu = TRUE,
model.nu = TRUE,
x = FALSE,
y = TRUE,
z = FALSE
)
Arguments
formula.mu |
regression formula linked to |
formula.nu |
regression formula linked to |
init.beta |
initial values for regression coefficients of |
init.delta |
initial values for regression coefficients of |
data |
an optional data frame, list or environment (or object coercible
by |
weights |
an optional vector of ‘prior weights’ to be used in the
fitting process. Should be |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data
contain |
maxiter_series |
Maximum number of iterations to perform in the calculation of the normalizing constant. |
tol |
tolerance with default zero meaning to iterate until additional terms to not change the partial sum in the calculation of the normalizing constant. |
offset |
this can be used to specify an a priori known component to be
included in the linear predictor during fitting. This should be |
opts |
a list with options to the optimizer,
|
model.mu |
a logical value indicating whether the mu model frame should be included as a component of the returned value. |
model.nu |
a logical value indicating whether the nu model frame should be included as a component of the returned value. |
x |
logical value indicating whether the mu model matrix used in the fitting process should be returned as a component of the returned value. |
y |
logical value indicating whether the response vector used in the fitting process should be returned as a component of the returned value. |
z |
logical value indicating whether the nu model matrix used in the fitting process should be returned as a component of the returned value. |
Details
Fit a COM-Poisson double generalized linear model using as optimizer the
NLOPT_LD_SLSQP algorithm of function nloptr
.
Value
glm.CMP
returns an object of class "glm_CMP"
. The
function summary
can be used to obtain or print a
summary of the results. An object of class "glm_CMP"
is a list
containing at least the following components:
coefficients |
a named vector of coefficients. |
residuals |
the residuals, that is response minus fitted values. |
fitted.values |
the fitted mean values. |
linear.predictors |
the linear fit on link scale. |
call |
the matched call. |
offset |
the offset vector used. |
weights |
the weights initially supplied,
a vector of |
y |
if requested (the default) the y vector used. |
matrix.mu |
if requested, the mu model matrix. |
matrix.nu |
if requested, the nu model matrix. |
model.mu |
if requested (the default) the mu model frame. |
model.nu |
if requested (the default) the nu model frame. |
nloptr |
an object of class |
References
Alan Huang (2017). "Mean-parametrized Conway–Maxwell–Poisson regression models for dispersed counts", Statistical Modelling, 17(6), pp. 359–380.
S. G. Johnson (2018). The nlopt nonlinear-optimization package
Examples
## Fit model
Bids$size.sq <- Bids$size^2
fit <- glm.CMP(formula.mu = numbids ~ leglrest + rearest + finrest +
whtknght + bidprem + insthold + size + size.sq + regulatn,
formula.nu = numbids ~ 1, data = Bids)
## Summary of the model
summary(fit)
## To see termination condition of the optimization process
fit$nloptr$message
## To see number of iterations of the optimization process
fit$nloptr$iterations