Skip to content

Commit

Permalink
Fixed bug concerning initialization for data with extreme outlieres
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabrina Krakau committed Apr 2, 2019
1 parent 0de8391 commit d6fb955
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/density_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ bool GAMMA::updateThetaAndK(String<String<String<double> > > &statePosteriors,
AppOptions const&options)
{
// use multidimensional simplex2
double fval = 100000.0; // note: f was negated before, we minimze
double fval = DBL_MAX; // note: f was negated before, we minimze
return callGSL_simplex2(fval, this->tp, this->k, this->b0, statePosteriors, setObs, kMin, kMax, options);
}

Expand All @@ -509,7 +509,7 @@ bool GAMMA::updateThetaAndK(String<String<double> > &startSet,
String<double> fvals;
String<double> ks;
String<double> b0s;
resize(fvals, length(startSet), 100000.0, Exact()); // note: f was negated before, we minimze
resize(fvals, length(startSet), DBL_MAX, Exact()); // note: f was negated before, we minimze
resize(ks, length(startSet), Exact());
resize(b0s, length(startSet), Exact());

Expand All @@ -526,7 +526,7 @@ bool GAMMA::updateThetaAndK(String<String<double> > &startSet,
ks[i] = k;
b0s[i] = b0;
}
double min_fval = 100000.0;
double min_fval = DBL_MAX;
for (unsigned i = 0; i < length(startSet); ++i)
{
if (fvals[i] < min_fval)
Expand Down
6 changes: 3 additions & 3 deletions src/density_functions_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ bool GAMMA_REG::updateRegCoeffsAndK(String<String<String<double> > > &statePoste
AppOptions const&options)
{
// use multidimensional minimzation
double fval = 100000.0; // note: f was negated before, we minimze
double fval = DBL_MAX; // note: f was negated before, we minimze
return callGSL_simplex2(fval, this->tp, this->k, this->b0, this->b1, statePosteriors, setObs, kMin, kMax, options);
}

Expand All @@ -540,7 +540,7 @@ bool GAMMA_REG::updateRegCoeffsAndK(String<String<double> > &startSet,
String<double> ks;
String<double> b0s;
String<double> b1s;
resize(fvals, length(startSet), 100000.0, Exact()); // note: f was negated before, we minimze
resize(fvals, length(startSet), DBL_MAX, Exact()); // note: f was negated before, we minimze
resize(ks, length(startSet), Exact());
resize(b0s, length(startSet), Exact());
resize(b1s, length(startSet), Exact());
Expand All @@ -560,7 +560,7 @@ bool GAMMA_REG::updateRegCoeffsAndK(String<String<double> > &startSet,
b0s[i] = b0;
b1s[i] = b1;
}
double min_fval = 100000.0;
double min_fval = DBL_MAX;
for (unsigned i = 0; i < length(startSet); ++i)
{
if (fvals[i] < min_fval)
Expand Down

0 comments on commit d6fb955

Please sign in to comment.