Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

Histogram Class Reference

makes a histogram of samples of a random variable. More...

#include <Histogram.h>

Inheritance diagram for Histogram::

EmpiricalStatistics List of all members.

Public Methods

 Histogram ()
 Histogram (real min_value, real max_value, int nintervals)
 ~Histogram ()
bool redim (real min_value, real max_value, int nintervals)
bool ok () const
void init ()
void setXaxisName (const String &name)
void update (real x)
void intermediateResults (Os &os)
void makeBarPlot (CurvePlotFile &file)
void makeDensityPlot (CurvePlotFile &file)
void makeCumulativePlot (CurvePlotFile &file)
real cumulDistr (real x)

Public Attributes

int nintervals
real min_value
real max_value
real dx
String sample_name

Detailed Description

makes a histogram of samples of a random variable.

NAME: Histogram - makes a histogram of samples of a random variable

DESCRIPTION:

The class offers functions for updating statistics and making plots of the histogram (plus density and cumulative distr.) as well as functions for evaluating the estimated cumulative distribution of the random variable. The user must specify an interval "[xmin,xmax]" in the constructor. This interval will be divided into a user-given number of subintervals. The class keeps track of the number of samples, recorded by the function "update", in each of the subintervals. Samples that fall outside the interval "[xmin,xmax]" are collected in a lower and an upper subinterval. When reporting results, the lower and upper subintervals are assigned a length equal to five times the length of a subinterval. The length of the lower and upper subinterval will only affect results in these two intervals; results regarding relative frequencies or probability values in the ordinary subintervals inside "[xmin,xmax]" will not be affected.


Constructor & Destructor Documentation

Histogram::Histogram ( )
 

The constructor requires the interval "[xmin,xmax]", the number of subintervals and a name of the statistical quantity for which a histogram is to be made. No further initialization is necessary.

Histogram::Histogram ( real min_value,
real max_value,
int nintervals )
 

See documentation of one of the overloaded constructor.

Histogram::~Histogram ( )
 


Member Function Documentation

real Histogram::cumulDistr ( real x )
 

returns the estimated value at a particular point of the cumulative distribution derived from the histogram.

void Histogram::init ( )
 

resets and initializes internal data structures.

Reimplemented from EmpiricalStatistics.

void Histogram::intermediateResults ( Os & os )
 

prints the current frequency at the middle point of the histogram and in the 2nd interval (enables the user to monitor two values in the histogram during a simulation).

void Histogram::makeBarPlot ( CurvePlotFile & file )
 

makes a plot of the histogram (relative frequencies) and saves it using the supplied "CurvePlotFile" object.

void Histogram::makeCumulativePlot ( CurvePlotFile & file )
 

makes a plot of the cumulative distribution derived from the histogram, and saves it using the supplied "CurvePlotFile" object.

void Histogram::makeDensityPlot ( CurvePlotFile & file )
 

makes a plot of the density function corresponding to the histogram, and saves it using the supplied "CurvePlotFile" object.

bool Histogram::ok ( ) const
 

returns true if the object is initialized with information on interval and subdivisions (a true value does not indicate that the object is initialized with a call to "init").

bool Histogram::redim ( real min_value,
real max_value,
int nintervals )
 

sets a new interval and subdivision factor. Returns true if the number of intervals has changed, otherwise it returns false.

void Histogram::setXaxisName ( const String & name ) [inline]
 

sets the name of the variable on the histogram's x-axis to the specified value.

void Histogram::update ( real x )
 

adds a new sample to the histogram.


Member Data Documentation

real Histogram::dx
 

real Histogram::max_value
 

real Histogram::min_value
 

int Histogram::nintervals
 

String Histogram::sample_name
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.