JarqueBeraALMTest[data]
tests whether data is normally distributed using the Jarque–Bera ALM test.
JarqueBeraALMTest[data,"property"]
returns the value of "property".
JarqueBeraALMTest
JarqueBeraALMTest[data]
tests whether data is normally distributed using the Jarque–Bera ALM test.
JarqueBeraALMTest[data,"property"]
returns the value of "property".
Details and Options
- JarqueBeraALMTest performs the Jarque–Bera ALM goodness-of-fit test with null hypothesis
that data was drawn from a NormalDistribution and alternative hypothesis
that it was not. - By default, a probability value or
-value is returned. - A small
-value suggests that it is unlikely that the data is normally distributed. - The data can be univariate {x1,x2,…} or multivariate {{x1,y1,…},{x2,y2,…},…}.
- The Jarque–Bera ALM test effectively compares the skewness and kurtosis of data to a NormalDistribution.
- For univariate data, the test statistic is given by
with
,
and
correction factors for finite sample sizes given by
,
, and
. - For multivariate tests, the sum of the univariate marginal
-values is used and is assumed to follow a UniformSumDistribution under
. - JarqueBeraALMTest[data,dist,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
- JarqueBeraALMTest[data,dist,"property"] can be used to directly give the value of "property".
- Properties related to the reporting of test results include:
-
"PValue"
-value"PValueTable" formatted version of "PValue" "ShortTestConclusion" a short description of the conclusion of a test "TestConclusion" a description of the conclusion of a test "TestData" test statistic and
-value"TestDataTable" formatted version of "TestData" "TestStatistic" test statistic "TestStatisticTable" formatted "TestStatistic" - The following properties are independent of which test is being performed.
- Properties related to the data distribution include:
-
"FittedDistribution" fitted distribution of data "FittedDistributionParameters" distribution parameters of data - The following options can be given:
-
Method Automatic the method to use for computing
-valuesSignificanceLevel 0.05 cutoff for diagnostics and reporting - For a test for goodness of fit, a cutoff
is chosen such that
is rejected only if
. The value of
used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. By default,
is set to 0.05. - With the setting Method->"MonteCarlo",
datasets of the same length as the input
are generated under
using the fitted distribution. The EmpiricalDistribution from JarqueBeraALMTest[si,"TestStatistic"] is then used to estimate the
-value.
Examples
open all close allBasic Examples (3)
Perform a Jarque–Bera ALM test for normality:
data = RandomVariate[NormalDistribution[], 10^4];JarqueBeraALMTest[data]Perform a test for multivariate normality:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];JarqueBeraALMTest[data]Extract the test statistic from a Jarque–Bera ALM test:
data = RandomVariate[NormalDistribution[], 10^3];JarqueBeraALMTest[data, "TestStatistic"]Scope (6)
Testing (3)
Perform a Jarque–Bera ALM test for normality:
data1 = RandomVariate[NormalDistribution[], 10^4];
data2 = RandomVariate[GammaDistribution[10, 2], 10^4];The
-value for the normal data is large compared to the
-value for the non-normal data:
JarqueBeraALMTest[data1]JarqueBeraALMTest[data2]Test for multivariate normality:
data1 = RandomVariate[BinormalDistribution[.5], 10^3];
data2 = RandomVariate[LaplaceDistribution[1, 2], {10^3, 2}];JarqueBeraALMTest[data1]JarqueBeraALMTest[data2]Create a HypothesisTestData object for repeated property extraction:
data = RandomVariate[NormalDistribution[], 10^5];ℋ = JarqueBeraALMTest[data, "HypothesisTestData"]The properties available for extraction:
ℋ["Properties"]Reporting (3)
Tabulate the results of the Jarque–Bera ALM test:
data = RandomVariate[NormalDistribution[], 100];ℋ = JarqueBeraALMTest[data, "HypothesisTestData"];ℋ["TestDataTable"]ℋ["PValueTable"]ℋ["TestStatisticTable"]Retrieve the entries from a Jarque–Bera ALM test table for custom reporting:
data1 = RandomVariate[NormalDistribution[], 100];
data2 = RandomVariate[NormalDistribution[], 100];ℋ1 = JarqueBeraALMTest[data1, "TestData"]ℋ2 = JarqueBeraALMTest[data2, "TestData"]BarChart[{Labeled[ℋ1, "Set 1"], Labeled[ℋ2, "Set 2"]}, ChartLabels -> {"SubscriptBox[D, n]", "p‐value"}]Report test conclusions using "ShortTestConclusion" and "TestConclusion":
data = BlockRandom[SeedRandom[1];RandomVariate[StudentTDistribution[3], 100]];ℋ = JarqueBeraALMTest[data, "HypothesisTestData"];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormThe conclusion may differ at a different significance level:
ℋ = JarqueBeraALMTest[data, "HypothesisTestData", SignificanceLevel -> .001];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormOptions (3)
Method (3)
Use Monte Carlo-based methods or a computation formula:
data = RandomVariate[NormalDistribution[], 100];JarqueBeraALMTest[data, Method -> "MonteCarlo"]JarqueBeraALMTest[data, Method -> Automatic]Set the number of samples to use for Monte Carlo-based methods:
data = RandomVariate[NormalDistribution[], 100];pts = Table[{i, JarqueBeraALMTest[data, Method -> {"MonteCarlo", "MonteCarloSamples" -> i}]}, {i, 5, 1000, 50}];The Monte Carlo estimate converges to the true
-value with increasing samples:
pval = JarqueBeraALMTest[data];ListLinePlot[{pts, {{0, pval}, {1000, pval}}}, PlotStyle -> {Automatic, Dashed}, AxesLabel -> {"# of Samples", "p-Value"}]Set the random seed used in Monte Carlo-based methods:
data = RandomVariate[NormalDistribution[], 100];pts = Table[{i, JarqueBeraALMTest[data, Method -> {"MonteCarlo", "RandomSeed" -> i, "MonteCarloSamples" -> 50}]}, {i, 10}];The seed affects the state of the generator and has some effect on the resulting
-value:
pval = JarqueBeraALMTest[data];ListLinePlot[{pts, {{0, pval}, {10, pval}}}, PlotStyle -> {Automatic, Dashed}, AxesLabel -> {"Seed", "p-Value"}]Applications (2)
A power curve for the Jarque–Bera ALM test:
data = Table[RandomVariate[CauchyDistribution[0, 1], {500, i}], {i, n = {10, 15, 20, 25, 30}}];ℋ = Table[JarqueBeraALMTest[data[[i, j]]], {i, Length[data]}, {j, Length[data[[i]]]}];pC = Interpolation[Transpose[{n, Table[Probability[x ≤ 0.05, xi], {i, ℋ}]}], InterpolationOrder -> 1];Visualize the approximate power curve:
Plot[pC[x], {x, 10, 30}, PlotRange -> {0, 1}, Ticks -> {n, Automatic}, AxesOrigin -> {7, 0}]Estimate the power of the Jarque–Bera ALM test when the underlying distribution is a CauchyDistribution[0,1], the test size is 0.05, and the sample size is 12:
pC[12.]Create a Jarque–Bera ALM test statistic generalized for other distributions:
jbTest[data_, c1_, c2_, c3_] := With[{n = Length[data], skew = Skewness[data], kurt = Kurtosis[data]},
n((skew^2/c1) + ((kurt - c2)^2/c3))]Finite-sample values for
,
, and
:
sampleCM[r_] := MomentConvert[CentralMoment[r], "SampleEstimator"]c1[dist_, n_] := MomentEvaluate[MomentConvert[sampleCM[3]^2, {CentralMoment, n}] / MomentConvert[sampleCM[2]^3, {CentralMoment, n}], dist]c2[dist_, n_] := MomentEvaluate[MomentConvert[sampleCM[4], {CentralMoment, n}] / MomentConvert[sampleCM[2] ^ 2, {CentralMoment, n}], dist]c3[dist_, n_] := (MomentEvaluate[MomentConvert[(sampleCM[4] - c2[dist, n] * sampleCM[2] ^ 2) ^ 2, {CentralMoment, n}] / MomentConvert[sampleCM[2] ^ 4, {CentralMoment, n}], dist])A Jarque–Bera ALM test statistic for fitting to a LaplaceDistribution:
c1L[n_] = c1[LaplaceDistribution[μ, σ], n];
c2L[n_] = c2[LaplaceDistribution[μ, σ], n];
c3L[n_] = c3[LaplaceDistribution[μ, σ], n];jbGen[data_, n_] := (1/n)jbTest[data, c1L[n], c2L[n], c3L[n]]With[{n = 150}, T = jbGen[#, n]& /@ RandomVariate[LaplaceDistribution[1, 2], {10 ^ 4, n}]];Perform the generalized test on some data:
With[{n = 150}, t = jbGen[#, n]& /@ RandomVariate[LaplaceDistribution[1, 2], {1000, n}]];The
-values are uniform as expected:
DistributionFitTest[SurvivalFunction[EmpiricalDistribution[T], t], UniformDistribution[]]The test is powerful against the alternative of a HyperbolicDistribution of similar mean and variance:
Histogram[Table[SurvivalFunction[EmpiricalDistribution[T], jbGen[RandomVariate[HyperbolicDistribution[4, 3, 8.36, -9.13], 150], 150]], {10 ^ 3}], Automatic, "PDF"]Properties & Relations (4)
The Adjusted Lagrange Multiplier (ALM) method outperforms the traditional Jarque–Bera test:
data = RandomVariate[NormalDistribution[], {1000, 15}];s[data_] := Skewness[data];
k[data_] := Kurtosis[data] - 3;The traditional Jarque–Bera test statistic:
jb[data_] := (Length[data]/6)(s[data]^2 + (1/4)k[data]^2)jbpval[t_] := SurvivalFunction[ChiSquareDistribution[2], t]jbT = jbpval[jb[#]]& /@ data;The
-values are not uniformly distributed:
Show[Histogram[jbT, Automatic, "PDF"], Graphics[{Thick, Dashed, Line[{{0, 1}, {1, 1}}]}]]jbalmT = JarqueBeraALMTest[#]& /@ data;The Jarque–Bera ALM test is superior for small samples:
Show[Histogram[jbalmT, Automatic, "PDF"], Graphics[{Thick, Dashed, Line[{{0, 1}, {1, 1}}]}]]The Jarque–Bera ALM test uses finite-sample values for the mean and variance of skewness and kurtosis, not the asymptotic values of 0, 6, 3, and 24 as in the traditional test:
jbTest[data_, c1_, c2_, c3_] := With[{n = Length[data], skew = Skewness[data], kurt = Kurtosis[data]},
n((skew^2/c1) + ((kurt - c2)^2/c3))]jbTraditional[data_] := jbTest[data, 6, 3, 24]The finite-sample values can be derived using MomentEvaluate and MomentConvert:
c1 = Factor[MomentEvaluate[MomentConvert[MomentConvert[CentralMoment[3], "SampleEstimator"]^2, {CentralMoment, n}] / MomentConvert[MomentConvert[CentralMoment[2], "SampleEstimator"]^3, {CentralMoment, n}], NormalDistribution[μ, σ]]]jbALM[data_] := With[{n = Length[data]}, (1/n)jbTest[data, (6(n - 2)/(n + 1)(n + 3)), (3 (n - 1)/n + 1), (24 n (n - 2) (n - 3)/(n + 1)^2 (n + 3) (n + 5))]]The test statistics have the same asymptotic distribution:
ListLinePlot[Table[data = RandomVariate[NormalDistribution[], n];{n, jbTraditional[data] - jbALM[data]}, {n, Join[Range[5, 100, 10], Range[101, 1000, 25], Range[1001, 10000, 100]]}], PlotRange -> All, PlotStyle -> Thick]The Jarque–Bera ALM statistic under the null hypothesis
follows ChiSquareDistribution:
data = RandomVariate[NormalDistribution[], {1000, 2000}];T = JarqueBeraALMTest[#, "TestStatistic"]& /@ data;Plot a histogram of the statistic and the probability density function of the distribution:
Show[Histogram[T, 40, "PDF"], Plot[PDF[ChiSquareDistribution[2], x], {x, 0, 10}, PlotStyle -> Thick]]DistributionFitTest[T, ChiSquareDistribution[2], "TestDataTable"]DistributionFitTest[T, ChiSquareDistribution[2], "ShortTestConclusion"]The Jarque–Bera ALM test works with the values only when the input is a TimeSeries:
ts = TemporalData[TimeSeries, {{{1.224578634529677, 0.47929635789978015, 0.6572781300178168,
0.21496048742669355, 0.7299608014554928, -0.2495111111278263, -1.3286551762002712,
0.552725018274874, 0.19272112205837066, 1.1809144012420882, -1.1671 ... 40938613662046, 1.052394590214582, 0.9345044123980388, 0.38537803109557855,
-0.48660931166089394, -0.71203560340161}}, {{0, 100, 1}}, 1, {"Continuous", 1},
{"Discrete", 1}, 1, {ValueDimensions -> 1, ResamplingMethod -> None}}, False, 10.1];JarqueBeraALMTest[ts]JarqueBeraALMTest[ts["Values"]]Possible Issues (1)
Neat Examples (1)
Compute the statistic when the null hypothesis
is true:
data1 = RandomVariate[NormalDistribution[], {250, 100}];T1 = JarqueBeraALMTest[#, "TestStatistic"]& /@ data1;The test statistic given a particular alternative:
data2 = RandomVariate[ChiSquareDistribution[50], {250, 100}];T2 = JarqueBeraALMTest[#, "TestStatistic"]& /@ data2;Compare the distributions of the test statistics:
SmoothHistogram[{T1, T2}, Filling -> Axis, PlotRange -> {{0, 40}, All}, PlotLegends -> {"SubscriptBox[H, 0] is True", "SubscriptBox[H, 0] is False"}, PlotRange -> All]Related Guides
History
Text
Wolfram Research (2010), JarqueBeraALMTest, Wolfram Language function, https://reference.wolfram.com/language/ref/JarqueBeraALMTest.html.
CMS
Wolfram Language. 2010. "JarqueBeraALMTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/JarqueBeraALMTest.html.
APA
Wolfram Language. (2010). JarqueBeraALMTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/JarqueBeraALMTest.html
BibTeX
@misc{reference.wolfram_2026_jarqueberaalmtest, author="Wolfram Research", title="{JarqueBeraALMTest}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/JarqueBeraALMTest.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_jarqueberaalmtest, organization={Wolfram Research}, title={JarqueBeraALMTest}, year={2010}, url={https://reference.wolfram.com/language/ref/JarqueBeraALMTest.html}, note=[Accessed: 13-June-2026]}