Isis 3 Programmer Reference
MaximumLikelihoodWFunctions.h
1 #ifndef MaximumLikelihoodWFunctions_h
2 #define MaximumLikelihoodWFunctions_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QString>
13 
14 namespace Isis {
50  public:
54  // Each model has an accompannying private method that converts from a
55  // resiuduals to a weight scaler.
56  enum Model {
57 
66 
74 
85 
94  Chen
95  };
96  static QString modelToString(Model model);
97  static MaximumLikelihoodWFunctions::Model stringToModel(QString modelName);
98 
100  MaximumLikelihoodWFunctions(Model modelSelection);
101  MaximumLikelihoodWFunctions(Model modelSelection, double tweakingConstant);
105 
106  void setModel(Model modelSelection); // uses default tweaking constant
108 
109  void setModel(Model modelSelection, double tweakingConstant);
111 
112  Model model() const;
113  double tweakingConstant() const;
114 
115  // the W functions provide an additional weighting factor W which is used
116  // to 're-weight' each observation dynamically during an adjustment, the
117  // scalar functions provide access to various flavors of this scalar (as
118  // a function of the residual divided by the residuals sigma)
119 
120  double sqrtWeightScaler(double residualZScore); //it is often convient to use square roots of
121  //weights when building normals, this function
122  // provides the scaler for the square root of
123  // the weight directly
124  double tweakingConstantQuantile(); // returns which quantile of the residuals is recommended to
125  // use as the tweaking constant, this varies as a function of
126  // the model being employed
127 
128  QString weightedResidualCutoff();
129 
130  QDataStream &write(QDataStream &stream) const;
131  QDataStream &read(QDataStream &stream);
132 
133  private:
134  double weightScaler(double residualZScore); // This directly provides the scaler for the weight
135  // (instead of the radical weight), thus it provides
136  // sqrtWeightScaler^2
137  double huber(double residualZScore);
138  double huberModified(double residualZScore);
139  double welsch(double residualZScore);
140  double chen(double residualZScore);
141 
151  };
152  // operators to read/write to/from binary data
153  QDataStream &operator<<(QDataStream &stream, const MaximumLikelihoodWFunctions &mlwf);
154  QDataStream &operator>>(QDataStream &stream, MaximumLikelihoodWFunctions &mlwf);
155 
156  QDataStream &operator<<(QDataStream &stream, const MaximumLikelihoodWFunctions::Model &modelEnum);
157  QDataStream &operator>>(QDataStream &stream, MaximumLikelihoodWFunctions::Model &modelEnum);
158 
159 };// end namespace Isis
160 
161 #endif
Isis::operator<<
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:314
Isis::MaximumLikelihoodWFunctions::weightScaler
double weightScaler(double residualZScore)
This provides the scalar for the weight (not the scaler for the square root of the weight,...
Definition: MaximumLikelihoodWFunctions.cpp:186
Isis::MaximumLikelihoodWFunctions::Model
Model
The supported maximum likelihood estimation models.
Definition: MaximumLikelihoodWFunctions.h:56
Isis::MaximumLikelihoodWFunctions::setModel
void setModel(Model modelSelection)
Allows the maximum likelihood model to be changed together and the default tweaking constant to be se...
Definition: MaximumLikelihoodWFunctions.cpp:87
Isis::MaximumLikelihoodWFunctions::tweakingConstantQuantile
double tweakingConstantQuantile()
Suggest a quantile of the probility distribution of the residuals to use as the tweaking constants ba...
Definition: MaximumLikelihoodWFunctions.cpp:324
Isis::MaximumLikelihoodWFunctions::setTweakingConstantDefault
void setTweakingConstantDefault()
Sets default tweaking constants based on the maximum likelihood estimation model being used.
Definition: MaximumLikelihoodWFunctions.cpp:98
Isis::MaximumLikelihoodWFunctions::huberModified
double huberModified(double residualZScore)
Modified Huber maximum likelihood estimation function evaluation.
Definition: MaximumLikelihoodWFunctions.cpp:262
Isis::MaximumLikelihoodWFunctions::chen
double chen(double residualZScore)
Modified Huber maximum likelihood estimation function evaluation.
Definition: MaximumLikelihoodWFunctions.cpp:302
Isis::MaximumLikelihoodWFunctions::weightedResidualCutoff
QString weightedResidualCutoff()
Method to return a string represtentation of the weighted residual cutoff (if it exists) for the Maxi...
Definition: MaximumLikelihoodWFunctions.cpp:399
Isis::MaximumLikelihoodWFunctions::modelToString
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
Definition: MaximumLikelihoodWFunctions.cpp:355
Isis::MaximumLikelihoodWFunctions::HuberModified
@ HuberModified
A modification to Huber's method propsed by William J.J.
Definition: MaximumLikelihoodWFunctions.h:73
Isis::MaximumLikelihoodWFunctions::MaximumLikelihoodWFunctions
MaximumLikelihoodWFunctions()
Sets up a maximumlikelihood estimation function with Huber model and default tweaking constant.
Definition: MaximumLikelihoodWFunctions.cpp:25
Isis::MaximumLikelihoodWFunctions::tweakingConstant
double tweakingConstant() const
Returns the current tweaking constant.
Definition: MaximumLikelihoodWFunctions.cpp:170
Isis::MaximumLikelihoodWFunctions::model
Model model() const
Accessor method to return the MaximumLikelihoodWFunctions::Model enumeration.
Definition: MaximumLikelihoodWFunctions.cpp:413
Isis::MaximumLikelihoodWFunctions::m_tweakingConstant
double m_tweakingConstant
The tweaking constant for the maximum likelihood models.
Definition: MaximumLikelihoodWFunctions.h:143
Isis::MaximumLikelihoodWFunctions::Welsch
@ Welsch
The Welsch method aggresively discounts measures with large resiudals.
Definition: MaximumLikelihoodWFunctions.h:84
Isis::MaximumLikelihoodWFunctions::huber
double huber(double residualZScore)
Huber maximum likelihood estimation function evaluation.
Definition: MaximumLikelihoodWFunctions.cpp:240
Isis::MaximumLikelihoodWFunctions::Huber
@ Huber
According to Zhang (Parameter Estimation: A Tutorial with application to conic fitting) "[Huber's] es...
Definition: MaximumLikelihoodWFunctions.h:65
Isis::MaximumLikelihoodWFunctions
Class provides maximum likelihood estimation functions for robust parameter estimation,...
Definition: MaximumLikelihoodWFunctions.h:49
Isis::MaximumLikelihoodWFunctions::sqrtWeightScaler
double sqrtWeightScaler(double residualZScore)
This provides the scaler to the sqrt of the weight, which is very useful for building normal equation...
Definition: MaximumLikelihoodWFunctions.cpp:217
Isis::MaximumLikelihoodWFunctions::m_model
Model m_model
The enumerated value for the maximum likelihood estimation model to be used.
Definition: MaximumLikelihoodWFunctions.h:142
Isis::operator>>
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:447
Isis::MaximumLikelihoodWFunctions::setTweakingConstant
void setTweakingConstant(double tweakingConstant)
Allows the tweaking constant to be changed without changing the maximum likelihood function.
Definition: MaximumLikelihoodWFunctions.cpp:156
Isis::MaximumLikelihoodWFunctions::welsch
double welsch(double residualZScore)
Modified Huber maximum likelihood estimation function evaluation.
Definition: MaximumLikelihoodWFunctions.cpp:284
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::MaximumLikelihoodWFunctions::Chen
@ Chen
The Chen method was found in "Robust Regression with Projection Based M-estimators" Chen,...
Definition: MaximumLikelihoodWFunctions.h:94