Stats Class Template Reference
[Mathematical algorithms]

#include <Stats.hpp>

Inheritance diagram for Stats:

Inheritance graph
[legend]
Collaboration diagram for Stats:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class gpstk::Stats< T >

Conventional statistics for one sample.

Constructor does the same as Reset(); use this when starting a new series of input samples. Results are available at any time by calling N(), Minimum(), Maximum(), Average(), Variance() and StdDev(). NB. Variance is normalized with 1/(N-1) and StdDev is sqrt(Variance). NB. This class may not give exactly correct results with non-floating types, (for which it is not intended).

Definition at line 50 of file Stats.hpp.

Public Member Functions

 Stats ()
 constructor
 Stats (Vector< T > &X, Vector< T > &W)
 constructor given a vector of data
void Reset (void)
 reset, i.e. ignore earlier data and restart sampling
unsigned int N (void) const
 access the sample size
Minimum (void) const
 return minimum value
Maximum (void) const
 return maximum value
Average (void) const
 return computed average
Variance (void) const
 return computed variance
StdDev (void) const
 return computed standard deviation
Normalization (void) const
 return the normalization constant = sum weights
bool Weighted (void) const
 return weight flag
void Add (const T &x, const T &wt_in=T())
 add a single sample to the computation of statistics, with optional weight
void Add (Vector< T > &X, Vector< T > w=Vector< T >())
 add a Vector<T> of samples to the computation of statistics, with optional weights
void Subtract (const T x, const T wt_in=T())
 remove a sample from the computation of statistics (can't do min and max).
void Subtract (Vector< T > &X)
 remove a Vector<T> of samples to the computation of statistics
void Load (unsigned int in_n, T in_min, T in_max, T in_ave, T in_var, bool wtd=false, T norm=1.0)
 define private members directly; useful in continuing with an object that was earlier saved (e.g.
Stats< T > & operator+= (const Stats< T > &S)
 combine two Stats (assumed taken from the same or equivalent samples); both must be either weighted or unweighted.


Constructor & Destructor Documentation

Stats  )  [inline, explicit]
 

constructor

Definition at line 54 of file Stats.hpp.

Stats Vector< T > &  X,
Vector< T > &  W
[inline]
 

constructor given a vector of data

Definition at line 57 of file Stats.hpp.


Member Function Documentation

void Add Vector< T > &  X,
Vector< T >  w = Vector<T>()
[inline]
 

add a Vector<T> of samples to the computation of statistics, with optional weights

Definition at line 137 of file Stats.hpp.

void Add const T &  x,
const T &  wt_in = T()
[inline]
 

add a single sample to the computation of statistics, with optional weight

Definition at line 104 of file Stats.hpp.

Referenced by GDCPass::detectGFslips(), GDCPass::detectGFsmallSlips(), BivarStats::estimateDeviation(), GDCPass::foundGFsmallSlip(), GDCPass::GFphaseResiduals(), GDCPass::GFslipFix(), PolyTest(), ObsClockModel::simpleOrdClock(), SatPass::smooth(), GDCPass::WLconsistencyCheck(), and GDCPass::WLstatSweep().

T Average void   )  const [inline]
 

return computed average

Definition at line 77 of file Stats.hpp.

Referenced by LinearClockModel::addEpoch(), EpochClockModel::addEpoch(), GDCPass::finish(), GDCPass::foundGFsmallSlip(), GDCPass::GFslipFix(), gpstk::operator<<(), ObsClockModel::simpleOrdClock(), SatPass::smooth(), GDCPass::WLconsistencyCheck(), and GDCPass::WLstatSweep().

void Load unsigned int  in_n,
in_min,
in_max,
in_ave,
in_var,
bool  wtd = false,
norm = 1.0
[inline]
 

define private members directly; useful in continuing with an object that was earlier saved (e.g.

to a file).

Definition at line 186 of file Stats.hpp.

T Maximum void   )  const [inline]
 

return maximum value

Definition at line 74 of file Stats.hpp.

Referenced by GDCPass::finish(), GDCPass::foundGFsmallSlip(), gpstk::operator<<(), and SatPass::smooth().

T Minimum void   )  const [inline]
 

return minimum value

Definition at line 71 of file Stats.hpp.

Referenced by GDCPass::finish(), GDCPass::foundGFsmallSlip(), gpstk::operator<<(), and SatPass::smooth().

unsigned int N void   )  const [inline]
 

access the sample size

Definition at line 68 of file Stats.hpp.

Referenced by EpochClockModel::addEpoch(), GDCPass::finish(), GDCPass::foundGFsmallSlip(), GDCPass::GFslipFix(), gpstk::operator<<(), ObsClockModel::simpleOrdClock(), SatPass::smooth(), GDCPass::WLconsistencyCheck(), and GDCPass::WLstatSweep().

T Normalization void   )  const [inline]
 

return the normalization constant = sum weights

Definition at line 98 of file Stats.hpp.

Stats<T>& operator+= const Stats< T > &  S  )  [inline]
 

combine two Stats (assumed taken from the same or equivalent samples); both must be either weighted or unweighted.

NB. Beware using this with very small sample size.

Definition at line 201 of file Stats.hpp.

void Reset void   )  [inline]
 

reset, i.e. ignore earlier data and restart sampling

Definition at line 65 of file Stats.hpp.

Referenced by GDCPass::detectGFslips(), GDCPass::detectGFsmallSlips(), GDCPass::detectWLsmallSlips(), GDCPass::GFphaseResiduals(), PolyTest(), Segment::Segment(), and ObsClockModel::simpleOrdClock().

T StdDev void   )  const [inline]
 

return computed standard deviation

Definition at line 91 of file Stats.hpp.

Referenced by GDCPass::finish(), GDCPass::foundGFsmallSlip(), GDCPass::GFslipFix(), gpstk::operator<<(), ObsClockModel::simpleOrdClock(), SatPass::smooth(), GDCPass::WLconsistencyCheck(), and GDCPass::WLstatSweep().

void Subtract Vector< T > &  X  )  [inline]
 

remove a Vector<T> of samples to the computation of statistics

Definition at line 179 of file Stats.hpp.

void Subtract const T  x,
const T  wt_in = T()
[inline]
 

remove a sample from the computation of statistics (can't do min and max).

TD test this...

Definition at line 153 of file Stats.hpp.

Referenced by GDCPass::detectGFsmallSlips(), and GDCPass::WLstatSweep().

T Variance void   )  const [inline]
 

return computed variance

Definition at line 84 of file Stats.hpp.

Referenced by GDCPass::foundGFsmallSlip(), gpstk::operator<<(), and GDCPass::WLstatSweep().

bool Weighted void   )  const [inline]
 

return weight flag

Definition at line 101 of file Stats.hpp.


The documentation for this class was generated from the following file:
Generated on Wed Feb 8 03:31:42 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1