Estimate Univariate Cox Model via Iteratively Reweighted Least Squares (IRLS)
Source:R/Rinternal.R
univariate_irls_cox.RdFits a univariate Cox proportional hazards model by maximizing the partial log-likelihood using an Iteratively Reweighted Least Squares (IRLS) approach. Supports both Breslow and Efron approximations for handling ties.
Arguments
- x
Numeric vector of length
n: covariate values.- y
Numeric matrix with shape
n × 2, where:y[,1]is the observed timey[,2]is the event indicator (1 = event, 0 = censored)
- offset
Numeric scalar or vector of length
n. Optional offset for the linear predictor.- ties
Character string specifying the method to handle ties:
"breslow"(default) or"efron".- lambda
Numeric penalty weight; if ≤ 0, defaults to \(\sqrt{2\log(n)/n}\) (default: 0.0).
- tau
Numeric truncation parameter; if ≤ 0, defaults to 0.5 (default: 0.5).
- max_iter
Integer: maximum number of IRLS iterations. Default is 25.
- tol
Numeric: convergence tolerance on parameter change. Default is 1e-8.
Details
The function starts from an initial coefficient value of 0 and updates the
slope estimate using Newton-Raphson iterations until convergence or until
reaching the maximum number of iterations. The linear predictor is
lp = offset + theta * x. The score function and observed information
are used to update the estimate.