LoginSignup
0
0

More than 1 year has passed since last update.

scipy.stats ジャック・ベラ検定 jarque_bera

Posted at

scipy.stats ジャック・ベラ検定 jarque_bera

データが尖度と歪度からみて,正規分布にしたがっているかを検定する。

サンプルサイズが 2000 以上の場合にのみ十分な近似ができる。小標本の場合には $\alpha$ エラーが大きくなりがちである。

jarque_bera(x)

from scipy.stats import jarque_bera
import numpy as np

np.random.seed(123)
x = np.random.normal(50, 10, 2000)
jarque_bera(x)
Jarque_beraResult(statistic=4.35459209387323, pvalue=0.11334760325001603)
from scipy.stats import t
np.random.seed(123)
y = t.rvs(df=1, size=2000)
jarque_bera(y)
Jarque_beraResult(statistic=84777241.15223904, pvalue=0.0)
np.random.seed(123)
z = t.rvs(df=30, size=2300)
jarque_bera(z)
Jarque_beraResult(statistic=6.215613681021044, pvalue=0.0446988796913278)
from scipy.stats import shapiro
shapiro(z)
ShapiroResult(statistic=0.9990779161453247, pvalue=0.29000625014305115)
d = [58, 63, 83, 10, 62, 41, 41, 31, 54, 44, 31, 34, 35, 15]
jarque_bera(d)
Jarque_beraResult(statistic=0.1860725636063782, pvalue=0.911160441152622)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0