In file src/main/java/jdistlib/evd/GEV.java the formula
q = shape == 0 ? exp(-exp(-q)) : pow(exp(max(1 + shape * q, 0)), -1.0/shape);
is not correct, and should instead be
q = shape == 0 ? exp(-exp(-q)) : exp(-pow(max(1 + shape * q, 0), -1.0/shape));
The formula can be found in https://en.wikipedia.org/wiki/Generalized_extreme_value_distribution.
Anonymous
Hi there, sorry for the really late reply, but I checked the code here:
https://sourceforge.net/p/jdistlib/code/ci/master/tree/JDistLib/src/main/java/jdistlib/evd/GEV.java#l45
And I believe it is correct, just as you mentioned.
q = shape == 0 ? exp(-exp(-q)) : exp(-pow(max(1 + shape * q, 0), -1.0/shape));
I haven't changed that code since 2017. Did you get the code elsewhere or did I miss anything? Thanks!
Alright then, I would consider this not a bug.