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

RazorBack::Stat_ Class Reference

Class Stat_: one-variable statistics. More...

#include <Stat2.hh>

List of all members.

Public Methods

 Stat_ ()
 constructor.

void clear ()
 clear(): resets the calling object.

Stat_& operator+= (double Val)
 Stat+=Val: adds a new data point Val to Stat. Returns calling object.

unsigned int data_no () const
 Returns the number of data points seen.

double min () const
 min(), max(): return the minimal/maximal value throws Statexc_ if there were no data items.

double max () const
double avg () const
 avg(): returns the average. More...

double sd () const
 sd(): returns the standard deviation. More...

double skew () const
 skew(): returns the estimated skewness. More...

double kurt () const
 kurt(): returns the estimated kurtosis. More...


Private Attributes

double Sx
double Sx2
double Sx3
double Sx4
 sums for moments.

double Min
double Max
 minimal and maximal value.

unsigned int N
 number of data.


Static Private Attributes

const double BIG_NUMBER
 for min,max init.

const double SMALL_NUMBER
 for near-zero testing.


Friends

ostream& operator<< (ostream &Out, const Stat_ &S)
 Prints a Stat_ object to Out. More...

istream& operator>> (istream &In, Stat_ &S)
 Reads a Stat_ object from In. More...


Detailed Description

Class Stat_: one-variable statistics.

A Stat_ object works much in the same way as the stat operations on a programmable calculator. Double data are accumulated in "stat sums" and the average and SD can be obtained from these.

Definition at line 40 of file Stat2.hh.


Constructor & Destructor Documentation

RazorBack::Stat_::Stat_ ( ) [inline]
 

constructor.

Definition at line 54 of file Stat2.hh.


Member Function Documentation

void RazorBack::Stat_::clear ( ) [inline]
 

clear(): resets the calling object.

Definition at line 58 of file Stat2.hh.

Stat_ & RazorBack::Stat_::operator+= ( double Val )
 

Stat+=Val: adds a new data point Val to Stat. Returns calling object.

unsigned int RazorBack::Stat_::data_no ( ) const [inline]
 

Returns the number of data points seen.

Definition at line 68 of file Stat2.hh.

double RazorBack::Stat_::min ( ) const
 

min(), max(): return the minimal/maximal value throws Statexc_ if there were no data items.

double RazorBack::Stat_::max ( ) const
 

double RazorBack::Stat_::avg ( ) const
 

avg(): returns the average.

Throws Statexc_ if there were no data items at all.

double RazorBack::Stat_::sd ( ) const
 

sd(): returns the standard deviation.

Throws Statexc_ if there were no data items at all. If N=1, 0.0 is returned automatically.

double RazorBack::Stat_::skew ( ) const
 

skew(): returns the estimated skewness.

Throws Statexc_ if there were no data items at all. If N==1 happens to be 0.0, then 0.0 is returned. Throws Sdevexc_ if the s.d. was not larger than 0.0.

double RazorBack::Stat_::kurt ( ) const
 

kurt(): returns the estimated kurtosis.

Note that 3.0 is NOT subtracted from this value (as opposed to the Numerical Recipes convention), so the kurtosis of a Gaussian distribution should be about 3.0. Throws Statexc_ if there were no data items at all. If N==1 happens to be 0.0, then 0.0 is returned. Throws Sdevexc_ if the s.d. was not larger than 0.0.


Friends And Related Function Documentation

ostream & operator<< ( ostream & Out,
const Stat_ & S ) [friend]
 

Prints a Stat_ object to Out.

The format is:-

       8 STAT
       N = 1000
       MIN = -4.7362
       MAX = 6.30655
       SUM = 957.413
       SUM2 = 4575.58
       SUM3 = 11291.8
       SUM4 = 57072.3
       ENDSTAT
       

istream & operator>> ( istream & In,
Stat_ & S ) [friend]
 

Reads a Stat_ object from In.

The format is:-

       8 STAT
       N = 1000
       MIN = -4.7362
       MAX = 6.30655
       SUM = 957.413
       SUM2 = 4575.58
       SUM3 = 11291.8
       SUM4 = 57072.3
       ENDSTAT
       


Member Data Documentation

const double RazorBack::Stat_::BIG_NUMBER [static, private]
 

for min,max init.

Definition at line 43 of file Stat2.hh.

const double RazorBack::Stat_::SMALL_NUMBER [static, private]
 

for near-zero testing.

Definition at line 44 of file Stat2.hh.

double RazorBack::Stat_::Sx [private]
 

Definition at line 46 of file Stat2.hh.

double RazorBack::Stat_::Sx2 [private]
 

Definition at line 46 of file Stat2.hh.

double RazorBack::Stat_::Sx3 [private]
 

Definition at line 46 of file Stat2.hh.

double RazorBack::Stat_::Sx4 [private]
 

sums for moments.

Definition at line 46 of file Stat2.hh.

double RazorBack::Stat_::Min [private]
 

Definition at line 47 of file Stat2.hh.

double RazorBack::Stat_::Max [private]
 

minimal and maximal value.

Definition at line 47 of file Stat2.hh.

unsigned int RazorBack::Stat_::N [private]
 

number of data.

Definition at line 48 of file Stat2.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:19 2002 for The Razorback C++ Library: Statistics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001