theplu::yat::statistics::ROC Class Reference

Class for Reciever Operating Characteristic. More...

#include <yat/statistics/ROC.h>

List of all members.

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.


Detailed Description

Class for Reciever Operating Characteristic.

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).


Member Function Documentation

void theplu::yat::statistics::ROC::add ( double  value,
bool  target,
double  weight = 1.0 
)

Adding a data value to ROC.

See also:
add(T &o, ForwardIterator first, ForwardIterator last, const classifier::Target &target)

double theplu::yat::statistics::ROC::area ( void   ) 

The area is defines as $ \frac{\sum w^+w^-} {\sum w^+w^-}$, where the sum in the numerator goes over all pairs where value+ is larger than value-. The denominator goes over all pairs.

Returns:
Area under curve.

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.

Returns:
reference to minimum_size

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.

Returns:
const reference to minimum_size

double theplu::yat::statistics::ROC::n ( void   )  const

Returns:
sum of weights

double theplu::yat::statistics::ROC::n_neg ( void   )  const

Returns:
sum of weights with negative target

double theplu::yat::statistics::ROC::n_pos ( void   )  const

Returns:
sum of weights with positive target

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.

Note:
Weights should be either zero or unity, else present implementation is nonsense.
Returns:
One-sided p-value.

double theplu::yat::statistics::ROC::p_value ( void   )  const

Two-sided p-value.

Returns:
min(2*p_value_one_sided, 2-2*p_value_one_sided)


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

Generated on Tue Jan 18 02:20:11 2011 for yat by  doxygen 1.5.5