Public Member Functions | Private Attributes | List of all members
gnsstk::BivarStats< T > Class Template Reference

Detailed Description

template<class T>
class gnsstk::BivarStats< T >

Conventional statistics for two samples. Constructor does the same as clear(); use this when starting a new series of input samples.

Definition at line 63 of file BivarStats.hpp.

#include <BivarStats.hpp>

Public Member Functions

averageX (void) const
 
averageY (void) const
 
void clear (void)
 Remove all data and start over. More...
 
correlation (void) const
 
Stats< T > estimateDeviation (const std::vector< std::pair< T, T > > &d) const
 
eval (const T &x) const
 compute intercept + x * slope More...
 
intercept (void) const
 Return intercept of best-fit line Y=slope*X + intercept. More...
 
maximumX (void) const
 
maximumY (void) const
 
minimumX (void) const
 
minimumY (void) const
 
size_t n (void) const
 Return the sample size. More...
 
BivarStats< T > & operator+= (BivarStats< T > &S)
 
sigmaSlope (void) const
 Return uncertainty in slope. More...
 
sigmaYX (void) const
 return conditional uncertainty = uncertainty y given x More...
 
slope (void) const
 Return slope of best-fit line Y=slope*X + intercept. More...
 
stdDevX (void) const
 
stdDevY (void) const
 
varianceX (void) const
 
varianceY (void) const
 
Constructors.

Various ways to construct a BivarStats object.

Parameters
xthe data to use for the independent variable
ythe data to use for the dependent variable
scalewhether data is scaled internally (default: false)
 BivarStats (bool scale=false)
 
 BivarStats (const T &x, const T &, bool scale=false)
 
 BivarStats (const std::vector< T > &x, const std::vector< T > &y, bool scale=false)
 
 BivarStats (const std::vector< std::pair< T, T > > &d, bool scale=false)
 
 BivarStats (const Vector< T > &x, const Vector< T > &y, bool scale=false)
 
Addition Functions

Add data to the statistics.

void add (const T &x, const T &y)
 
void add (const std::vector< T > &x, const std::vector< T > &y)
 
void add (const std::vector< std::pair< T, T > > &d)
 
void add (const Vector< T > &x, const Vector< T > &y)
 
Subtraction Functions

Subtract data from the statistics.

void subtract (const T &x, const T &y)
 
void subtract (const std::vector< T > &x, const std::vector< T > &y)
 
void subtract (const std::vector< std::pair< T, T > > &d)
 
void subtract (const Vector< T > &x, const Vector< T > &y)
 

Private Attributes

size_t ns
 Number of samples added to the statistics so far. More...
 
bool scaled
 
scaleX
 
scaleY
 
sumX
 
sumX2
 
sumXY
 
sumY
 
sumY2
 
xMax
 
xMin
 
yMax
 
yMin
 

Constructor & Destructor Documentation

◆ BivarStats() [1/5]

template<class T >
gnsstk::BivarStats< T >::BivarStats ( bool  scale = false)

Definition at line 170 of file BivarStats.hpp.

◆ BivarStats() [2/5]

template<class T >
gnsstk::BivarStats< T >::BivarStats ( const T &  x,
const T &  y,
bool  scale = false 
)

Definition at line 175 of file BivarStats.hpp.

◆ BivarStats() [3/5]

template<class T >
gnsstk::BivarStats< T >::BivarStats ( const std::vector< T > &  x,
const std::vector< T > &  y,
bool  scale = false 
)

Definition at line 182 of file BivarStats.hpp.

◆ BivarStats() [4/5]

template<class T >
gnsstk::BivarStats< T >::BivarStats ( const std::vector< std::pair< T, T > > &  d,
bool  scale = false 
)

Definition at line 190 of file BivarStats.hpp.

◆ BivarStats() [5/5]

template<class T >
gnsstk::BivarStats< T >::BivarStats ( const Vector< T > &  x,
const Vector< T > &  y,
bool  scale = false 
)

Definition at line 197 of file BivarStats.hpp.

Member Function Documentation

◆ add() [1/4]

template<class T >
void gnsstk::BivarStats< T >::add ( const std::vector< std::pair< T, T > > &  d)

Definition at line 253 of file BivarStats.hpp.

◆ add() [2/4]

template<class T >
void gnsstk::BivarStats< T >::add ( const std::vector< T > &  x,
const std::vector< T > &  y 
)

Definition at line 243 of file BivarStats.hpp.

◆ add() [3/4]

template<class T >
void gnsstk::BivarStats< T >::add ( const T &  x,
const T &  y 
)

Definition at line 204 of file BivarStats.hpp.

◆ add() [4/4]

template<class T >
void gnsstk::BivarStats< T >::add ( const Vector< T > &  x,
const Vector< T > &  y 
)

Definition at line 261 of file BivarStats.hpp.

◆ averageX()

template<class T >
T gnsstk::BivarStats< T >::averageX ( void  ) const

Definition at line 346 of file BivarStats.hpp.

◆ averageY()

template<class T >
T gnsstk::BivarStats< T >::averageY ( void  ) const

Definition at line 349 of file BivarStats.hpp.

◆ clear()

template<class T >
void gnsstk::BivarStats< T >::clear ( void  )

Remove all data and start over.

This assumes that the accessors will check for n>0, which they do.

Definition at line 331 of file BivarStats.hpp.

◆ correlation()

template<class T >
T gnsstk::BivarStats< T >::correlation ( void  ) const

Definition at line 399 of file BivarStats.hpp.

◆ estimateDeviation()

template<class T >
Stats< T > gnsstk::BivarStats< T >::estimateDeviation ( const std::vector< std::pair< T, T > > &  d) const

