yat  0.21pre
Classes | Public Types | Public Member Functions | List of all members
theplu::yat::statistics::KaplanMeier Class Reference

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
 

Detailed Description

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.

Since
New in yat 0.21

Member Typedef Documentation

◆ const_iterator

Const iterator used to iterate through the underlying data structure.

Constructor & Destructor Documentation

◆ KaplanMeier()

theplu::yat::statistics::KaplanMeier::KaplanMeier ( void  )

Default constructor

Member Function Documentation

◆ add() [1/2]

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.

◆ add() [2/2]

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.

◆ begin()

const_iterator theplu::yat::statistics::KaplanMeier::begin ( void  ) const
Returns
an iterator to the earliest data point with data

◆ clear()

void theplu::yat::statistics::KaplanMeier::clear ( void  )

Clear all data.

◆ end()

const_iterator theplu::yat::statistics::KaplanMeier::end ( void  ) const
Returns
past last iterator

◆ find()

const_iterator theplu::yat::statistics::KaplanMeier::find ( double  time) const
Returns
If there is any data at time time, return an iterator pointing to it. Otherwise, end() is returned.

◆ lower_bound()

const_iterator theplu::yat::statistics::KaplanMeier::lower_bound ( double  time) const
Returns
first time point that is not earlier than time

◆ upper_bound()

const_iterator theplu::yat::statistics::KaplanMeier::upper_bound ( double  time) const
Returns
first time point that is later than time

The documentation for this class was generated from the following file:

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14