BIE::KSDistance Class Reference

The KS statistic offers a way of comparing two one dimensional distributions, and gives the probability that two distributions come from the same underlying distribution. More...

#include <KSDistance.h>

List of all members.

Public Member Functions

 KSDistance (int convergelim=100, double esp1=0.001, double esp2=1.0e-8)
 Constructs a KS distance object - values for the constants used for convergence testing during calculation of the statistic can be given explicit values if appropriate.
double ksdistance (vector< SampleDistribution * > distributions)
 Returns the KS distance for a set of of binned distributions.
double kssignificance (SampleDistribution *, SampleDistribution *)
 Returns the probability that the two distributions are drawn from the same underlying distributions.


Detailed Description

The KS statistic offers a way of comparing two one dimensional distributions, and gives the probability that two distributions come from the same underlying distribution.

The method is based on the maximam distance between the cummulative distribution function of each distribution. This implementation is based the code in Numerical Recipes in C : The Art of Scientific Computing; William H. Press, et al

Todo:
This statistic breaks down where the binning of the distributions is not similar. Where the binning of distributions is different, linear interpolation can be used to smooth the CDF of each distribution - this would provide a more sensible result.

Constructor & Destructor Documentation

BIE::KSDistance::KSDistance ( int  convergelim = 100,
double  esp1 = 0.001,
double  esp2 = 1.0e-8 
) [inline]

Constructs a KS distance object - values for the constants used for convergence testing during calculation of the statistic can be given explicit values if appropriate.


Member Function Documentation

double BIE::KSDistance::ksdistance ( vector< SampleDistribution * >  distributions  ) 

Returns the KS distance for a set of of binned distributions.

The binning of the distributions need not be the same, but the quality of the result will suffer if they are not.

double BIE::KSDistance::kssignificance ( SampleDistribution ,
SampleDistribution  
)

Returns the probability that the two distributions are drawn from the same underlying distributions.


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

Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU.
Documentation generated at Fri Mar 26 00:35:12 2010 by doxygen