Jarque–Bera test

From Wikipedia, the free encyclopedia

  (Redirected from Jarque-Bera test)
Jump to: navigation, search

In statistics, the Jarque–Bera test is a goodness-of-fit measure of departure from normality, based on the sample kurtosis and skewness. The test is named after Carlos Jarque and Anil K. Bera. The test statistic JB is defined as


\mathit{JB} = \frac{n}{6} \left( S^2 + \frac{(K-3)^2}{4} \right)

where n is the number of observations (or degrees of freedom in general); S is the sample skewness, K is the sample kurtosis, defined as


S = \frac{ \hat{\mu}_3 }{ \hat{\sigma}^3 } = \frac{ \hat{\mu}_3 }
{ \left( \hat{\sigma}^2 \right)^{3/2} } = \frac{ \frac{1}{n} \sum_{i=1}^n \left( x_i - \bar{x} \right)^3}{ \left( \frac{1}{n} \sum_{i=1}^n \left( x_i - \bar{x} \right)^2 \right)^{3/2}}

K = \frac{ \hat{\mu}_4 }{ \hat{\sigma}^4 } = \frac{ \hat{\mu}_4 }{ \left( \hat{\sigma}^2 \right)^{2} } = \frac{\frac{1}{n} \sum_{i=1}^n \left( x_i - \bar{x} \right)^4}{\left( \frac{1}{n} \sum_{i=1}^n \left( x_i - \bar{x} \right)^2 \right)^2}

where \hat{\mu}_3 and \hat{\mu}_4 are the estimates of third and fourth central moments, respectively, \bar{x} is the sample mean, and \hat{\sigma}_2 is the estimate of the second central moment, the variance. Therefore, this can be considered as a sort of portmanteau test, since the four lowest moments about the origin are used jointly for its calculation.

The statistic JB has an asymptotic chi-square distribution with two degrees of freedom and can be used to test the null 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 0, since 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.

The chi-square approximation, however, is overly sensitive (lacking specificity) for small samples, rejecting the null hypothesis often when it is in fact 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-square distribution that differ from their true alpha levels for very small samples.

Calculated p-value equivalents to true alpha levels at given sample sizes
True α level 20 30 50 70 100
.1 .307 .252 .201 .183 .1560
.05 .1461 .109 .079 .067 .062
.025 .051 .0303 .020 .016 .0168
.01 .0064 .0033 .0015 .0012 .002

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

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

[edit] References

  • Jarque, Carlos M.; Anil K. Bera (1980). "Efficient tests for normality, homoscedasticity and serial independence of regression residuals". Economics Letters 6 (3): 255–259. doi:10.1016/0165-1765(80)90024-5. 
  • Jarque, Carlos M.; Anil K. Bera (1981). "Efficient tests for normality, homoscedasticity and serial independence of regression residuals: Monte Carlo evidence". Economics Letters 7 (4): 313–318. doi:10.1016/0165-1765(81)90035-5. 
  • Judge; et al. (1988). Introduction and the Theory and Practice of Econometrics (3rd edn. ed.). pp. 890–892. 

[edit] Implementations

  • ALGLIB includes implementation of the Jarque–Bera test in C++, C#, Delphi, Visual Basic, etc.
  • gretl includes an implementation of the Jarque–Bera test
  • R includes an implementation of the Jarque–Bera test, the function jarque.bera.test in library tseries.
  • MATLAB includes implementation of the Jarque–Bera test, the function "jbtest".