Spatial Variational Inference

Statistics
Introduced by
Titsias (2009) for sparse GP; Rue, Martino & Chopin (2009) for latent Gaussian spatial models
Year
2009
Type
Approximate Bayesian inference algorithm
Family
Bayesian / computational

What does it do?

Spatial variational inference is an approximate Bayesian method that fits latent Gaussian or Gaussian-process models to georeferenced data by maximising a lower bound on the marginal likelihood, the evidence lower bound (ELBO).

It replaces the sampling step of MCMC with an optimisation problem, which makes approximate posterior uncertainty for spatial fields practical on larger datasets. The result is an approximation to the posterior, so its accuracy has to be checked rather than assumed.

The intuition behind the method

Imagine estimating a smooth pollution surface from measurements at many monitoring stations and quantifying uncertainty at unmeasured locations. Exact Bayesian inference via MCMC requires repeated operations on large covariance matrices. Variational inference instead chooses a simpler, tractable family of distributions and finds the member closest to the true posterior by maximising the ELBO. Sparse inducing-point approximations compress the spatial structure so that optimisation stays feasible on large grids or point clouds, and the output is still a full distribution rather than a single point estimate.

History

Titsias (2009) introduced a variational treatment of inducing variables for sparse Gaussian process regression, which underlies the inducing-point approximation used here. Rue, Martino, and Chopin (2009) developed integrated nested Laplace approximations for latent Gaussian models, a model class that includes spatial models, as a deterministic alternative for computing posterior marginals. The two papers address related but distinct approximation strategies, and the spatial variational approach described on this page draws on the first.

When to use it

Choose spatial variational inference when you need Bayesian uncertainty for a spatial latent field and the number of locations makes exact GP inference or spatial MCMC costly. It is a reasonable fit for non-Gaussian responses such as counts or binary outcomes, because the ELBO accommodates the likelihood directly, and when the model must be refitted many times. Do not use it when the approximation error must be negligible or exact posterior summaries are required; MCMC or INLA are the usual alternatives in that case. It is also the wrong tool when the spatial structure is areal or graph-based and a proper areal model such as a CAR or ICAR model is more natural.

Limitations and considerations

  • The variational family is typically Gaussian, which can underestimate posterior variance; the credible intervals are therefore only as well calibrated as this approximation allows.
  • Approximation quality depends on the number and placement of inducing points, and a poor choice can bias predictions in regions the inducing points do not cover.
  • With complex spatial covariance structures the ELBO may have several local maxima, so the fitted solution can depend on initialisation.
  • Convergence diagnostics are less transparent than MCMC trace diagnostics; a rising or flat ELBO does not by itself show that the approximate posterior is accurate.
  • Results rest on the assumptions that observations are conditionally independent given the latent field, that the Gaussian process prior with its stationary kernel describes the spatial structure, and that the likelihood is correctly specified. When conditional independence fails (for example through unmodelled clustering) or the stationary kernel is too restrictive for a non-stationary study region, the approximate posterior and its credible intervals can be misleading.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Scales to large spatial datasets by summarising the latent field through inducing points, so the main cost depends on the number of inducing points m rather than the full number of locations n.
  • Accommodates non-Gaussian likelihoods (for example Poisson, binomial, or negative binomial) because the ELBO only requires the expected log-likelihood under the approximate posterior.
  • Returns approximate posterior means and variances at observed and new locations without MCMC sampling, which makes spatial prediction and uncertainty mapping direct.
  • Estimates kernel hyperparameters, such as range and smoothness, jointly with the variational parameters by maximising the ELBO.

Applications

  • Disease mapping: estimating spatially smoothed disease rates with uncertainty from sparse health registry data.
  • Environmental monitoring: interpolating air quality or temperature fields across dense sensor networks.
  • Ecological species distribution modelling with count or presence-absence responses over large landscapes.
  • Remote sensing: fusing satellite imagery pixels into continuous surface estimates with predictive variance.
  • Geostatistical reserve estimation in mining or hydrology where prediction uncertainty drives decisions.
  • Urban analytics: modelling spatially varying effects of land use or accessibility on outcomes such as property prices.

How it works

How it works

1

Specify a spatial model: observations y at locations s are linked to a latent spatial field f through a likelihood (Gaussian, Poisson, binomial, etc.). The observations are treated as conditionally independent given f, and the field f is given a Gaussian process prior with a stationary spatial covariance kernel capturing range, sill, and smoothness. Stationarity means the covariance depends on the differences between locations rather than on their absolute positions.

