STAT_UNIVARIATE Class Reference
Container for accumulating and computing univariate statistics.
More...
#include <mi32/statunivar.h>
List of all members.
Public Member Functions |
| | STAT_UNIVARIATE () |
| | ~STAT_UNIVARIATE () |
| ERRVALUE | Accumulate (const STAT_UNIVARIATE &stats) |
| ERRVALUE | Accumulate (UINT32 NumValues, const void *pValues, const UINT8 *pValidity=0) |
| ERRVALUE | AccumulateCounted (const void *pValue, UINT64 count) |
| ERRVALUE | AccumulateWeighted (const void *pValue, double weight) |
| void | Clear () |
| double | ComputeBinCenter (INT32 BinIndex) const |
| INT32 | ComputeBinIndex (double value) const |
| UINT32 | ComputeBinIndexLimit (double value) const |
| void | ComputeBinRange (INT32 BinIndex, DOUBLE_RANGE &BinRange) const |
| ERRVALUE | Finalize () |
| INT32 | FindBinIndexPctAbove (double pct) const |
| INT32 | FindBinIndexPctBelow (double pct) const |
| UINT64 | GetBinCount (INT32 BinIndex) const |
| double | GetBinCountWeighted (INT32 BinIndex) const |
| const DOUBLE_RANGE & | GetBinRange () const |
| double | GetBinWidth (INT32 BinIndex=0) const |
| UINT64 | GetCountAboveMaxBin () const |
| double | GetCountAboveMaxBinWeighted () const |
| UINT64 | GetCountBelowMinBin () const |
| double | GetCountBelowMinBinWeighted () const |
| UINT64 | GetCountInvalid () const |
| UINT64 | GetCountValid () const |
| double | GetCountValidWeighted () const |
| MISTRING | GetDisplayStats () const |
| double | GetMean () const |
| INT32 | GetMedianBinIndex () const |
| INT32 | GetModeBinIndex () const |
| UINT32 | GetNumBins () const |
| NUMTYPE | GetNumType () const |
| double | GetStdDev () const |
| double | GetSum2 () const |
| const DOUBLE_RANGE & | GetValueRange () const |
| XMLNODE * | GetXML (XMLNODE *parentnode, const char *nodename) const |
| bool | HasEqualBinWidths () const |
| ERRVALUE | Initialize (NUMTYPE NumType, const STAT_UNIVARIATE &existing) |
| ERRVALUE | Initialize (NUMTYPE NumType, UINT32 NumBins, double MinBin, double MaxBin, double BinWidth=0) |
| bool | IsValid () const |
| ERRVALUE | Set (UINT64 CountValid, UINT64 CountBelowMinBin, UINT64 CountAboveMaxBin, UINT64 CountInvalid, double Mean, double Sum2, const DOUBLE_RANGE &ValueRange, const DOUBLE_RANGE &BinRange, double BinWidth, const void *BinCounts, UINT32 NumBins, int BinBytes, NUMTYPE NumType=NUMTYPE_Invalid) |
| void | SetAllInvalid (UINT64 CountInvalid) |
| ERRVALUE | SetFromXML (const XMLNODE *xmlnode) |
Detailed Description
Container for accumulating and computing univariate statistics.
Statistics include minimum, maximum, mean, standard deviation and optional histogram.
Constructor & Destructor Documentation
| STAT_UNIVARIATE::STAT_UNIVARIATE |
( |
|
) |
|
| STAT_UNIVARIATE::~STAT_UNIVARIATE |
( |
|
) |
|
Member Function Documentation
Accumulate from another set of statistics.
- Parameters:
-
| ERRVALUE STAT_UNIVARIATE::Accumulate |
( |
UINT32 |
NumValues, |
|
|
const void * |
pValues, |
|
|
const UINT8 * |
pValidity = 0 | |
|
) |
| | |
Accumulate samples for computing statistics.
- Parameters:
-
| NumValues | Number of sample values |
| pValues | Pointer to sample values, must match numeric type specified in Initialize |
| pValidity | Pointer to validity, if NULL all samples considered valid |
| ERRVALUE STAT_UNIVARIATE::AccumulateCounted |
( |
const void * |
pValue, |
|
|
UINT64 |
count | |
|
) |
| | |
Accumulate single sample with count.
- Parameters:
-
| pValue | Pointer to sample value, must match numeric type specified in Initialize, NULL for invalid |
| count | Count of values |
| ERRVALUE STAT_UNIVARIATE::AccumulateWeighted |
( |
const void * |
pValue, |
|
|
double |
weight | |
|
) |
| | |
Accumulate single sample with weight.
- Parameters:
-
| pValue | Pointer to sample value, must match numeric type specified in Initialize |
| weight | Weight, 1.0 same as whole sample |
| void STAT_UNIVARIATE::Clear |
( |
|
) |
|
Clear all statistics, reverting to "invalid" state.
| double STAT_UNIVARIATE::ComputeBinCenter |
( |
INT32 |
BinIndex |
) |
const |
Compute center value for specified bin.
- Parameters:
-
| INT32 STAT_UNIVARIATE::ComputeBinIndex |
( |
double |
value |
) |
const |
Compute bin index from specified value.
| UINT32 STAT_UNIVARIATE::ComputeBinIndexLimit |
( |
double |
value |
) |
const |
Compute bin index from specified value with value forced to table limit.
| void STAT_UNIVARIATE::ComputeBinRange |
( |
INT32 |
BinIndex, |
|
|
DOUBLE_RANGE & |
BinRange | |
|
) |
| | const |
Compute range of values counted in specified bin.
- Parameters:
-
| BinIndex | Bin index |
| BinRange | Range of values for bin returned |
Finalize computation of statistics.
| INT32 STAT_UNIVARIATE::FindBinIndexPctAbove |
( |
double |
pct |
) |
const |
Find bin index at most specified percentage of counts are above.
- Returns:
- Bin index or error < 0
- Parameters:
-
| INT32 STAT_UNIVARIATE::FindBinIndexPctBelow |
( |
double |
pct |
) |
const |
Find bin index at most specified percentage of counts are below.
- Returns:
- Bin index or error < 0
- Parameters:
-
| UINT64 STAT_UNIVARIATE::GetBinCount |
( |
INT32 |
BinIndex |
) |
const |
Get count of samples in specified bin.
If any weighted will be rounded up, use GetBinCountWeighted for weighted total.
- Parameters:
-
| double STAT_UNIVARIATE::GetBinCountWeighted |
( |
INT32 |
BinIndex |
) |
const |
Get count of samples in specified bin with partial counts for weighted.
- Parameters:
-
| const DOUBLE_RANGE& STAT_UNIVARIATE::GetBinRange |
( |
|
) |
const [inline] |
Get range for histogram bins.
| double STAT_UNIVARIATE::GetBinWidth |
( |
INT32 |
BinIndex = 0 |
) |
const |
Get width of specified bin.
- Parameters:
-
| UINT64 STAT_UNIVARIATE::GetCountAboveMaxBin |
( |
|
) |
const |
Get count of valid samples above maximum bin.
If any weighted will be rounded up, use GetCountAboveMaxBinWeighted for weighted total.
| double STAT_UNIVARIATE::GetCountAboveMaxBinWeighted |
( |
|
) |
const |
Get count of valid samples above maximum bin with partial counts for weighted.
| UINT64 STAT_UNIVARIATE::GetCountBelowMinBin |
( |
|
) |
const |
Get count of valid samples below minimum bin.
If any weighted will be rounded up, use GetCountBelowMinBinWeighted for weighted total.
| double STAT_UNIVARIATE::GetCountBelowMinBinWeighted |
( |
|
) |
const |
Get count of valid samples below minimum bin with partial counts for weighted.
| UINT64 STAT_UNIVARIATE::GetCountInvalid |
( |
|
) |
const [inline] |
Get count of invalid samples.
| UINT64 STAT_UNIVARIATE::GetCountValid |
( |
|
) |
const |
Get count of valid samples.
If any weighted will be rounded up, use GetCountValidWeighted for weighted total.
| double STAT_UNIVARIATE::GetCountValidWeighted |
( |
|
) |
const |
Get count of valid samples with partial counts for weighted.
| MISTRING STAT_UNIVARIATE::GetDisplayStats |
( |
|
) |
const |
Get display string for statistics (without bin counts).
| double STAT_UNIVARIATE::GetMean |
( |
|
) |
const [inline] |
| INT32 STAT_UNIVARIATE::GetMedianBinIndex |
( |
|
) |
const [inline] |
Get index for median bin.
| INT32 STAT_UNIVARIATE::GetModeBinIndex |
( |
|
) |
const [inline] |
| UINT32 STAT_UNIVARIATE::GetNumBins |
( |
|
) |
const [inline] |
| NUMTYPE STAT_UNIVARIATE::GetNumType |
( |
|
) |
const [inline] |
| double STAT_UNIVARIATE::GetStdDev |
( |
|
) |
const [inline] |
| double STAT_UNIVARIATE::GetSum2 |
( |
|
) |
const [inline] |
| const DOUBLE_RANGE& STAT_UNIVARIATE::GetValueRange |
( |
|
) |
const [inline] |
Get range of accumulated values.
| XMLNODE* STAT_UNIVARIATE::GetXML |
( |
XMLNODE * |
parentnode, |
|
|
const char * |
nodename | |
|
) |
| | const |
Get XMLNODE representation for saving.
- Parameters:
-
| parentnode | Parent node |
| nodename | Node name |
| bool STAT_UNIVARIATE::HasEqualBinWidths |
( |
|
) |
const [inline] |
Determine if has equal bin widths.
Initialize for accumulation and statistics computation, using same bin settings as existing instance.
- Parameters:
-
| NumType | Sample numeric type |
| existing | Existing statistics to initialize bin settings from |
| ERRVALUE STAT_UNIVARIATE::Initialize |
( |
NUMTYPE |
NumType, |
|
|
UINT32 |
NumBins, |
|
|
double |
MinBin, |
|
|
double |
MaxBin, |
|
|
double |
BinWidth = 0 | |
|
) |
| | |
Initialize for accumulation and statistics computation, including histogram with equal bin widths.
Note that for integer types, the bin width will also be an integer, thus the last bin may have a smaller width.
- Parameters:
-
| NumType | Sample numeric type |
| NumBins | Number of bins to allocate, if 0 will determine from bin range and width |
| MinBin | Minimum bin value |
| MaxBin | Maximum bin value |
| BinWidth | Bin width, if 0 will determine from number of bins and range |
| bool STAT_UNIVARIATE::IsValid |
( |
|
) |
const [inline] |
Determine if has valid statistics.
| ERRVALUE STAT_UNIVARIATE::Set |
( |
UINT64 |
CountValid, |
|
|
UINT64 |
CountBelowMinBin, |
|
|
UINT64 |
CountAboveMaxBin, |
|
|
UINT64 |
CountInvalid, |
|
|
double |
Mean, |
|
|
double |
Sum2, |
|
|
const DOUBLE_RANGE & |
ValueRange, |
|
|
const DOUBLE_RANGE & |
BinRange, |
|
|
double |
BinWidth, |
|
|
const void * |
BinCounts, |
|
|
UINT32 |
NumBins, |
|
|
int |
BinBytes, |
|
|
NUMTYPE |
NumType = NUMTYPE_Invalid | |
|
) |
| | |
Set all statistics.
- Parameters:
-
| CountValid | Count of valid samples |
| CountBelowMinBin | Count of samples below minimum bin |
| CountAboveMaxBin | Count of samples above maximum bin |
| CountInvalid | Count of invalid samples |
| Mean | Mean |
| Sum2 | Sum of squares of sample values |
| ValueRange | Range of sample values |
| BinRange | Range of bin values |
| BinWidth | Bin width |
| BinCounts | Bin count array |
| NumBins | Number of bins |
| BinBytes | Bin size in bytes (1, 2, 4 or 8) |
| NumType | Numeric data type |
| void STAT_UNIVARIATE::SetAllInvalid |
( |
UINT64 |
CountInvalid |
) |
|
Set to having only "invalid" data samples.
- Parameters:
-
| CountInvalid | Count of invalid samples |
Set from XML.
Will be cleared on failure.
- Parameters:
-
The documentation for this class was generated from the following file: