DEHistogram Class Reference

Measures the histogram of the values provided via AddValue(), providing raw data, pdf and CDF. More...

#include <dehistogram.h>

List of all members.

Public Member Functions

 DEHistogram (double _BinWidth=1.0, double _BinStart=0.0)
 Constructs a Histogram with spacified parameters.
bool SetParams (double _BinWidth=1.0, double _BinStart=0.0)
 Set parameters for the Histogram.
void Reset ()
 Resets all collected statistics.
void AddValue (double x)
 Add value x to currently collected statistics.
double Mean ()
 Returns the mean of the collected data.
double SqMean ()
 Returns the square mean of the collected data.
double Variance ()
 Returns the variance of the collected data.
double Num ()
 Returns the number of collected data.
void printHisto (ostream &s)
 Prints the histogram in readable form on stream s.


Detailed Description

Measures the histogram of the values provided via AddValue(), providing raw data, pdf and CDF.

This class automatically generates an histogram of the observed values, grouped in bins.

The number of the bins is automatically expanded, so it is unnecessary to define them a-priori. Each bin width and the bin start (i.e., if the bins are zero-centered or not) can be specified in the probe constructor. Note that to have a zero-centered histogram (i.e., where the central bin is centered in zero), BinStart must be equal to BinWidth/2.

The class measures the $pdf_i$ ($val[i]/(N \, BinWidth)$), $CDF_i$ ($\sum_{j=-\infty}^i val[j]/(N BinWidth)$) and $Raw-CDF_i$ ($\sum_{j=-\infty}^i val[j]$), where $val[i]$ is the value of bin $i$, as is the number of observed values falling in the $i$-th bin.


Constructor & Destructor Documentation

DEHistogram::DEHistogram double  _BinWidth = 1.0,
double  _BinStart = 0.0
 

Constructs a Histogram with spacified parameters.

Parameters:
_BinWidth  the width of each bin
_BinStart  the start of the bins


Member Function Documentation

void DEHistogram::printHisto ostream &  s  ) 
 

Prints the histogram in readable form on stream s.

The output file format is:

# N = number of observations

# Mean = $\overline{x} = E[x]$

# Square Mean = $\overline{x^2} = E[x^2]$

# Variance = $E[(x-\overline{x})^2]$

# BinWidth = your bin width

# BinStart = your bin start

start of bin 0 TAB $pdf_0$ TAB $val[0]$ TAB $CDF_0$ TAB $Raw-CDF_0$

start of bin 1 TAB $pdf_1$ TAB $val[1]$ TAB $CDF_1$ TAB $Raw-CDF_1$

etc.

bool DEHistogram::SetParams double  _BinWidth = 1.0,
double  _BinStart = 0.0
 

Set parameters for the Histogram.

Returns:
TRUE if params are set successfully.

FALSE if the Histo already started collecting. No action is taken in this case.

Parameters:
_BinWidth  the width of each bin
_BinStart  the start of the bins


The documentation for this class was generated from the following file:
Generated on Wed Dec 22 23:23:49 2004 for NePSing by doxygen 1.3.9.1 ---- Hosted by SourceForge.net Logo