npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::StatAccumulatorPair Class Reference

#include <StatAccumulatorPair.hh>

Public Member Functions

const StatAccumulatorfirst () const
 
const StatAccumulatorsecond () const
 
long double crossSumsq () const
 
unsigned long count () const
 
double cov () const
 
double corr () const
 
void accumulate (double x, double y)
 
void accumulate (const std::pair< double, double > &point)
 
void accumulate (const StatAccumulatorPair &)
 
void reset ()
 
StatAccumulatorPairoperator+= (const std::pair< double, double > &point)
 
StatAccumulatorPairoperator+= (const StatAccumulatorPair &r)
 
template<typename ConvertibleToLDouble >
StatAccumulatorPairoperator*= (const ConvertibleToLDouble &r)
 
template<typename ConvertibleToLDouble >
StatAccumulatorPairoperator/= (const ConvertibleToLDouble &r)
 
template<typename ConvToLDouble >
StatAccumulatorPair operator* (const ConvToLDouble &r) const
 
template<typename ConvToLDouble >
StatAccumulatorPair operator/ (const ConvToLDouble &r) const
 
bool operator== (const StatAccumulatorPair &r) const
 
bool operator!= (const StatAccumulatorPair &r) const
 
gs::ClassId classId () const
 
bool write (std::ostream &of) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static void restore (const gs::ClassId &id, std::istream &in, StatAccumulatorPair *acc)
 

Detailed Description

This class functions like a pair of StatAccumulator objects but it also accumulates the cross term so that the correlation coefficient between two variables can be evaluated.

Member Function Documentation

◆ accumulate() [1/2]

void npstat::StatAccumulatorPair::accumulate ( const StatAccumulatorPair )

Accumulate the data from another accumulator

◆ accumulate() [2/2]

void npstat::StatAccumulatorPair::accumulate ( double  x,
double  y 
)

Accumulate the data

◆ classId()

gs::ClassId npstat::StatAccumulatorPair::classId ( ) const
inline

Method related to "geners" I/O

◆ corr()

double npstat::StatAccumulatorPair::corr ( ) const

Correlation coefficient between two variables

◆ count()

unsigned long npstat::StatAccumulatorPair::count ( ) const
inline

Number of observations processed so far

◆ cov()

double npstat::StatAccumulatorPair::cov ( ) const

Covariance between two variables

◆ crossSumsq()

long double npstat::StatAccumulatorPair::crossSumsq ( ) const
inline

The sum of cross terms

◆ first()

const StatAccumulator& npstat::StatAccumulatorPair::first ( ) const
inline

Statistical summary for the first variable

◆ operator!=()

bool npstat::StatAccumulatorPair::operator!= ( const StatAccumulatorPair r) const
inline

Logical negation of operator==

◆ operator*()

template<typename ConvToLDouble >
StatAccumulatorPair npstat::StatAccumulatorPair::operator* ( const ConvToLDouble &  r) const
inline

Binary multiplication by a double

◆ operator*=()

template<typename ConvertibleToLDouble >
StatAccumulatorPair& npstat::StatAccumulatorPair::operator*= ( const ConvertibleToLDouble &  r)
inline

The effect of "operator*=" is the same as if all values were multiplied by "r" for each "accumulate" call

◆ operator+=() [1/2]

StatAccumulatorPair& npstat::StatAccumulatorPair::operator+= ( const StatAccumulatorPair r)
inline

Add the summary from another accumulator

◆ operator+=() [2/2]

StatAccumulatorPair& npstat::StatAccumulatorPair::operator+= ( const std::pair< double, double > &  point)
inline

Accumulate the data

◆ operator/()

template<typename ConvToLDouble >
StatAccumulatorPair npstat::StatAccumulatorPair::operator/ ( const ConvToLDouble &  r) const
inline

Binary division by a double

◆ operator/=()

template<typename ConvertibleToLDouble >
StatAccumulatorPair& npstat::StatAccumulatorPair::operator/= ( const ConvertibleToLDouble &  r)
inline

The effect of "operator/=" is the same as if all values were divided by "r" for each "accumulate" call

◆ operator==()

bool npstat::StatAccumulatorPair::operator== ( const StatAccumulatorPair r) const

Comparison for equality

◆ reset()

void npstat::StatAccumulatorPair::reset ( )

Clear all accumulators

◆ second()

const StatAccumulator& npstat::StatAccumulatorPair::second ( ) const
inline

Statistical summary for the second variable


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