#include <measure.h>
Inheritance diagram for DstMeasure:
Public Member Functions | |
DstMeasure () | |
Create an emptry DstMeasure. | |
~DstMeasure () | |
Do nothing. | |
void | addSample (sample_t x, unsigned int id, unsigned int bin) |
Add a sample to a population bin. | |
Population & | getPopulation (unsigned int id, unsigned int bin) |
Return the population of a given index/bin. | |
Population & | getPopulationCDF (unsigned int id, unsigned int bin) |
Return the CDF population of a given index/bin. | |
Population & | getMeanPopulation (unsigned int id) |
Return the mean population. | |
Population & | getMedianPopulation (unsigned int id) |
Return the mediam population. | |
Population & | getPercentile95Population (unsigned int id) |
Return the 95th percentile population. | |
Population & | getPercentile99Population (unsigned int id) |
Return the 99th percentile population. | |
void | computeDerivedStatistics (unsigned int id) |
Compute the derived statistics (mean, quantiles) if not already done. | |
bool | getValid (unsigned int id, unsigned int bin) |
Return true if the population with a given index exists. | |
unsigned int | getSize () const |
Return the number of populations in this measure. | |
unsigned int | getSize (unsigned int id) |
Return the number of bins in the given index. | |
void | setBinSize (sample_t s) |
Set the bin size. | |
void | setDistLower (sample_t s) |
Set the distribution lower bound. | |
sample_t | getBinSize () const |
Get the bin size. | |
sample_t | getDistLower () const |
Get the distribution lower bound. | |
Private Attributes | |
std::vector< std::vector< Population > > | populations |
Array of array of populations. | |
std::vector< std::vector< Population > > | populationsCDF |
Array of array of populations. Cumulative wrt the previous bins. | |
std::vector< std::vector< bool > > | valid |
Bit array to check if the i-th entry of populations is valid. | |
sample_t | binSize |
Bin size. | |
sample_t | distLower |
Distribution lower bound. | |
bool | binSizeSet |
True if the bin size has been set. | |
bool | distLowerSet |
True if the distribution lower bound has been set. | |
std::vector< Population > | meanPopulations |
Populations of average values. | |
std::vector< Population > | medianPopulations |
Populations of median values. | |
std::vector< Population > | percentile95Populations |
Populations of 95th percentile values. | |
std::vector< Population > | percentile99Populations |
Populations of 99th percentile values. | |
std::vector< unsigned int > | derivedLast |
Record the last size of the bins populations. |
Each element in a DstMeasure is the probability that a given sample fits in a given bin. The size of the bin and the minimum value of the distribution are part of the DstMeasure data structure. In addition to the cumulative distribution function and the probability mass function, the mean value and quantiles are derived from the DstMeasure.
The bin size and the mininmum data structure must be set before computing the quantile values. Also, samples must be added in bin order. If they are not, then the cumulative values will not be meaningful.
|
Array of array of populations. Cumulative wrt the previous bins. Note that the populations and populationsCDF always have the same size and structure. Thus, the valid structure is meaningful for both these data structures. |