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

#include <WeightedStatAccumulatorPair.hh>

Public Member Functions

const WeightedStatAccumulatorfirst () const
 
const WeightedStatAccumulatorsecond () const
 
long double crossSumsq () const
 
double count () const
 
unsigned long ncalls () const
 
unsigned long nfills () const
 
double cov () const
 
double corr () const
 
void accumulate (double x, double y, double w)
 
void accumulate (const std::pair< double, double > &point, double w)
 
void accumulate (const WeightedStatAccumulatorPair &)
 
void accumulate (const WeightedStatAccumulatorPair &, double w)
 
void reset ()
 
template<typename Triple >
WeightedStatAccumulatorPairoperator+= (const Triple &t)
 
WeightedStatAccumulatorPairoperator+= (const WeightedStatAccumulatorPair &r)
 
template<typename ConvertibleToLDouble >
WeightedStatAccumulatorPairoperator*= (const ConvertibleToLDouble &r)
 
WeightedStatAccumulatorPairscaleWeights (const double r)
 
template<typename ConvertibleToLDouble >
WeightedStatAccumulatorPairoperator/= (const ConvertibleToLDouble &r)
 
template<typename ConvToLDouble >
WeightedStatAccumulatorPair operator* (const ConvToLDouble &r) const
 
template<typename ConvToLDouble >
WeightedStatAccumulatorPair operator/ (const ConvToLDouble &r) const
 
bool operator== (const WeightedStatAccumulatorPair &r) const
 
bool operator!= (const WeightedStatAccumulatorPair &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, WeightedStatAccumulatorPair *acc)
 

Detailed Description

This class functions like a pair of WeightedStatAccumulator 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::WeightedStatAccumulatorPair::accumulate ( const WeightedStatAccumulatorPair )

Accumulate the data from another accumulator

◆ accumulate() [2/2]

void npstat::WeightedStatAccumulatorPair::accumulate ( double  x,
double  y,
double  w 
)

Accumulate the data

◆ classId()

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

Method related to "geners" I/O

◆ corr()

double npstat::WeightedStatAccumulatorPair::corr ( ) const

Correlation coefficient between two variables

◆ count()

double npstat::WeightedStatAccumulatorPair::count ( ) const
inline

This method returns the effective number of counts which is (squared sum of weights)/(sum of squared weights)

◆ cov()

double npstat::WeightedStatAccumulatorPair::cov ( ) const

Covariance between two variables

◆ crossSumsq()

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

The sum of cross terms

◆ first()

const WeightedStatAccumulator& npstat::WeightedStatAccumulatorPair::first ( ) const
inline

Statistical summary for the first variable

◆ ncalls()

unsigned long npstat::WeightedStatAccumulatorPair::ncalls ( ) const
inline

This method returns the total number of times the "accumulate" method was called since the last reset (or since the object was created)

◆ nfills()

unsigned long npstat::WeightedStatAccumulatorPair::nfills ( ) const
inline

This method returns the number of times the "accumulate" method was called with a positive weight

◆ operator!=()

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

Logical negation of operator==

◆ operator*()

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

Binary multiplication by a double

◆ operator*=()

template<typename ConvertibleToLDouble >
WeightedStatAccumulatorPair& npstat::WeightedStatAccumulatorPair::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]

template<typename Triple >
WeightedStatAccumulatorPair& npstat::WeightedStatAccumulatorPair::operator+= ( const Triple t)
inline

Accumulate the data

◆ operator+=() [2/2]

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

Add the summary from another accumulator

◆ operator/()

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

Binary division by a double

◆ operator/=()

template<typename ConvertibleToLDouble >
WeightedStatAccumulatorPair& npstat::WeightedStatAccumulatorPair::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::WeightedStatAccumulatorPair::operator== ( const WeightedStatAccumulatorPair r) const

Comparison for equality

◆ reset()

void npstat::WeightedStatAccumulatorPair::reset ( )

Clear all accumulators

◆ scaleWeights()

WeightedStatAccumulatorPair& npstat::WeightedStatAccumulatorPair::scaleWeights ( const double  r)
inline

Scaling of the weights. The effect is the same as if all weights were multiplied by "r" for each "accumulate" call. Note that r can not be negative for this method.

◆ second()

const WeightedStatAccumulator& npstat::WeightedStatAccumulatorPair::second ( ) const
inline

Statistical summary for the second variable


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