USGS

Isis 3.0 Object Programmers' Reference

Home

StatCumProbDistDynCalc.h
Go to the documentation of this file.
1 #ifndef StatCumProbDistDynCalc_h
2 #define StatCumProbDistDynCalc_h
3 
24 #include <vector>
25 
26 namespace Isis {
50  //class uses the P^2 Algorithim to calculate equiprobability cell histograms from a stream of data without storing the data
51  // see "The p^2 Algorithim for Dynamic Calculations of Quantiles and Histograms Without Storing Observations"
52  public:
53  StatCumProbDistDynCalc(unsigned int nodes=20); //individual qunatile value to be calculated
54  ~StatCumProbDistDynCalc() { }; //empty destructor
55 
56  void addObs(double obs); //
57 
58  double cumProb(double value); //given a value return the cumulative probility
59  double value(double cumProb); //given a cumulative probibility return a value
60  double max(); //return the largest value so far
61  double min(); //return the smallest values so far
62  void initialize(unsigned int nodes=20); //resets the class to start a new dynamic calculation
63 
64  private:
65 
68  unsigned int m_nCells; //the number of cells in the histogram
69 
70 
74  unsigned int m_nQuan; //the number of quantiles being calculated (m_cells+1)
75 
76 
77 
80  std::vector<double> m_quan; //the target quantile
81 
82 
83 
86  std::vector<double> m_nIdeal; //ideal positions of quantiles
87 
88 
89 
92  std::vector<int> m_n;
93 
94 
95 
98  std::vector<double> m_q;
99 
100 
101 
104  unsigned int m_nObs; //the number of observations
105  };
106 
107 } //end namespace Isis
108 
109 #endif