Isis 3 Programmer Reference
StatCumProbDistDynCalc.h
1#ifndef StatCumProbDistDynCalc_h
2#define StatCumProbDistDynCalc_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include <QList>
11#include <QObject>
12#include <QVector>
13
14class QDataStream;
15class QUuid;
16class QXmlStreamWriter;
17class QXmlStreamReader;
18
19namespace Isis {
20 class Project;// ??? does xml stuff need project???
21
64 Q_OBJECT
65 // class uses the P^2 Algorithim to calculate equiprobability cell histograms from a stream of
66 // data without storing the data
67 // see "The p^2 Algorithim for Dynamic Calculations of Quantiles and Histograms Without Storing
68 // Observations"
69 public:
70 StatCumProbDistDynCalc(unsigned int nodes=20, QObject *parent = 0); //individual qunatile value to be calculated
71 StatCumProbDistDynCalc(QXmlStreamReader *xmlReader, QObject *parent = 0);
72 void readStatistics(QXmlStreamReader *xmlReader);
75 StatCumProbDistDynCalc &operator=(const StatCumProbDistDynCalc &other);
76
77 void initialize(); // clears the member lists and initializes the rest of the member data to 0
78 void setQuantiles(unsigned int nodes); // initializes/resets the class to start new calculation
79
80 void validate();
81 void addObs(double obs);
82
83 double cumProb(double value); //given a value return the cumulative probility
84 double value(double cumProb); //given a cumulative probibility return a value
85 double max(); //return the largest value so far
86 double min(); //return the smallest values so far
87
88 void save(QXmlStreamWriter &stream, const Project *project) const; // TODO: does xml stuff need project???
89
90 QDataStream &write(QDataStream &stream) const;
91 QDataStream &read(QDataStream &stream);
92
93 unsigned int m_numberCells;
96 unsigned int m_numberQuantiles;
100 unsigned int m_numberObservations;
103 QList<double> m_quantiles;
105 QList<double> m_observationValues;
117 };
118
119 // operators to read/write StatCumProbDistDynCalc to/from binary data
120 QDataStream &operator<<(QDataStream &stream, const StatCumProbDistDynCalc &scpddc);
121 QDataStream &operator>>(QDataStream &stream, StatCumProbDistDynCalc &scpddc);
122
123} //end namespace Isis
124
125#endif
The main project for ipce.
Definition Project.h:287
This class is used to approximate cumulative probibility distributions of a stream of observations wi...
QList< int > m_numObsBelowQuantile
The actual number of observations that are less than or equal to the value of the corresponding quant...
unsigned int m_numberObservations
The number of observations, note this is dynamically changing as observations are added.
double min()
Returns the maximum observation so far included in the dynamic calculation.
QList< double > m_idealNumObsBelowQuantile
The ideal number of observations that should be less than or equal to the value of the corresponding ...
QList< double > m_observationValues
The calculated values of the quantiles, note this is dynamically changing as observations are added.
StatCumProbDistDynCalc(unsigned int nodes=20, QObject *parent=0)
Construtor sets up the class to start recieving data.
void initialize()
Inializer, resets the class to start its dynamic calculation anew.
unsigned int m_numberCells
The number of cells or histogram bins that are being used to model the probility density function.
~StatCumProbDistDynCalc()
Destroys StatCumProbDistDynCalc object.
unsigned int m_numberQuantiles
The number of quantiles being used to model the probility density function.
QList< double > m_quantiles
The target quantiles being modeled, between 0 and 1.
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
void addObs(double obs)
Values for the estimated quantile positions are update as observations are added.
double cumProb(double value)
Provides the cumulative probility, that is, the proportion of the distribution that is less than or e...
double max()
Returns the maximum observation so far included in the dynamic calculation.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.