MardiaKurtosisTest[data]
tests whether data follows a MultinormalDistribution using the Mardia kurtosis test.
MardiaKurtosisTest[data,"property"]
returns the value of "property".
MardiaKurtosisTest
MardiaKurtosisTest[data]
tests whether data follows a MultinormalDistribution using the Mardia kurtosis test.
MardiaKurtosisTest[data,"property"]
returns the value of "property".
Details and Options
- MardiaKurtosisTest performs the Mardia kurtosis goodness-of-fit test with null hypothesis
that data was drawn from a MultinormalDistribution 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 Mardia kurtosis test effectively compares a multivariate measure of kurtosis for data to a MultinormalDistribution.
- MardiaKurtosisTest[data,dist,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
- MardiaKurtosisTest[data,dist,"property"] can be used to directly give the value of "property".
- PearsonChiSquareTest[data,dist,"property"] can be used to directly give the value of "property".
- Properties related to the reporting of test results include:
-
"DegreesOfFreedom" the degrees of freedom used in a test "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. - The following methods can be used to compute
-values: -
Automatic correct for small samples up to dimension 5 "Asymptotic" use the asymptotic distribution of the test statistic "MonteCarlo" use Monte Carlo simulation - With the setting Method-> "MonteCarlo",
datasets of the same length as the input
are generated under
using the fitted distribution. The EmpiricalDistribution from "MonteCarlo" MardiaKurtosisTest[si,"TestStatistic"] is then used to estimate the
-value.
Examples
open all close allBasic Examples (3)
Perform a test for multivariate normality:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];MardiaKurtosisTest[data]Extract the test statistic from the Mardia kurtosis test:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];MardiaKurtosisTest[data, "TestStatistic"]Obtain a formatted test table:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];MardiaKurtosisTest[data, "TestDataTable"]Scope (5)
Testing (2)
Perform a Mardia kurtosis test for multivariate normality:
data1 = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];
data2 = RandomVariate[MultivariateTDistribution[IdentityMatrix[2], 3], 1000];The
-value for the normal data is large compared to the
-value for the non-normal data:
MardiaKurtosisTest[data1]MardiaKurtosisTest[data2]Create a HypothesisTestData object for repeated property extraction:
data = RandomVariate[BinormalDistribution[.5], 10^5];ℋ = MardiaKurtosisTest[data, "HypothesisTestData"]The properties available for extraction:
ℋ["Properties"]Reporting (3)
Tabulate the results of the Mardia kurtosis test:
data = RandomVariate[BinormalDistribution[.5], 10^3];ℋ = MardiaKurtosisTest[data, "HypothesisTestData"];ℋ["TestDataTable"]ℋ["PValueTable"]ℋ["TestStatisticTable"]Retrieve the entries from a Mardia kurtosis test table for custom reporting:
data1 = RandomVariate[BinormalDistribution[.5], 10^3];
data2 = RandomVariate[BinormalDistribution[.5], 10^3];ℋ1 = MardiaKurtosisTest[data1, "TestData"]ℋ2 = MardiaKurtosisTest[data2, "TestData"]BarChart[{Labeled[ℋ1, "Set 1"], Labeled[ℋ2, "Set 2"]}, ChartLabels -> {"SubscriptBox[M, K]", "p‐value"}]Report test conclusions using "ShortTestConclusion" and "TestConclusion":
data = BlockRandom[SeedRandom[2];RandomVariate[StudentTDistribution[4], {100, 2}]];ℋ = MardiaKurtosisTest[data, "HypothesisTestData"];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormThe conclusion may differ at a different significance level:
ℋ = MardiaKurtosisTest[data, "HypothesisTestData", SignificanceLevel -> .001];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormOptions (4)
Method (3)
Use Monte Carlo-based methods or a computation formula:
data = RandomVariate[NormalDistribution[], {50, 2}];MardiaKurtosisTest[data, Method -> "MonteCarlo"]MardiaKurtosisTest[data, Method -> Automatic]Set the number of samples to use for Monte Carlo-based methods:
data = RandomVariate[BinormalDistribution[.5], 50];pts = Table[{i, MardiaKurtosisTest[data, Method -> {"MonteCarlo", "MonteCarloSamples" -> i}]}, {i, Range[5, 1000, 150]}];The Monte Carlo estimate converges to the true
-value with increasing samples:
pval = MardiaKurtosisTest[data];Show[ListLinePlot[pts, PlotRange -> {0, 1}, FrameLabel -> {"Samples", "P-Value"}, Frame -> True, AxesOrigin -> {0, 0}], Graphics[{Dashed, Line[{{0, pval}, {1000, pval}}]}]]Set the random seed used in Monte Carlo-based methods:
data = RandomVariate[BinormalDistribution[.5], 25];pts = Table[{i, MardiaKurtosisTest[data, Method -> {"MonteCarlo", "RandomSeed" -> i}]}, {i, Range[1, 10]}];The seed affects the state of the generator and has some effect on the resulting
-value:
Show[ListLinePlot[pts, PlotRange -> {Min[pts[[All, 2]]], Max[pts[[All, 2]]]}, FrameLabel -> {"Seed", "P-Value"}, Frame -> True, AxesOrigin -> {0, 0}]]SignificanceLevel (1)
Set the significance level used for "TestConclusion" and "ShortTestConclusion":
data = BlockRandom[SeedRandom[1];RandomVariate[StudentTDistribution[5], {100, 2}]];MardiaKurtosisTest[data, "ShortTestConclusion", SignificanceLevel -> .1]MardiaKurtosisTest[data, "ShortTestConclusion", SignificanceLevel -> .25]MardiaKurtosisTest[data, "TestConclusion"]//TraditionalFormApplications (2)
A power curve for the Mardia kurtosis test:
data = Table[RandomVariate[MultivariateTDistribution[IdentityMatrix[2], 3], {500, i}], {i, n = {10, 15, 20, 25, 30}}];ℋ = Table[MardiaKurtosisTest[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 Mardia kurtosis test when the underlying distribution is a MultivariateTDistribution, the test size is 0.05, and the sample size is 27:
pC[27.]Measures of petal and sepal dimensions for three varieties of iris were recorded. A multivariate test of means can be used as a quick check that the measures might be useful in discriminating between two similar species but is only valid if the data follows a multivariate normal distribution:
data = ExampleData[{"Statistics", "FisherIris"}];ExampleData[{"Statistics", "FisherIris"}, "ColumnDescriptions"]species = data[[All, -1]];The multivariate kurtosis of the two species is similar to a multivariate normal distribution:
MardiaKurtosisTest[virg = Pick[data[[All, 1 ;; -2]], species, "virginica"]]MardiaKurtosisTest[vers = Pick[data[[All, 1 ;; -2]], species, "versicolor"]]The multivariate skewness should also be checked to confirm normality:
MardiaSkewnessTest[virg]MardiaSkewnessTest[vers]The data appears normal, so TTest is valid:
TTest[{virg, vers}, 0, "TestDataTable"]Properties & Relations (5)
The multivariate test statistic:
data = RandomVariate[BinormalDistribution[.5], 50];MVKurtosis[data_] := Block[{n = Length[data], x = Transpose[Standardize[data, Mean, 1&]], p = Dimensions[data][[2]], e, s, SInv},
e = p * (p + 2);
s = Sqrt[(8 * p * (p + 2)) / n];
SInv = Inverse[Covariance[data]];
((Tr[(Transpose[x].SInv.x) ^ 2] / n) - e) / s
]MVKurtosis[data]MardiaKurtosisTest[data, "TestStatistic"]The univariate test statistic:
data = RandomVariate[NormalDistribution[], 100];UVKurtosis[data_] := With[{n = Length[data]}, (Kurtosis[data] - 3/Sqrt[24 / n])]UVKurtosis[data]MardiaKurtosisTest[data, "TestStatistic"]The multivariate test statistic has an asymptotic NormalDistribution[0,1]:
data = RandomVariate[MultinormalDistribution[{0, 0, 0}, IdentityMatrix[3]], 5000];{t, p} = MardiaKurtosisTest[data, "TestData", Method -> "Asymptotic"]2SurvivalFunction[NormalDistribution[], Abs@t]The asymptotic
-value can be very inaccurate for small samples:
data2 = RandomVariate[MultinormalDistribution[{0, 0, 0}, IdentityMatrix[3]], 15];{t, pA} = MardiaKurtosisTest[data2, "TestData", Method -> "Asymptotic"]{t, pAuto} = MardiaKurtosisTest[data2, "TestData", Method -> Automatic]For comparison, the Monte Carlo
-value is much closer to the small-sample value:
RandomVariate[MultinormalDistribution[{0, 0, 0}, IdentityMatrix[3]], {1000, 15}];tstats = MardiaKurtosisTest[#, "TestStatistic"]& /@ %;2Min[Probability[T <= t, Ttstats], Probability[T > t, Ttstats]]//NMardia's kurtosis test can only detect departures from normality in kurtosis:
data = BlockRandom[SeedRandom[5];RandomVariate[𝒟 = WeibullDistribution[2.252, 1], {1000, 2}]];The data is clearly not normally distributed:
Show[Histogram3D[data, Automatic, "PDF"], Plot3D[PDF[MultinormalDistribution[Mean[data], Covariance[data]], {x, y}], {x, -1, 3}, {y, -1, 3}, PlotRange -> All], AspectRatio -> 1]MardiaKurtosisTest[data]Decisions should be based on MardiaSkewnessTest and MardiaKurtosisTest:
MardiaSkewnessTest[data]The Mardia kurtosis test works with the values only when the input is a TimeSeries:
ts = TemporalData[TimeSeries, {{{{-0.49926617600557877, -0.9693358407186422, 0.5958383000077166},
{-1.33047395864177, -0.8677417392521979, -0.07701839279253664},
{-0.0007329523045247477, 0.3732688420773089, 0.4231608535246955},
{-0.628458 ... 1802556, -0.646006722738045, 0.22111034631867293},
{0.5843977994899021, 0.20194372201917066, 0.04486228650659786}}}, {{0, 100, 1}}, 1,
{"Continuous", 1}, {"Discrete", 1}, 3, {ValueDimensions -> 3, ResamplingMethod -> None}}, False,
10.1];ts["ValueDimensions"]MardiaKurtosisTest[ts]MardiaKurtosisTest[ts["Values"]]Possible Issues (1)
If the covariance matrix of the data is not positive definite, the test will fail:
data = {{37, 67, 72, 25}, {39, 27, 22, 51}, {63, 71, 59, 2}};PositiveDefiniteMatrixQ@Covariance[data]MardiaKurtosisTest[data]The number of data points must be greater than the dimension of the data:
Tally@Table[PositiveDefiniteMatrixQ[Covariance[RandomVariate[NormalDistribution[], {4, 5}]]], 10 ^ 3]Tally@Table[PositiveDefiniteMatrixQ[Covariance[RandomVariate[NormalDistribution[], {5, 5}]]], 10 ^ 3]Tally@Table[PositiveDefiniteMatrixQ[Covariance[RandomVariate[NormalDistribution[], {6, 5}]]], 10 ^ 3]Neat Examples (1)
Compute the statistic when the null hypothesis
is true:
data1 = RandomVariate[BinormalDistribution[.5], {250, 100}];T1 = MardiaKurtosisTest[#, "TestStatistic"]& /@ data1;The test statistic given a particular alternative:
data2 = RandomVariate[MultivariateTDistribution[{{1, .2}, { .2, 1}}, 10], {250, 100}];T2 = MardiaKurtosisTest[#, "TestStatistic"]& /@ data2;Compare the distributions of the test statistics:
SmoothHistogram[{T1, T2}, Filling -> Axis, PlotLegends -> {"SubscriptBox[H, 0] is True", "SubscriptBox[H, 0] is False"}]Related Guides
History
Text
Wolfram Research (2010), MardiaKurtosisTest, Wolfram Language function, https://reference.wolfram.com/language/ref/MardiaKurtosisTest.html.
CMS
Wolfram Language. 2010. "MardiaKurtosisTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MardiaKurtosisTest.html.
APA
Wolfram Language. (2010). MardiaKurtosisTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MardiaKurtosisTest.html
BibTeX
@misc{reference.wolfram_2026_mardiakurtosistest, author="Wolfram Research", title="{MardiaKurtosisTest}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/MardiaKurtosisTest.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mardiakurtosistest, organization={Wolfram Research}, title={MardiaKurtosisTest}, year={2010}, url={https://reference.wolfram.com/language/ref/MardiaKurtosisTest.html}, note=[Accessed: 13-June-2026]}