Improved Estimation for
Generalized Additive Models

Ioannis Kosmidis

Department of Statistics, University of Warwick

ioannis.kosmidis@warwick.ac.uk
ikosmidis.com   ikosmidis


ISNPS 2026
Thessaloniki, Greece

24 June 2026

Joint with

Dr Oliver Kemp

Generalized additive models

Generalized additive model

Data

Response values: \(y_1, \ldots, y_N\) with \(y_i \in \mathcal{Y} \subset \Re\)

Covariate values: \(x_1, \ldots, x_N\) with \(x_i \in \Re^p\)

Model1

\(Y_1, \ldots, Y_N\) are independent conditionally on the covariate values

\(Y_i \mid x_i\) has an exponential family distribution with mean \(\mu_i = E(Y_i \mid x_i)\) and dispersion parameter \(\phi\), with

\[ g(\mu_i) = \alpha^\top w_i + \sum_{j = 1}^q f_j(z_{ij}) \]

  • \(w_i\) and \(z_i\) are sub-vectors of \(x_i\)
  • \(\alpha\) is a vector of unknown scalar parameters, \(f_1, \ldots, f_q\) are unknown smooth functions

Spline basis expansions

Typically, \(f_1, \ldots f_q\) are defined via spline basis expansions, resulting in the linear predictor structure \[ g(\mu_i) = \alpha^\top w_i+ \sum_{j = 1}^q \beta_j^\top b_{ij} \] where \(b_{ij}\) is determined solely by the basis expansion and the covariates \(z_{ij}\).

Maximum penalized likelihood estimation

Estimation typically proceeds by maximizing the penalized log-likelihood \[ l_P = l - \frac{1}{2\phi} \sum_{j=1}^q \lambda_j \beta_j^\top S_j \beta_j \]

  • \(\beta_j^\top S_j \beta_j\) is a quadratic roughness penalty

  • \(\lambda_1, \ldots, \lambda_q\) are positive smoothing parameters

  • \(l\) denotes the log-likelihood as a function of \(\theta = (\alpha^\top, \beta^\top)^\top\)

  • \(\phi\) is treated as fixed

The penalty prevents overfitting by balancing function fit to the data and smoothness.

Penalized (left) and unpenalized (right) smooth fits.

Maximum penalized likelihood estimation

Regression parameters

For fixed \(\lambda\), a P-IRLS iteration can be used to estimate \(\alpha\) and \(\beta\), under identifiability constraints for the functions1.

Smoothing parameters

\(\lambda_j\) can be estimated using REML, GCV, UBRE via an outer iteration around P-IRLS.

See, for example, ?mgcv::gam for details, and other options.

Dispersion parameter

\(\phi\) can be estimated using the adjusted Pearson statistic estimator of Fletcher (2012).

Improved estimation

Bias

As is the case for maximum likelihood (ML) estimation for GLMs, maximum penalized likelihood (MPL) estimators for GAMs can also suffer from finite-sample bias.

Beyond standard sampling bias, bias may also be amplified by the smoothing penalty1.

Bias reduction for ML estimation

Explicit methods

\(\tilde\theta = \hat\theta - \hat{B}\)

e.g. Asymptotic bias correction1, Jackknife2, Bootstrap3

Implicit methods

e.g. Bias-reducing adjusted score equations4

The solution \(\tilde\theta\) of \(s + A = 0\), with \(s = \nabla l\), has \(E(\tilde\theta - \theta) = o(n^{-1})\) if \[ A_t = \frac{1}{2} {\rm trace}\left\{ i^{-1}\left(P_t + Q_t\right) \right\} \]

\(i = E(s s{}^\top)\), \(P_t = E( s_t s s{}^\top)\), \(Q_t = E(s_t \nabla \nabla^\top l)\)

Bias-reducing adjusted score equations

Bias reduction using adjusted score equations is becoming a standard approach, because it does not require repeated fitting and has useful side-effects.

e.g. in logistic regression1

  • If the model matrix is of full rank, \(\tilde\theta\) has all of its components finite.

  • \(\tilde\theta\) shrinks the model towards equi-probability across observations relative to the ML estimator, which typically leads to smaller estimated variances.

  • \(\tilde\theta\) has the same asymptotic distribution expected by standard ML estimators.

Adjusted score equations in GAM estimation

The adjusted score equations approach cannot be directly applied to GAMs, because:

  • Even when using spline basis expansions, a GAM may have more parameters than observations, and, hence, the information matrix is rank deficient.

  • The existence of the smoothing penalty results in bias in the estimating equations.

Bias-reducing adjustments for GAMs

Adjusted penalized score equations