Definition at line 439 of file BivarStats.hpp.

◆ eval()

template<class T >
T gnsstk::BivarStats< T >::eval ( const T &  x) const
inline

compute intercept + x * slope

Definition at line 127 of file BivarStats.hpp.

◆ intercept()

template<class T >
T gnsstk::BivarStats< T >::intercept ( void  ) const

Return intercept of best-fit line Y=slope*X + intercept.

Definition at line 381 of file BivarStats.hpp.

◆ maximumX()

template<class T >
T gnsstk::BivarStats< T >::maximumX ( void  ) const

Definition at line 339 of file BivarStats.hpp.

◆ maximumY()

template<class T >
T gnsstk::BivarStats< T >::maximumY ( void  ) const

Definition at line 343 of file BivarStats.hpp.

◆ minimumX()

template<class T >
T gnsstk::BivarStats< T >::minimumX ( void  ) const

Definition at line 337 of file BivarStats.hpp.

◆ minimumY()

template<class T >
T gnsstk::BivarStats< T >::minimumY ( void  ) const

Definition at line 341 of file BivarStats.hpp.

◆ n()

template<class T >
size_t gnsstk::BivarStats< T >::n ( void  ) const
inline

Return the sample size.

Definition at line 334 of file BivarStats.hpp.

◆ operator+=()

template<class T >
BivarStats< T > & gnsstk::BivarStats< T >::operator+= ( BivarStats< T > &  S)

Combine two BivarStats (assumed to be taken from the same or equivalent samples).

combine two BivarStats (assumed to be taken from the same or equivalent samples)

Definition at line 420 of file BivarStats.hpp.

◆ sigmaSlope()

template<class T >
T gnsstk::BivarStats< T >::sigmaSlope ( void  ) const

Return uncertainty in slope.

Definition at line 390 of file BivarStats.hpp.

◆ sigmaYX()

template<class T >
T gnsstk::BivarStats< T >::sigmaYX ( void  ) const

return conditional uncertainty = uncertainty y given x

Definition at line 409 of file BivarStats.hpp.

◆ slope()

template<class T >
T gnsstk::BivarStats< T >::slope ( void  ) const

Return slope of best-fit line Y=slope*X + intercept.

Definition at line 371 of file BivarStats.hpp.

◆ stdDevX()

template<class T >
T gnsstk::BivarStats< T >::stdDevX ( void  ) const

Definition at line 366 of file BivarStats.hpp.

◆ stdDevY()

template<class T >
T gnsstk::BivarStats< T >::stdDevY ( void  ) const

Definition at line 368 of file BivarStats.hpp.

◆ subtract() [1/4]

template<class T >
void gnsstk::BivarStats< T >::subtract ( const std::vector< std::pair< T, T > > &  d)

Definition at line 312 of file BivarStats.hpp.

◆ subtract() [2/4]

template<class T >
void gnsstk::BivarStats< T >::subtract ( const std::vector< T > &  x,
const std::vector< T > &  y 
)

Definition at line 302 of file BivarStats.hpp.

◆ subtract() [3/4]

template<class T >
void gnsstk::BivarStats< T >::subtract ( const T &  x,
const T &  y 
)

Definition at line 271 of file BivarStats.hpp.

◆ subtract() [4/4]

template<class T >
void gnsstk::BivarStats< T >::subtract ( const Vector< T > &  x,
const Vector< T > &  y 
)

Definition at line 320 of file BivarStats.hpp.

◆ varianceX()

template<class T >
T gnsstk::BivarStats< T >::varianceX ( void  ) const

Definition at line 354 of file BivarStats.hpp.

◆ varianceY()

template<class T >
T gnsstk::BivarStats< T >::varianceY ( void  ) const

Definition at line 360 of file BivarStats.hpp.

Member Data Documentation

◆ ns

template<class T >
size_t gnsstk::BivarStats< T >::ns
private

Number of samples added to the statistics so far.

Definition at line 138 of file BivarStats.hpp.

◆ scaled

template<class T >
bool gnsstk::BivarStats< T >::scaled
private

Definition at line 142 of file BivarStats.hpp.

◆ scaleX

template<class T >
T gnsstk::BivarStats< T >::scaleX
private

Definition at line 141 of file BivarStats.hpp.

◆ scaleY

template<class T >
T gnsstk::BivarStats< T >::scaleY
private

Definition at line 141 of file BivarStats.hpp.

◆ sumX

template<class T >
T gnsstk::BivarStats< T >::sumX
private

Definition at line 143 of file BivarStats.hpp.

◆ sumX2

template<class T >
T gnsstk::BivarStats< T >::sumX2
private

Definition at line 143 of file BivarStats.hpp.

◆ sumXY

template<class T >
T gnsstk::BivarStats< T >::sumXY
private

Definition at line 143 of file BivarStats.hpp.

◆ sumY

template<class T >
T gnsstk::BivarStats< T >::sumY
private

Definition at line 143 of file BivarStats.hpp.

◆ sumY2

template<class T >
T gnsstk::BivarStats< T >::sumY2
private

Definition at line 143 of file BivarStats.hpp.

◆ xMax

template<class T >
T gnsstk::BivarStats< T >::xMax
private

Definition at line 140 of file BivarStats.hpp.

◆ xMin

template<class T >
T gnsstk::BivarStats< T >::xMin
private

Definition at line 140 of file BivarStats.hpp.

◆ yMax

template<class T >
T gnsstk::BivarStats< T >::yMax
private

Definition at line 140 of file BivarStats.hpp.

◆ yMin

template<class T >
T gnsstk::BivarStats< T >::yMin
private

Definition at line 140 of file BivarStats.hpp.


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


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44