Skip to content
Subconscious

Gaussian Process Geospatial Modeling: Beyond Hierarchical Models

On this page

A geospatial model should use a justified relationship between locations. An exchangeable county-intercept model pools groups without encoding geographic proximity; a spatial Gaussian process (GP) can share information through a distance-based covariance. Neither choice is universally better. The useful question is whether spatial structure improves predictions for locations relevant to the decision.

What does the radon tutorial demonstrate?

Thomas Wiecki's August 17, 2022 PyMC Labs tutorial uses 919 household radon measurements across 85 Minnesota counties. It fits a spatial GP and predicts at 39 unobserved county locations: two in Minnesota and 37 in neighboring states. The tutorial reports a southwest-to-northeast gradient and wider predictive uncertainty farther from observed locations.

The model uses a Matérn-3/2 covariance with chordal distance, calculated from coordinates on a sphere. Its length-scale prior has a mean of 200 km and a standard deviation of 50 km. Those numbers describe the prior, not a reported posterior estimate or a hard extrapolation boundary. The tutorial omits the basement/floor indicator for simplicity and uses location proxies because exact household coordinates are unavailable. These choices limit interpretation of household-level predictions.

How does the covariance encode proximity?

For a unit-amplitude Matérn-3/2 kernel, the covariance fragment is:

k(r) = (1 + \sqrt{3} \cdot r) \cdot \exp(-\sqrt{3} \cdot r)

Here r = d / ℓ, where d is distance and ℓ is the length scale. A complete model also specifies an amplitude, mean function, observation likelihood, and priors. This expression alone is not a fitted radon model. The PyMC GP guide explains the distinction between a latent GP and a marginal model; the covariance API lists kernel interfaces.

Latitude and longitude in degrees should not be passed into an ordinary Euclidean kernel without considering geometry and units. On a regional map, a suitable projected coordinate system may be useful. On a sphere, chordal distance measures the straight line through the sphere, while geodesic distance follows its surface. Kernel validity and distance choice must be considered together.

What distinguishes the model choices?

PropertyExchangeable county-intercept baselineSpatial GP
Sharing informationPools county effects through a common distributionShares through a specified covariance
Unobserved locationNo proximity information unless covariates or spatial terms are addedConditional prediction depends on kernel and observed locations
Main assumptionExchangeability after included predictorsSimilarity follows the chosen spatial structure
Main riskOmits relevant spatial dependenceImposes misleading smoothness or distance relationships
Best forBest for: groups without a defensible spatial relationBest for: a process with plausible, testable spatial continuity
Comparison list: exchangeable county effects do not encode proximity; a spatial GP uses distance-based covariance. Both need predictive validation.
Compare model assumptions before trusting predictions at unobserved locations.

An exchangeable model can appropriately give similar uncertainty to different unseen groups when there is no validated relation between them. A spatial model's uncertainty often grows away from nearby observations under a stationary kernel, but its shape also depends on noise, covariates, kernel, and sampling coverage. Do not require every model's intervals to follow physical distance.

How should you validate regional predictions?

Hold out entire regions or spatial blocks aligned with the intended deployment. Randomly holding out nearby observations can make interpolation look like successful extrapolation. Compare the spatial model with an exchangeable baseline and a covariate-based alternative using the same held-out outcome and scoring rule.

Report predictive interval coverage as well as point-error measures. Distinguish uncertainty about a latent regional mean from uncertainty about a new household measurement. Repeat the comparison under plausible length-scale priors and kernel choices. Sparse edge regions deserve explicit checks, especially when a recommendation depends on them.

Does spatial reasoning transfer to customer segments?

Only when the proposed similarity structure has a substantive justification and predictive evidence. Geography supplies a physical metric; customer labels do not automatically supply an ordering or distance. Shared demographics may fail to capture differences in preferences or exposure. Ask how a segment relation was defined and whether held-out segments support it.

This tutorial establishes no internal architecture or deployment capability for Subconscious or another vendor. For simulated choice research, inspect the evidence record and methods guidance. A model interval can describe uncertainty inside a configured simulation while excluding simulation-to-human mismatch. Matched validation is needed before using that interval to support a claim about an untested human market.