datasketches-cpp
Loading...
Searching...
No Matches
bounds_on_ratios_in_theta_sketched_sets< ExtractKey > Class Template Reference

Bounds on ratios in Theta sketched sets. More...

#include <bounds_on_ratios_in_theta_sketched_sets.hpp>

Static Public Member Functions

template<typename SketchA, typename SketchB>
static double lower_bound_for_b_over_a (const SketchA &sketch_a, const SketchB &sketch_b)
 Gets the approximate lower bound for B over A based on a 95% confidence interval.
template<typename SketchA, typename SketchB>
static double upper_bound_for_b_over_a (const SketchA &sketch_a, const SketchB &sketch_b)
 Gets the approximate upper bound for B over A based on a 95% confidence interval.
template<typename SketchA, typename SketchB>
static double estimate_of_b_over_a (const SketchA &sketch_a, const SketchB &sketch_b)
 Gets the estimate for B over A.

Detailed Description

template<typename ExtractKey>
class datasketches::bounds_on_ratios_in_theta_sketched_sets< ExtractKey >

Bounds on ratios in Theta sketched sets.

This is to compute the bounds on the estimate of the ratio B / A, where:

  • A is a Theta Sketch of population PopA.
  • B is a Theta Sketch of population PopB that is a subset of A, obtained by an intersection of A with some other Theta Sketch C, which acts like a predicate or selection clause.
  • The estimate of the ratio PopB/PopA is estimate_of_b_over_a(A, B).
  • The Upper Bound estimate on the ratio PopB/PopA is upper_bound_for_b_over_a(A, B).
  • The Lower Bound estimate on the ratio PopB/PopA is lower_bound_for_b_over_a(A, B).

Note: The theta of A cannot be greater than the theta of B. If B is formed as an intersection of A and some other set C, then the theta of B is guaranteed to be less than or equal to the theta of B.

Member Function Documentation

◆ lower_bound_for_b_over_a()

template<typename ExtractKey>
template<typename SketchA, typename SketchB>
double lower_bound_for_b_over_a ( const SketchA & sketch_a,
const SketchB & sketch_b )
inlinestatic

Gets the approximate lower bound for B over A based on a 95% confidence interval.

Parameters
sketch_athe sketch A
sketch_bthe sketch B
Returns
the approximate lower bound for B over A

◆ upper_bound_for_b_over_a()

template<typename ExtractKey>
template<typename SketchA, typename SketchB>
double upper_bound_for_b_over_a ( const SketchA & sketch_a,
const SketchB & sketch_b )
inlinestatic

Gets the approximate upper bound for B over A based on a 95% confidence interval.

Parameters
sketch_athe sketch A
sketch_bthe sketch B
Returns
the approximate upper bound for B over A

◆ estimate_of_b_over_a()

template<typename ExtractKey>
template<typename SketchA, typename SketchB>
double estimate_of_b_over_a ( const SketchA & sketch_a,
const SketchB & sketch_b )
inlinestatic

Gets the estimate for B over A.

Parameters
sketch_athe sketch A
sketch_bthe sketch B
Returns
the estimate for B over A

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