Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Python 3.5 MATLAB 2013b
我有一个简单的数组。
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
为什么它显示不同的输出?
这是在 Python 中定义的正确方法吗?
您正在使用Fisher's definition,您打算使用Pearson’s definition峰度:
Fisher's definition
Pearson’s definition
IN: scipy.stats.kurtosis([1,2,3,4,5], axis=0, fisher=False) OUT: 1.7