Ordinary kriging answers a question about a variable measured at points. At a place you did not sample, it returns the linear unbiased estimate of that variable, and the error variance of that estimate, from a single variogram. A disease map asks that question about a count. The observation is a number of cases over a population at risk, published as a rate for a county, a census tract, or a year of that county. A county of a few thousand residents produces a far noisier rate than a county of a million, at the same underlying risk.
This notebook is the map for the three Poisson-kriging families in GeoLattice. Centroid Poisson kriging keeps the ordinary-kriging system and adds a population term on the diagonal. Area-to-area and area-to-point Poisson kriging replace the point covariances with averages over the people inside each polygon. Poisson cokriging stacks several correlated counts into one system. Spatio-temporal Poisson kriging gives the covariance a spatial lag and a temporal lag. The notebook writes that shared system, then runs centroid Poisson kriging on twelve counties and one target. The three notebooks that follow keep one family each and carry it through a disease dataset.
Four notebooks estimate a disease rate from counts and population, so a small county does not dominate the map.
Overview
Write the ordinary-kriging predictor at an unsampled location \(\mathbf{u}_0\) as
\[
\hat Z(\mathbf{u}_0) = \sum_{i=1}^{n} \lambda_i \, Z(\mathbf{u}_i),
\]
with weights from the system in the kriging introduction:
\[
\begin{bmatrix}
\mathbf{C} & \mathbf{1} \\
\mathbf{1}^{\top} & 0
\end{bmatrix}
\begin{bmatrix}
\boldsymbol{\lambda} \\
\mu
\end{bmatrix}
=
\begin{bmatrix}
\mathbf{c}_0 \\
1
\end{bmatrix}.
\]
\(\mathbf{C}\) holds covariances among the samples, \(\mathbf{c}_0\) holds covariances between the samples and the target, and \(\mu\) enforces \(\sum \lambda_i = 1\) so an unknown constant mean cancels. The kriging variance is \(C(0) - \boldsymbol{\lambda}^{\top}\mathbf{c}_0 - \mu\).
A disease rate is a different observation. Let area \(v_i\) have population \(n_i\) and count \(d_i\). The latent risk \(R(v_i)\) is the intensity of a Poisson count,
\[
d_i \sim \mathrm{Poisson}\big(n_i \, R(v_i)\big),
\qquad
z_i = B\,\frac{d_i}{n_i},
\]
where \(B\) is the rate base (rate_base: \(1\) for a proportion, \(100\) for a percentage, \(10^5\) for a rate per 100,000). Because a Poisson count has variance equal to its mean,
\[
\mathrm{Var}(z_i) = B\,\frac{m^\ast}{n_i},
\qquad
m^\ast = \frac{\sum_j n_j \, z_j}{\sum_j n_j}.
\]
\(m^\ast\) is the population-weighted mean of the rates as they are stored. Equivalently, with \(\bar R = m^\ast / B\) the mean per-person risk, the same variance is \(B^2 \bar R / n_i\). A small \(n_i\) makes a large variance. Ordinary kriging of \(z\) reads every rate as a measurement of \(R\) with one common noise level. Poisson kriging (Goovaerts, 2006) puts \(\mathrm{Var}(z_i)\) on that area’s diagonal, so the weight shrinks as the population shrinks.
The Poisson reliability term
The predictor is still linear and unbiased,
\[
\hat R(\mathbf{u}_0) = \sum_{i=1}^{k} \lambda_i \, z_i,
\qquad
\sum_{i=1}^{k} \lambda_i = 1,
\]
and the weights solve
\[
\begin{bmatrix}
\mathbf{C} + B\,\mathrm{diag}\!\left(\dfrac{m^\ast}{n_i}\right) & \mathbf{1} \\[6pt]
\mathbf{1}^{\top} & 0
\end{bmatrix}
\begin{bmatrix}
\boldsymbol{\lambda} \\
\mu
\end{bmatrix}
=
\begin{bmatrix}
\mathbf{c}_0 \\
1
\end{bmatrix}.
\]
The kriging variance keeps the ordinary-kriging form, \(\sigma^2 = C(0) - \boldsymbol{\lambda}^{\top}\mathbf{c}_0 - \mu\). PoissonKriging returns the standard error \(\sigma\).
In a local neighborhood the mean \(m^\ast\) is the population-weighted mean of the \(k\) neighbors that enter that system, which is what _solve computes. rate_base scales the diagonal onto the units of \(z\). The class detects \(B\) from the magnitude of the rates when rate_base is omitted. Pass it explicitly when the base is known. A per-100,000 rate with the diagonal left unscaled is short by about \(10^5\), and the small counties keep too much weight.
The size of the term relative to the sill is the whole decision. On the twelve counties below, \(C(0) = 81.5\). A population of 200,000 adds about 27 to the diagonal. A population of 4,000 adds about 1,350, roughly seventeen times the sill, and that rate almost drops out of the estimate.
Centroid, area-to-area, and area-to-point
All three estimators in the breast-cancer notebook are this system. They differ in the support of \(C\).
Centroid. Each county is one point, its population-weighted centroid \(\mathbf{u}_i\), with population \(n_i\) and rate \(z_i\). The covariance is the point covariance \(C_R(\mathbf{u}_i - \mathbf{u}_j)\). This is PoissonKriging. It is the call in the worked example. The size and shape of the polygon stay outside the covariance.
Area-to-area (ATA). Point covariances are replaced by block covariances averaged over the census points inside the two counties, weighted by population,
\[
\bar C_R(v_i, v_j)
= \frac{\sum_{s \in v_i}\sum_{s' \in v_j} n_s \, n_{s'} \, C(\mathbf{u}_s - \mathbf{u}_{s'})}
{\sum_{s \in v_i}\sum_{s' \in v_j} n_s \, n_{s'}}.
\]
This is AreaPoissonKriging.predict_area. Averaging over the polygon filters short-range variance, and the kriging variance usually falls relative to the centroid estimator. PointSupport holds the census points grouped by county.
Area-to-point (ATP). The left-hand side stays the area-to-area matrix. The right-hand side becomes the covariance between each county and one target point \(\mathbf{u}_s\),
\[
\bar C_R(v_i, \mathbf{u}_s)
= \frac{\sum_{s' \in v_i} n_{s'} \, C(\mathbf{u}_{s'} - \mathbf{u}_s)}{\sum_{s' \in v_i} n_{s'}}.
\]
AreaPoissonKriging.predict_points evaluates that system on a grid and returns a continuous surface. The population-weighted average of the point estimates inside a county recovers the area-to-area estimate of that county (the coherence constraint). The breast-cancer notebook checks the identity to machine precision.
The population-weighted variogram
The kriging engine consumes a point-support covariance of the risk. The rates that are observed are noisy and, for ATA and ATP, areal. Two steps sit in front of the solve. Both are worked on the breast-cancer counties. This notebook sets the variogram by hand, the same device as the kriging introduction.
The population-weighted risk semivariogram (Monestiez et al., 2006) down-weights pairs whose populations are small and subtracts the Poisson noise, so the sill is the variance of \(R\) and the sampling variance stays on the kriging diagonal where it belongs:
\[
\hat\gamma_R(h)
= \frac{1}{2\sum_{\alpha \in N(h)} w_\alpha}
\sum_{\alpha \in N(h)} w_\alpha \Big[(z_\alpha - z_{\alpha+h})^2 - m^\ast\Big],
\qquad
w_\alpha = \frac{n_\alpha \, n_{\alpha+h}}{n_\alpha + n_{\alpha+h}}.
\]
Distances between counties are the population-weighted distances between their census-point clouds.
Deconvolution recovers the point-support model from that areal semivariogram. Regularisation relates the two by
\[
\gamma_v(h) = \bar\gamma(v, v_h) - \bar\gamma(v, v),
\]
and the breast-cancer notebook inverts the relation iteratively with the same block-semivariance helpers the kriging engine uses. The point-support sill comes out higher than the areal sill: change of support had averaged that variance away, and ATP needs it back.
Poisson cokriging
One disease is often a thin signal. Physical inactivity and obesity move with diabetes across counties; several rare counts can share a spatial pattern. Poisson cokriging (Payares-Garcia, Osei, Mateu & Stein, 2024) keeps a Poisson variance for every count and couples the risks with a linear model of coregionalization.
For diseases \(\ell, \kappa\) the direct and cross semivariograms use the same pair weights \(w_{ij} = n_i n_j / (n_i + n_j)\), with a noise term subtracted so the sill is the covariance of the risks. An LMC writes every covariance as one basic structure times a coregionalization matrix,
\[
C_{\ell\kappa}(h) = b_{\ell\kappa}\, g(h),
\]
where \(g(0) = 1\) and \(B = [b_{\ell\kappa}]\) is symmetric positive semidefinite. fit_lmc estimates \(B\) by weighted least squares and projects it onto the nearest positive-semidefinite matrix. The module fits one exponential or one spherical structure. A nested exponential-plus-spherical LMC is the form in the paper; one structure is the form LMC stores.
The target risk is a linear combination of every disease’s rates. The target disease has weights that sum to 1. Each auxiliary has weights that sum to 0, the usual cokriging constraint that keeps an auxiliary from shifting the mean:
\[
\hat R_t(s_0) = \sum_{\ell=1}^{P} \sum_{i=1}^{k_\ell} \lambda_\ell(s_i)\, z_\ell(s_i),
\qquad
\sum_i \lambda_t(s_i) = 1,
\qquad
\sum_i \lambda_\ell(s_i) = 0 \quad (\ell \neq t).
\]
The block diagonal carries the Poisson terms. On a direct block the addition is \(m^\ast_\ell / n_i\) in the units of that disease’s rate. On a cross block, at a county where both diseases are observed, the addition is the mean shared risk over \(n_i\). poisson_cokrige builds and solves that system. With one disease it reduces to univariate Poisson kriging (poisson_krige). With the prediction locations equal to the data locations and each county removed in turn, the same call smooths the observed rates.
The cokriging notebook fits the LMC on a simulation where the true risk is known, then on Northeast diabetes with inactivity and obesity as the auxiliaries.
A year on the same counties
A panel observes the same counties every year. The predictor keeps the Poisson diagonal and replaces \(C(h)\) with a covariance of a joint lag. The model used in this chapter is the metric model from the spatio-temporal introduction:
\[
h_{st} = \sqrt{h_s^2 + (a \, h_t)^2},
\qquad
C(h_s, h_t) = C(h_{st}).
\]
The anisotropy \(a\) (stAni) converts a time lag into the units of the map. vgm builds the joint variogram. vgm_st("metric", joint=..., st_ani=a) wraps it. empirical_st_variogram and fit_metric_st_variogram estimate that model from a complete county-by-year matrix. vgm_st also builds separable, productSum, sumMetric, and simpleSumMetric when the spatial range and the temporal range should be separate parameters.
STPoissonKriging solves the centroid system on the \(k\) nearest area-years in the scaled coordinates \((x, y, a \cdot t)\):
\[
\sum_j \lambda_j \Big[C\big((\mathbf{u}_i, t_i) - (\mathbf{u}_j, t_j)\big) + \delta_{ij}\, B\,\frac{m^\ast}{n_i}\Big] + \mu
= C\big((\mathbf{u}_i, t_i) - (\mathbf{u}_0, t_0)\big).
\]
One time stamp per area returns centroid Poisson kriging. Equal populations return space-time ordinary kriging. The Atlantic notebook fits the metric model to lung-cancer mortality, 1998-2012, holds out 60 counties, and forecasts one year past the last observed year.
A local neighborhood
Solving against every training row scales as \(O(N^3)\). PoissonKriging.predict and STPoissonKriging.predict build each prediction from its \(k\) nearest neighbors and stack those systems into one batched solve of shape (n_pred, k+1, k+1): NumPy on CPU, CuPy on GPU (use_gpu). poisson_cokrige(..., number_of_neighbors=k) stacks systems of shape (n_pred, P k + P, P k + P). The worked example uses use_gpu=False.
predict_id is leave-one-out of one stored area, and it stays on CPU. Area-to-area and area-to-point covariances are block averages, and they stay on CPU as well. The three case-study notebooks time the batched path on a national county set.
How to read the estimate
The partial sill is \(81.492\), the variance of the twelve generating risks, and the nugget is \(0\), so \(C(0) = 81.492\). The range is \(80\) km. number_of_neighbors=8 and rate_base=100000.
The eight nearest centroids to \((30, 62)\) are C7 at \(12.17\) km (rate \(54.70\), population \(200{,}000\)), C6 at \(13.89\) km (rate \(160\), population \(4{,}000\)), then C10, C11, C8, C2, C1, and C3, the last of them at \(48.33\) km. All eight sit inside the range. The population-weighted mean rate of those eight neighbors is \(m^\ast = 54.003\). The diagonal addition is \(B m^\ast / n\):
\[
\frac{100{,}000 \times 54.003}{4{,}000} = 1{,}350
\quad\text{at C6},
\qquad
\frac{100{,}000 \times 54.003}{200{,}000} = 27.00
\quad\text{at a large county}.
\]
\(1{,}350\) is about seventeen times the sill, so C6’s covariance with the target barely survives the penalty. \(27\) is about a third of the sill, so a large county keeps the weight its distance would give it under ordinary kriging.
Poisson kriging at the target is \(54.412\), with standard error \(5.986\). The generating risk there is \(50.5\). C7, the nearest large county, reports \(54.70\), and the estimate sits with that neighbor. The spike of \(160\) at C6, \(13.9\) km away, does not pull it.
The same system with every population set to \(200{,}000\) returns \(86.867\), with standard error \(5.435\). C6 now carries a diagonal addition of \(27\), the same term as its neighbors, and the rate \(160\) takes a share of the weight. The estimate moves from \(54.4\) toward \(160\). The two standard errors are close because both are functions of the same covariance geometry; the population term changes the weights, and the variance moves with them.
Leave-one-out at C6 is \(50.246\), with standard error \(7.184\). The rate on the file is \(160\). The generating risk is \(46.3\). The smoothed value sits next to the risk, because the county is predicted from its neighbors and its own rate is excluded. That gap, from \(160\) down to \(50.2\), is the sampling noise the diagonal is built to filter when C6 is a neighbor of somewhere else.
Leave-one-out at C7 is \(57.711\), with standard error \(6.569\). C7 reports \(54.70\) from a population of \(200{,}000\), and the estimate stays beside that rate. The standard error is larger than the \(5.986\) at the target: the target sits between C6 and C7, and the leave-one-out neighborhood has lost C7 itself.