Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Histogram Class Reference
[Useful math tools]

Class to hold and compute histograms over the real numbers. More...

#include <quantum.h>

List of all members.

Public Member Functions

 Histogram (bool i_softends=false, bool i_log=false)
 Default constructor: constructs an empty histogram with 0 bins and a null [0,0] support (and optional boolean flags).
 Histogram (itype i_bins, bool i_softends=false, bool i_log=false)
 Constructor: constructs an empty histogram with i_bins bins and a null [0,0] support (and optional boolean flags).
 Histogram (itype i_bins, double i_min, double i_max, bool i_softends=false, bool i_log=false)
 Constructor: constructs an empty histogram with i_bins bins and support [i_min,i_max] (and optional boolean flags).
void Reset ()
 Empties the histogram, resetting the number of samples to zero.
void SetSoftends (bool i_softends)
 Toggles whether the histogram accepts or rejects values outside its support; resets samples to zero.
void SetLog (bool i_log)
 Toggles whether the bins are spaced geometrically or arithmetically; resets samples to zero. NOTE: this feature is immature.
void SetRange (double i_min, double i_max)
 Redefines the support to [i_min,i_max]; resets samples to zero.
void SetSize (itype i_bins)
 Sets the total number of bins; resets samples to zero.
itype Insert (double x)
 Inserts a sample x to the histogram, and returns the index of the incremented bin.
itype Frequency (itype bin)
 Returns the number of samples to be found in bin bin.
itype Frequency (double x)
 Returns the number of samples to be found in the bin that contains x.
double Probability (itype bin)
 Returns the probability that a random sample will be found in bin bin.
double Probability (double x)
 Returns the probability that a random sample will be found in the bin that contains x.
double ProbabilityDensity (itype bin)
 Returns the probability density in bin bin. NOTE: does not currently work right for log spacing.
double ProbabilityDensity (double x)
 Returns the probability density in the bin containing x. See previous entry for details.
double BinCenter (itype bin)
 Returns the median value of the bin bin.


Detailed Description

Class to hold and compute histograms over the real numbers.

The Histogram class computes a histogram for a sample of real numbers.


Member Function Documentation

double Histogram::Probability itype  bin  ) 
 

Returns the probability that a random sample will be found in bin bin.

This is just the number of samples in that bin, divided by the total samples in the histogram.

double Histogram::Probability double  x  ) 
 

Returns the probability that a random sample will be found in the bin that contains x.

This is just the number of samples in that bin, divided by the total samples in the histogram.

double Histogram::ProbabilityDensity itype  bin  ) 
 

Returns the probability density in bin bin. NOTE: does not currently work right for log spacing.

Formally, this means the following. Take a random sample $y$ from the histogram, and select a random interval $[x\ldots x+dx]$ of infinitesmal width $dx$ from within bin bin. Let $ p(y\sim x) $ be the probability that $y$ is within that interval. Then the probability density is the ratio $p(y\sim x)/dx$ .

In practice, this is simply Probability( bin ) divided by the width of bin.


The documentation for this class was generated from the following files:
Generated on Wed Jun 14 22:25:28 2006 for linalg by  doxygen 1.4.4