I have the following code for estimating a generalized extreme value distribution from scipy.
from scipy.stats import genextreme
ys = [22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 22.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.3, 23.2, 23.2, 23.2, 23.2, 23.2, 23.2, 23.2, 23.2, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 29.9, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 27.7, 24.5, 24.5, 24.5, 24.5, 24.5, 24.5, 24.5, 24.5, 24.5, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 26.6, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 23.7, 23.7, 23.7, 23.7, 23.7, 23.7, 23.7, 23.7, 23.7, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.9, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764, 22.058823529411764]
shape, loc, scale = genextreme.fit(ys)
mean, var = genextreme.stats(shape, loc, scale, moments='mv')
I got the following fitted parameters (shape, location and scale respecitvely):
-2.787020488783334
22.058823529411782
5.0707584099150134e-14
Thus, the shape is negative but the documentation on https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.genextreme.html allows the shape to go negative.
However, my mean and variance are both nan.
It looks like I can fit a model, and the fitted parameters look reasonable, but why am I unable to get a mean from the fitted distribution?
