mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 14:20:39 +01:00
[apps/proba] Fix chi squared root search bracket for parameter < 2
This commit is contained in:
@@ -76,7 +76,7 @@ double ChiSquaredLaw::cumulativeDistributiveInverseForProbability(double * proba
|
||||
const double kOver2Minus1 = k/2.0 - 1.0;
|
||||
double xmax = m_parameter1 > 2.0 ?
|
||||
2 * *probability * std::exp(std::lgamma(ceilKOver2)) / (exp(-kOver2Minus1) * std::pow(kOver2Minus1, kOver2Minus1)) :
|
||||
std::exp(2/k * std::log(k * std::pow(2.0, kOver2Minus1) * *probability * std::exp(std::lgamma(k/2))));
|
||||
30.0; // Ad hoc value
|
||||
return cumulativeDistributiveInverseForProbabilityUsingBrentRoots(probability, DBL_EPSILON, maxDouble(xMax(), xmax));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user