Why a Gaussian Spatial Covariance?
A spatial random effect represents latent variation that may be more similar at nearby locations than at distant ones. The covariance function makes that relationship explicit. The Gaussian spatial covariance is especially useful when the latent effect is expected to vary smoothly: its correlation approaches one particularly quickly as the distance between locations approaches zero.
Here, “Gaussian” names the shape of the covariance function. The latent effects are also assumed to have a joint Gaussian distribution in the Gaussian-process specification below, but these are distinct ideas: a Gaussian-shaped covariance function is a rule for dependence, while a Gaussian distribution specifies the random variables’ joint distribution.
Stationarity means the covariance depends on the pair of locations through their separation rather than their absolute positions. Isotropy further means that it depends on separation only through distance, not direction. At \(d=0\), the covariance is the marginal spatial-effect variance \(\sigma_{\text{sp}}^2\); for distinct locations, the correlation is positive and decreases with distance. The covariance tends to zero as distance tends to infinity.
In a GLMM, \(u(s)\) can be added to a linear predictor as a latent spatial effect. The covariance function describes dependence among those latent effects; it does not, by itself, specify the observation distribution or the link function. The assumptions here concern the spatial effect: its mean is zero, its finite collections of values are jointly Gaussian, and its covariance follows the stated stationary, isotropic function.
Why the Covariance Is Valid
A proposed covariance function must generate a positive semidefinite covariance matrix for every finite collection of locations. In particular, for locations \(s_1,\ldots,s_m\), the matrix with entries \(C(\lVert s_i-s_j\rVert)\) must satisfy \(a^\mathsf{T}Ka\geq 0\) for every real vector \(a\). This condition ensures that the specified variances of all linear combinations of the latent effects are nonnegative.
The Gaussian kernel satisfies this condition in any Euclidean dimension. To see why, first take \(\ell>0\) and write the correlation kernel as \(\exp[-\lVert s_i-s_j\rVert^2/\ell^2]\). Since \(\lVert s_i-s_j\rVert^2=\lVert s_i\rVert^2+\lVert s_j\rVert^2-2s_i^\mathsf{T}s_j\), its quadratic form can be expanded as follows.
Here \(q\) is the spatial dimension and \(s_{ir}\) is coordinate \(r\) of location \(s_i\). The second equality follows by expanding the exponential of the inner product as a power series and collecting terms. Every coefficient is nonnegative and each remaining term is a square, so the quadratic form cannot be negative. Multiplication by \(\sigma_{\text{sp}}^2>0\) preserves that property. Thus the proposed function gives valid covariance matrices for finite sets of Euclidean locations.
Worked Example: Correlations and Covariances at Several Distances
Suppose hypothetical latent effects are observed at locations measured in kilometres, and the covariance model has \(\ell=2\) km and \(\sigma_{\text{sp}}^2=4\) latent-effect units squared. Calculate correlation and covariance at distances \(0.5\), \(2\), and \(3\) km.
For any distance \(d\), substitute into \(\rho(d)=\exp[-(d/2)^2]\) and multiply the resulting correlation by \(4\) to obtain the covariance.
At \(d=0.5\) km, \(\rho(0.5)=\exp[-(0.5/2)^2]=\exp(-0.0625)\approx 0.9394\). Therefore \(C(0.5)=4(0.9394)\approx 3.758\) latent-effect units squared.
At \(d=2\) km, \(\rho(2)=\exp[-(2/2)^2]=\exp(-1)\approx 0.3679\). Therefore \(C(2)=4(0.3679)\approx 1.472\) latent-effect units squared.
At \(d=3\) km, \(\rho(3)=\exp[-(3/2)^2]=\exp(-2.25)\approx 0.1054\). Therefore \(C(3)=4(0.1054)\approx 0.4216\) latent-effect units squared.
The correlation is dimensionless, while the covariance has the squared units of the latent effect. The results show that correlation decreases with distance, but does not become exactly zero at any finite distance.
Near-Origin Behavior and Exponential Covariance
The key distinction from the exponential spatial covariance is how the correlation decreases for very small positive distances. Under the parameterizations used here, the exponential model has \(\rho_{\mathrm{exp}}(d)=\exp(-d/\ell)\), while the Gaussian model has \(\rho_{\mathrm{G}}(d)=\exp[-(d/\ell)^2]\). Let \(x=d/\ell\). A Taylor expansion around \(x=0\) gives
For small positive \(x\), the Gaussian correlation is closer to one: its leading decrease is proportional to \(x^2\), whereas the exponential model’s decrease is proportional to \(x\). This difference has a direct interpretation through the variance of a spatial increment. For either stationary model,
The equality uses the common marginal variance at both locations, which follows from stationarity. Applying the expansions above, the Gaussian model has increment variance \(2\sigma_{\text{sp}}^2(d/\ell)^2+O((d/\ell)^4)\), while the exponential model has increment variance \(2\sigma_{\text{sp}}^2(d/\ell)+O((d/\ell)^2)\). Thus, under a common scale parameterization, the Gaussian model penalizes short-distance differences more strongly and encodes a smoother latent effect. In particular, its covariance is differentiable at the origin in the way required for mean-square differentiability; the exponential covariance has a cusp there.
Worked Example: Comparing Short-Distance Increments
Consider two hypothetical latent spatial effects with \(\sigma_{\text{sp}}^2=1\) and \(\ell=1\) km. Compare their correlations and increment variances at \(d=0.1\) km. The two models have the same variance and scale under the formulas above.
For the Gaussian model, \(\rho_{\mathrm{G}}(0.1)=\exp[-(0.1/1)^2]=\exp(-0.01)\approx 0.9900\). Its increment variance is \(2(1)\{1-0.9900\}\approx 0.01990\) latent-effect units squared.
For the exponential model, \(\rho_{\mathrm{exp}}(0.1)=\exp(-0.1/1)=\exp(-0.1)\approx 0.9048\). Its increment variance is \(2(1)\{1-0.9048\}\approx 0.1903\) latent-effect units squared.
At this distance the Gaussian model implies much less latent variation between the two locations. This is a consequence of the covariance shapes, not evidence that the Gaussian model is preferable for every application. A model should encode plausible spatial behavior and be assessed against the data.
Building and Checking a Covariance Matrix
For observed locations \(s_1,\ldots,s_m\), first calculate every pairwise distance \(d_{ij}=\lVert s_i-s_j\rVert\), then set \(K_{ij}=\sigma_{\text{sp}}^2\exp[-(d_{ij}/\ell)^2]\). The diagonal entries equal \(\sigma_{\text{sp}}^2\), because \(d_{ii}=0\); off-diagonal entries are the covariances between distinct locations. This matrix can be used to specify the joint Gaussian distribution of the vector of latent effects.
Worked Example: A Three-Location Correlation Matrix
Take three hypothetical locations on a straight line at positions \(0\), \(1\), and \(2\) km, with \(\ell=1\) km. The pairwise distances are \(1\), \(1\), and \(2\) km. The adjacent-location correlation is \(\exp(-1)\approx0.3679\), and the end-to-end correlation is \(\exp(-4)\approx0.01832\). The resulting correlation matrix is
For example, the covariance between the first and third latent effects is \(\sigma_{\text{sp}}^2\exp[-(2/1)^2]=0.01832\sigma_{\text{sp}}^2\). The matrix is symmetric, has unit diagonal, and is valid because the Gaussian kernel produces positive semidefinite matrices for all finite location sets, as shown above. If the marginal variance were \(4\), the covariance matrix would be \(4R\), with diagonal entries \(4\) and an end-to-end covariance of approximately \(0.07326\) latent-effect units squared.
Model Choice, Diagnostics, and Limitations
The Gaussian and exponential functions are both stationary and isotropic, but they make different assumptions about local spatial variation. The comparison below uses the same \(\ell\) in each formula; estimated scale values need not be comparable if a different parameterization is used.
| Feature | Gaussian covariance | Exponential covariance |
|---|---|---|
| Correlation function | \(\exp[-(d/\ell)^2]\) | \(\exp(-d/\ell)\) |
| Decrease near zero distance | Quadratic in \(d/\ell\) | Linear in \(d/\ell\) |
| Local behavior | Smoother latent effect | Rougher latent effect |
| At \(d=\ell\) | Correlation is \(\exp(-1)\) | Correlation is \(\exp(-1)\) |
| For \(d>\ell\) | Decays faster under this shared-scale comparison | Decays more slowly under this shared-scale comparison |
Diagnostics should assess whether the assumed spatial dependence is credible, not merely whether a covariance matrix can be calculated. For example, examine spatial patterns in model residuals or other suitable diagnostics for remaining spatial structure, and compare observed short-distance behavior with the model’s implied smoothness. A practical check is to compute fitted correlations at distances represented in the data and compare them with empirical summaries or model-based simulations. For GLMMs, the choice of residual and diagnostic matters because the observations may not have constant variance or be Gaussian.
The Gaussian form can be a poor choice if the latent effect has abrupt local changes or the observed dependence decreases less rapidly at longer distances than the fitted model implies. It also assumes isotropy: two location pairs at the same Euclidean distance receive the same correlation, regardless of direction. Sparse spatial coverage, few close pairs, or a narrow range of observed distances can make the scale and variance difficult to distinguish reliably. These are data limitations as well as model limitations.
The exponential model is a direct alternative when rougher local behavior is plausible. A model with no spatial dependence is another useful reference when the question is whether spatial structure is needed at all. The Gaussian model is not automatically superior because it is smoother, and the exponential model is not automatically inferior because it is rougher. Selection should consider scientific expectations, diagnostic evidence, and the consequences of the resulting spatial predictions. The parameterization also matters: other sources may write the Gaussian exponent with a factor of \(1/2\), which changes the meaning of the scale parameter. Always calculate correlations from the formula actually fitted.
Check Your Understanding
Answer each question, then compare with the solutions below.
- For \(\sigma_{\text{sp}}^2=9\) and \(\ell=3\) km, find the Gaussian correlation and covariance at distance \(1.5\) km.
- At a small positive distance \(d\), which model has correlation closer to one under the same \(\ell\): the Gaussian or exponential model? Explain using the leading terms of their expansions.
- For the Gaussian model, derive the variance of the difference between latent effects at two locations separated by distance \(d\).
- Does a Gaussian spatial covariance imply zero correlation beyond some finite distance? Explain.
Solutions. (1) The correlation is \(\exp[-(1.5/3)^2]=\exp(-0.25)\approx0.7788\). The covariance is \(9(0.7788)\approx7.009\) latent-effect units squared. (2) The Gaussian correlation is closer to one: with \(x=d/\ell\), it is \(1-x^2+O(x^4)\), while the exponential correlation is \(1-x+O(x^2)\). (3) Stationarity gives equal variances \(\sigma_{\text{sp}}^2\) at the two locations, so \(\operatorname{Var}\{u(s+h)-u(s)\}=2\sigma_{\text{sp}}^2-2C(d)\). Substituting \(C(d)=\sigma_{\text{sp}}^2\exp[-(d/\ell)^2]\) yields \(2\sigma_{\text{sp}}^2\{1-\exp[-(d/\ell)^2]\}\). (4) No. For every finite \(d\), \(\exp[-(d/\ell)^2]>0\), although the correlation approaches zero as \(d\) grows without bound.