I am trying to figure out why the following code returns different values for the sample's kurtosis:
import pandas
import scipy
e = pandas.DataFrame([1, 2, 3, 4, 5, 4, 3, 2, 1])
print "pandas.rolling_kurt:\n", pandas.rolling_kurt(e, window=9)
print "\nscipy.stats.kurtosis:", scipy.stats.kurtosis(e)
The output I am getting:
pandas.rolling_kurt:
0
0 NaN
1 NaN
2 NaN
3 NaN
4 NaN
5 NaN
6 NaN
7 NaN
8 -1.060058
scipy.stats.kurtosis: [-1.15653061]
I have tried to play with the pearson vs fisher setting but to no avail.
Setting bias=False
seems to do it:
In [3]: scipy.stats.kurtosis(e,bias=False)
Out[3]: array([-1.06005831])