Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 36 5 ii Solution Created 2026-10-03 Updated 2026-10-14
With the negative-binomial size held fixed, collect all mean-independent terms into . The cell log-likelihood isIts derivative isFor it is positive below and negative above , so the saturated maximum is at . For , the maximum is the boundary limit . Evaluating the saturated-minus-fitted log-likelihood gives the negative binomial devianceAll gamma-function and factorial terms cancel because the same known is used in both models. The zero-count logarithmic term is interpreted as zero; its remaining cell contribution is . No intercept score cancellation is required for this formula, so it applies to the specified design whether or not its covariates include an intercept.
For completeness, the fitted coefficients obey the score equations of the fixed-size negative binomial generalized linear model,The logarithmic link is not the canonical link for this family, but it produces the requested positive means. As a check, when ,so the formula tends to the full Poisson deviance, including the linear terms when an intercept-balance equation is unavailable. The size used here is the negative-binomial size parameter; it is distinct from the random-multiplier variance denoted by the same letter in Question 4.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 3 d Solution Created 2026-10-03 Updated 2026-10-06
Use negative binomial regression with a logarithmic mean link, for exampleIn the mean-size parametrization,The extra parameter allows overdispersion that grows quadratically with the mean, unlike the proportional variance of Quasi-Poisson regression.
library(MASS)
species_nb <- glm.nb(nspecies ~ altitude, link = log)The printed assertion needs qualification: a negative-binomial model with fixed size is a generalized linear model. For known , its probability mass function isWith natural parameter , it has exponential family formwith dispersion one. A logarithmic link is permitted even though it is not the canonical link function. This is the fixed-size negative binomial generalized linear model.
What prevents a single ordinary fixed-family GLM fit in
glm.nb is joint estimation of the unknown size : it changes the cumulant, carrier, and variance function, rather than merely multiplying a fixed variance function by a scalar dispersion. The routine alternates a GLM fit at fixed with size-parameter likelihood updates. Thus the intended distinction is between that enlarged fitting problem and a single fixed-family GLM, not a claim that negative-binomial regression can never be a GLM. The package documentation explicitly supports both conventions: stat.ethz.ch/R-manual/R-patched/library/MASS/html/glm.nb.html and stat.ethz.ch/R-manual/R-patched/library/MASS/html/negative.binomial.html.