Isis 3.0 Programmer Reference
Back | Home
MaximumLikelihoodWFunctions.h
Go to the documentation of this file.
1 #ifndef MaximumLikelihoodWFunctions_h
2 #define MaximumLikelihoodWFunctions_h
3 
27 #include <QString>
28 
29 namespace Isis {
63  public:
67  // Each model has an accompannying private method that converts from a
68  // resiuduals to a weight scaler.
69  enum Model {
70 
79 
87 
98 
108  };
109  static QString modelToString(Model model);
110  static MaximumLikelihoodWFunctions::Model stringToModel(QString modelName);
111 
113  MaximumLikelihoodWFunctions(Model modelSelection);
114  MaximumLikelihoodWFunctions(Model modelSelection, double tweakingConstant);
118 
119  void setModel(Model modelSelection); // uses default tweaking constant
121 
122  void setModel(Model modelSelection, double tweakingConstant);
124 
125  Model model() const;
126  double tweakingConstant() const;
127 
128  // the W functions provide an additional weighting factor W which is used
129  // to 're-weight' each observation dynamically during an adjustment, the
130  // scalar functions provide access to various flavors of this scalar (as
131  // a function of the residual divided by the residuals sigma)
132 
133  double sqrtWeightScaler(double residualZScore); //it is often convient to use square roots of
134  //weights when building normals, this function
135  // provides the scaler for the square root of
136  // the weight directly
137  double tweakingConstantQuantile(); // returns which quantile of the residuals is recommended to
138  // use as the tweaking constant, this varies as a function of
139  // the model being employed
140 
141  QString weightedResidualCutoff();
142 
143  QDataStream &write(QDataStream &stream) const;
144  QDataStream &read(QDataStream &stream);
145 
146  private:
147  double weightScaler(double residualZScore); // This directly provides the scaler for the weight
148  // (instead of the radical weight), thus it provides
149  // sqrtWeightScaler^2
150  double huber(double residualZScore);
151  double huberModified(double residualZScore);
152  double welsch(double residualZScore);
153  double chen(double residualZScore);
154 
164  };
165  // operators to read/write to/from binary data
166  QDataStream &operator<<(QDataStream &stream, const MaximumLikelihoodWFunctions &mlwf);
167  QDataStream &operator>>(QDataStream &stream, MaximumLikelihoodWFunctions &mlwf);
168 
169  QDataStream &operator<<(QDataStream &stream, const MaximumLikelihoodWFunctions::Model &modelEnum);
170  QDataStream &operator>>(QDataStream &stream, MaximumLikelihoodWFunctions::Model &modelEnum);
171 
172 };// end namespace Isis
173 
174 #endif
void setTweakingConstant(double tweakingConstant)
Allows the tweaking constant to be changed without changing the maximum likelihood function...
double tweakingConstant() const
Returns the current tweaking constant.
double tweakingConstantQuantile()
Suggest a quantile of the probility distribution of the residuals to use as the tweaking constants ba...
double sqrtWeightScaler(double residualZScore)
This provides the scaler to the sqrt of the weight, which is very useful for building normal equation...
According to Zhang (Parameter Estimation: A Tutorial with application to conic fitting) "[Huber&#39;s] es...
double weightScaler(double residualZScore)
This provides the scalar for the weight (not the scaler for the square root of the weight...
QString weightedResidualCutoff()
Method to return a string represtentation of the weighted residual cutoff (if it exists) for the Maxi...
Model model() const
Accessor method to return the MaximumLikelihoodWFunctions::Model enumeration.
Model m_model
The enumerated value for the maximum likelihood estimation model to be used.
double chen(double residualZScore)
Modified Huber maximum likelihood estimation function evaluation.
Model
The supported maximum likelihood estimation models.
double huber(double residualZScore)
Huber maximum likelihood estimation function evaluation.
The Chen method was found in &quot;Robust Regression with Projection Based M-estimators&quot; Chen...
A modification to Huber&#39;s method propsed by William J.J.
The Welsch method aggresively discounts measures with large resiudals.
void setModel(Model modelSelection)
Allows the maximum likelihood model to be changed together and the default tweaking constant to be se...
MaximumLikelihoodWFunctions()
Sets up a maximumlikelihood estimation function with Huber model and default tweaking constant...
void setTweakingConstantDefault()
Sets default tweaking constants based on the maximum likelihood estimation model being used...
double m_tweakingConstant
The tweaking constant for the maximum likelihood models.
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:463
Class provides maximum likelihood estimation functions for robust parameter estimation, e.g.
double huberModified(double residualZScore)
Modified Huber maximum likelihood estimation function evaluation.
double welsch(double residualZScore)
Modified Huber maximum likelihood estimation function evaluation.
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum...
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:308

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:23:13