Glossary

Terms used throughout the Whittaker documentation, listed alphabetically. Where a term has a direct counterpart in Whittaker’s API, the relevant class or function is noted.

Additive model
A regression model in which the predictor is the sum of individual functions of the covariates: \eta = \beta_0 + f_1(x_1) + f_2(x_2) + \cdots. Each function f_j captures the effect of one covariate independently. Because the model is additive, the contribution of each covariate can be estimated and visualized separately. See also generalized additive model.
Adaptive smooth (bs="ad")
A thin plate regression spline whose smoothness is allowed to vary spatially along the covariate axis. Instead of a single smoothing parameter \lambda, AdaptiveTPRS decomposes the ordinary TPRS penalty matrix into its eigenvectors and assigns each (or a contiguous block of eigenvectors) its own \lambda. Regions where the true function varies rapidly receive less smoothing, while flatter regions are smoothed more heavily. The number of separate penalty components is controlled by n_penalties. Prefer over plain TPRS when there is a priori reason to expect the required smoothness to vary across the covariate range. Specified with bs="ad" in the formula. Available via AdaptiveTPRS. See also TPRS.
Basis dimension (k)
The number of basis functions used to represent a smooth term before penalization. It sets an upper bound on the flexibility of the smooth: higher k allows more complex shapes, but the smoothing parameter \lambda prevents overfitting by penalizing excess curvature. In practice, k should be set large enough that the data do not need more flexibility than it allows. The k-index test (model.check()) flags terms where k may be too small. The default in Whittaker is k=10 for most basis types.
Basis function
One of a set of known functions whose weighted sum approximates an unknown smooth function. For example, a cubic regression spline with k=10 represents a smooth as f(x) = \sum_{j=1}^{10} \beta_j B_j(x), where each B_j is a basis function and the \beta_j are estimated coefficients. Different basis types (TPRS, CRS, P-splines) use different sets of basis functions with different mathematical properties.
Beta family
A response family for proportions on the open interval (0, 1), using a logit link by default: g(\mu) = \log(\mu / (1 - \mu)). The variance function is V(\mu) = \mu(1-\mu)/(1+\phi), where \phi is a precision parameter. Available via Beta(). See also BetaLS for the distributional variant.
BetaLS (Beta location-scale)
A GAMLSS family that models both the mean \mu and the precision \phi of a Beta distribution as smooth functions of covariates. The logit link constrains \mu to (0, 1) and the log link keeps \phi positive. Available via BetaLS(). See also GAMLSS.
BigGAM
A scalable variant of GAM that uses discretized P-IRLS to fit models on large datasets. Each covariate is binned into n_discrete unique values and sufficient statistics are accumulated over the grid, reducing memory from O(n \cdot p) to O(d \cdot p) where d \ll n. Uses fREML for smoothing parameter estimation. See also PolarsGAM, DuckDBGAM.
Binomial family
A response family for binary outcomes or proportions. The default logit link maps the linear predictor to a probability: P(y = 1 \mid x) = 1 / (1 + e^{-\eta}). The variance function is V(\mu) = \mu(1 - \mu). Available via Binomial().
Canonical link
The link function that sets g(\mu) = \theta, where \theta is the canonical parameter of the exponential family. Using the canonical link simplifies the score equations and guarantees concavity of the log-likelihood. Examples: identity for Gaussian, log for Poisson, logit for Binomial. Non-canonical links are sometimes preferred for interpretability.
CATE (Conditional Average Treatment Effect)
The expected treatment effect conditional on covariates: \tau(x) = E[Y(1) - Y(0) \mid X = x]. Unlike the ATE, CATE allows the effect to vary across the covariate space. Estimated by CausalGAM with method="interactive". See also treatment effect.
CausalGAM
A GAM-based implementation of the double machine learning (DML) framework for estimating causal treatment effects from observational data. It uses cross-fitted nuisance models to partial out confounders, producing debiased estimates of the ATE or CATE. Available via CausalGAM.
Coefficient function (\beta(t))
In functional GAM, the smooth function that weights each location t along the domain of a functional covariate in its contribution to the scalar response: \text{effect}_i = \int X_i(t)\,\beta(t)\,\mathrm{d}t. The coefficient function is estimated as a penalized expansion in a B-spline or Fourier basis and is returned by FunctionalGAM.coefficient_function() as a CoefficientFunction object with pointwise confidence bands. See also functional GAM, FunctionalTerm.
Concavity constraint
A shape constraint that forces a smooth to curve downward (i.e., f''(x) \le 0). Useful for modeling diminishing returns. Specified with bs="cv" in the formula. See also shape constraint, convexity constraint.
Concordance
See concurvity.
Concurvity
The nonlinear analogue of collinearity. When two smooth terms in a GAM can approximate each other, the model has high concurvity, which inflates standard errors and makes individual term estimates unreliable. Diagnosed with model.concurvity(), which returns pairwise and overall concurvity measures. Values above 0.8 are typically concerning.
Confidence band (interval)
A band around the fitted curve that reflects uncertainty in the estimated smooth. Pointwise intervals cover the true value at each individual x with the stated probability. Simultaneous bands cover the entire curve at once and are wider, accounting for the multiple-testing aspect of evaluating many points. Simultaneous bands are produced by predict(..., interval="simultaneous").
Conformal prediction
A distribution-free method for constructing prediction intervals with finite-sample coverage guarantees. Whittaker implements three conformal methods: split conformal ("split"), CV+ ("cv+"), and jackknife+ ("jackknife+"). The intervals adapt to local variance without distributional assumptions. Available via ConformalPredictor.
Conformity score
A measure of how unusual a calibration observation is relative to the fitted model, used in conformal prediction. The simplest conformity score is the absolute residual s_i = |y_i - \hat\mu_i|. The empirical quantile of the calibration scores determines the half-width of prediction intervals for new observations: a larger score means the model predicted that point poorly and the resulting interval will be wider. See also conformal prediction, marginal coverage.
Contrast
The difference between a smooth term’s predicted values at two specific covariate configurations. Contrasts answer questions like “how does the effect at x = 5 differ from the effect at x = 2?” with a point estimate, standard error, and confidence interval. Computed by model.contrasts(), which returns a ContrastResult. See also marginal effect.
Convexity constraint
A shape constraint that forces a smooth to curve upward (i.e., f''(x) \ge 0). Useful for modeling U-shaped cost curves or economies of scale. Specified with bs="cx" in the formula. See also shape constraint, concavity constraint.
Cook’s distance
A leave-one-out influence diagnostic that measures how much the fitted values change when observation i is removed: D_i = \frac{(\hat{\boldsymbol\mu} - \hat{\boldsymbol\mu}_{(i)})^\top (\hat{\boldsymbol\mu} - \hat{\boldsymbol\mu}_{(i)})}{p\,\hat\phi}. In practice it is approximated from the hat matrix diagonals and residuals without refitting. Large values flag observations that disproportionately drive the model fit. Returned by model.influence() in InfluenceResult.cooks_distance. See also hat matrix.
Cox proportional hazards (CoxPH)
A semiparametric model for time-to-event (survival) data that models the hazard as h(t \mid x) = h_0(t)\,e^{\eta(x)}, where h_0(t) is an unspecified baseline hazard and \eta is the (possibly smooth) linear predictor. Fitting maximizes the Cox partial log-likelihood, which conditions on the risk set at each event time and does not require estimating h_0(t). Right-censored observations (event time unknown but bounded below) are handled naturally. The ties= argument selects the Breslow or Efron approximation for tied event times. Available via CoxPH(status="event") as a family in GAM. See also family.
Cross-fitting
A procedure used in double machine learning to avoid overfitting bias when estimating causal effects. The data are partitioned into K folds. For each fold, nuisance functions (outcome and treatment models) are trained on the remaining K-1 folds, and residuals are computed on the held-out fold. This ensures the residuals used to estimate the treatment effect are independent of the nuisance fits. Combined with Neyman orthogonality, cross-fitting makes the treatment effect estimator root-n consistent despite using regularized nuisance GAMs. Used internally by CausalGAM. See also double machine learning.
Cross-validation (CV)
A resampling procedure for estimating out-of-sample model performance. The data are split into k folds. The model is trained on k - 1 folds and evaluated on the held-out fold, rotating so every observation is used for evaluation exactly once. The k scores are averaged to produce a single performance estimate. In Whittaker, cross_validate() returns a CVResult with the mean score, its standard error, and per-fold breakdowns.
Cubic regression spline (CRS)
A piecewise cubic polynomial with knots placed at quantiles of the covariate. The pieces join with continuous first and second derivatives, ensuring overall smoothness. CRS uses a wiggliness penalty on the integrated squared second derivative. Specified with bs="cr" in the formula. See also cyclic CRS.
Cumulant function
The function b(\theta) in the exponential family density whose derivatives give the mean (\mu = b'(\theta)) and the variance function (V(\mu) = b''(\theta)). It characterizes the distribution and determines the deviance.
Cyclic CRS
A variant of the cubic regression spline that wraps around, matching function values and derivatives at the boundary knots. Useful for periodic covariates such as time of day or day of year. Specified with bs="cc" in the formula.
Cyclic P-spline
A variant of the P-spline basis with periodic boundary conditions. Like cyclic CRS but using B-spline basis functions with a difference penalty. Specified with bs="cps" in the formula.
Deviance
A measure of the discrepancy between the fitted model and a saturated (perfect-fit) model: D = 2\phi[\ell(\text{saturated}) - \ell(\text{fitted})]. It generalizes the residual sum of squares to non-Gaussian families and is the quantity minimized during P-IRLS fitting. The deviance explained (analogous to R^2) is 1 - D / D_\text{null}.
Deviance explained
The proportion of the null deviance accounted for by the fitted model: 1 - D_\text{model}/D_\text{null}. Analogous to R^2 in linear regression, ranging from 0 (no improvement over an intercept-only model) to 1 (perfect fit on the deviance scale). Accessed via model.deviance_explained and reported in model.summary(). See also null deviance, deviance.
Deviance residuals
Residuals based on the contribution of each observation to the total deviance: r_i^D = \text{sign}(y_i - \hat\mu_i) \sqrt{d_i}, where d_i is the unit deviance. Deviance residuals are more nearly normally distributed than raw residuals for non-Gaussian families, making them the default choice for diagnostic plots.
Divergent transition
An MCMC step in which the Hamiltonian energy error exceeds a threshold (1000 by default), indicating that the leapfrog integrator has entered a region of very high posterior curvature and can no longer accurately simulate the dynamics. The resulting draw is biased rather than just being noisy, so any divergences invalidate local inferences. Divergences are reported in MCMCResult.n_divergent. Remedies include increasing target_accept (which adapts to a smaller step size) or reparameterizing the model to remove funnels or other high-curvature geometry. See also NUTS, Hamiltonian Monte Carlo, warmup.
Dispersion parameter (\phi)
A scale parameter that controls the spread of the response distribution beyond what is captured by the variance function. For Gaussian models, \phi = \sigma^2. For Poisson and Binomial, \phi = 1 (known). For Gamma, \phi is estimated. Accessed via model.scale.
Double machine learning (DML)
A framework for estimating causal effects in the presence of high-dimensional confounders. DML uses cross-fitting to estimate nuisance functions (outcome and treatment models) separately from the target causal parameter, avoiding regularization bias. Implemented in Whittaker via CausalGAM.
Double penalty (smooth selection)
A technique for automatic smooth term selection that adds a second penalty to each smooth, allowing the entire term to be shrunk to zero (effectively removed from the model). Activated with select=True in model.fit(). Terms that do not contribute receive near-zero effective degrees of freedom.
Duchon spline (bs="ds")
A generalization of the thin plate regression spline that provides explicit control over both the polynomial null-space order m and the radial exponent s of the kernel (the standard TPRS is the special case s = 1). Smaller values of s give a less smooth, more locally adaptive kernel at the cost of a larger polynomial null space. Useful when the default TPRS penalty becomes numerically awkward in higher dimensions or when the analyst wants direct control over the smoothness-exponent trade-off. Specified with bs="ds" and optional m=[s, m_order] in the formula. Available via DuchonSpline.
DuckDBGAM
A scalable GAM backend that streams data from DuckDB tables or SQL queries via Arrow. Ideal when the data lives in a database or when SQL-based filtering and transformation are needed before fitting. See also BigGAM, PolarsGAM.
Effective degrees of freedom (EDF)
The effective number of parameters used by a smooth term, accounting for penalization. An EDF of 1 means the term is a straight line. Higher values indicate more complex shapes. The total EDF across all terms determines model complexity. Accessed via model.edf_total and reported per term in model.summary().
Effective sample size (ESS)
An estimate of how many independent draws the correlated output of an MCMC chain is worth. Because successive MCMC samples are correlated, the information content of N draws is less than that of N independent draws. Whittaker reports two ESS variants (Vehtari et al. 2021):
  • ESS bulk (mcmc_result.ess): Geyer’s initial positive sequence estimator applied to rank-normalized draws. Measures mixing in the bulk of the posterior. An ESS / total-draws ratio above 0.05 is generally adequate.
  • ESS tail (mcmc_result.ess_tail): the minimum of the ESS of the binary indicators I(x \le Q_{0.05}) and I(x \ge Q_{0.95}). Measures how reliably the sampler explores the extreme tails. Low tail ESS can persist even when bulk ESS looks healthy.
Both are reported in model.summary(). See also MCMC, R-hat.
ELF (Expectile-Like Family) loss
The smoothed loss function used by QuantileGAM to approximate the quantile check function. It replaces the non-differentiable kink at zero with a smooth surrogate controlled by a bandwidth parameter \sigma. As \sigma \to 0, ELF converges to the true check function. The smoothness enables P-IRLS fitting. See also sigma calibration.
Exponential family
A class of probability distributions whose density can be written as f(y \mid \theta, \phi) = a(y, \phi) \exp[(y\theta - b(\theta))/\phi]. All response families in Whittaker (Gaussian, Poisson, Binomial, Gamma, etc.) belong to this class. The exponential family structure enables a unified fitting algorithm (P-IRLS).
Factor smooth (bs="fs")
A smooth interaction that creates a separate smooth of a numeric covariate for each level of a grouping factor, with all levels sharing the same smoothing parameter. Useful for random-slope models. Specified with s(x, group, bs="fs") in the formula. Available via FactorSmoothBasis.
Family
An object that specifies the conditional distribution of the response and the link function connecting the mean to the linear predictor. Every GAM requires a family. Whittaker provides: Gaussian, Poisson, Binomial, Gamma, NegativeBinomial, Beta, Tweedie, InverseGaussian, and CoxPH. Set via the family= argument to GAM.
Fitted values
The model’s estimate of the conditional mean \hat\mu_i for each training observation. On the response scale, fitted values are obtained by applying the inverse link to the linear predictor: \hat\mu = g^{-1}(\hat\eta). Accessed via model.predict(training_data).
Formula
A string specifying the model structure: the response variable, smooth terms, linear terms, and interactions. Whittaker uses R-style formula syntax: "y ~ s(x1) + s(x2) + x3" specifies a model with two smooth terms and one linear term. The formula is parsed into a Formula object that builds the model matrix.
fREML (fast REML)
A variant of REML optimized for discretized fitting in BigGAM and its streaming variants. It exploits the reduced-rank structure of the discretized design matrix for efficient smoothing parameter estimation. The recommended method for large datasets.
Functional GAM
A GAM for scalar-on-function regression, where one or more predictors are entire curves (functions) observed on a grid. The model estimates a coefficient function \beta(t) that weights the functional covariate along its domain. Available via FunctionalGAM with FunctionalTerm specifications.
Gamma family
A response family for strictly positive, right-skewed continuous data. The default link is the inverse: g(\mu) = 1/\mu. The log link is often preferred for interpretability. The variance function is V(\mu) = \mu^2, meaning variance grows with the squared mean. Available via Gamma().
GammaLS (Gamma location-scale)
A GAMLSS family that models both the mean \mu and the coefficient of variation of a Gamma distribution as smooth functions of covariates. Available via GammaLS().
GAMLSS (Generalized Additive Models for Location, Scale, and Shape)
An extension of GAMs that models multiple parameters of the response distribution (not just the mean) as smooth functions of covariates. For example, GaussianLS models both the mean \mu and the standard deviation \sigma, capturing heteroscedasticity. Fitted via alternating outer iteration. Available via GAMLSS with distributional families such as GaussianLS, GammaLS, BetaLS, ZeroInflatedPoisson, and ZeroInflatedNegativeBinomial.
Gaussian family
The default response family, assuming continuous unbounded responses with constant variance. The identity link maps the linear predictor directly to the mean: \hat\mu = \hat\eta. Fitting reduces to penalized least squares and converges in a single P-IRLS step. Available via Gaussian().
GaussianLS (Gaussian location-scale)
A GAMLSS family that models both the mean \mu and the standard deviation \sigma as smooth functions of covariates. Useful when variance changes with the predictors (heteroscedasticity). Available via GaussianLS().
Gaussian process smooth (bs="gp")
A smooth basis built from the leading eigenfunctions of a covariance (kernel) matrix evaluated at the training points. The inverse eigenvalues serve directly as the penalty, encoding prior beliefs about the correlation structure of the unknown function rather than imposing a derivative-based bending-energy penalty. Available covariance functions: "matern32" (default, once-differentiable), "matern52" (twice-differentiable), "exp" (exponential/rough), and "sqexp" (squared-exponential, infinitely smooth). Well suited to spatial covariates where smoothness reflects physical correlation. Specified with bs="gp" in the formula. Available via GaussianProcess.
GCV (Generalized Cross-Validation)
A smoothing parameter selection criterion that estimates leave-one-out cross-validation error without refitting: \text{GCV} = n \sum (y_i - \hat\mu_i)^2 / (n - \text{EDF})^2. GCV tends to undersmooth more than REML and is less robust to concurvity. It is an alternative to method="REML" in model.fit().
Generalized additive model (GAM)
A regression model that extends the generalized linear model by replacing linear covariate effects with smooth functions: g(\mu) = \beta_0 + f_1(x_1) + f_2(x_2) + \cdots. The smooth functions are estimated from the data using penalized regression splines, with smoothing parameters controlling the trade-off between fit and smoothness. The central class in Whittaker is GAM.
Generalized linear model (GLM)
A regression model that extends linear regression to non-Gaussian responses via a link function and an exponential family distribution. A GLM is a GAM in which every smooth function is replaced by a linear term. GLMs are a special case of GAMs.
Hamiltonian Monte Carlo (HMC)
A Markov chain Monte Carlo algorithm that uses gradient information to make distant proposals with high acceptance probability. The algorithm simulates Hamiltonian dynamics in an augmented space (β, p), where p is an auxiliary momentum vector. Each proposal is generated by the leapfrog integrator and accepted or rejected via a Metropolis step. HMC explores the posterior far more efficiently than random-walk Metropolis by following the geometry of the log-posterior surface. Whittaker provides two HMC-based samplers: static-trajectory HMC (sampler="HMC"), which runs a fixed number of leapfrog steps per proposal, and NUTS (sampler="NUTS", the default), which selects the trajectory length automatically. Both use a diagonal mass matrix pre-conditioned by the Laplace posterior covariance and dual-averaging step-size adaptation during warmup. Activated with method="MCMC" in model.fit(). See also NUTS, MCMC, leapfrog integrator.
Hat matrix (influence matrix)
The matrix \mathbf{A} such that \hat{\mathbf{y}} = \mathbf{A} \mathbf{y}. Its diagonal elements A_{ii} measure each observation’s leverage (influence on its own fitted value). The trace of \mathbf{A} equals the effective degrees of freedom. High-leverage observations warrant closer inspection in diagnostics.
Heteroscedasticity
The condition in which the variance of the response depends on the predictors. Standard GAMs with a Gaussian family assume constant variance. When heteroscedasticity is present, GAMLSS (which models variance as a smooth function) or quantile regression (which makes no variance assumption) are more appropriate.
Identifiability constraint
A constraint applied to each smooth term to make it uniquely estimable. By default, smooth terms in a GAM are centered to have mean zero across the data, so the intercept \beta_0 captures the overall level. Without this constraint, the intercept and the smooth would be confounded.
Inverse link
The function g^{-1} that maps from the linear predictor scale back to the response (mean) scale. For example, with a log link, the inverse link is g^{-1}(\eta) = e^\eta. Predictions on the response scale are obtained by applying the inverse link to the linear predictor.
k-index test
A diagnostic test for whether the basis dimension k is large enough for a smooth term. It compares the estimated residual variance near neighbouring covariate values to the overall residual variance. A significant result (p-value below 0.05) suggests that k should be increased. Produced by model.check() and reported as a GamCheckResult.
Knot
A fixed point along the covariate axis where basis function pieces join. In CRS, knots are placed at quantiles of the covariate. In P-splines, knots are equally spaced. The number and placement of knots, combined with the smoothing parameter, determine the shape of the fitted smooth.
Laplace approximation
An approximation to the marginal likelihood used in REML and ML estimation of smoothing parameters. It replaces the integral over the coefficient space with a Gaussian approximation centered at the mode, enabling efficient optimization of the smoothing parameter objective.
Leapfrog integrator
A numerical integrator for Hamiltonian dynamics used inside Hamiltonian Monte Carlo. It alternates half-steps in the momentum p and full steps in the position \beta, which preserves volume in phase space (symplecticity) and is exactly time-reversible. Both properties are required for the Metropolis acceptance step to maintain detailed balance and sample the correct posterior distribution. Whittaker’s leapfrog takes L steps of size \varepsilon per proposal, with L fixed by leapfrog_steps in mcmc_options. See also Hamiltonian Monte Carlo.
Linear predictor (\eta)
The additive combination of the intercept, smooth terms, and linear terms before applying the link function: \eta_i = \beta_0 + \sum_j f_j(x_{ij}). For Gaussian models with an identity link, \eta = \mu. For other families, \eta is on a transformed scale (log, logit, etc.) and must be back-transformed via the inverse link to obtain predictions on the response scale.
Link function
A monotonic, differentiable function g that maps the conditional mean \mu to the linear predictor \eta: g(\mu) = \eta. The link ensures that predictions respect the constraints of the response distribution (e.g., the log link keeps Poisson means positive). Each family has a default (canonical) link, but alternatives are available.
Marginal coverage
The probability that the true response falls within the prediction interval, averaged over the distribution of new observations: P(Y_{n+1} \in [L(X_{n+1}), U(X_{n+1})]) \ge 1 - \alpha. Conformal prediction methods provide a finite-sample marginal coverage guarantee without distributional assumptions. Marginal coverage does not guarantee coverage at every specific covariate value (that stronger notion is called conditional coverage). See also conformal prediction, conformity score.
Marginal effect
The change in the predicted response for a unit change in one covariate, holding all others fixed. For a smooth term f(x), the marginal effect at a point is the derivative f'(x). Computed by model.derivatives().
Markov random field (MRF) smooth (bs="mrf")
A smooth for discrete areal data (counties, districts, grid cells) that uses one indicator basis function per region and penalizes differences between neighboring regions via the graph Laplacian: \boldsymbol\beta^\top \mathbf{L}\boldsymbol\beta = \sum_{(i,j)\in\text{neighbors}} (\beta_i - \beta_j)^2. The neighborhood structure is supplied by the user as a dict mapping region labels to neighbor lists, or as a symmetric adjacency matrix. Use instead of a continuous 2-D smooth whenever the covariate domain is a set of discrete areas linked by shared borders rather than Euclidean coordinates. Specified with bs="mrf" in the formula. Available via MRFBasis. See also graph Laplacian.
Mediation analysis
A causal analysis that decomposes the total effect of a treatment on an outcome into a direct effect (not through the mediator) and an indirect effect (through the mediator). Requires the assumption of no unmeasured confounders of the mediator-outcome relationship. Available via mediation_analysis().
MCMC (Markov chain Monte Carlo)
A family of algorithms for drawing samples from a probability distribution by constructing a Markov chain whose stationary distribution is the target posterior. Rather than approximating the posterior analytically (as the Laplace approximation does), MCMC produces a set of coefficient vectors that characterize the full posterior distribution, including any non-Gaussian shape, skewness, or multimodality. Whittaker’s default MCMC sampler is NUTS (No-U-Turn Sampler); static-trajectory Hamiltonian Monte Carlo (HMC) is also available via sampler="HMC". Multiple independent chains are run in parallel; convergence is assessed via R-hat and ESS. Activated with method="MCMC" in model.fit(). See also NUTS, Hamiltonian Monte Carlo, R-hat, effective sample size, warmup.
ML (Maximum Likelihood)
A smoothing parameter selection criterion that maximizes the full (profiled) log-likelihood over the smoothing parameters. ML tends to undersmooth relative to REML because it does not account for the loss of degrees of freedom from estimating the fixed effects. Selected with method="ML" in model.fit().
Model matrix (design matrix)
The matrix \mathbf{X} whose columns are the evaluated basis functions (and any parametric terms) for all observations. Each row corresponds to an observation and each column to a basis function or parametric coefficient. The model matrix is constructed from the formula and the data by the ModelMatrix class.
Monotonicity constraint
A shape constraint that forces a smooth to be non-decreasing (bs="mpi") or non-increasing (bs="mpd"). Enforced by projecting P-IRLS updates onto the monotone cone using the pool adjacent violators algorithm (PAVA). See also shape constraint.
Multinomial family
A response family for unordered categorical data with K \ge 2 levels. Uses a baseline-category logit model: P(Y = k \mid \eta) \propto \exp(\alpha_k + \beta_k\eta), with the final category as the reference (\alpha_K = \beta_K = 0). Unlike ordered categorical, no assumption is made about category ordering — each non-reference category has its own loading \beta_k that can differ in magnitude and sign, so categories can respond differently to the same covariate effect. Available via Multinomial(n_categories=K). For binary responses use Binomial; for ordinal responses use OrderedCategorical. See also ordered categorical.
Multi-response GAM
A GAM that fits multiple response variables simultaneously against a shared formula, optionally estimating the residual correlation between responses. Each response has its own coefficients, but corresponding smooth terms share the same basis structure. Useful when several related outcomes are measured on the same units (e.g. multiple environmental metrics at the same sites) and joint modeling improves efficiency or coherence. The estimated residual correlation is returned by model.residual_correlation() as a ResidualCorrelation object. Available via MultiResponseGAM.
Negative Binomial family
A response family for overdispersed count data (variance exceeds the mean). Uses the NB2 parameterization with variance function V(\mu) = \mu + \mu^2/\theta, where \theta controls overdispersion. As \theta \to \infty, the distribution converges to Poisson. Available via NegativeBinomial().
Neyman orthogonality
A property of the moment condition used in double machine learning that makes the treatment effect estimate insensitive to first-order errors in the nuisance functions. Specifically, the derivative of the identifying equation with respect to the nuisance parameters is zero at the truth, so that estimation error in the nuisance GAMs contributes only second-order bias to the treatment effect estimate. Combined with cross-fitting, Neyman orthogonality ensures CausalGAM produces a root-n consistent, asymptotically normal treatment effect estimate despite using regularized GAMs for the nuisance fits.
Non-crossing constraint
A constraint in quantile regression that ensures fitted quantile curves do not cross: \hat{Q}_{\tau_1}(x) \le \hat{Q}_{\tau_2}(x) whenever \tau_1 < \tau_2. Enforced by isotonic projection after each P-IRLS update. Activated with non_crossing=True in QuantileGAM.
Null deviance
The deviance of an intercept-only model, computed as though no predictors were included: D_\text{null} = D(\mathbf{y},\, \bar\mu\,\mathbf{1}), where \bar\mu is the maximum-likelihood estimate of the mean under the null (intercept-only) model. Serves as the baseline for computing deviance explained: a larger reduction from D_\text{null} to D_\text{model} indicates a better fit. Accessed via model.null_deviance. See also deviance, deviance explained.
Nuisance function
A function that must be estimated as part of a statistical procedure but is not the primary object of inference. In double machine learning (DML), the outcome regression E[Y \mid X] and the treatment regression E[T \mid X] are both nuisance functions: they are needed to form debiased residuals for the treatment effect estimate but are not themselves the causal parameters of interest. CausalGAM fits nuisance functions as penalized GAMs using cross-fitting to avoid regularization bias. See also cross-fitting, Neyman orthogonality.
NUTS (No-U-Turn Sampler)
An extension of Hamiltonian Monte Carlo (Hoffman & Gelman 2014) that eliminates the need to specify a trajectory length. Instead of running a fixed number of leapfrog steps, NUTS grows a binary tree of states by doubling the trajectory in alternating forward and backward directions. Expansion stops automatically when a U-turn condition is detected: the leading endpoint has begun to double back toward the root, indicated by (β^+ - β^-)\cdot p^- < 0 or (β^+ - β^-)\cdot p^+ < 0. The final proposed state is drawn from the tree by slice sampling and biased progressive sampling within each subtree, ensuring detailed balance. NUTS adapts the step size \varepsilon during warmup using dual-averaging. The tree depth j determines the number of leapfrog evaluations: 2^j per NUTS step. Mean tree depth is reported in MCMCResult.mean_tree_depth; a cap is set by max_tree_depth (default 10). NUTS is the default sampler in Whittaker (sampler="NUTS"). See also Hamiltonian Monte Carlo, MCMC, leapfrog integrator, warmup.
Offset
A term in the linear predictor with a fixed coefficient of 1, not estimated from the data. Offsets are used to account for known exposure or population size in rate models. Specified as offset(log_exposure) in the formula.
Ordered categorical (OrderedCategorical)
A response family for ordinal data — outcomes with a natural order but no meaningful numeric spacing, such as Likert scales or severity grades. Uses the proportional-odds (cumulative logit) model: \log[P(Y \le k \mid \eta)/P(Y > k \mid \eta)] = \alpha_k - \eta, where \alpha_1 < \cdots < \alpha_{K-1} are estimated cutpoints and \eta is the shared linear predictor. The proportional-odds assumption is that a unit increase in \eta shifts the log-odds of being in a higher category by the same amount at every threshold. Available via OrderedCategorical(n_categories=K). For binary data use Binomial; for nominal (unordered) data use Multinomial.
P-IRLS (Penalized Iteratively Reweighted Least Squares)
The core fitting algorithm for GAMs. It iterates between constructing a penalized working linear model (using weights and a working response derived from the current fit) and solving the resulting penalized least-squares problem. For Gaussian models with an identity link, P-IRLS converges in a single step. For other families, it iterates until convergence.
P-spline
A smooth basis that combines B-spline basis functions with a difference penalty on adjacent coefficients. The penalty order controls the type of smoothness: first-order penalizes jumps, second-order (default) penalizes curvature. P-splines are computationally efficient because the B-spline basis and the penalty matrix are both banded. Specified with bs="ps" in the formula.
Partially linear model
The structural form used by CausalGAM with method="partial" for estimating the average treatment effect. The outcome is decomposed as Y = \theta T + g(X) + \varepsilon, where \theta is the constant treatment effect, g(X) is a nonparametric smooth of the confounders, and T is the treatment indicator. After partialling out g(X) from both Y and T via cross-fitting, \theta is estimated by regressing the outcome residuals on the treatment residuals. See also CausalGAM, double machine learning.
Partial dependence
The isolated effect of one smooth term on the predicted response, computed by varying that term’s covariates over a grid while holding all other terms at their model-matrix values and applying the identifiability constraint. Unlike partial_effects() (which returns Altair charts), model.partial_dependence() returns structured PartialDependenceResult objects with arrays for the grid values, effects, standard errors, and confidence bounds — suitable for custom plotting or downstream analysis. See also smooth term, confidence band.
PAVA (Pool Adjacent Violators Algorithm)
An algorithm for isotonic regression that enforces monotonicity by iteratively merging adjacent blocks of values that violate the ordering constraint, replacing them with their weighted average. Used internally by monotonicity constraints and the non-crossing constraint in quantile regression.
Pearson residuals
Residuals standardized by the variance function: r_i^P = (y_i - \hat\mu_i) / \sqrt{V(\hat\mu_i)}. For Poisson models, this divides by \sqrt{\hat\mu_i}. For Binomial, by \sqrt{\hat\mu_i(1 - \hat\mu_i)}. Useful for checking the variance assumption.
Penalty matrix
The matrix \mathbf{S} that encodes the smoothness penalty for a basis. The penalized objective is \|\mathbf{y} - \mathbf{X}\boldsymbol\beta\|^2 + \lambda \boldsymbol\beta^\top \mathbf{S} \boldsymbol\beta. For a second-derivative penalty, \mathbf{S} is the integrated squared second derivative of the basis functions. Larger \lambda values penalize wiggliness more strongly.
Pinball loss (check function)
The standard loss function for quantile regression: \rho_\tau(u) = u(\tau - \mathbf{1}[u < 0]), where \tau \in (0,1) is the target quantile. It penalizes over- and under-prediction asymmetrically: residuals above zero cost (1 - \tau)|u| and residuals below zero cost \tau|u|. The conditional \tau-th quantile is the minimizer of the expected pinball loss. Because the pinball loss has a non-differentiable kink at zero, Whittaker approximates it with the smooth ELF loss during fitting. See also ELF loss, sigma calibration, quantile regression.
Poisson family
A response family for non-negative integer counts, assuming equidispersion (variance equals the mean). The log link ensures predicted counts are positive: \hat\mu = \exp(\hat\eta). When the data show overdispersion, consider Negative Binomial or quasi-Poisson approaches. Available via Poisson().
PolarsGAM
A scalable GAM backend that extends BigGAM to accept Polars DataFrames, LazyFrames, or file paths (Parquet, CSV, IPC, NDJSON). Data is streamed in chunks via Polars’ lazy engine, so the full dataset never needs to be in memory. See also BigGAM, DuckDBGAM.
Prediction interval
An interval intended to cover a future observation (not just the mean) with a stated probability. Prediction intervals are wider than confidence bands because they account for both estimation uncertainty and residual noise. Produced by predict(..., interval="prediction").
PredictionResult
The object returned by GAM.predict(). Contains .values (predicted means on the response scale), .linear_predictor (on the link scale), and optionally .se, .lower, .upper when standard errors or intervals are requested.
Quantile regression
A regression method that estimates conditional quantiles Q_\tau(y \mid x) rather than the conditional mean. It is distribution-free and robust to outliers. Whittaker’s QuantileGAM fits one or more quantiles simultaneously using smooth additive functions and the ELF loss. Useful for heteroscedastic data, risk quantification, and adaptive prediction intervals.
R-hat (rank-normalized split R-hat)
A convergence diagnostic for MCMC (Vehtari et al., 2021). Each chain is first split in half, giving twice as many half-chains. This detects non-stationarity within a single chain. Classic Gelman-Rubin R-hat is then applied to the rank-normalized draws, making the statistic robust to heavy-tailed posteriors where the classic version can give a false sense of convergence. \hat{R} \approx 1 when all half-chains have converged to the same distribution. Values below 1.01 are ideal, values below 1.1 are generally acceptable, and values above 1.1 suggest insufficient warmup, too few chains, or poor posterior geometry. Computed per coefficient and reported in model.summary() and model.mcmc_result.r_hat. See also MCMC, effective sample size.
Random effect smooth
A smooth term that acts as a penalized random intercept or slope. It is a ridge-penalized set of indicator variables for a grouping factor, equivalent to a normal random effect in mixed models. Specified with bs="re" in the formula.
REML (Restricted Maximum Likelihood)
The recommended smoothing parameter selection criterion. REML maximizes a modified likelihood that accounts for the loss of degrees of freedom from estimating the fixed effects, producing more stable and slightly smoother fits than GCV or ML. Selected with method="REML" in model.fit().
Residuals
The difference between observed and fitted values, computed in various forms depending on the family: deviance residuals (default), Pearson residuals, working residuals, and response residuals. Residual plots are the primary tool for checking model assumptions. Accessed via model.predict(training_data) subtracted from the response, or via the type= argument.
Scale parameter
See dispersion parameter.
Shape constraint
A restriction on the shape of a smooth term, such as monotonicity, convexity, or concavity. Shape constraints are enforced by projecting the P-IRLS solution onto the constrained space at each iteration. Available basis types: "mpi" (monotone increasing), "mpd" (monotone decreasing), "cx" (convex), "cv" (concave). See also PAVA.
Shrinkage smooth
A variant of TPRS or CRS that includes an extra penalty component capable of shrinking the entire smooth to zero, enabling automatic smooth selection without using select=True. Specified with bs="ts" (shrinkage TPRS) or bs="cs" (shrinkage CRS) in the formula.
Sigma calibration
The process of selecting the ELF bandwidth parameter \sigma for quantile regression. Smaller \sigma gives a tighter approximation to the true quantile but makes optimization harder. calibrate_sigma() evaluates candidate values via cross-validation and returns the one that minimizes the out-of-sample pinball loss.
Simultaneous confidence band
A confidence region that covers the entire true curve f(x) with the stated probability, not just each individual point. Constructed by simulating from the posterior covariance of the coefficients to estimate a critical value c_\alpha such that P(\sup_x |f(x) - \hat f(x)| / \text{se}(x) \le c_\alpha) = 1 - \alpha. The resulting band \hat f(x) \pm c_\alpha \cdot \text{se}(x) is wider than the pointwise interval because it corrects for the multiplicity of evaluating the curve at many points. Produced by model.simultaneous_ci(), which returns a SimultaneousCIResult. See also confidence band.
Smooth selection
The process of deciding which smooth terms to include in the model. Whittaker supports two approaches: double penalty selection (select=True), which can shrink entire terms to zero during fitting, and cross-validation comparison of models with different term structures. See also shrinkage smooth.
Smooth term
A nonlinear function of a covariate estimated from the data, expressed as a weighted sum of basis functions with a smoothness penalty. Written as s(x) in the formula. Multiple covariates can form tensor product smooths via te(x1, x2) or tensor interactions via ti(x1, x2).
Smoothing parameter (\lambda)
A non-negative scalar that controls the trade-off between data fidelity and smoothness. When \lambda = 0, the smooth interpolates the data (no penalty). As \lambda \to \infty, the smooth shrinks to a straight line (maximum penalty). Estimated automatically by REML, GCV, ML, or fREML, or set manually via sp= in the formula.
Soap film smooth (bs="so")
A smooth for two-dimensional spatial data over irregular domains that may contain boundaries, concavities, or interior holes. Standard 2-D smooths such as TPRS or tensor product smooth treat the domain as convex and can leak information across geographic barriers (e.g. two points on opposite banks of a narrow bay appear close in Euclidean distance but are far apart within the domain). The soap film smooth avoids this by finite-element-discretizing the actual domain — expressed as a list of boundary polygons — and penalizing thin-plate bending energy only over paths reachable within the domain. Suitable for coastal, riverine, or any geographically constrained data. Specified with bs="so" and boundary polygons plus interior knots supplied via xt= in the formula. Available via SoapFilm.
StreamingGAM
A GAM variant for online learning that accumulates sufficient statistics incrementally as new data batches arrive. Each partial_fit() call updates the running totals. solve() produces a GAM fit from the accumulated statistics. An optional decay parameter downweights older batches for tracking distribution shift. Available via StreamingGAM.
Tensor product smooth (te)
A smooth of two or more covariates constructed by taking the row-wise Kronecker product of marginal basis matrices. Tensor products can model interactions between covariates on different scales. Each marginal has its own smoothing parameter, so a two-dimensional te(x1, x2) has two or more penalties. Written as te(x1, x2) in the formula.
Tensor interaction (ti)
A smooth that captures only the interaction effect between covariates, excluding the main effects. Used in models like "y ~ s(x1) + s(x2) + ti(x1, x2)" to decompose the bivariate surface into interpretable main effects plus a pure interaction. Written as ti(x1, x2) in the formula.
Thin plate regression spline (TPRS)
The default smooth basis in Whittaker. TPRS approximates the thin plate spline (which minimizes integrated squared second derivatives over any number of dimensions) using a truncated eigen-decomposition. It is isotropic (invariant to rotation of the covariates) and does not require knot placement. Specified with bs="tp" in the formula.
Treatment effect (ATE)
The average treatment effect: \text{ATE} = E[Y(1) - Y(0)], the expected difference in outcomes between the treated and control conditions, averaged over the population. Estimated by CausalGAM and returned as a TreatmentEffect object with .ate, .se, .ci_lower, .ci_upper, and .p_value.
Tweedie family
A response family for data with exact zeros mixed with positive continuous values (e.g., insurance claims, rainfall). The variance function is V(\mu) = \mu^p, where the power parameter p is between 1 and 2. At p = 1, it reduces to Poisson; at p = 2, to Gamma. Available via Tweedie().
Variance function (V(\mu))
The function that describes how the variance of the response depends on the mean: \text{Var}(Y) = \phi \cdot V(\mu). Each family has a characteristic variance function: V(\mu) = 1 for Gaussian, V(\mu) = \mu for Poisson, V(\mu) = \mu^2 for Gamma, etc. The variance function determines the weights in P-IRLS and is central to residual diagnostics.
VIF (Variance Inflation Factor)
A diagnostic for collinearity among the parametric terms (or among smooths, via concurvity). A VIF of 1 means no collinearity (values above 5-10 are concerning). Computed by model.vif().
Warmup
The initial phase of MCMC sampling during which the sampler adapts its step size (and, in some algorithms, its mass matrix) to the geometry of the posterior. Warmup draws are discarded after adaptation because the chain has not yet reached its stationary distribution. Whittaker uses dual-averaging step-size adaptation during warmup, targeting an acceptance rate of 0.65. The number of warmup draws per chain is controlled by n_warmup in mcmc_options (default: 500). See also MCMC, Hamiltonian Monte Carlo.
Working response
An adjusted dependent variable used internally by P-IRLS. At each iteration, the working response is z_i = \hat\eta_i + (y_i - \hat\mu_i) / g'(\hat\mu_i), where g' is the derivative of the link function. P-IRLS then solves a weighted least-squares problem with the working response as the target.
Zero-inflated model
A GAMLSS model for count data with more zeros than a standard Poisson or Negative Binomial distribution can accommodate. The model has a point-mass component at zero (with probability \pi) and a count component (with mean \mu). Both \pi and \mu can be modeled as smooth functions of covariates. Available via ZeroInflatedPoisson() and ZeroInflatedNegativeBinomial().