Formula
y_i \mid f(s_i) \sim p(y_i \mid f(s_i)), \quad f \sim \mathcal{GP}(0, k_{\theta})
2

The variational objective is the ELBO, the expected log-likelihood under the approximate posterior minus a KL divergence penalty that keeps the approximation close to the prior. Maximising the ELBO brings the approximation closer to the true posterior and, in the same optimisation, updates the kernel hyperparameters.

Formula
\mathcal{L}(q) = \mathbb{E}_{q(f)}[\log p(y \mid f)] - \mathrm{KL}[q(f) \| p(f)]
3

To handle large spatial datasets, the full GP posterior is approximated through a small set of inducing points Z. The approximate posterior q(f) is obtained by integrating out the inducing variables u = f(Z) under a variational distribution q(u), which reduces the O(n^3) matrix operations to O(nm^2), where m is much smaller than n.

Formula
q(f) = \int p(f \mid u)\, q(u)\, du, \quad u = f(Z)
4

The ELBO is maximised over the variational parameters (mean and covariance of q(u)) and the kernel hyperparameters using gradient-based optimisers. When full-data gradients are too costly, stochastic mini-batches of observations can be used, which makes each update cheaper but makes the ELBO estimate noisy. Mini-batching is only justified under the conditional-independence assumption above; if spatial dependence remains in the data after the latent field is included, compare mini-batch fits with full-data gradients before relying on them.

Formula
\hat{\phi} = \arg\max_{\phi} \mathcal{L}(q_\phi)
5

Once optimisation has converged, the fitted approximate posterior gives means, variances, and credible intervals at observed and new spatial locations. These support spatial prediction and uncertainty mapping at lower computational cost than MCMC, though the intervals are only as accurate as the variational family allows.

Common pitfalls

  • Using too few inducing points, which produces a poor spatial approximation and systematically biased predictions.
  • Ignoring posterior calibration checks; always compare posterior predictive distributions with held-out spatial observations.
  • Assuming the Gaussian variational family is adequate without testing it against a richer approximation or against MCMC on a small subset of the data.
  • Conflating ELBO convergence with posterior accuracy; a converged ELBO does not guarantee that the approximate posterior is close to the true posterior.
  • Omitting a nugget (noise) variance when the measurements are noisy; a nugget is often needed for numerical stability and to separate measurement error from spatial variation, so check its estimated size.

Frequently asked questions

How does spatial variational inference differ from spatial MCMC?

Both target the posterior over a spatial latent field, but MCMC samples the exact posterior (given enough iterations) while variational inference optimises a parametric approximation. Variational inference is faster and deterministic but may underestimate posterior variance; MCMC is asymptotically exact but costly for large spatial grids.

What are inducing points and how many do I need?

Inducing points are a small set of representative locations that summarise the full spatial field. More inducing points give a better approximation at higher computational cost, since the cost grows with m. There is no fixed rule for choosing m; a practical approach is to increase m and stop when the ELBO and held-out predictive metrics stop changing appreciably.

Can I use spatial variational inference for non-Gaussian data like disease counts?

Yes. The ELBO framework handles any likelihood, so Poisson, binomial, and negative binomial spatial models are natural applications. The latent GP captures spatial smoothness while the likelihood accounts for count or binary observations.

How do I assess whether the variational approximation is adequate?

Run posterior predictive checks on held-out locations, compare credible interval coverage to nominal levels, and where feasible compare against MCMC on a small data subset. A richer variational family or more inducing points can help if diagnostics reveal overconfidence.

Is spatial variational inference the same as INLA?

No. INLA uses structured Laplace approximations for latent Gaussian models, as described by Rue, Martino, and Chopin (2009). Variational inference with inducing points targets GP posteriors and can handle non-Gaussian likelihoods through the ELBO. Both are approximate Bayesian methods, but they use different approximation strategies, and their relative speed depends on the model and the data.

Related methods

Sources

  1. Titsias, M. K. (2009). Variational learning of inducing variables in sparse Gaussian processes. In Proceedings of the 12th International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR 5, pp. 567-574.

    Open publication reference
  2. Rue, H., Martino, S., & Chopin, N. (2009). Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. Journal of the Royal Statistical Society: Series B, 71(2), 319-392.

    Open DOI reference