Isis Developer Reference
StatCumProbDistDynCalc.h
Go to the documentation of this file.
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);
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...
Definition StatCumProbDistDynCalc.h:63
QList< int > m_numObsBelowQuantile
The actual number of observations that are less than or equal to the value of the corresponding quant...
Definition StatCumProbDistDynCalc.h:113
unsigned int m_numberObservations
The number of observations, note this is dynamically changing as observations are added.
Definition StatCumProbDistDynCalc.h:100
double min()
Returns the maximum observation so far included in the dynamic calculation.
Definition StatCumProbDistDynCalc.cpp:221
QList< double > m_idealNumObsBelowQuantile
The ideal number of observations that should be less than or equal to the value of the corresponding ...
Definition StatCumProbDistDynCalc.h:108
QList< double > m_observationValues
The calculated values of the quantiles, note this is dynamically changing as observations are added.
Definition StatCumProbDistDynCalc.h:105
StatCumProbDistDynCalc(unsigned int nodes=20, QObject *parent=0)
Construtor sets up the class to start recieving data.
Definition StatCumProbDistDynCalc.cpp:37
void readStatistics(QXmlStreamReader *xmlReader)
Definition StatCumProbDistDynCalc.cpp:49
void setQuantiles(unsigned int nodes)
Definition StatCumProbDistDynCalc.cpp:168
void initialize()
Inializer, resets the class to start its dynamic calculation anew.
Definition StatCumProbDistDynCalc.cpp:158
unsigned int m_numberCells
The number of cells or histogram bins that are being used to model the probility density function.
Definition StatCumProbDistDynCalc.h:93
void validate()
Definition StatCumProbDistDynCalc.cpp:615
QDataStream & write(QDataStream &stream) const
Definition StatCumProbDistDynCalc.cpp:575
~StatCumProbDistDynCalc()
Destroys StatCumProbDistDynCalc object.
Definition StatCumProbDistDynCalc.cpp:130
unsigned int m_numberQuantiles
The number of quantiles being used to model the probility density function.
Definition StatCumProbDistDynCalc.h:96
QList< double > m_quantiles
The target quantiles being modeled, between 0 and 1.
Definition StatCumProbDistDynCalc.h:103
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
Definition StatCumProbDistDynCalc.cpp:243
void addObs(double obs)
Values for the estimated quantile positions are update as observations are added.
Definition StatCumProbDistDynCalc.cpp:455
QDataStream & read(QDataStream &stream)
Definition StatCumProbDistDynCalc.cpp:586
double cumProb(double value)
Provides the cumulative probility, that is, the proportion of the distribution that is less than or e...
Definition StatCumProbDistDynCalc.cpp:360
StatCumProbDistDynCalc & operator=(const StatCumProbDistDynCalc &other)
Definition StatCumProbDistDynCalc.cpp:135
double max()
Returns the maximum observation so far included in the dynamic calculation.
Definition StatCumProbDistDynCalc.cpp:204
void save(QXmlStreamWriter &stream, const Project *project) const
Definition StatCumProbDistDynCalc.cpp:552
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.
Definition CSVReader.cpp:447
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition Hillshade.cpp:313