With the help of statsmodels.jarque_bera()
method, we can get the jarque bera test for normality and it’s a test based on skewness, and the kurtosis, and has an asymptotic distribution.
Syntax :
statsmodels.jarque_bera(residual, axis)
Return : Return the jarque bera test statistics, pvalue, skewness, and the kurtosis.
Example #1 :
In this example we can see that by using statsmodels.jarque_bera()
method, we are able to get the jarque bera test statistics, pvalue, skewness and kurtosis by using this method.
# import numpy and statsmodels import numpy as np from statsmodels.stats.stattools import jarque_bera g = np.array([ 1 , 2 , 3 ]) # Using statsmodels.jarque_bera() method gfg = jarque_bera(g) print (gfg) |
Output :
(0.28125, 0.8688150562628432, 0.0, 1.5)
Example #2 :
# import numpy and statsmodels import numpy as np from statsmodels.stats.stattools import jarque_bera g = np.array([ 1 , 2 , 3 , - 1 , - 2 , - 3 ]) # Using statsmodels.jarque_bera() method gfg = jarque_bera(g) print (gfg) |
Output :
(0.5625000000000003, 0.7548396019890072, 0.0, 1.4999999999999996)