Skip to content
Related Articles

Related Articles

Improve Article

statsmodels.jarque_bera() in Python

  • Last Updated : 26 Mar, 2020

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)

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :