Open TobiasGlaubach opened 6 years ago
Ok, as expected the problem seems to be that the 2nd Moment (denominator) is zero for all equal values, which results in a division by zero.
scipy solves this problem by:
m2 = moment(a, 2, axis)
m4 = moment(a, 4, axis)
vals = np.where(m2 == 0, 0, m4 / m2**2.0)
which basically just replaces the NaN values with zeros.
Should we implement something similar, or keep the definition like it is? Any opinions on that?
Hi, I found, that the Kurtosis method returns NaN, in a case when all samples are equal.
Testcode:
Check in python:
looking at numpy's reference it states, these definitions should be OK.
Looking at the MathNet.numerics implementation I found, that it needs to be more than 3 and 4 values, which can not be the problem:
Is the definition different from numpy, or is there an issue?