---
title: Locally Smoothed Gaussian Process Regression
url: https://www.emergentmind.com/topics/locally-smoothed-gaussian-process-regression
type: topic
---

# Locally Smoothed Gaussian Process Regression

Locally Smoothed Gaussian Process Regression (LSGPR) refers to a class of Gaussian process regression methodologies that exploit localized structure in the input space to enhance computational tractability, statistical adaptivity, and prediction quality. By restricting or down-weighting the influence of distant training points on the prediction at any query location, LSGPR achieves a balance between the expressive power of GP models and the scalability or nonstationarity requirements encountered in many scientific and engineering applications. This paradigm encompasses a diversity of concrete frameworks, notably including weighting schemes via localization kernels, explicit partitioning, adaptive neighbor selection, and joint estimation of local hyperparameters or boundaries.

## 1. Theoretical Foundation: Localizing the Gaussian Process Prior

Standard Gaussian process regression for data $\mathcal{D} = \{(x_i, y_i)\}_{i=1}^n$ places a Gaussian process prior $f \sim \mathcal{GP}(0, K(\cdot, \cdot))$ on the regression function, implying that all $n$ training points can exert global influence on the prediction at any test location $x_0$. Classically, the predictive mean and variance at $x_0$ are given by:
\[
m(x_0) = K_{x_0X}(K_{XX} + \sigma^2 I)^{-1} y, \qquad v(x_0) = K(x_0, x_0) - K_{x_0X}(K_{XX} + \sigma^2 I)^{-1}K_{Xx_0},
\]
where $K_{XX}$ is the $n \times n$ kernel Gram matrix and $\sigma^2$ is the noise variance.

