Skip to main content
Computes posterior variance from normal-normal conjugate model.

Signature

Arguments

Returns

scalar expression composable in SELECT lists (posterior variance, ≥0).

Notes

observation variance: σ² (e.g., from a fitted model’s residual variance) prior variance: σ₀² sample size: n The posterior variance (precision-weighted average) is: posterior_var = 1 / (n / σ² + 1 / σ₀²) This is the inverse of the sum of precisions. Returns NULL if either variance is NULL or ≤0.

Usage