#include <yat/statistics/ROC.h>
Public Member Functions | |
ROC (void) | |
Default constructor. | |
virtual | ~ROC (void) |
The destructor. | |
void | add (double value, bool target, double weight=1.0) |
double | area (void) |
unsigned int & | minimum_size (void) |
const unsigned int & | minimum_size (void) const |
double | n (void) const |
double | n_neg (void) const |
double | n_pos (void) const |
double | p_value_one_sided (void) const |
double | p_value (void) const |
Two-sided p-value. | |
void | reset (void) |
Set everything to zero. |
As the area under an ROC curve is equivalent to Mann-Whitney U statistica, this class can be used to perform a Mann-Whitney U-test (aka Wilcoxon).
void theplu::yat::statistics::ROC::add | ( | double | value, | |
bool | target, | |||
double | weight = 1.0 | |||
) |
Adding a data value to ROC.
double theplu::yat::statistics::ROC::area | ( | void | ) |
The area is defines as , where the sum in the numerator goes over all pairs where value+ is larger than value-. The denominator goes over all pairs.
const unsigned int& theplu::yat::statistics::ROC::minimum_size | ( | void | ) | const |
minimum_size is the threshold for when a normal approximation is used for the p-value calculation.
unsigned int& theplu::yat::statistics::ROC::minimum_size | ( | void | ) |
minimum_size is the threshold for when a normal approximation is used for the p-value calculation.
double theplu::yat::statistics::ROC::n | ( | void | ) | const |
double theplu::yat::statistics::ROC::n_neg | ( | void | ) | const |
double theplu::yat::statistics::ROC::n_pos | ( | void | ) | const |
double theplu::yat::statistics::ROC::p_value | ( | void | ) | const |
Two-sided p-value.
double theplu::yat::statistics::ROC::p_value_one_sided | ( | void | ) | const |
Calculates the p-value, i.e. the probability of observing an area equally or larger if the null hypothesis is true. If P is near zero, this casts doubt on this hypothesis. The null hypothesis is that the values from the 2 classes are generated from 2 identical distributions. The alternative is that the median of the first distribution is shifted from the median of the second distribution by a non-zero amount. If the smallest group size is larger than minimum_size (default = 10), then P is calculated using a normal approximation.