geodalib / core/src / empiricalBayes
Function: empiricalBayes()
empiricalBayes(
baseValues
,eventValues
):number
[]
Defined in: core/src/mapping/rates.ts:162
Description
Compute the empirical Bayes smoothed rates using the Poisson-Gamma model.
The EB estimate for risk in location i is:
where:
is the crude (raw) rate is the reference rate (prior mean) is the weight calculated as: is the population at risk in area i and are the mean and variance of the prior distribution
The method:
- Estimates
(theta1) as the reference rate: - Estimates
(theta2) using the formula: - If
is negative, sets it to 0 (conventional approach) - Computes weights and final smoothed rates
Small areas (with small population at risk) will have their rates adjusted considerably, while larger areas will see minimal changes.
Parameters
baseValues
number
[]
The values of base variable (P_i, population at risk).
eventValues
number
[]
The values of event variable (O_i, observed events).
Returns
number
[]
The empirical Bayes smoothed rates.