Finds the maximum likelihood estimate of an additive negative binomial (NB1) model using an ECME algorithm, where each of the mean coefficients is restricted to be non-negative.
nnnegbin(y, x, standard, offset, start, control = addreg.control(),
accelerate = c("em", "squarem", "pem", "qn"),
control.method = list())
non-negative integer response vector.
non-negative covariate matrix.
standardising vector, where each element is a positive constant that (multiplicatively) standardises the fitted value of the corresponding element of the response vector. The default is a vector of ones.
non-negative additive offset vector. The default is a vector of zeros.
vector of starting values for the parameter estimates. The last element is
the starting value of the scale
, and must be > 1
. The remaining
elements are for the additive mean parameters, and must be
greater than control$bound.tol
.
an addreg.control
object, which controls the fitting process.
a character string that determines the acceleration
algorithm to be used, (partially) matching one of "em"
(no acceleration -- the default),
"squarem"
, "pem"
or "qn"
. See turboem
for further details. Note that "decme"
is not permitted.
a list of control parameters for the acceleration algorithm. See turboem
for details of the parameters that apply to each algorithm. If not specified, the defaults are used.
A list containing the following components
the constrained non-negative maximum likelihood estimate of the mean parameters.
the maximum likelihood estimate of the scale parameter.
the residuals at the MLE, that is y - fitted.values
the fitted mean values.
the number of parameters in the model (named ``rank
" for compatibility ---
we assume that models have full rank)
included for compatibility --- will always be negbin1(identity)
.
included for compatibility --- same as fitted.values
(as this is
an identity-link model).
up to a constant, minus twice the maximised log-likelihood (with respect to
a saturated NB1 model with the same scale
).
a version of Akaike's An Information Criterion, minus twice the maximised log-likelihood plus twice the number of parameters.
a small-sample corrected version of Akaike's An Information Criterion (Hurvich, Simonoff and Tsai, 1998).
the deviance for the null model, comparable with deviance
.
The null model will include the offset and an intercept.
the number of iterations of the EM algorithm used.
included for compatibility --- a vector of ones.
included for compatibility --- a vector of ones.
the standard
vector passed to this function.
the residual degrees of freedom.
the residual degrees of freedom for the null model.
the y
vector used.
logical. Did the ECME algorithm converge
(according to conv.test
)?
logical. Is the MLE on the boundary of the parameter
space --- i.e. are any of the coefficients < control$bound.tol
?
the maximised log-likelihood.
the non-negative x
matrix used.
This is a workhorse function for addreg
, and runs the ECME algorithm to find the
constrained non-negative MLE associated with an additive NB1 model.
Donoghoe, M. W. and I. C. Marschner (2016). Estimation of adjusted rate differences using additive negative binomial regression. Statistics in Medicine 35(18): 3166--3178.
Hurvich, C. M., J. S. Simonoff and C.-L. Tsai (1998). Smoothing parameter selection in non-parametric regression using an improved Akaike information criterion. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 60(2): 271--293.