yat
0.21pre
|
Kaplan-Meier estimator. More...
#include <yat/statistics/KaplanMeier.h>
Classes | |
class | TimePoint |
Public Types | |
typedef std::map< double, TimePoint >::const_iterator | const_iterator |
Public Member Functions | |
KaplanMeier (void) | |
void | add (double time, bool event) |
void | add (double time, unsigned int event, unsigned int censored) |
const_iterator | begin (void) const |
void | clear (void) |
const_iterator | end (void) const |
const_iterator | find (double time) const |
const_iterator | lower_bound (double time) const |
const_iterator | upper_bound (double time) const |
Kaplan-Meier estimator.
Data is evaluated lazily, i.e., data is not computed when added but when data is accessed through the functions returning iterators to the underlying data structure. Since computing teh data is linear in number of time points, the typical use case is to first add all the data and then access the estimated values.
typedef std::map<double, TimePoint>::const_iterator theplu::yat::statistics::KaplanMeier::const_iterator |
Const iterator used to iterate through the underlying data structure.
theplu::yat::statistics::KaplanMeier::KaplanMeier | ( | void | ) |
Default constructor
void theplu::yat::statistics::KaplanMeier::add | ( | double | time, |
bool | event | ||
) |
Add a data point at time time
. If event
is true, counted as an event (e.g. death); otherwise counted as sample being censored at time time
.
Takes logarithmic time in terms of already added time points.
void theplu::yat::statistics::KaplanMeier::add | ( | double | time, |
unsigned int | event, | ||
unsigned int | censored | ||
) |
Add event
events and censored
censored data points at time time
.
Takes logarithmic time in terms of already added time points.
const_iterator theplu::yat::statistics::KaplanMeier::begin | ( | void | ) | const |
void theplu::yat::statistics::KaplanMeier::clear | ( | void | ) |
Clear all data.
const_iterator theplu::yat::statistics::KaplanMeier::end | ( | void | ) | const |
const_iterator theplu::yat::statistics::KaplanMeier::find | ( | double | time | ) | const |
time
, return an iterator pointing to it. Otherwise, end() is returned. const_iterator theplu::yat::statistics::KaplanMeier::lower_bound | ( | double | time | ) | const |
time
const_iterator theplu::yat::statistics::KaplanMeier::upper_bound | ( | double | time | ) | const |
time