Public Member Functions | Private Attributes | Friends
mbl_stats_nd Class Reference

Simple statistics (mean, variance) on vectors. More...

#include <mbl_stats_nd.h>

List of all members.

Public Member Functions

 mbl_stats_nd ()
void clear ()
 Remove all data.
void obs (const vnl_vector< double > &v)
 Add given observation.
unsigned n_obs () const
 Number of observations.
vnl_vector< double > mean () const
 Mean of current observations.
vnl_vector< double > sd () const
 Standard deviation of current observations.
vnl_vector< double > stdError () const
 Standard error (sd of estimate of mean) of current observations.
vnl_vector< double > variance () const
 Variance of current observations.
const vnl_vector< double > & sum () const
 Sum of current observations.
const vnl_vector< double > & sumSq () const
 Sum of squares of current observations.
mbl_stats_ndoperator+= (const mbl_stats_nd &s1)
 Add statistics together.
void print_summary (vcl_ostream &os) const
short version_no () const
 Version number for I/O.
void b_write (vsl_b_ostream &bfs) const
void b_read (vsl_b_istream &bfs)
bool operator== (const mbl_stats_nd &s) const
 Test for equality.

Private Attributes

vnl_vector< double > sum_
vnl_vector< double > sum_sq_
unsigned n_obs_

Friends

mbl_stats_nd operator+ (const mbl_stats_nd &s1, const mbl_stats_nd &s2)

Detailed Description

Simple statistics (mean, variance) on vectors.

Note: Uses unbiased estimate of variance (ie divide by (n_obs()-1))

Definition at line 15 of file mbl_stats_nd.h.


Constructor & Destructor Documentation

mbl_stats_nd::mbl_stats_nd ( )

Definition at line 13 of file mbl_stats_nd.cxx.


Member Function Documentation

void mbl_stats_nd::b_read ( vsl_b_istream bfs)

Definition at line 134 of file mbl_stats_nd.cxx.

void mbl_stats_nd::b_write ( vsl_b_ostream bfs) const

Definition at line 125 of file mbl_stats_nd.cxx.

void mbl_stats_nd::clear ( )

Remove all data.

Definition at line 18 of file mbl_stats_nd.cxx.

vnl_vector< double > mbl_stats_nd::mean ( ) const

Mean of current observations.

Definition at line 43 of file mbl_stats_nd.cxx.

unsigned mbl_stats_nd::n_obs ( ) const [inline]

Number of observations.

Definition at line 30 of file mbl_stats_nd.h.

void mbl_stats_nd::obs ( const vnl_vector< double > &  v)

Add given observation.

Definition at line 25 of file mbl_stats_nd.cxx.

mbl_stats_nd & mbl_stats_nd::operator+= ( const mbl_stats_nd s1)

Add statistics together.

Definition at line 100 of file mbl_stats_nd.cxx.

bool mbl_stats_nd::operator== ( const mbl_stats_nd s) const

Test for equality.

Definition at line 111 of file mbl_stats_nd.cxx.

void mbl_stats_nd::print_summary ( vcl_ostream &  os) const

Definition at line 160 of file mbl_stats_nd.cxx.

vnl_vector< double > mbl_stats_nd::sd ( ) const

Standard deviation of current observations.

Definition at line 65 of file mbl_stats_nd.cxx.

vnl_vector< double > mbl_stats_nd::stdError ( ) const

Standard error (sd of estimate of mean) of current observations.

Definition at line 82 of file mbl_stats_nd.cxx.

const vnl_vector<double>& mbl_stats_nd::sum ( ) const [inline]

Sum of current observations.

Definition at line 43 of file mbl_stats_nd.h.

const vnl_vector<double>& mbl_stats_nd::sumSq ( ) const [inline]

Sum of squares of current observations.

Definition at line 46 of file mbl_stats_nd.h.

vnl_vector< double > mbl_stats_nd::variance ( ) const

Variance of current observations.

Definition at line 49 of file mbl_stats_nd.cxx.

short mbl_stats_nd::version_no ( ) const

Version number for I/O.

Definition at line 120 of file mbl_stats_nd.cxx.


Friends And Related Function Documentation

mbl_stats_nd operator+ ( const mbl_stats_nd s1,
const mbl_stats_nd s2 
) [friend]

Definition at line 183 of file mbl_stats_nd.cxx.


Member Data Documentation

unsigned mbl_stats_nd::n_obs_ [private]

Definition at line 19 of file mbl_stats_nd.h.

vnl_vector<double> mbl_stats_nd::sum_ [private]

Definition at line 17 of file mbl_stats_nd.h.

vnl_vector<double> mbl_stats_nd::sum_sq_ [private]

Definition at line 18 of file mbl_stats_nd.h.


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