Beispiel #1
0
GammaDouble GammaDoubleMLE (double M, double G)
{
    GammaDoubleMleHelper hlp(G/M);
    std::pair<double,double> pair = boost::math::tools::bisect(hlp, ABS_ERROR, MAX_SHAPE, GammaDoubleMleTol);
    double k = (pair.first + pair.second) / 2.0;
    return GammaDouble(k, M/k);
}
GammaDouble GammaDoubleMLE (double M, double G)
{
    GammaDoubleMleHelper hlp(G/M);
    // Conversion to double is due to an Intel's bug with __builtin_signbit being undefined for float
    std::pair<double,double> pair = boost::math::tools::bisect(hlp, (double)ABS_ERROR, (double)MAX_SHAPE, GammaDoubleMleTol);
    double k = (pair.first + pair.second) / 2.0;
    return GammaDouble(k, M/k);
}