geodalib / core/src / spatialEmpiricalBayes
Function: spatialEmpiricalBayes()
spatialEmpiricalBayes(
baseValues
,eventValues
,neighbors
):number
[]
Defined in: core/src/mapping/rates.ts:240
Description
Compute the spatial empirical Bayes smoothed rates using a local reference rate for each observation.
For each location i, the reference mean (
The local prior variance (
where:
are binary spatial weights (1 for neighbors, 0 otherwise) are observed events in area j are populations at risk in area j are crude rates in area j is the number of neighbors of area i
Key differences from standard EB:
- Uses a local reference rate specific to each observation's spatial window
- Requires sufficient observations in the reference window for effective smoothing
- Block weights are useful to avoid irregularity in neighbor counts
Note: If the estimated variance is negative, it is set to zero as in standard EB.
Parameters
baseValues
number
[]
The values of base variable (populations at risk,
eventValues
number
[]
The values of event variable (observed events,
neighbors
number
[][]
The list of neighbors for each location.
Returns
number
[]
The spatial empirical Bayes smoothed rates.