3

Python 3.5 MATLAB 2013b

I have a simple array.

MATLAB:

x = [1,2,3,4,5];
kurtosis(x)

1.7

Python:

def mykurtosis(x):
    return scipy.stats.kurtosis(x)

x = [1,2,3,4,5]
print(mykurtosis(x))

-1.3

Why it shows different outputs ?

Is it the right way to define in Python ?

GilZ
  • 6,418
  • 5
  • 30
  • 40
Raady
  • 1,686
  • 5
  • 22
  • 46

1 Answers1

5

You're using Fisher's definition, you intend to use Pearson’s definition of kurtosis:

IN: scipy.stats.kurtosis([1,2,3,4,5], axis=0, fisher=False)
OUT: 1.7
SerialDev
  • 2,777
  • 20
  • 34
  • thank you, what is the actual difference in both of these ? Any links to study about the difference, Wiki has mentions about pearson only. In that case can we change like that in Matlab as well ? – Raady Jan 17 '17 at 07:47