MardiaSkewnessTest[data]
tests whether data follows a MultinormalDistribution using the Mardia skewness test.
MardiaSkewnessTest[data,"property"]
returns the value of "property".
MardiaSkewnessTest
MardiaSkewnessTest[data]
tests whether data follows a MultinormalDistribution using the Mardia skewness test.
MardiaSkewnessTest[data,"property"]
returns the value of "property".
Details and Options
- MardiaSkewnessTest performs the Mardia skewness 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 skewness test effectively compares a multivariate measure of skewness for data to a MultinormalDistribution.
- MardiaSkewnessTest[data,dist,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
- MardiaSkewnessTest[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 MardiaSkewnessTest[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];MardiaSkewnessTest[data]Extract the test statistic from the Mardia skewness test:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];MardiaSkewnessTest[data, "TestStatistic"]Obtain a formatted test table:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, IdentityMatrix[3]], 1000];MardiaSkewnessTest[data, "TestDataTable"]Scope (6)
Testing (3)
Perform a Mardia skewness 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:
MardiaSkewnessTest[data1]MardiaSkewnessTest[data2]Test some data for univariate normality:
data1 = RandomVariate[NormalDistribution[], 1000];
data2 = RandomVariate[ExponentialDistribution[2], 1000];MardiaSkewnessTest[data1]MardiaSkewnessTest[data2]Create a HypothesisTestData object for repeated property extraction:
data = RandomVariate[BinormalDistribution[.5], 10^5];ℋ = MardiaSkewnessTest[data, "HypothesisTestData"]The properties available for extraction:
ℋ["Properties"]Reporting (3)
Tabulate the results of the Mardia skewness test:
data = RandomVariate[BinormalDistribution[.5], 10^3];ℋ = MardiaSkewnessTest[data, "HypothesisTestData"];ℋ["TestDataTable"]ℋ["PValueTable"]ℋ["TestStatisticTable"]Retrieve the entries from a Mardia skewness test table for custom reporting:
data1 = RandomVariate[BinormalDistribution[.5], 10^4];
data2 = RandomVariate[BinormalDistribution[.5], 10^3];ℋ1 = MardiaSkewnessTest[data1, "TestData"]ℋ2 = MardiaSkewnessTest[data2, "TestData"]BarChart[{Labeled[ℋ1, "Set 1"], Labeled[ℋ2, "Set 2"]}, ChartLabels -> {"SubscriptBox[M, S]", "p‐value"}]Report test conclusions using "ShortTestConclusion" and "TestConclusion":
data = BlockRandom[SeedRandom[3];RandomVariate[StudentTDistribution[4], {100, 2}]];ℋ = MardiaSkewnessTest[data, "HypothesisTestData"];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormThe conclusion may differ at a different significance level:
ℋ = MardiaSkewnessTest[data, "HypothesisTestData", SignificanceLevel -> .001];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormOptions (4)
Method (3)
Use Monte Carlo-based methods or a computation formula:
data = RandomVariate[NormalDistribution[], {250, 2}];MardiaSkewnessTest[data, Method -> "MonteCarlo"]MardiaSkewnessTest[data, Method -> Automatic]Set the number of samples to use for Monte Carlo-based methods:
data = RandomVariate[BinormalDistribution[.5], 25];pts = Table[{i, MardiaSkewnessTest[data, Method -> {"MonteCarlo", "MonteCarloSamples" -> i}]}, {i, Range[5, 1000, 150]}];The Monte Carlo estimate converges to the true
-value with increasing samples:
pval = MardiaSkewnessTest[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, MardiaSkewnessTest[data, Method -> {"MonteCarlo", "RandomSeed" -> i, "MonteCarloSamples" -> 100}]}, {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}]];MardiaSkewnessTest[data, "ShortTestConclusion", SignificanceLevel -> .1]MardiaSkewnessTest[data, "ShortTestConclusion", SignificanceLevel -> .25]MardiaSkewnessTest[data, "TestConclusion"]//TraditionalFormApplications (2)
A power curve for the Mardia skewness test:
data = Table[RandomVariate[MultivariateTDistribution[IdentityMatrix[2], 3], {500, i}], {i, n = {10, 15, 20, 25, 30}}];ℋ = Table[MardiaSkewnessTest[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 skewness test when the underlying distribution is a MultivariateTDistribution, the test size is 0.05, and the sample size is 12:
pC[12.]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 skewness of the two species is similar to a multivariate normal distribution:
MardiaSkewnessTest[virg = Pick[data[[All, 1 ;; -2]], species, "virginica"]]MardiaSkewnessTest[vers = Pick[data[[All, 1 ;; -2]], species, "versicolor"]]The multivariate kurtosis should also be checked to confirm normality:
MardiaKurtosisTest[virg]MardiaKurtosisTest[vers]The data appears normal, so TTest is valid:
TTest[{virg, vers}, 0, "TestDataTable"]Properties & Relations (4)
The multivariate test statistic:
data = RandomVariate[BinormalDistribution[.5], 50];MVSkew[data_] := With[{n = Length[data], x = Transpose[Standardize[data, Mean, 1&]]},
(n/6) Total[(Transpose[x].Inverse[Covariance[data]].x)^3, ∞] / n^2
]MVSkew[data]MardiaSkewnessTest[data, "TestStatistic"]Under
the test statistic follows a ChiSquareDistribution:
samp = RandomVariate[MultinormalDistribution[{0, 0}, IdentityMatrix[2]], {1000, 100}];res = MVSkew /@ samp;DistributionFitTest[res, ChiSquareDistribution[df]]The univariate test statistic:
data = RandomVariate[NormalDistribution[], 100];UVSkew[data_] := With[{n = Length[data]},
Skewness[data]^2 / (6/n)]UVSkew[data]MardiaSkewnessTest[data, "TestStatistic"]Under
the test statistic follows a ChiSquareDistribution[1]:
samp = RandomVariate[NormalDistribution[], {1000, 100}];res = UVSkew /@ samp;DistributionFitTest[res, ChiSquareDistribution[1]]Mardia's skewness test can only detect departures from normality in skewness:
data = BlockRandom[SeedRandom[5];RandomVariate[MultivariateTDistribution[IdentityMatrix[2], 5], 1000]];The data is clearly not normally distributed:
Show[Histogram3D[data, Automatic, "PDF"], Plot3D[PDF[MultinormalDistribution[Mean[data], Covariance[data]], {x, y}], {x, -6, 6}, {y, -6, 6}, PlotRange -> All], AspectRatio -> 1]MardiaSkewnessTest[data]Decisions should be based on MardiaSkewnessTest and MardiaKurtosisTest:
MardiaKurtosisTest[data]The Mardia skewness 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"]MardiaSkewnessTest[ts]MardiaSkewnessTest[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]MardiaSkewnessTest[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 = MardiaSkewnessTest[#, "TestStatistic"]& /@ data1;The test statistic given a particular alternative:
data2 = RandomVariate[MultivariateTDistribution[{{1, .2}, { .2, 1}}, 10], {250, 100}];T2 = MardiaSkewnessTest[#, "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"}, PlotStyle -> Thick]Related Guides
History
Text
Wolfram Research (2010), MardiaSkewnessTest, Wolfram Language function, https://reference.wolfram.com/language/ref/MardiaSkewnessTest.html.
CMS
Wolfram Language. 2010. "MardiaSkewnessTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MardiaSkewnessTest.html.
APA
Wolfram Language. (2010). MardiaSkewnessTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MardiaSkewnessTest.html
BibTeX
@misc{reference.wolfram_2026_mardiaskewnesstest, author="Wolfram Research", title="{MardiaSkewnessTest}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/MardiaSkewnessTest.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_mardiaskewnesstest, organization={Wolfram Research}, title={MardiaSkewnessTest}, year={2010}, url={https://reference.wolfram.com/language/ref/MardiaSkewnessTest.html}, note=[Accessed: 12-June-2026]}