Class JarqueBera
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.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 JB statistic 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 0 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 isrjb.test
in packagelawstat
, orjarque.bera.test
in packagetseries
for N > 2000.- See Also:
- Wikipedia: Jarque-Bera test
-
-
Field Summary
Fields Modifier and Type Field Description int
nSim
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlternativeHypothesis()
Get the description of the alternative hypothesis.String
getNullHypothesis()
Get a description of the null hypothesis.double
pValue()
Get the p-value for the test statistics.double
statistics()
Get the test statistics.-
Methods inherited from class dev.nm.stat.test.HypothesisTest
isNullRejected, nGroups, nObs, oneSidedPvalue
-
-
-
-
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 sampleisExact
-true
if 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
-
getNullHypothesis
public String getNullHypothesis()
Description copied from class:HypothesisTest
Get a description of the null hypothesis.- Specified by:
getNullHypothesis
in classHypothesisTest
- Returns:
- the null hypothesis description
- See Also:
- Wikipedia: Null hypothesis
-
getAlternativeHypothesis
public String getAlternativeHypothesis()
Description copied from class:HypothesisTest
Get the description of the alternative hypothesis.- Specified by:
getAlternativeHypothesis
in classHypothesisTest
- Returns:
- the alternative hypothesis description
- See Also:
- Wikipedia: Alternative hypothesis
-
statistics
public double statistics()
Description copied from class:HypothesisTest
Get the test statistics.- Specified by:
statistics
in classHypothesisTest
- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
pValue
public double pValue()
Description copied from class:HypothesisTest
Get the p-value for the test statistics.- Specified by:
pValue
in classHypothesisTest
- Returns:
- the p-value
- See Also:
- Wikipedia: P-value
-
-