GClasses
|
Computes a running covariance matrix about the origin.
#include <GGaussianProcess.h>
Public Member Functions | |
GRunningCovariance (size_t dims) | |
Prepares to compute a dims x dims covariance matrix. All attributes are assumed to be continuous. More... | |
~GRunningCovariance () | |
void | add (const GVec &vec) |
Adds a vector to the covariance. (Remember that covariance is computed about the origin, not the centroid. If pVec comes from a distribution with a non-zero mean, then you may need to subtract the mean before calling this method.) It is okay for some elements of pVec to be UNKNOWN_REAL_VALUE. More... | |
void | decay (double gamma) |
Multiplies relevant internal counts and sums by gamma. (This is used for computing "moving covariance" instead of "running covariance".) More... | |
double | element (size_t row, size_t col) |
Returns the current specified element of the covariance matrix. Returns UNKNOWN_REAL_VALUE if one or fewer relevant samples was added. More... | |
Static Public Member Functions | |
static void | test () |
Protected Attributes | |
GMatrix | m_counts |
GMatrix | m_sums |
GClasses::GRunningCovariance::GRunningCovariance | ( | size_t | dims | ) |
Prepares to compute a dims x dims covariance matrix. All attributes are assumed to be continuous.
GClasses::GRunningCovariance::~GRunningCovariance | ( | ) |
void GClasses::GRunningCovariance::add | ( | const GVec & | vec | ) |
Adds a vector to the covariance. (Remember that covariance is computed about the origin, not the centroid. If pVec comes from a distribution with a non-zero mean, then you may need to subtract the mean before calling this method.) It is okay for some elements of pVec to be UNKNOWN_REAL_VALUE.
void GClasses::GRunningCovariance::decay | ( | double | gamma | ) |
Multiplies relevant internal counts and sums by gamma. (This is used for computing "moving covariance" instead of "running covariance".)
double GClasses::GRunningCovariance::element | ( | size_t | row, |
size_t | col | ||
) |
Returns the current specified element of the covariance matrix. Returns UNKNOWN_REAL_VALUE if one or fewer relevant samples was added.
|
static |
|
protected |
|
protected |