LSGPR modifies this paradigm by introducing a localization kernel $k_h(x, x_0)$ centered at $x_0$ with localization scale $h > 0$, typically chosen such that $k_h(x, x_0)$ rapidly decays or is zero when $\|x - x_0\| > h$. The prior and data are multiplied by $\sqrt{k_h(x, x_0)}$, yielding a localized GP prior:
\[
\tilde{f}(x) = \sqrt{k_h(x, x_0)} f(x), \qquad \tilde{K}(x, x'; x_0) = \sqrt{k_h(x, x_0)} K(x, x') \sqrt{k_h(x', x_0)},
\]
and localized observations $\tilde{y}_i = \sqrt{k_h(x_i, x_0)} y_i$. Only training points with $k_h(x_i, x_0) > 0$ are included in the regression at $x_0$, leading to sparsification of the Gram matrix and strictly local influences [2210.09998].

## 2. Localization Kernels and Neighborhood Construction

The choice of localization kernel $k(u)$ is pivotal in LSGPR. Common examples include:

| Kernel Type      | Formula                                                      | Support            |
|------------------|-------------------------------------------------------------|--------------------|
| Rectangular      | $k(u) = \mathbb{I}(u \leq 1)$                               | Compact ($\leq h$) |
| Epanechnikov     | $k(u) = \frac{d+2}{2V_d}(1 - u^2)\mathbb{I}(u \leq 1)$      | Compact ($\leq h$) |
| Gaussian         | $k(u) = (2\pi)^{-d/2} \exp(-u^2/2)$                         | All $u$            |
| Hilbert (Sing.)  | $k(u) = u^{-1}\mathbb{I}(u \leq 1)$                         | Compact ($\leq h$) |

where $V_d$ is the volume of the unit $d$-ball. Compactly supported $k(u)$ enforces strict localization; Gaussian weights allow soft decay.

Neighborhoods may also be defined adaptively, e.g., via $k$-nearest neighbors with lengthscale-weighted metrics or by identifying regions from data-driven partitions, as in splitting or partitioned GPs [2010.02424, 1604.04980].

## 3. Inference and Prediction in the Localized GP Framework

Let $I = \{i: \|x_i - x_0\| \leq h\}$ denote the set of indices of training points sufficiently close to $x_0$. The locally modified Gram matrix is:
\[
\tilde{K}_{X_I X_I} = K_{X_I X_I} + \sigma^2 W_{x_0}^{-1}
\]
where $W_{x_0} = \operatorname{diag}(k_h(x_i, x_0))_{i \in I}$.

Posterior mean and variance for $f(x_0)$ are then:
\[
\tilde{m}(x_0) = K_{x_0 X_I} \tilde{K}_{X_I X_I}^{-1} y_I, \quad \tilde{v}(x_0) = K(x_0, x_0) - K_{x_0 X_I} \tilde{K}_{X_I X_I}^{-1} K_{X_I x_0}.
\]
Hyperparameters (kernel, noise, localization width) are selected by maximizing the local marginal log-likelihood on each neighborhood, with $h$ typically chosen by grid search or by ensuring a minimum neighbor count [2210.09998].

The computational cost per test is $O(s_0^3)$ for an $s_0 \times s_0$ system, with $s_0 = |I| \ll n$. This is in sharp contrast with the $O(n^3)$ scaling of global GPR.

## 4. Extensions: Adaptive Partitioning, Boundary Learning, and Local Hyperparameters

LSGPR gracefully accommodates a spectrum of extensions, each leveraging the local structure for improved adaptivity:

- **Joint Local Boundary Estimation**: Estimating piecewise continuous functions with discontinuities, as in "Jump GP," involves constructing a local linear separator $g(u; \theta_b) = w^\top u + b$, and keeping only those local neighbors on the same side as $x_*$, with $\theta_b$ learned jointly with kernel hyperparameters [2104.06487].
- **Streaming and Partitioned GPs**: Partitioning the input space adaptively (via principal direction divisive partitioning or similar) and fitting local GPs to each leaf enables bounded $O(m^3)$ update time and linear memory scaling, suitable for streaming or massive datasets. Smoothing across boundaries is achieved by weighted aggregation of regionwise predictions [2010.02424].
- **Locally Adaptive Weights and Distances**: Adaptive neighborhood selection can weight training points by lengthscale-informed Mahalanobis distances or insert explicit weights into the kernel matrix construction, as in variational sparse-spectrum and local feature GP regression [1306.1999, 1402.0645].

These adaptations yield models that can locally select relevant features, tune smoothness to the local nonstationarity of the function of interest, and more accurately capture discontinuities or regime shifts.

## 5. Empirical Evaluation and Comparative Performance

A spectrum of benchmarks demonstrates that LSGPR models deliver competitive or superior predictive accuracy compared to both global GPR and alternative local/mixed models, typically at orders of magnitude lower computational cost per prediction [2210.09998].

For example, on UCI benchmarks (Yacht, Boston, Concrete, Kin8nm, Powerplant, Protein), LSGPR with Hilbert localization kernel achieved lower test MSE than both full GP and deep GP baselines in several cases, with local models operating on as few as $5$–$20$ neighbors per query and observed speedups on the order of $10^7$ for large $n$ [2210.09998]. "Jump GP" and partitioned LSGPR both report strong mitigation of boundary bias and improved performance in piecewise-continuous and partitioned-regime settings [2104.06487, 2010.02424].

## 6. Practical Guidelines and Trade-Offs

Selecting the localization scale $h$ (or neighbor count $m$) involves a bias-variance and speed-accuracy trade-off:
- Small $h$ (fewer neighbors): high adaptivity, lower computational burden, greater variance.
- Large $h$ (more neighbors): diminished locality, higher computation, predictions converge to global GPR.

Compactly supported localizers (rectangular, Epanechnikov) ensure sparse Gram matrices and computational parsimony. Soft/decaying kernels (Gaussian) may give smoother predictions but reduced sparsity.

Hyperparameters should be cross-validated locally. A kd-tree or similar spatial index is advised for efficient neighbor queries. For stability, inputs should be standardized.

Local smoothing inherently induces nonstationary behavior in the predictive covariance, even with stationary base kernels. This adaptivity is a primary strength, allowing LSGPR to accommodate heteroskedasticity, varying function smoothness, and regime shifts [2210.09998].

## 7. Limitations and Open Challenges

Limitations of LSGPR methods include:
- Loss of some global structure in favor of local adaptation; very small $h$ can lead to high-variance or unstable predictions.
- For discontinuities, the quality of boundary estimation or partitioning is critical.
- Selection of $h$, kernel type, and neighbor count remains problem-dependent and lacks universal automated prescription.
- In very high-dimensional settings or for highly non-separable kernels, neighbor finding and kernel matrix assembly can still become costly.

Current research directions include extensions to more sophisticated adaptive neighborhood selection, combination with deep learning architectures for feature extraction, batch and online selection strategies, and theoretical guarantees of local model consistency under sparse sampling [2104.06487, 2010.02424].

---

For further mathematical and algorithmic details as well as implementation-focused recipes, see [2210.09998], [2104.06487], [2010.02424], and [1604.04980].

Source: https://www.emergentmind.com/topics/locally-smoothed-gaussian-process-regression