public IList <Point <decimal, decimal> > GetCDF() { nelsonAalen = new KaplanMeier(observationsInternal); var result = new List <Point <decimal, decimal> >(); var cnt = 0; foreach (var set in observationsInternal) { var survival = nelsonAalen.GetSurvivalValueUpToPeriod(cnt + 1); var point = new Point <decimal, decimal>(set.unitTime * cnt, (1 - survival)); result.Add(point); cnt++; } return(result); }
/// <summary> /// S(t) = 1-F(t) where F(t) = /// </summary> /// <returns></returns> public IList <Point <decimal, decimal> > SurvivalFunction() { MaximumSurvivalValue = 0; MaximumSurvivalValueTime = 0; nelsonAalen = new KaplanMeier(observationsInternal); var result = new List <Point <decimal, decimal> >(); var cnt = 0; foreach (var set in observationsInternal) { var survival = nelsonAalen.GetSurvivalValueUpToPeriod(cnt + 1); SetMaximumSurvivalValue(survival, cnt); var point = new Point <decimal, decimal>(set.unitTime * cnt, (survival)); result.Add(point); cnt++; } return(result); }