Skip to main content
Computes Bayesian shrinkage estimate from observed data and prior. Normal-normal conjugate model: posterior_mean = (n × observed + prior_weight × prior_mean) / (n + prior_weight)

Signature

Arguments

Returns

scalar expression composable in SELECT lists. Tolerates n=0 by returning NULL (via NULLIF), which is the correct behaviour for unobserved cells.

Usage