pub struct PHRegTies { /* private fields */ }Expand description
A Cox proportional-hazards model with a selectable tie-handling method.
Implementations§
Source§impl PHRegTies
impl PHRegTies
Sourcepub fn new(
time: &[f64],
exog: &Array2<f64>,
status: &[f64],
ties: Ties,
) -> Result<Self>
pub fn new( time: &[f64], exog: &Array2<f64>, status: &[f64], ties: Ties, ) -> Result<Self>
Build a Cox PH model with the chosen tie-handling method.
time[i] is the event or censoring time, exog has one row per subject
(covariates in columns, no implicit intercept — the Cox baseline hazard
absorbs it), and status[i] is 1.0 for an observed event and 0.0
for right-censoring.
Sourcepub fn breslow_loglike(&self, params: &Array1<f64>) -> f64
pub fn breslow_loglike(&self, params: &Array1<f64>) -> f64
Breslow partial log-likelihood evaluated at params.
Sourcepub fn efron_loglike(&self, params: &Array1<f64>) -> f64
pub fn efron_loglike(&self, params: &Array1<f64>) -> f64
Efron partial log-likelihood evaluated at params.
Sourcepub fn loglike(&self, params: &Array1<f64>) -> f64
pub fn loglike(&self, params: &Array1<f64>) -> f64
Partial log-likelihood under the configured tie-handling method.
Sourcepub fn breslow_gradient(&self, params: &Array1<f64>) -> Array1<f64>
pub fn breslow_gradient(&self, params: &Array1<f64>) -> Array1<f64>
Breslow gradient of the partial log-likelihood at params.
Sourcepub fn efron_gradient(&self, params: &Array1<f64>) -> Array1<f64>
pub fn efron_gradient(&self, params: &Array1<f64>) -> Array1<f64>
Efron gradient of the partial log-likelihood at params.
Sourcepub fn gradient(&self, params: &Array1<f64>) -> Array1<f64>
pub fn gradient(&self, params: &Array1<f64>) -> Array1<f64>
Gradient under the configured tie-handling method.
Sourcepub fn breslow_hessian(&self, params: &Array1<f64>) -> Array2<f64>
pub fn breslow_hessian(&self, params: &Array1<f64>) -> Array2<f64>
Breslow Hessian of the partial log-likelihood at params.
Negative-definite at the maximum; its negative is the observed information used for standard errors.
Sourcepub fn efron_hessian(&self, params: &Array1<f64>) -> Array2<f64>
pub fn efron_hessian(&self, params: &Array1<f64>) -> Array2<f64>
Efron Hessian of the partial log-likelihood at params.
Negative-definite at the maximum; its negative is the observed information used for standard errors.
Sourcepub fn hessian(&self, params: &Array1<f64>) -> Array2<f64>
pub fn hessian(&self, params: &Array1<f64>) -> Array2<f64>
Hessian under the configured tie-handling method.
Sourcepub fn fit(&self) -> Result<PHRegTiesResults>
pub fn fit(&self) -> Result<PHRegTiesResults>
Estimate the model by Newton iteration on the partial likelihood.