Generalized additive model Created 2026-10-05 Updated 2026-10-14
A generalized additive model has linear predictor . Centering the smooth functions identifies the intercept. The response family and link function remain part of the model; an unspecified software family must not be inferred from the response name.
Identity link Created 2026-10-14 Updated 2026-10-20
The identity link function equates the response mean with the linear predictor. In a generalized linear model it gives . It is the canonical link function for the normal distribution. For response families whose means must remain positive or between zero and one, using the identity link requires corresponding restrictions on the linear predictor.
Multi-armed bandit 2026-10-25
A sequential decision model in which each round selects an action and observes its reward, balancing information gathering against immediate reward. For fixed action means , the pseudoregret compares selected actions with an action maximizing . In models with a link function and parameter , rewards may have means .
Nathaniel E. Helwig 2026-11-05
Nathaniel E. Helwig develops statistical methods at the intersection of psychology and computational statistics. His University of Minnesota research biography emphasizes multivariate and nonparametric statistics for complex observations.[ref]
His Generalized Linear Models in R by Nathaniel E. Helwig explains how a link function connects a response's conditional expected value with a linear predictor. For logistic regression, the predictor represents log odds; for Poisson regression, a logarithmic link ensures a positive fitted mean. This separates the model for the mean from the response's probability distribution, while making deviance and dispersion part of model assessment.[ref]
Generalized Linear Models in R by Nathaniel E. Helwig. Section 1 and logistic/Poisson examples; the notes explicitly credit their textbook basis
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 41 3 Solution Created 2026-10-03 Updated 2026-10-14
The Poisson distribution mass function isIt is an exponential dispersion family of order one withIndeed, and . A generalized linear model specifies independent random variables from a response exponential family, together with a linear predictor and a link function relating it to the response mean. The Poisson canonical link is .
For the insurance counts, let class and merit be the reference levels in a regression factor. The fitted Poisson regression assumesThe insured exposure is known; its logarithm is an offset, not a coefficient to estimate. The model has eight free mean parameters and fixes the dispersion parameter at one. It assumes additive class and merit effects on the log-rate scale, hence multiplicative effects on the rate scale without a class-by-merit interaction.
Apart from constants independent of the parameters, the log-likelihood isDifferentiating gives the Poisson regression margin-matching score equationsThus the fitted totals equal the observed totals in each class and merit category, including the reference categories by subtraction. In design matrix notation these equations are . Fisher scoring solves them iteratively; the reported three iterations describe the numerical fit, not an additional statistical result.
The regression intercept gives the baseline fitted claim rate per insured car year. The merit rate ratios, relative to merit at the same class, areThe class rate ratios, relative to class at the same merit, areEach predicted cell rate is the baseline rate times its class and merit multipliers. The output's coefficient-to-standard error ratios are asymptotic normal Wald test statistics under the fitted Poisson regression, despite the software label “t value”; there is no estimated Gaussian residual scale in this model. All nonreference effects have very large absolute ratios.
The null Poisson deviance is on nineteen statistical degrees of freedom; adding the seven factor coefficients reduces it by . But the final Poisson deviance is still on twelve statistical degrees of freedom, and the deviance residuals include values near and . These are far beyond what a well-fitting unit-dispersion model would normally produce. The additive Poisson model fits substantially better than a common rate, but remains grossly inadequate. A class-by-merit interaction, overdispersion, or statistical dependence between claims could contribute; the summary alone does not distinguish these explanations. Its very small nominal standard errors and formal Wald tests rely on the rejected model, so improved mean structure and error assumptions are needed before treating them as reliable uncertainty assessments.
Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 3 5I Solution Created 2026-09-24 Updated 2026-10-14
In a generalized linear model, the linear predictor is , a linear combination of the covariates with unknown coefficients. The link function relates this predictor to the mean: . The canonical link function chooses the natural parameter of the exponential family, namely . Differentiating the normalization of the density shows that , so the canonical link function is on the admissible parameter interval.
For a Bernoulli distribution, the probability mass function can be written asThus and . The canonical link is the logit:
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 43 5 a Solution Created 2026-10-03 Updated 2026-10-14
A Gaussian generalised additive model with the identity link specifiesThe are unknown smooth functions estimated from the data, rather than necessarily straight lines. The model is additive in their effects, so it does not automatically contain interactions between covariates. To identify the intercept separately from the smooths, impose a constraint such as for each . Linear terms can also be included alongside smooth terms. More generally a specified link function can make additive; for the normal identity-link model the mean itself has the displayed form. Smoothness is typically controlled through a basis and a roughness penalty, preventing an unrestricted smooth from interpolating all the noise.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 42 5 Solution Created 2026-10-03 Updated 2026-10-14
An exponential dispersion family of order one has density or mass function, relative to a fixed dominating measure, of the formwhere is a scalar natural parameter, is the dispersion parameter, and the support does not depend on . For regular families, is twice differentiable on an open natural-parameter domain and . Known observation weights replace by . “Order one” refers to the scalar canonical statistic , rather than an arbitrary vector of canonical statistics.
Differentiate the normalization , or its discrete counterpart, assuming differentiation under the integral is valid. The first derivative gives . The second derivative givesConsequently,The variance function expresses the second derivative in terms of the mean:
A generalized linear model specifies independent responses from an exponential dispersion family, a linear predictor , and a differentiable monotone link function relating it to the response mean by . The family, variance function, covariate design, link function and dispersion specification together define the model. The canonical link function identifies the linear predictor with the natural parameter:One advantage is that the likelihood equations become particularly simple. With known weights and common dispersion , the score function and negative Hessian matrix for areThe latter does not explicitly depend on the responses, so it equals the expected Fisher information matrix at the same parameter. With full-rank design and positive variances the likelihood is strictly concave in , simplifying optimization. These statements concern the coefficient block at a fixed dispersion value.
For a normal distribution with mean and variance ,Thus , , , and . Its canonical link function is , the identity link.
For a Poisson distribution with mean and support ,Here , , , and . Therefore , , and the Poisson canonical link is .
For a Bernoulli distribution with success probability ,Taking , , , and gives the required form. Its mean and variance function are and . Its canonical link function is , the logit link. The fixed dispersion values in the Poisson and Bernoulli cases are part of those models; an arbitrary continuous dispersion is not being asserted for them.
To test , first fit the unrestricted model and then the restricted model with that component fixed at zero, estimating all nuisance parameters, including dispersion when applicable, in each fit. If and denote their full fitted parameter vectors, the likelihood-ratio test usesFor identifiable regular models, an interior null parameter and a fixed-dimensional full-rank design with increasing information, the Wilks theorem gives under . A level- test rejects for greater than the -quantile of the chi-squared distribution with one degree of freedom.
Alternatively the Wald test uses , with the variance obtained from the appropriate inverse full Fisher information matrix; it has the same limiting null law. The score test fits only the restricted model. If collects its nuisance parameters, its efficient information is , and the statistic is , again asymptotically . Accounting for the nuisance block is necessary rather than using the unadjusted diagonal information.
Past exam of the mathematics course of the University of Cambridge 2008 ii Paper 4 5J Solution Created 2026-09-24 Updated 2026-10-14
These are nested Poisson regression models with independent counts and the default log link function. If is biomass and is the three-level pH group, model 1 specifies : one common intercept and slope. Model 2 specifies : three group-specific intercepts and a common slope. Model 3 specifies : three intercepts and three slopes, because the multiplication syntax includes both main effects and their interaction. The parameter counts are therefore .
The analysis of deviance compares model 1 against model 2 by testing equality of the three intercepts, conditional on a common biomass slope. The likelihood-ratio test statistic is with two additional parameters, giving the reported tiny p-value. The next test compares model 2 against model 3 by testing equality of their three slopes. Its statistic is , again with two degrees of freedom and reported . Both restrictions are rejected. Thus model 3 is the supported choice: both baseline richness and its biomass dependence vary with pH. Under the Poisson assumptions, residual deviance on residual degrees of freedom is also consistent with a satisfactory fit, although these nested tests themselves establish improvement rather than every possible aspect of model adequacy.
The prediction from model 2 is on its linear-predictor scale. Exponentiating gives its fitted means. The final expression is twice the saturated log likelihood minus the model-2 log likelihood, i.e. the Poisson deviance of model 2. ConsequentlyIn the saturated model each mean equals the corresponding observed count, with the usual continuous convention for a zero count.
Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 3 5J Solution Created 2026-09-24 Updated 2026-10-14
A generalized linear model has independent responses whose distributions belong to an exponential family:Here the expected value and variance are and . A specified one-to-one link function connects the mean to the linear predictor: . The canonical link function is .
In binomial regression, independently, with known trial counts and probabilities related to the predictor. The logistic regression and probit regression specifications are respectivelyHere is the standard normal distribution function. The binomial log-density contains , so its natural parameter is the log-odds: the logistic link is canonical. If the response mean is written as , the canonical link is .
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 3 b Solution Created 2026-10-03 Updated 2026-10-06
A generalized linear model specifies independent responses in an exponential dispersion family, their means , and a link function connecting those means to a linear predictor. In the common notation,where are known positive weights, is the common dispersion parameter, and is the variance function. The systematic part isHere is a row of the known design matrix and contains the unknown regression coefficients. The link function is invertible on the permitted mean domain; the canonical link function takes the mean to the natural parameter. This separates distributional, predictor, and link assumptions: it does not require the response itself to be normally distributed or the mean itself to be linear in the covariates.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 3 c Solution Created 2026-10-03 Updated 2026-10-06
Both fits use the same Gamma distribution mean model and inverse link function. Their coefficient estimates, fitted means and hence their weight matrices coincide: the common dispersion parameter only multiplies the likelihood score by a scalar and therefore does not change its zero. The displayed calls likewise show the same family and formula; fixing dispersion in a summary changes the uncertainty calculation, not these coefficient estimates.
For and , the Fisher information weights areThus the common matrix is multiplied by dispersion in the exponential case and by in the fitted gamma case. Taking square roots of the diagonal covariances givesFor instance for the intercept, and the same factor applies to all the coefficients. The standard errors are smaller because the fitted dispersion parameter is below one, not because a different mean function was fitted.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 3 e Solution Created 2026-10-03 Updated 2026-10-06
The dispersion-one assumption is strongly contradicted by the preceding calculation. Use the gamma analysis with estimated dispersion, namely the F table. A failure to reject shape three does not establish that the true shape equals exactly three; retaining the estimated dispersion parameter is appropriate.
In the analysis of deviance for nested generalized linear models, a deviance reduction for extra coefficients is divided by when dispersion is estimated. The approximate null calibration is . For the type term, the null is that the two type contrasts vanish, against at least one nonzero contrast. The statistic iswith approximate null distribution and p-value . For position, the null is that its coefficient vanishes after accounting for type; the statistic iswith approximate null distribution and p-value . At 5% there is evidence that component type affects the expected failure time, and no significant additional position effect. The table is sequential: the type comparison is to the intercept-only model, while the position comparison adjusts for type. The individual gamma coefficient tests also suggest that type 3 accounts for the clearer type difference. The inverse link function means its positive contrast corresponds to a lower fitted mean failure time, holding position fixed.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 4 a Solution 2026-10-06
The three Poisson regression models have independent counts and a logarithmic link function: their mean predictors include both
pc and urban in m1, only urban in m2, and only pc in m3. Nested comparisons through the full model are preferable to a direct comparison of the two nonnested one-predictor models.To remove
urban from m1, test against . The likelihood-ratio test statistic is the deviance differencewith approximate null distribution . It is below , so do not reject at 5%. The corresponding Wald p-value is consistent with this decision. To remove pc from m1, test against a nonzero coefficient, giving with approximate null distribution ; reject decisively. The Akaike information criterion also prefers m3, whose value is smaller than and . Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 5 b i Solution Created 2026-10-03 Updated 2026-10-06
For woman , write for the number of births, for the number with defects, for baseline age, and for exposure. Let be the common marginal defect probability for her births. The first fit is a grouped grouped-binomial logistic regression:It assumes independent women and, conditionally on their covariates, independent births with the same probability within each woman. The supplied birth totals are the binomial denominators; fitting the proportions with weights is equivalent to this grouped-binomial specification. The fitted linear predictor is .
The second fit is a generalized additive model with the same logit link function and the mean specificationThe functions are penalized cubic regression splines with natural boundary conditions. Centering constraints such as separate them from the intercept; the fitted centered intercept is . Their second derivative roughness penalties control complexity.
The call estimates a common scale rather than fixing it at one. Its working variance specification for the counts isEquivalently the variance of is . This is the working moment interpretation of an overdispersed binomial generalized additive model: the code uses binomial deviance for fitting and estimated scale for inference. With , it is not an exact independent-binomial sampling model. Women are still treated as independent groups, but within-woman dependence or unobserved heterogeneity can motivate the extra dispersion. The quasibinomial regression interpretation states what the scaled analysis assumes without inventing a full probability distribution for its counts.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 1 12J Solution Created 2026-09-24 Updated 2026-10-14
Under the binomial distribution model's assumption of independent games with a common win probability , the probability of winning a match isThis is also the cumulative distribution function of a beta distribution with parameters : differentiation of the binomial tail gives , and . In particular is strictly increasing on and maps bijectively onto itself.
The new match probability is , while the desired linear predictor remains the game-level log odds. Therefore the link function isIts endpoint values are and . This is not the ordinary match-level log odds link: it first recovers the underlying game probability. Symmetry of the binomial tail gives , hence , as required by swapping the players. Dependence or varying game probabilities within a match would invalidate the stated binomial-tail conversion.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 3 5J b Solution Created 2026-09-24 Updated 2026-10-03
For independent observations from an exponential dispersion family with common known dispersion parameter , the generalized linear model log-likelihood iswhere and the link function satisfies .
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 4 13J a Solution Created 2026-09-24 Updated 2026-09-29
A generalized linear model assumes independent responses from one exponential dispersion family,where , , and a link function relates the mean to the linear predictor by . It follows from normalization of the density after shifting the natural parameter thatIndependence therefore gives the joint moment-generating functionwhenever every shifted natural parameter lies in its natural-parameter domain.
Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 2 5J Solution Created 2026-09-23 Updated 2026-09-25
A generalized linear model assumes that the independent responses have distributions in an exponential family, with means , and thatThe invertible function is the link function; it connects the mean to the linear predictor.
For binomial regression, write independently, so . The logistic regression link iswhile probit regression useswhere is the standard-normal distribution function. The logit is the canonical link function for the binomial family.
Past exam of the mathematics course of the University of Cambridge 2026 iii Paper 218 1 b Solution Created 2026-09-24 Updated 2026-09-25
Writing for difficulty, model1 assumes independent responseswith common dispersion. The estimates are and .
One extra difficulty level decreases the fitted inverse squared mean response time by . Since , this means that fitted mean response time increases with difficulty. The negative coefficient is therefore unsurprising; its sign looks counterintuitive only if the inverse-squared link function is ignored. The independence assumption is questionable because every subject contributes eight repeated responses.