datasketches-cpp
Loading...
Searching...
No Matches
kolmogorov_smirnov Class Reference

Kolmogorov-Smirnov test for KLL or Quantiles sketches. More...

#include <kolmogorov_smirnov.hpp>

Static Public Member Functions

template<typename Sketch>
static double delta (const Sketch &sketch1, const Sketch &sketch2)
 Computes the raw delta area between two quantile sketches for the Kolmogorov-Smirnov Test.
template<typename Sketch>
static double threshold (const Sketch &sketch1, const Sketch &sketch2, double p)
 Computes the adjusted delta area threshold for the Kolmogorov-Smirnov Test.
template<typename Sketch>
static bool test (const Sketch &sketch1, const Sketch &sketch2, double p)
 Performs the Kolmogorov-Smirnov Test between two quantile sketches.

Detailed Description

Kolmogorov-Smirnov test for KLL or Quantiles sketches.

Member Function Documentation

◆ delta()

template<typename Sketch>
double delta ( const Sketch & sketch1,
const Sketch & sketch2 )
static

Computes the raw delta area between two quantile sketches for the Kolmogorov-Smirnov Test.

Will work for a type-matched pair of KLL or Quantiles sketches of the same parameterized type T.

Parameters
sketch1sketch 1
sketch2sketch 2
Returns
the raw delta between two KLL quantile sketches

◆ threshold()

template<typename Sketch>
double threshold ( const Sketch & sketch1,
const Sketch & sketch2,
double p )
static

Computes the adjusted delta area threshold for the Kolmogorov-Smirnov Test.

Adjusts the computed threshold by the error epsilons of the two given sketches. See Kolmogorov–Smirnov Test Will work for a type-matched pair of KLL or Quantiles sketches of the same parameterized type T.

Parameters
sketch1sketch 1
sketch2sketch 2
pTarget p-value. Typically .001 to .1, e.g., .05.
Returns
the adjusted threshold to be compared with the raw delta

◆ test()

template<typename Sketch>
bool test ( const Sketch & sketch1,
const Sketch & sketch2,
double p )
static

Performs the Kolmogorov-Smirnov Test between two quantile sketches.

Will work for a type-matched pair of KLL or Quantiles sketches of the same parameterized type T. Note: if the given sketches have insufficient data or if the sketch sizes are too small, this will return false.

Parameters
sketch1sketch 1
sketch2sketch 2
pTarget p-value. Typically .001 to .1, e.g., .05.
Returns
Boolean indicating whether we can reject the null hypothesis (that the sketches reflect the same underlying distribution) using the provided p-value.

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