| cox_glm_weight_function | R Documentation |
Computes working weights for the Cox PH information matrix, used by
lgspline when updating \mathbf{G} after obtaining constrained
estimates. The weights are a diagonal approximation built from the Breslow
tied-event information contributions.
cox_glm_weight_function(
mu,
y,
order_indices,
family,
dispersion,
observation_weights,
status
)
mu |
Predicted values (exp(eta), i.e., relative hazard). |
y |
Observed survival times. |
order_indices |
Observation indices in partition order. |
family |
Cox family object (unused, for interface compatibility). |
dispersion |
Dispersion parameter (fixed at 1 for Cox PH). |
observation_weights |
Observation weights. |
status |
Event indicator (1 = event, 0 = censored). |
For a tied event-time block g, the diagonal approximation uses
W_{jj}^{(g)} = d_g^{(w)} \frac{h_j}{S_g}
\Bigl(1 - \frac{h_j}{S_g}\Bigr), \qquad j \in R_g
where h_j = w_j \exp(\eta_j),
S_g = \sum_{k \in R_g} h_k, and
d_g^{(w)} = \sum_{i \in D_g} w_i.
When the natural weights are degenerate (all zero or non-finite), falls back to a vector of ones.
Numeric vector of working weights, length N.
## Used internally by lgspline; see cox_helpers examples below.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.