#include <Histograms.h>
Public Member Functions | |
Covariance () | |
double | covariance () |
void | fill (const double &x, const double &y) |
double | getN () |
Protected Attributes | |
int | N_ |
double | productXY_ |
double | sumX_ |
double | sumY_ |
This class can be used to compute the covariance between two input variables. The Fill method needs the two input variables. In the end the covariance method computes the covariance as: cov(x,y) = Sum_i(x_i*y_i)/N - x_mean*y_mean. Of course passing the same variable for x and y gives the variance of that variable.
Definition at line 1500 of file Histograms.h.
Covariance::Covariance | ( | ) | [inline] |
Definition at line 1503 of file Histograms.h.
: productXY_(0), sumX_(0), sumY_(0), N_(0) {}
double Covariance::covariance | ( | void | ) | [inline] |
Definition at line 1515 of file Histograms.h.
References N_, productXY_, sumX_, and sumY_.
Referenced by HCovarianceVSxy::Write().
void Covariance::fill | ( | const double & | x, |
const double & | y | ||
) | [inline] |
Definition at line 1509 of file Histograms.h.
References N_, productXY_, sumX_, sumY_, x, and detailsBasic3DVector::y.
Referenced by HCovarianceVSxy::Fill().
double Covariance::getN | ( | ) | [inline] |
int Covariance::N_ [protected] |
Definition at line 1529 of file Histograms.h.
Referenced by covariance(), fill(), and getN().
double Covariance::productXY_ [protected] |
Definition at line 1526 of file Histograms.h.
Referenced by covariance(), and fill().
double Covariance::sumX_ [protected] |
Definition at line 1527 of file Histograms.h.
Referenced by covariance(), and fill().
double Covariance::sumY_ [protected] |
Definition at line 1528 of file Histograms.h.
Referenced by covariance(), and fill().