简体   繁体   English

jarque bera测试结果

[英]jarque bera test results

I dont understand the results of a Jarque Bera test. 我不了解Jarque Bera测试的结果。

from statsmodels.stats.stattools import jarque_bera    
np.random.seed(123)
jarque_bera(np.random.normal(-5, 1, 1000))

Results: 结果:

(0.1675179797931011,
 0.9196528750223983,
 -0.029040113501245704,
 2.9745614712223074)

3rd value looks like P-value. 第三值看起来像P值。 The others I thought are Kurtosis and Skew and the 4th I dont know. 我认为其他的是峰度和偏斜,而我不知道的是第四。

So I tested my theory but it was wrong as per the code below: 所以我测试了我的理论,但是按照下面的代码是错误的:

import scipy.stats as stats

print(stats.skew(np.random.normal(-5, 1, 1000)))
print(stats.kurtosis(np.random.normal(-5, 1, 1000)))

-0.19743173433793879
-0.11038007419823126

You need n > 2000 for the Jarque Bera test to be valid 您需要n> 2000才能使Jarque Bera测试有效

The output gives you; 输出给您; the test stat, the p value, skew, kurtosis in that order. 测试stat,p值,偏斜,峰度按该顺序排列。 Not sure why this is not in the docs though? 不知道为什么这不在文档中吗?

Also the implemented Jarque Bera test uses Pearson's definition of kurtosis not Fisher's , so... 同样,已实施的Jarque Bera测试使用的是Pearson对峰度的定义,而不是Fisher的定义 ,因此...

from statsmodels.stats.stattools import jarque_bera  
import scipy.stats as stats
import numpy as np

np.random.seed(123)
samples = np.random.normal(-5, 1, 3000)

print(jarque_bera(samples))
print(stats.skew(samples))
print(stats.kurtosis(samples, fisher=False))

Output.. 输出..

(3.9600892567754835, 0.13806307564092868, -0.08899286958111645, 3.0013381737844793)
-0.08899286958111645
3.0013381737844793

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM