Tutorials › Generalized Linear Mixed Models (GLMM) › Conditional Autoregressive Spatial Effects

Spatial and Temporal Correlation · Tutorial 582 of 698

Conditional Autoregressive Spatial Effects

Learn how adjacency weights determine the conditional mean and variance of each CAR spatial effect, and what that implies for dependence across locations.

Advanced 10 min read

What You'll Learn

  • Define a symmetric adjacency-weight matrix and each location’s total neighbor weight.
  • Write the intrinsic CAR conditional distribution for a spatial effect.
  • Derive its weighted-neighbor mean and degree-dependent conditional variance.
  • Interpret CAR dependence as conditional rather than marginal.
  • Diagnose isolated locations, weight choices, and graph-based modeling limitations.

Why Define Spatial Effects Through Neighbors?

Spatial random effects represent residual variation associated with location after accounting for the fixed effects in a generalized linear mixed model. One way to describe spatial dependence is through distances between coordinates and a covariance function. A conditional autoregressive (CAR) specification instead starts with a map or network: it states how the effect at each location is distributed given the effects at its neighbors. This is useful when the scientific structure is naturally defined by adjacency, such as shared borders between regions.

The central modeling choice is therefore not only the distribution of an effect, but also the rule that determines which locations count as neighbors and how strongly they contribute. The conditional specification makes that choice explicit. It does not, by itself, mean that the observed responses at neighboring locations are independent or that adjacency proves a causal connection.

Definition: For \(m\) locations, let \(u_i\) be the latent spatial effect at location \(i\). An adjacency-weight matrix \(W=(w_{ij})\) records the strength of the neighbor relation: \(w_{ij}\geq 0\), \(w_{ii}=0\), and, for the standard CAR specification here, \(w_{ij}=w_{ji}\). The total neighbor weight for location \(i\) is \(d_i=\sum_{j\ne i}w_{ij}\). A location with \(w_{ij}>0\) is a neighbor of \(i\); a zero weight indicates no direct neighbor relation.

For binary adjacency, \(w_{ij}=1\) when two locations are neighbors and \(w_{ij}=0\) otherwise. More generally, nonnegative weights can distinguish stronger from weaker neighbor relations. A basic intrinsic CAR specification assumes \(d_i>0\) for every location and gives the conditional distribution of each effect given all the other effects:

$$ u_i \mid \{u_j:j\ne i\} \sim N\left( \frac{\sum_{j\ne i} w_{ij}u_j}{d_i}, \frac{\tau^2}{d_i} \right), \qquad d_i=\sum_{j\ne i}w_{ij}. $$

Here \(N(\mu,\sigma^2)\) uses its second argument as a variance, and \(\tau^2>0\) is a common variance scale. Only the effects at locations with positive weights enter the conditional mean. That mean is their weighted average; the conditional variance is smaller when the total neighbor weight is larger. For binary adjacency, \(d_i\) is simply the number of neighbors.

The specification is called intrinsic because its conditional distributions do not generally define a normalized joint probability density for all the effects without additional constraints. It is still useful as a model for local conditional dependence. The precise joint precision matrix and its null space are separate matters; here the emphasis is on constructing and interpreting the conditionals.

Why the Conditional Mean and Variance Have This Form

A convenient local justification uses a quadratic penalty: differences between effects at linked locations are penalized, with larger weights applying stronger penalties. For a fixed location \(i\), the terms involving \(u_i\) have the kernel

$$ \exp\left\{ -\frac{1}{2\tau^2} \sum_{j\ne i}w_{ij}(u_i-u_j)^2 \right\}. $$

Expand the sum and define the weighted neighbor mean \(\bar{u}_{i,w}=\sum_{j\ne i}w_{ij}u_j/d_i\). Terms not involving \(u_i\) can be treated as constants when conditioning on the other effects:

$$ \begin{aligned} \sum_{j\ne i}w_{ij}(u_i-u_j)^2 &=d_i u_i^2-2u_i\sum_{j\ne i}w_{ij}u_j+\text{constant}\\ &=d_i(u_i-\bar{u}_{i,w})^2+\text{constant}. \end{aligned} $$

Thus the conditional kernel is proportional, as a function of \(u_i\), to \(\exp\{-d_i(u_i-\bar{u}_{i,w})^2/(2\tau^2)\}\). Comparing this with the kernel of a normal distribution gives conditional mean \(\bar{u}_{i,w}\) and conditional variance \(\tau^2/d_i\). This argument justifies the local form; it does not assert that the resulting joint distribution is proper.

Symmetric weights are important for the standard CAR construction: they make the neighbor relation reciprocal, so a link from \(i\) to \(j\) is also a link from \(j\) to \(i\). Arbitrary asymmetric conditionals need not correspond to a coherent joint model. Also, multiplying every weight by the same positive constant leaves each weighted neighbor mean unchanged but changes the conditional variances unless the variance scale is adjusted.

Worked Example: A Four-Location Chain

Suppose four hypothetical regions form a chain: region 1 borders 2, region 2 borders 1 and 3, region 3 borders 2 and 4, and region 4 borders 3. Use binary adjacency. Suppose the effects at regions 1 and 3 are \(u_1=-0.4\) and \(u_3=0.8\), and set \(\tau^2=0.36\). Find the conditional distribution of \(u_2\).

Region 2 has two neighbors, so \(d_2=1+1=2\). Its weighted neighbor mean is

$$ \frac{1(-0.4)+1(0.8)}{2} =\frac{0.4}{2} =0.2. $$

Its conditional variance is \(0.36/2=0.18\). Therefore,

$$ u_2\mid u_1,u_3,u_4 \sim N(0.2,0.18). $$

The corresponding conditional standard deviation is \(\sqrt{0.18}\approx 0.4243\). The conditional mean is between the two neighbor effects because it is their average. The effect at region 4 does not enter this conditional mean because region 4 is not directly adjacent to region 2.

Worked Example: Unequal Adjacency Weights

Consider a hypothetical location \(A\) with two neighbors, \(B\) and \(C\). Let \(w_{AB}=2\), \(w_{AC}=1\), \(u_B=0.3\), \(u_C=-0.6\), and \(\tau^2=0.27\). Calculate the conditional distribution of \(u_A\).

The total neighbor weight is \(d_A=2+1=3\). The weighted neighbor mean is

$$ \frac{2(0.3)+1(-0.6)}{3} =\frac{0.6-0.6}{3} =0. $$

The conditional variance is \(0.27/3=0.09\), so the conditional standard deviation is \(0.3\). Hence

$$ u_A\mid u_B,u_C,\text{ other effects} \sim N(0,0.09). $$

The two neighbor effects cancel after applying their weights. The higher weight on \(B\) gives its effect twice the influence of \(C\) in the conditional mean. The weights encode the chosen neighbor structure; they are not automatically estimated measures of a causal or physical influence.

Interpreting CAR Effects in a GLMM

For example, a binary-response GLMM might use a logit linear predictor \(\eta_i=x_i^\mathsf{T}\beta+u_i\), where \(x_i^\mathsf{T}\beta\) is the fixed-effects contribution and \(u_i\) is the location effect. Under the CAR specification, a location whose neighbors have high effects has a conditional distribution centered toward their weighted average. This is a statement about the latent effects conditional on the other latent effects, not a statement that the observed outcomes must match across neighboring locations.

The effects are conditionally dependent: changing a neighboring effect changes the conditional mean. The conditionals are not a claim that every pair of locations has the same marginal correlation. In particular, a location’s effect can be associated with another location through paths in the adjacency graph even when they are not direct neighbors. Do not interpret the conditional variance \(\tau^2/d_i\) as the marginal variance of \(u_i\); it is uncertainty in \(u_i\) conditional on the other effects.

Worked Example: Degree and Conditional Variability

Suppose a hypothetical adjacency graph is a star with a center location \(C\) connected to three leaves \(L_1,L_2,L_3\). There are no links among the leaves, and binary weights are used. Let \(\tau^2=0.25\), with leaf effects \(u_{L_1}=0.2\), \(u_{L_2}=0.5\), and \(u_{L_3}=-0.1\).

The center has degree \(d_C=3\), so its conditional mean and variance are

$$ \frac{0.2+0.5-0.1}{3}=0.2, \qquad \frac{0.25}{3}\approx 0.08333. $$

Thus \(u_C\mid u_{L_1},u_{L_2},u_{L_3}\sim N(0.2,0.08333)\). Each leaf has degree 1. For example, \(u_{L_1}\mid u_C,\text{ other effects}\sim N(u_C,0.25)\). The center’s conditional variance is smaller because its total neighbor weight is larger. This comparison concerns conditional variances only; it does not establish that the center has smaller marginal variance than every leaf.

Checking the Adjacency Model

Because the adjacency matrix defines the dependence structure, constructing it is part of the statistical model rather than a clerical step. A defensible analysis should document the rule used to define neighbors and consider whether plausible alternatives would change the substantive conclusions.

  • Check reciprocity. For this standard specification, verify \(w_{ij}=w_{ji}\). A one-sided neighbor relation requires a different justification and may not yield compatible CAR conditionals.
  • Check for isolated locations. If \(d_i=0\), the weighted average and \(\tau^2/d_i\) are undefined. An isolated location needs a separate modeling decision; silently assigning it a CAR conditional is not valid.
  • Inspect the graph and weights. Confirm that border-sharing, distance thresholds, or other chosen rules represent the scientific notion of neighborhood. Verify that weights are nonnegative and that any weighting scheme is documented.
  • Assess sensitivity. If conclusions depend strongly on a small change in the adjacency rule or weights, report that dependence rather than presenting one graph as uniquely determined by the data.
  • Keep conditional and marginal statements distinct. The neighbor average and \(\tau^2/d_i\) describe a conditional distribution. Neither is, by itself, a marginal correlation or marginal variance.

Disconnected components are also possible: two groups of locations may have no links between them. The CAR conditionals then express no direct graph-based connection between the components. That fact should be understood as a feature of the chosen adjacency model, not proof that the components are unrelated in every other respect.

How CAR Differs From Common Alternatives

An independent location effect assigns separate effects without neighbor-based conditional dependence. It can represent unexplained heterogeneity, but it does not encode local smoothing. A coordinate-based spatial covariance model instead specifies dependence through locations and a covariance function, often using distance. That approach can be natural when geographic separation is central; CAR is attractive when a discrete neighborhood graph is more meaningful or available.

These choices are not interchangeable. A map-based adjacency rule does not automatically represent distance decay, and a coordinate-based covariance function does not automatically respect administrative borders or network connections. In either case, the dependence structure is an assumption to examine. CAR also has limitations: results can depend on the graph, isolated locations require special treatment, and the intrinsic specification has joint-distribution constraints that are not captured by inspecting one conditional distribution alone.

Key takeaway: In the intrinsic CAR conditional specification, each location’s effect has a normal conditional distribution centered at the weighted average of its neighbors, with conditional variance \(\tau^2/d_i\). The adjacency weights define which effects contribute and how strongly; they do not, by themselves, determine a marginal correlation interpretation.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A location has three binary-adjacency neighbors with effects \(0.2\), \(0.5\), and \(-0.1\), and \(\tau^2=0.36\). What is its CAR conditional mean and variance?
  2. For weights 3 and 1 on two neighbors with effects \(0.4\) and \(-0.2\), respectively, and \(\tau^2=0.32\), calculate the conditional mean and variance.
  3. Why does \(d_i=0\) prevent use of the stated CAR conditional distribution?
  4. Does the conditional variance \(\tau^2/d_i\) give the marginal variance of the location effect? Explain.

Solutions. (1) The degree is 3; the mean is \((0.2+0.5-0.1)/3=0.2\), and the variance is \(0.36/3=0.12\). (2) The total weight is 4; the mean is \(\{3(0.4)+1(-0.2)\}/4=1/4=0.25\), and the variance is \(0.32/4=0.08\). (3) With no neighbor weight, both the weighted average and division by \(d_i\) are undefined, so the stated conditional model cannot be applied. (4) No. It is the variance conditional on the other effects; the marginal variance is a different quantity.

Clinical Biostats