Isis Developer Reference
MultivariateStatistics.h
Go to the documentation of this file.
1 
2 #ifndef MultivariateStatistics_h
3 #define MultivariateStatistics_h
4 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 #include "Constants.h"
11 #include "PvlObject.h"
12 #include "SpecialPixel.h"
13 #include "Statistics.h"
14 
15 namespace 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 
86  Isis::Statistics p_x;
88  Isis::Statistics p_y;
89 
91  double p_sumxy;
96  BigInt p_validPixels;
101  BigInt p_invalidPixels;
106  BigInt p_totalPixels;
107  };
108 };
109 
110 #endif
Isis::Statistics::SumSquare
double SumSquare() const
Returns the sum of all the squared data.
Definition: Statistics.cpp:351
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Statistics::AddData
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Isis::Statistics::Sum
double Sum() const
Returns the sum of all the data.
Definition: Statistics.cpp:341
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::MultivariateStatistics::Y
Isis::Statistics Y() const
Returns a Stats object for all of the Y data fed through the AddData method.
Definition: MultivariateStatistics.cpp:262
Isis::MultivariateStatistics::Covariance
double Covariance() const
Computes and returns the covariance between the two data sets If there are no valid data (pixels) the...
Definition: MultivariateStatistics.cpp:153
SpecialPixel.h
Isis::MultivariateStatistics::ValidPixels
BigInt ValidPixels() const
Returns the number of valid pixels processed.
Definition: MultivariateStatistics.cpp:201
PvlGroup.h
Isis::MultivariateStatistics::~MultivariateStatistics
~MultivariateStatistics()
Destructs a MultivariateStatistics object.
Definition: MultivariateStatistics.cpp:54
Isis::Statistics::Reset
void Reset()
Reset all accumulators and counters to zero.
Definition: Statistics.cpp:113
Isis::MultivariateStatistics::InvalidPixels
BigInt InvalidPixels() const
Returns the number of invalid pixels encountered.
Definition: MultivariateStatistics.cpp:211
Isis::MultivariateStatistics::toPvl
PvlObject toPvl(QString name="MultivariateStatistics") const
Serializes a multivariate statistics object as a PvlObject.
Definition: MultivariateStatistics.cpp:293
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::MultivariateStatistics::AddData
void AddData(const double *x, const double *y, const unsigned int count)
Add two arrays of doubles to the accumulators and counters.
Definition: MultivariateStatistics.cpp:66
Isis::MultivariateStatistics::X
Isis::Statistics X() const
Returns a Stats object for all of the X data fed through the AddData method.
Definition: MultivariateStatistics.cpp:252
Isis::Statistics::RemoveData
void RemoveData(const double *data, const unsigned int count)
Remove an array of doubles from the accumulators and counters.
Definition: Statistics.cpp:206
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::MultivariateStatistics
Container of multivariate statistics.
Definition: MultivariateStatistics.h:54
Isis::Statistics::StandardDeviation
double StandardDeviation() const
Computes and returns the standard deviation.
Definition: Statistics.cpp:312
Isis::NULL8
const double NULL8
Definition: SpecialPixel.h:94
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::IException
Isis exception class.
Definition: IException.h:91
MultivariateStatistics.h
Isis::Statistics::toPvl
PvlGroup toPvl(QString name="Statistics") const
Serialize statistics as a pvl group.
Definition: Statistics.cpp:695
Isis::MultivariateStatistics::MultivariateStatistics
MultivariateStatistics()
Constructs a Multivariate Statistics object with accumulators and counters set to zero.
Definition: MultivariateStatistics.cpp:25
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
Isis::Statistics::Average
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:300
Isis::MultivariateStatistics::LinearRegression
void LinearRegression(double &a, double &b) const
Fits a line.
Definition: MultivariateStatistics.cpp:222
Statistics.h
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::IsValidPixel
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
Definition: SpecialPixel.h:223
Isis::MultivariateStatistics::RemoveData
void RemoveData(const double *x, const double *y, const unsigned int count)
Remove an array of doubles from the accumulators and counters.
Definition: MultivariateStatistics.cpp:124
Isis::MultivariateStatistics::TotalPixels
BigInt TotalPixels() const
Returns the total number of pixels processed.
Definition: MultivariateStatistics.cpp:189
PvlKeyword.h
Isis::MultivariateStatistics::Correlation
double Correlation() const
Computes and returns the coefficient of correlation (between -1.0 and 1.0) of the two data sets.
Definition: MultivariateStatistics.cpp:171
PvlObject.h
Constants.h
Isis::MultivariateStatistics::Reset
void Reset()
Resets all accumulators to zero.
Definition: MultivariateStatistics.cpp:42
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::MultivariateStatistics::SumXY
double SumXY() const
Returns the sum of x*y for all data given through the AddData method.
Definition: MultivariateStatistics.cpp:242