16 MaximumLikelihoodWFunctions::MaximumLikelihoodWFunctions(
Model modelSelection,
double tweakingConstant) {
20 if (tweakingConstant <= 0.0) {
21 IString msg =
"Maximum likelihood estimation tweaking constants must be > 0.0";
32 MaximumLikelihoodWFunctions::MaximumLikelihoodWFunctions(
Model modelSelection) {
50 if (tweakingConstant <= 0.0) {
51 IString msg =
"Maximum likelihood estimation tweaking constants must be > 0.0";
71 void MaximumLikelihoodWFunctions::maximumLikelihoodModel(
char *model) {
74 strcpy(model,
"Huber");
77 strcpy(model,
"HuberModified");
80 strcpy(model,
"Welsch");
99 if (tweakingConstant <= 0.0)
return false;
100 if (tweakingConstant <= 0.0) {
101 IString msg =
"Maximum likelihood estimation tweaking constants must be > 0.0";
116 void MaximumLikelihoodWFunctions::weightedResidualCutoff(
char *cutoff) {
119 strcpy(cutoff,
"N/A");
122 strcpy(cutoff,
"N/A");
125 sprintf(cutoff,
"%lf",
m_c*1.5);
128 sprintf(cutoff,
"%lf",
m_c);
131 strcpy(cutoff,
"None");
146 return this->
huber(residualZScore);
150 return this->
welsch(residualZScore);
152 return this->
chen(residualZScore);
167 if (scaler <= 0.0)
return 0.0;
179 if ( fabs(residualZScore) <
m_c)
return 1.0;
180 else return m_c/fabs(residualZScore);
191 if ( fabs(residualZScore)/
m_c <
m_PI/2.0)
return m_c*(sin(residualZScore/
m_c)/residualZScore);
192 else return m_c/fabs(residualZScore);
203 return exp(-((residualZScore/
m_c)*(residualZScore/
m_c)));
214 if ( fabs(residualZScore) <=
m_c)
return 6*(
m_c*
m_c-residualZScore*residualZScore)*(
m_c*
m_c-residualZScore*residualZScore);