| .compute_tuning_residuals | R Documentation |
Computes the residuals used by the tuning criteria. Handles identity link, general GLM link functions with pseudocount delta, custom deviance residual functions, and observation weights.
.compute_tuning_residuals(
y,
preds,
delta,
family,
observation_weights,
K,
order_list,
...
)
y |
List; response vectors by partition. |
preds |
List; prediction vectors by partition. |
delta |
Numeric; pseudocount for link function stabilization. |
family |
GLM family object. |
observation_weights |
List; observation weights by partition. |
K |
Integer; number of interior knots (partitions - 1). |
order_list |
List; observation indices per partition. |
... |
Additional arguments passed to |
Three computation paths:
Identity link or no custom deviance: Standard
g(y) - \hat{\eta} residuals on the link scale, optionally
weighted by observation weights for non-Gaussian families.
For Gaussian identity link with heterogeneous weights, the weights
have already been absorbed into X and y prior to this call.
Custom deviance residuals: Delegates to
family$custom_dev.resids(y, mu, order_indices, family,
observation_weights, ...).
List of residual vectors, one per partition.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.