Log I/O
Loading...
Searching...
No Matches
Statistics Class Referencesealed

Class for computing running statistics on a data stream. More...

Public Member Functions

Object GetMaxValue ()
 Return maximum observed value.
 
double GetMean ()
 Return mean (average) value of the (actual) observations.
 
double GetMedian ()
 Return the 50% percentile (median) of the (actual) observations.
 
Object GetMinValue ()
 Return minimum observed value.
 
int GetNActualValues ()
 Return number of actual observations i.e.
 
int GetNNoValues ()
 Return number of no-values (NaN or Infinity) observed.
 
int GetNValues ()
 Return total number of observations.
 
double GetPercentile25 ()
 Return the 25% percentile of the (actual) observations.
 
double GetPercentile75 ()
 Return the 75% percentile of the (actual) observations.
 
double GetStandardDeviation ()
 Return the standard deviation of the (actual) observations.
 
double GetSum ()
 Return the sum of the (actual) observations.
 
double GetVariance ()
 Return the variance of the (actual) observations.
 
void Push (double value)
 Include a new observation in the statistics.
 
void Reset ()
 Reset the statistics.
 
 Statistics ()
 Create an instance for keeping track of running statistics.
 
override string ToString ()
 

Detailed Description

Class for computing running statistics on a data stream.

No data is cached in the class, all statistics are computed during streaming:

  • Number of values
  • Number of actual values
  • Number of no-values (NaN or Infinity)
  • Minimum value
  • Maximum value
  • Mean (average)
  • Variance
  • Standard deviation
  • 25% percentile
  • Median (50% percentile)
  • 75% percentile
  • Sum
Author
Petroware AS

Constructor & Destructor Documentation

◆ Statistics()

Create an instance for keeping track of running statistics.

Add observation values by calling the #Push method.

Member Function Documentation

◆ GetMaxValue()

Object GetMaxValue ( )

Return maximum observed value.

Returns
Maximum observed value.

◆ GetMean()

double GetMean ( )

Return mean (average) value of the (actual) observations.

Returns
Mean value of the observations.

◆ GetMedian()

double GetMedian ( )

Return the 50% percentile (median) of the (actual) observations.

Returns
The median of the observations.

◆ GetMinValue()

Object GetMinValue ( )

Return minimum observed value.

Returns
Minimum observed value.

◆ GetNActualValues()

int GetNActualValues ( )

Return number of actual observations i.e.

all values except NaNs or infinities.

Returns
Number of actual observations. [0,>.

◆ GetNNoValues()

int GetNNoValues ( )

Return number of no-values (NaN or Infinity) observed.

Returns

◆ GetNValues()

int GetNValues ( )

Return total number of observations.

I.e. number of times the #Push method has been called.

Returns
Total number of observed values. [0,>.

◆ GetPercentile25()

double GetPercentile25 ( )

Return the 25% percentile of the (actual) observations.

Returns
The 25% percentile of the observations.

◆ GetPercentile75()

double GetPercentile75 ( )

Return the 75% percentile of the (actual) observations.

Returns
The 75% percentile of the observations.

◆ GetStandardDeviation()

double GetStandardDeviation ( )

Return the standard deviation of the (actual) observations.

Returns
Standard deviation of the observations. [0,>.

◆ GetSum()

double GetSum ( )

Return the sum of the (actual) observations.

Returns
Sum of the observations.

◆ GetVariance()

double GetVariance ( )

Return the variance of the (actual) observations.

Returns
Variance of the observations. [0,>.

◆ Push()

void Push ( double value)

Include a new observation in the statistics.

Parameters
valueObservation to include. Double.NaN or Double.Infinity will count as no-values.

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