Jarque Bera test - mauriceling/mauriceling.github.io GitHub Wiki

Purpose: To test whether the sample data is normally distributed.

Null hypothesis: Sample is drawn from a normally distributed population.

Alternate hypothesis: Sample is not drawn from a normally distributed population.

Note: Jarque-Bera test is more suited for large sample size of more than 2000 (n > 2000) as it is based on whether the sample data has the skewness and kurtosis matching a normal distribution.

Code:

>>> from scipy import stats
>>> X = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
>>> result = stats.jarque_bera(X)
>>> print("Statistic = %.3f" % result[0])
Statistic = 1.212
>>> print("p-value = %.3f" % result[1])
p-value = 0.546

Reference:

  1. Jarque CM, Bera, AK. 1980. Efficient tests for normality, homoscedasticity and serial independence of regression residuals. Econometric Letters 6(3), 255-259.