Generalized additive model Created 2026-10-05 Updated 2026-10-06
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.
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 is
Here 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.
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 are
Thus 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 gives
For 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.
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 is
with approximate null distribution and p-value . For position, the null is that its coefficient vanishes after accounting for type; the statistic is
with 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.
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 difference
with 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 .
Among these three models choose m3, retaining building cover and omitting the urban indicator. This is a comparison within the stated Poisson family; its absolute fit must still be checked, as the next part does.
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 specification
The 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 is
Equivalently 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.
Under the binomial distribution model's assumption of independent games with a common win probability , the probability of winning a match is
This 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 is
Its 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.
For independent observations from an exponential dispersion family with common known dispersion parameter , the generalized linear model log-likelihood is
where and the link function satisfies .
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 that
Independence therefore gives the joint moment-generating function
whenever every shifted natural parameter lies in its natural-parameter domain.
A generalized linear model assumes that the independent responses have distributions in an exponential family, with means , and that
The invertible function is the link function; it connects the mean to the linear predictor.
For binomial regression, write independently, so . The logistic regression link is
while probit regression uses
where is the standard-normal distribution function. The logit is the canonical link function for the binomial family.
Writing for difficulty, model1 assumes independent responses
with 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.