#analysis #survival #weibull

survival_analysis

Survival analysis library

1 unstable release

0.1.0 Jul 25, 2020

#257 in #analysis

MIT license

27KB
701 lines

Survival Analysis

A experimental survival analysis library, initially inspired by Python's lifelines.

Current Limitations:

  • Only supports fitting to a Weibull distribution
  • Only supports distributions that can be fitted without derivatives
  • No autodifferentiation support

Fitting Data

use ndarray::prelude::*;
use survival_analysis::{IntervalCensored, Fitter, BaseFitter};
use survival_analysis::distribution::WeibullDistribution;

let data = IntervalCensored {
    start: array![0., 2., 5., 10.],
    stop: array![2., 5., 10., 1e10f64],
};

let fitter = BaseFitter::new(data);

let params: WeibullDistribution<f64> = fitter.fit().unwrap();

assert!((params.shape - 0.980).abs() < 1e-2);
assert!((params.scale - 7.187).abs() < 1e-2);

Dependencies

~6–14MB
~171K SLoC