|
Isis 3.0 Object Programmers' Reference |
Home |
#include <MultivariateStatistics.h>
Collaboration diagram for Isis::MultivariateStatistics:

This class is used to accumulate multivariate statisics on two double arrays. In particular, it is highly useful for obtaining the covariance, correlation, and linear regression analysis on the the data. It ignores input values which are Isis special pixel values. That is, if either co-aligned double value is a special pixel then both values are not used in any statistical computation.
Stats
For internal use only.
For the below methods we will need to compute log x, loy y, sumx3, sumx4,sumx2y: void ExponentialRegression (double &a, double &b) const; void PowerRegression (double &a, double &b) const; void parabolicRegression (double &a, double &b, double &c);
Definition at line 61 of file MultivariateStatistics.h.
Public Member Functions | |
| MultivariateStatistics () | |
| Constructs a Multivariate Statistics object with accumulators and counters set to zero. | |
| ~MultivariateStatistics () | |
| Destructs a MultivariateStatistics object. | |
| void | Reset () |
| Resets all accumulators to zero. | |
| void | AddData (const double *x, const double *y, const unsigned int count) |
| Add two arrays of doubles to the accumulators and counters. | |
| void | RemoveData (const double *x, const double *y, const unsigned int count) |
| Remove an array of doubles from the accumulators and counters. | |
| Isis::Statistics | X () const |
| Returns a Stats object for all of the X data fed through the AddData method. | |
| Isis::Statistics | Y () const |
| Returns a Stats object for all of the Y data fed through the AddData method. | |
| double | SumXY () const |
| Returns the sum of x*y for all data given through the AddData method. | |
| double | Covariance () const |
| Computes and returns the covariance between the two data sets If there are no valid data (pixels) then NULL8 is returned. | |
| double | Correlation () const |
| Computes and returns the coefficient of correlation (between -1.0 and 1.0) of the two data sets. | |
| void | LinearRegression (double &a, double &b) const |
| Fits a line
| |
| BigInt | ValidPixels () const |
| Returns the number of valid pixels processed. | |
| BigInt | InvalidPixels () const |
| Returns the number of invalid pixels encountered. | |
| BigInt | TotalPixels () const |
| Returns the total number of pixels processed. | |
Private Attributes | |
| Isis::Statistics | p_x |
| A Statistics object holding x data. | |
| Isis::Statistics | p_y |
| A Statistics object holding y data. | |
| double | p_sumxy |
| The sum of x and y. | |
| BigInt | p_validPixels |
| The number of valid (computed) pixels. | |
| BigInt | p_invalidPixels |
| The number of invalid (ignored) pixels. | |
| BigInt | p_totalPixels |
| The total number of pixels (invalid and valid). | |
| Isis::MultivariateStatistics::MultivariateStatistics | ( | ) |
Constructs a Multivariate Statistics object with accumulators and counters set to zero.
Definition at line 36 of file MultivariateStatistics.cpp.
References Reset().
| Isis::MultivariateStatistics::~MultivariateStatistics | ( | ) |
Destructs a MultivariateStatistics object.
Definition at line 52 of file MultivariateStatistics.cpp.
| void Isis::MultivariateStatistics::AddData | ( | const double * | x, | |
| const double * | y, | |||
| const unsigned int | count | |||
| ) |
Add two arrays of doubles to the accumulators and counters.
This method can be invoked multiple times, for example, once for each line in a cube, before obtaining statistics.
| x | Array of doubles to add. | |
| y | Array of doubles to add. | |
| count | Number of doubles to process. |
Definition at line 62 of file MultivariateStatistics.cpp.
References Isis::Statistics::AddData(), Isis::IsValidPixel(), p_invalidPixels, p_sumxy, p_totalPixels, p_validPixels, p_x, and p_y.
Referenced by Isis::MaximumCorrelation::MatchAlgorithm().
| double Isis::MultivariateStatistics::Correlation | ( | ) | const |
Computes and returns the coefficient of correlation (between -1.0 and 1.0) of the two data sets.
This can be used as a goodness-of-fit measurement. The close the correlation is two -1.0 or 1.0 the more likely the data sets are related (and therefore the regression equation is valid).
Definition at line 138 of file MultivariateStatistics.cpp.
References Covariance(), Isis::NULL8, p_validPixels, p_x, p_y, and Isis::Statistics::StandardDeviation().
Referenced by Isis::MaximumCorrelation::MatchAlgorithm().
| double Isis::MultivariateStatistics::Covariance | ( | ) | const |
Computes and returns the covariance between the two data sets If there are no valid data (pixels) then NULL8 is returned.
Definition at line 121 of file MultivariateStatistics.cpp.
References Isis::Statistics::Average(), Isis::NULL8, p_sumxy, p_validPixels, p_x, p_y, and Isis::Statistics::Sum().
Referenced by Correlation().
| BigInt Isis::MultivariateStatistics::InvalidPixels | ( | ) | const |
Returns the number of invalid pixels encountered.
Definition at line 175 of file MultivariateStatistics.cpp.
References p_invalidPixels.
| void Isis::MultivariateStatistics::LinearRegression | ( | double & | a, | |
| double & | b | |||
| ) | const |
Fits a line
through the data.
| a | The additive constant A. | |
| b | The additive constant B. |
Definition at line 185 of file MultivariateStatistics.cpp.
References _FILEINFO_, Isis::iException::Message(), p_sumxy, p_validPixels, p_x, p_y, Isis::Statistics::Sum(), and Isis::Statistics::SumSquare().
| void Isis::MultivariateStatistics::RemoveData | ( | const double * | x, | |
| const double * | y, | |||
| const unsigned int | count | |||
| ) |
Remove an array of doubles from the accumulators and counters.
| x | Pointer to an array of doubles to remove. | |
| y | Array of doubles to add. | |
| count | Number of doubles to process. |
For internal use only.
Definition at line 93 of file MultivariateStatistics.cpp.
References _FILEINFO_, Isis::IsValidPixel(), Isis::iException::Message(), p_invalidPixels, p_sumxy, p_totalPixels, p_validPixels, p_x, p_y, and Isis::Statistics::RemoveData().
| void Isis::MultivariateStatistics::Reset | ( | ) |
Resets all accumulators to zero.
Definition at line 41 of file MultivariateStatistics.cpp.
References p_invalidPixels, p_sumxy, p_totalPixels, p_validPixels, p_x, p_y, and Isis::Statistics::Reset().
Referenced by MultivariateStatistics().
| double Isis::MultivariateStatistics::SumXY | ( | ) | const |
Returns the sum of x*y for all data given through the AddData method.
Definition at line 204 of file MultivariateStatistics.cpp.
References p_sumxy.
| BigInt Isis::MultivariateStatistics::TotalPixels | ( | ) | const |
Returns the total number of pixels processed.
Definition at line 155 of file MultivariateStatistics.cpp.
References p_totalPixels.
| BigInt Isis::MultivariateStatistics::ValidPixels | ( | ) | const |
Returns the number of valid pixels processed.
Only valid pixels are utilized when computing the average, standard deviation, variance, minimum, and maximum.
Definition at line 166 of file MultivariateStatistics.cpp.
References p_validPixels.
Referenced by Isis::MaximumCorrelation::MatchAlgorithm().
| Isis::Statistics Isis::MultivariateStatistics::X | ( | ) | const |
Returns a Stats object for all of the X data fed through the AddData method.
Definition at line 213 of file MultivariateStatistics.cpp.
References p_x.
| Isis::Statistics Isis::MultivariateStatistics::Y | ( | ) | const |
Returns a Stats object for all of the Y data fed through the AddData method.
Definition at line 220 of file MultivariateStatistics.cpp.
References p_y.
The number of invalid (ignored) pixels.
For internal use only.
Definition at line 101 of file MultivariateStatistics.h.
Referenced by AddData(), InvalidPixels(), RemoveData(), and Reset().
double Isis::MultivariateStatistics::p_sumxy [private] |
The sum of x and y.
Definition at line 91 of file MultivariateStatistics.h.
Referenced by AddData(), Covariance(), LinearRegression(), RemoveData(), Reset(), and SumXY().
The total number of pixels (invalid and valid).
For internal use only.
Definition at line 106 of file MultivariateStatistics.h.
Referenced by AddData(), RemoveData(), Reset(), and TotalPixels().
The number of valid (computed) pixels.
For internal use only.
Definition at line 96 of file MultivariateStatistics.h.
Referenced by AddData(), Correlation(), Covariance(), LinearRegression(), RemoveData(), Reset(), and ValidPixels().
A Statistics object holding x data.
Definition at line 86 of file MultivariateStatistics.h.
Referenced by AddData(), Correlation(), Covariance(), LinearRegression(), RemoveData(), Reset(), and X().
A Statistics object holding y data.
Definition at line 88 of file MultivariateStatistics.h.
Referenced by AddData(), Correlation(), Covariance(), LinearRegression(), RemoveData(), Reset(), and Y().