elki-project / elki

ELKI Data Mining Toolkit
https://elki-project.github.io/
GNU Affero General Public License v3.0
780 stars 321 forks source link

Naive quantiles for exponentially modified gaussian #62

Closed jcfj closed 5 years ago

jcfj commented 5 years ago

I needed 99% and 99.9% quantiles for an EMG and was able to get decent results with something as simple as

double x = emg.getMean() + emg.getStddev() - Math.log(1 - qt) / emg.getLambda();
for (int i = 0; i < 10; i++)
    x -= (emg.cdf(x) - qt) / emg.pdf(x);

I'm wondering: is that worthy of a PR, or too stupid?

kno10 commented 5 years ago

I'd prefer something that has been checked for numerical reliability.