Let \(\tilde\theta\) be the solution of \(\nabla l - \frac{1}{\phi} S_\lambda \theta + A_P = 0\), where \(A_P = O(1)\).

Bias expansion

If \(\lambda_j = O(1)\) and \(\phi\) is treated as fixed, then the bias of \(\tilde\theta\) is

\[ E(\tilde\theta - \theta) = -\underbrace{i_P^{-1} A}_{\text{sampling}} - \overbrace{\frac{1}{\phi} i_P^{-1} S_\lambda \theta}^{\text{smoothing}} + \underbrace{i_P^{-1} A_P}_{\text{adjustment}} + O(n^{-3/2}) \]

  • \(i_P = i + S_\lambda / \phi\), assumed invertible for \(\lambda_j > 0\) under identifiability constraints

  • \(S_\lambda\) is such that \(\theta^\top S_\lambda \theta = \sum_{j=1}^q \lambda_j \beta_j^\top S_j \beta_j\)

  • \(A_t = {\rm trace}\{ i_P^{-1} (P_t + Q_t)\} / 2\)

Bias-reducing adjustments for GAMs

Bias-reducing adjustments to the penalized score equations

If \(\lambda_j = O(1)\) and \(A_P = A + S_\lambda \theta / \phi\), then \(E(\tilde\theta - \theta) = o(n^{-1})\).

No smoothing

For \(\lambda = 0\), \(i_P = i\) and \(S_\lambda = 0\). Hence, we recover the bias-reducing adjusted score equations for standard GLMs.

Implementation

For GAMs, implementations of \(i\), \(P_t\) and \(Q_t\) as functions of \(\theta\) can be computed by the enrichwith R package (using the corresponding glm object).

P-IRLS can be extended to solve the adjusted score equations. The caveat is that as for GLMs1, \(\alpha\), \(\beta\) and \(\phi\) need to be updated at each iteration.

The smoothing parameters can be estimated in the same way as for maximum penalized likelihood.

Illustrations

Simulation study

\(Y_1, \ldots, Y_N\) are independent conditionally on covariates \(w_1, \ldots w_N, z_1, \ldots, z_N\).

\(Y_i \mid w_i, z_i \sim \operatorname{Binomial}(10, \pi_i)\) with

\[ \log\frac{\pi_i}{1 - \pi_i} = \alpha_0 + \sum_{k=1}^{10} \alpha_k w_{ik} + f_1(z_{i1}) + f_2(z_{i2}) \]

  • \(f_1(x) = \sin(17.5 x^2)\)

  • \(f_2(x) = \begin{cases} 2\sin(\pi x/1.5), & 0\le x<0.75,\\ 2, & 0.75\le x\le1. \end{cases}\)

\(z_{i1}\) and \(z_{i2}\) are realisations of independent \(\operatorname{Unif}(0,1)\) random variables.

Scalar covariates and effects

\(g_{i1}, \ldots, g_{i10}\) are realisations of independent standard normal variables, \(I(\cdot)\) is the indicator function, and \([a]\) is the floor of \(a\).1

Covariate \(\alpha_k\)
\(w_{i1}=I(g_{i1}<0.84)\) \(\log(4)\)
\(w_{i2}=I(g_{i2}<-0.35)\) \(\log(4)\)
\(w_{i3}=I(g_{i3}<0)\) \(\log(4)\)
\(w_{i4}=I(g_{i4}<0)\) \(\log(4)\)
\(w_{i5}=I(g_{i5}\ge-1.2)+I(g_{i5}\ge0.75)\) \(\log(2)\)
\(w_{i6}=I(g_{i6}\ge0.5)+I(g_{i6}\ge1.5)\) \(\log(2)\)
\(w_{i7}=[10g_{i7}+55]\) \(\log(\sqrt2)\)
\(w_{i8}=[\max\{0,100\exp(g_{i8})-20\}]\) 0
\(w_{i9}=[\max\{0,80\exp(g_{i9})-20\}]\) 0
\(w_{i10}=[10g_{i10}+55]\) \(-\log(\sqrt2)\)

\(\alpha_0\) is set so that \(E(Y_i | w_i, z_i) \approx 4\).

Setup

\(N = 100\)

\(30\) knots per function with a second-order P-spline1

\(1000\) samples

\(\lambda_1 = \lambda_2 = \lambda \in \{0.1, 0.2, 0.4, 0.8, 1.6, 3.2\}\) along with the data-driven mgcv smoothing parameter estimates

Estimation of scalar effects

Bias for the ten scalar effects

Estimation of scalar effects

MSE for the ten scalar effects

Estimation of \(f_1(\cdot)\)