liveBook · Manning

Jarque–Bera test

As explained in Statistics Every Programmer Needs

The Jarque–Bera test is a statistical test of normality based on sample skewness and kurtosis.

The Jarque–Bera test evaluates whether regression residuals are normally distributed by measuring skewness, or asymmetry, and kurtosis, or tail thickness. section 4.2.4

Use the test to interpret residual normality alongside a visual Q–Q check:

  • Set the null hypothesis as normally distributed data. section 4.2.4
  • Reject normality when the p-value is below 5%. section 4.2.4
  • Treat the result as a more rigorous complement to the potentially subjective Q–Q plot. section 4.2.4
>>> from statsmodels.stats.stattools import jarque_bera 
>>> print(jarque_bera(lm.resid)) 
SignificanceResult(statistic=2.150037983280995, pvalue=0.34129127355827205)

Apply the test directly to fitted-model residuals with statsmodels; the demonstrated result is a statistic of 2.1500 and p-value of 0.3413. section 4.2.4

How Statistics Every Programmer Needs covers it

How deep it goes
Defines skewness, kurtosis, null hypothesis, threshold, and interpretation, but does not derive the statistic.
Examples
Uses fitted linear-regression residuals, a Q–Q plot, and a statsmodels output with p-value 0.3413.
What it assumes
Assumes fitted linear-regression residuals and familiarity with normality as a model assumption.
What you can do after
Diagnose residual normality with statsmodels and interpret the p-value against a 5% threshold.
How it connects
Connects residual analysis with linear regression, Q–Q plots, and normality assumptions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.