Kalpana Kalpana (Editor)

Jarque–Bera test

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In statistics, the Jarque–Bera test is a goodness-of-fit test of whether sample data have the skewness and kurtosis matching a normal distribution. The test is named after Carlos Jarque and Anil K. Bera. The test statistic JB is defined as

Contents

J B = n k + 1 6 ( S 2 + 1 4 ( C 3 ) 2 )

where n is the number of observations (or degrees of freedom in general); S is the sample skewness, C is the sample kurtosis, and k is the number of regressors:

S = μ ^ 3 σ ^ 3 = 1 n i = 1 n ( x i x ¯ ) 3 ( 1 n i = 1 n ( x i x ¯ ) 2 ) 3 / 2 , C = μ ^ 4 σ ^ 4 = 1 n i = 1 n ( x i x ¯ ) 4 ( 1 n i = 1 n ( x i x ¯ ) 2 ) 2 ,

where μ ^ 3 and μ ^ 4 are the estimates of third and fourth central moments, respectively, x ¯ is the sample mean, and σ ^ 2 is the estimate of the second central moment, the variance.

If the data comes from a normal distribution, the JB statistic asymptotically has a chi-squared distribution with two degrees of freedom, so the statistic can be used to test the hypothesis that the data are from a normal distribution. The null hypothesis is a joint hypothesis of the skewness being zero and the excess kurtosis being zero. Samples from a normal distribution have an expected skewness of 0 and an expected excess kurtosis of 0 (which is the same as a kurtosis of 3). As the definition of JB shows, any deviation from this increases the JB statistic.

For small samples the chi-squared approximation is overly sensitive, often rejecting the null hypothesis when it is true. Furthermore, the distribution of p-values departs from a uniform distribution and becomes a right-skewed uni-modal distribution, especially for small p-values. This leads to a large Type I error rate. The table below shows some p-values approximated by a chi-squared distribution that differ from their true alpha levels for small samples.

(These values have been approximated by using Monte Carlo simulation in Matlab)

In MATLAB's implementation, the chi-squared approximation for the JB statistic's distribution is only used for large sample sizes (> 2000). For smaller samples, it uses a table derived from Monte Carlo simulations in order to interpolate p-values.

History

Considering normal sampling, and √β1 and β2 contours, Bowman & Shenton (1975) noticed that the statistic JB will be asymptotically χ2(2)-distributed; however they also noted that “large sample sizes would doubtless be required for the χ2 approximation to hold”. Bowman and Shelton did not study the properties any further, preferring D’Agostino’s K-squared test.

Jarque–Bera test in regression analysis

According to Robert Hall, David Lilien, et al. (1995) when using this test along with multiple regression analysis the right estimate is:

J B = n k 6 ( S 2 + 1 4 ( C 3 ) 2 )

where n is the number of observations and k is the number of regressors when examining residuals to an equation.

Implementations

  • ALGLIB includes an implementation of the Jarque–Bera test in C++, C#, Delphi, Visual Basic, etc.
  • gretl includes an implementation of the Jarque–Bera test
  • R includes implementations of the Jarque–Bera test: jarque.bera.test in the package tseries, for example, and jarque.test in the package moments.
  • MATLAB includes an implementation of the Jarque–Bera test, the function "jbtest".
  • Python statsmodels includes an implementation of the Jarque–Bera test, "statsmodels.stats.stattools.py".
  • References

    Jarque–Bera test Wikipedia