Isis 3 Programmer Reference
MultivariateStatistics.h
1
2#ifndef MultivariateStatistics_h
3#define MultivariateStatistics_h
9/* SPDX-License-Identifier: CC0-1.0 */
10#include "Constants.h"
11#include "PvlObject.h"
12#include "SpecialPixel.h"
13#include "Statistics.h"
14
15namespace Isis {
16
55 public:
57 MultivariateStatistics(const PvlObject &inStats);
59
60 void Reset();
61 void AddData(const double *x, const double *y,
62 const unsigned int count);
63 void AddData(double x, double y, unsigned int count = 1);
64 void RemoveData(const double *x, const double *y,
65 const unsigned int count);
66
67 Isis::Statistics X() const;
68 Isis::Statistics Y() const;
69 double SumXY() const;
70 double Covariance() const;
71 double Correlation() const;
72
73 void LinearRegression(double &a, double &b) const;
74
75 BigInt ValidPixels() const;
76 BigInt InvalidPixels() const;
77 BigInt TotalPixels() const;
78
79 PvlObject toPvl(QString name = "MultivariateStatistics") const;
80
81 private:
82
83 void fromPvl(const PvlObject &inStats);
84
89
91 double p_sumxy;
107 };
108};
109
110#endif
Container of multivariate statistics.
void LinearRegression(double &a, double &b) const
Fits a line.
void RemoveData(const double *x, const double *y, const unsigned int count)
Remove an array of doubles from the accumulators and counters.
Isis::Statistics p_y
A Statistics object holding y data.
double Correlation() const
Computes and returns the coefficient of correlation (between -1.0 and 1.0) of the two data sets.
Isis::Statistics Y() const
Returns a Stats object for all of the Y data fed through the AddData method.
Isis::Statistics p_x
A Statistics object holding x data.
BigInt p_validPixels
The number of valid (computed) pixels.
double Covariance() const
Computes and returns the covariance between the two data sets If there are no valid data (pixels) the...
MultivariateStatistics()
Constructs a Multivariate Statistics object with accumulators and counters set to zero.
PvlObject toPvl(QString name="MultivariateStatistics") const
Serializes a multivariate statistics object as a PvlObject.
BigInt TotalPixels() const
Returns the total number of pixels processed.
BigInt InvalidPixels() const
Returns the number of invalid pixels encountered.
double SumXY() const
Returns the sum of x*y for all data given through the AddData method.
~MultivariateStatistics()
Destructs a MultivariateStatistics object.
double p_sumxy
The sum of x and y.
BigInt p_invalidPixels
The number of invalid (ignored) pixels.
BigInt ValidPixels() const
Returns the number of valid pixels processed.
Isis::Statistics X() const
Returns a Stats object for all of the X data fed through the AddData method.
void fromPvl(const PvlObject &inStats)
Unserializes a multivariate statistics object from a PvlObject.
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.
BigInt p_totalPixels
The total number of pixels (invalid and valid).
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
long long int BigInt
Big int.
Definition Constants.h:49