| unconstrained_fit_cox | R Documentation |
Estimates penalized Cox PH coefficients for a single partition (or the full model when K = 0) using damped Newton-Raphson on the penalized partial log-likelihood with the Breslow approximation for tied event times.
This function is passed to lgspline's unconstrained_fit_fxn
argument. It receives the partition-level design matrix and response,
sorts internally by event time, and returns the coefficient vector.
unconstrained_fit_cox(
X,
y,
LambdaHalf,
Lambda,
keep_weighted_Lambda,
family,
tol = 1e-08,
K,
parallel,
cl,
chunk_size,
num_chunks,
rem_chunks,
order_indices,
weights,
status
)
X |
Design matrix (N_k x p) for partition k. |
y |
Survival times for partition k. |
LambdaHalf |
Square root of penalty matrix (unused here, retained for interface compatibility). |
Lambda |
Penalty matrix. |
keep_weighted_Lambda |
Logical; if TRUE, return hot-start estimates without refinement (not recommended for Cox). |
family |
Cox family object. |
tol |
Convergence tolerance. |
K |
Number of knots. |
parallel |
Logical for parallel processing. |
cl |
Cluster object. |
chunk_size |
num_chunks, rem_chunks Parallelism parameters. |
order_indices |
Observation indices mapping partition to full data. |
weights |
Observation weights. |
status |
Event indicator (1 = event, 0 = censored), full-data length. |
The penalized partial log-likelihood is
\ell_p(\boldsymbol{\beta}) = \ell(\boldsymbol{\beta})
- \tfrac{1}{2}\boldsymbol{\beta}^{\top}
\boldsymbol{\Lambda}\boldsymbol{\beta}
Newton-Raphson updates use the Cox score and observed information
(computed via score_cox and info_cox), plus the penalty
term. The step is damped: the step size is halved until the penalized
log-likelihood improves.
Numeric column vector of penalized partial-likelihood coefficient estimates.
## Used internally by lgspline; see the full-model example below.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.