Manuscript Offprint

arXiv:2610.26437

R2-GP: Variance-Calibrated Priors for Additive Gaussian Processes

Javier Enrique Aguilar, Soham Mukherjee, David Kohns

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We develop R2-GP, an R2D2-type prior for Gaussian process (GP) generalised additive models (GAMs) that calibrates explained variance (R2R^2) for Matérn covariance kernels. The function variance for standard Matérn kernels depends jointly on the effect magnitude and length-scale. As such, smooth and rough components with identical amplitudes contribute very different amounts of variation. With independent priors on component amplitudes, this variation results in variance overestimation, especially in higher dimensions. We overcome this by taking direct control over each component's expected contribution to prior explained variance. We do this by rescaling each component based on its length scale and observed inputs, and modelling each rescaled variance as a share of the function variance induced by a global R2R^2 prior. This allows R2-GP to scale well to many components. To also scale to large sample sizes, we extend R2-GP to Hilbert space approximation methods, a framework for kernels exploiting their spectral decompositions for fast and efficient inference. Our simulations and real-world case studies demonstrate superior generalisation and parameter recovery over independent variance priors.

1 Introduction

Gaussian processes (GPs) are a class of probabilistic methods for modelling non-linear functions. They do so by assuming a multivariate Gaussian prior distribution over a finite set of these functions and are specified through a mean function and a covariance kernel (Williams and Rasmussen, 1995). Common choices of covariance kernel involve the Matérn class of functions (Rasmussen and Williams, 2006), defined using a length scale parameter and a magnitude parameter (also called GP marginal variance). The former controls the correlation decay rate between two arbitrary inputs while the latter controls prior variance of the functions at a single input.

GP priors have been specifically used in generalised additive models (GAMs; Hastie and Tibshirani, 1986, 1990) as an approach to model smooth functions (Wood, 2017). In GAMs, a response y∈RNy \in \mathbb{R}^N is modelled using multiple covariates X∈RN×DX \in \mathbb{R}^{N \times D} such that

yi=μ0+∑d=1Dfd(xid)+εi,εi∼N(0,σ2),(1)y_{i}=\mu_{0}+\sum_{d=1}^{D}f_{d}(x_{id})+\varepsilon_{i},\qquad\varepsilon_{i}\sim N(0,\sigma^{2}), \tag{1}

for i=1,…,Ni = 1, \ldots, N, where μ0\mu_0 is the intercept, εi\varepsilon_i is the residual error and fdf_d is a GP specific to the dd-th covariate. Additive GPs arise as a special case of the general class of models presented in Duvenaud et al. (2011).

In GAMs, modelling a response with many covariates introduces a variance explosion problem familiar from high-dimensional linear regression. If each of the DD components receives an independent variance prior with positive mass on non-zero values, the total signal variance accumulates as DD grows. Consequently, the implied prior on the proportion of explained variance R2R^{2} pathologically concentrates near one. This may lead to overfitting and contradict the modeller's domain knowledge about R2R^{2}, rendering the model predictively inconsistent (Riha et al., 2026).

Preventing this variance accumulation requires explicitly controlling the model's total variance. In regression contexts, a natural approach is to place a prior on R2R^{2} and partition it across the components, analogous to the R2D2 prior for linear models (Zhang et al., 2022). The mapping between a component's magnitude parameter and the observed function variance one wishes to control is however blurred by the simultaneous impact of the length scale and the input design. Because of this entanglement, smooth and rough components with identical magnitudes contribute vastly different amounts to observed function variation (Figure 1).

We overcome this structural issue with our R2-GP prior. By rescaling each component with a normaliser which is derived from its length scale and the input design, R2-GP forces the component's magnitude to exactly match its expected variation across the data. This calibration allows a global R2R^{2} prior which is partitioned with a simplex prior that forces components to compete for a share of the variance budget.

A drawback of this normalisation is the computational burden it adds to posterior inference. Since the normaliser depends on the length scale, it must be recomputed at every gradient evaluation when using MCMC methods like Hamiltonian Monte Carlo (Neal, 2011; Hoffman and Gelman, 2014). For an exact GP, this requires O(N2)O(N^{2}), added to the standard O(N3)O(N^{3}) cost of factorising the exact covariance matrix.

We solve this scalability issue by extending the R2-GP prior to Hilbert space approximation methods (HSGPs) (Solin and Särkkä, 2020; Riutort-Mayol et al., 2023; Mukherjee et al., 2026). HSGPs exploit the spectral decomposition of the kernel using basis functions M for large sample scalability and have been extended to GAMs efficiently (Timonen and Lähdesmäki, 2025). With the extension to HSGPs based on M<<NM << N basis functions, computing the normaliser simplifies to a single pre-computation of O(NM)O(NM) and O(M)O(M).

Code to replicate the experiments is available at https://github.com/davkoh/r2-gp.

References (27)