pub struct PHReg { /* private fields */ }Expand description
A Cox proportional-hazards model awaiting estimation.
Implementations§
Source§impl PHReg
impl PHReg
Sourcepub fn new(time: &[f64], exog: &Array2<f64>, status: &[f64]) -> Result<Self>
pub fn new(time: &[f64], exog: &Array2<f64>, status: &[f64]) -> Result<Self>
Build a Cox PH model from event times, covariates and status flags.
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 breslow_gradient(&self, params: &Array1<f64>) -> Array1<f64>
pub fn breslow_gradient(&self, params: &Array1<f64>) -> Array1<f64>
Gradient of the Breslow partial log-likelihood at params.
Sourcepub fn breslow_hessian(&self, params: &Array1<f64>) -> Array2<f64>
pub fn breslow_hessian(&self, params: &Array1<f64>) -> Array2<f64>
Hessian of the Breslow partial log-likelihood at params.
Negative-definite at the maximum; its negative is the observed information used for standard errors.
Sourcepub fn fit(&self) -> Result<PHRegResults>
pub fn fit(&self) -> Result<PHRegResults>
Estimate the model by Newton iteration on the partial likelihood.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PHReg
impl RefUnwindSafe for PHReg
impl Send for PHReg
impl Sync for PHReg
impl Unpin for PHReg
impl UnsafeUnpin for PHReg
impl UnwindSafe for PHReg
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more