survival_analysis

Crates.iosurvival_analysis
lib.rssurvival_analysis
version0.1.0
sourcesrc
created_at2020-07-25 06:09:23.60298
updated_at2020-07-25 06:09:23.60298
descriptionSurvival analysis library
homepagehttp://github.com/mikkyang/survival-analysis
repositoryhttp://github.com/mikkyang/survival-analysis
max_upload_size
id269423
size28,046
Michael Yang (mikkyang)

documentation

https://docs.rs/survival-analysis

README

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);
Commit count: 0

cargo fmt