SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.distribution.normality
Class JarqueBera

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.HypothesisTest
      extended by com.numericalmethod.suanshu.stats.test.distribution.normality.JarqueBera

public class JarqueBera
extends HypothesisTest

The Jarque–Bera test is a goodness-of-fit measure of departure from normality, based on the sample kurtosis and skewness.

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 R equivalent function is rjb.test in package lawstat, or jarque.bera.test in package tseries for N > 2000.

See Also:
Wikipedia: Jarque–Bera test

Field Summary
 int nSim
           
 
Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
k, N, pValue, testStatistics
 
Constructor Summary
JarqueBera(double[] sample)
          Perform the Jarque-Bera test to test for the departure from normality, using the asymptotic chi-square distribution.
JarqueBera(double[] sample, boolean isExact)
          Perform the Jarque-Bera test to test for the departure from normality.
 
Method Summary
 java.lang.String alternativeHypothesis()
          Get a description of the alternative hypothesis.
 java.lang.String nullHypothesis()
          Get a description of the null hypothesis.
 
Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
oneSidedPvalue, pValue, rejectNull, testStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nSim

public final int nSim
See Also:
Constant Field Values
Constructor Detail

JarqueBera

public JarqueBera(double[] sample,
                  boolean isExact)
Perform the Jarque-Bera test to test for the departure from normality.

Parameters:
sample - a sample
isExact - indicate whether the exact Jarque-Bera distribution is to be used

JarqueBera

public JarqueBera(double[] sample)
Perform the Jarque-Bera test to test for the departure from normality, using the asymptotic chi-square distribution.

Parameters:
sample - a sample
Method Detail

nullHypothesis

public java.lang.String nullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.

Specified by:
nullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
See Also:
Wikipedia: Null hypothesis

alternativeHypothesis

public java.lang.String alternativeHypothesis()
Description copied from class: HypothesisTest
Get a description of the alternative hypothesis.

Specified by:
alternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
See Also:
Wikipedia: Alternative hypothesis

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.