dot-bf_gee_deviance: Compute Whitened Deviance for GEE Convergence Monitoring

.bf_gee_devianceR Documentation

Compute Whitened Deviance for GEE Convergence Monitoring

Description

Evaluates deviance in the whitened (decorrelated) space when the family supplies fam$custom_dev.resids. In that case the raw deviance residuals are divided by \sqrt{W} and then pre-multiplied by \mathbf{V}^{-1/2} before squaring and averaging. If only fam$dev.resids is available, the function falls back to the usual mean deviance (and otherwise mean squared error). Used in the GEE refinement loop (Case c) of blockfit_solve.

Usage

.bf_gee_deviance(y_vec, mu_vec, W_vec, ord, obs_wt, VhInv, fam, ...)

Arguments

y_vec

Numeric vector of observed responses.

mu_vec

Numeric vector of fitted means.

W_vec

Numeric vector of damped Newton-Raphson weights at current iterate.

ord

Integer vector of observation indices (passed to custom deviance residual functions).

obs_wt

Numeric vector of observation weights.

VhInv

\mathbf{V}^{-1/2} matrix (permuted to partition ordering).

fam

GLM family object.

...

Additional arguments forwarded to fam$custom_dev.resids.

Value

Scalar; the mean whitened deviance.


lgspline documentation built on May 8, 2026, 5:07 p.m.