Definition
A P-spline (penalized B-spline) is a nonparametric smoother that fits a curve as a linear combination of a rich B-spline basis — many equidistant knots — while a difference penalty on adjacent basis coefficients controls smoothness (Eilers-Marx 1996). By penalizing the coefficients rather than choosing knot positions, it decouples the hard knot-selection problem from the smoothness problem: use plenty of knots and let a single penalty parameter λ regulate the fit.
Key Ideas
- Basis + penalty. Model μ=Ba where B is an m×n B-spline design matrix over equally spaced knots and a the coefficient vector. Smoothness is imposed by a k-th order difference penalty λ∥Dka∥2, where Dk forms k-th differences of adjacent coefficients (D2aj=aj−2aj−1+aj−2).
- Penalized least squares. a^=(B′B+λDk′Dk)−1B′y; the fit is linear in y with smoother ("hat") matrix H=B(B′B+λDk′Dk)−1B′.
- Connection to smoothing splines. For second-order differences the difference penalty is a discrete analogue of O'Sullivan's / Reinsch's integrated-squared-second-derivative penalty — the classical smoothing-spline penalty — but far simpler to compute and generalize to any difference order.
- Effective dimension = trace of the smoother. The effective number of parameters is tr(H) (following Hastie–Tibshirani), decreasing smoothly from n (at λ=0) toward the order of the penalty polynomial as λ→∞. This scalar makes different knot counts, spline degrees and penalty orders directly comparable.
- Choosing λ. Cross-validation or AIC built on the effective dimension; both are cheap because everything is a (generalized) linear regression.
- Limit and conservation properties. As λ→∞ the fit approaches a polynomial of degree k−1; P-splines conserve moments (means, variances) of the data and have no boundary effects, unlike kernel smoothers.
- GLM / likelihood extension. Drop the penalty into a penalized likelihood and solve by iteratively reweighted least squares — giving penalized nonparametric logistic regression, Poisson smoothing, and density estimation (smoothing a fine histogram as Poisson counts).
How It Works
Over-parameterize deliberately: place, say, 10–40 equidistant knots regardless of the true smoothness. The unpenalized fit would overfit, so add λ∥Dka∥2, which shrinks differences between neighbouring coefficients toward zero — a locally smooth coefficient sequence produces a smooth curve. Because the penalty acts on coefficients (not an integral of the curve), the normal equations gain only the small λDk′Dk term, so P-splines slot into any software that already does B-spline regression. Tune λ by minimizing AIC/CV over the effective dimension tr(H).
Why It Matters
- Removes knot-placement as a modelling burden, the historical Achilles heel of regression splines — a single continuous λ replaces a discrete combinatorial search.
- General-purpose smoother for scatterplot smoothing, nonparametric logistic/Poisson regression, and density estimation, and a natural building block for generalized additive models and, with tensor products, multidimensional and spatial smoothing.
- Cheap and modular: standard (generalized) linear-regression machinery, closed-form linear smoother, trivial effective-dimension bookkeeping.
Open Questions
- Automatic, robust selection of λ (CV vs AIC vs mixed-model REML) and its behaviour under correlated errors.
- Choice of penalty order k and number of knots — largely conventional rather than principled.
- Extending the trace-based effective dimension cleanly to the generalized (IRLS) and multidimensional/tensor-product cases.
Related