Skewness
Details
- Skewness measures the asymmetry in data or of dist.
- Skewness[…] is equivalent to CentralMoment[…,3]/CentralMoment[…,2]3/2.
- A positive skewness
indicates a distribution with a long right tail. A negative skewness indicates a distribution with a long left tail. - Skewness[{{x1,y1,…},{x2,y2,…},…}] gives {Skewness[{x1,x2,…}],Skewness[{y1,y2,…}],…}.
- Skewness handles both numerical and symbolic data.
- The data can have the following additional forms and interpretations:
-
Association the values (the keys are ignored) » SparseArray as an array, equivalent to Normal[data] » QuantityArray quantities as an array » WeightedData weighted mean, based on the underlying EmpiricalDistribution » EventData based on the underlying SurvivalDistribution » TimeSeries, TemporalData, … vector or array of values (the time stamps ignored) » Image,Image3D RGB channel's values or grayscale intensity value » Audio amplitude values of all channels » DateObject, TimeObject list of dates or list of times » - For a random process proc, the skewness function can be computed for slice distribution at time t, SliceDistribution[proc,t], as α[t]=Skewness[SliceDistribution[proc,t]]. »
Examples
open all close allBasic Examples (4)
Scope (23)
Basic Uses (7)
Exact input yields exact output:
Skewness[{1, 7, 3, 4}]Approximate input yields approximate output:
Skewness[{1., 7., 3., 4.}]Skewness[N[{1, 7, 3, 4}, 30]]Find the skewness of WeightedData:
Skewness[WeightedData[{1, 2, 3}, {Subscript[w, 1], Subscript[w, 2], Subscript[w, 3]}]]data = {8, 3, 5, 4, 9, 0, 4, 2, 2, 3};
weights = {0.15, 0.09, 0.12, 0.10, 0.16, 0., 0.11, 0.08, 0.08, 0.09};Skewness[WeightedData[data, weights]]Find the skewness of EventData:
e = {1.0, 2.1, 3.2, 4.5, 5.7};
ci = {0, 0, 0, 1, 0};Skewness[EventData[e, ci]]Find the skewness of TemporalData:
s1 = {2, 1, 6, 5, 7, 4};
s2 = {4, 7, 5, 2, 1, 2};
s3 = {3, 12, 2, 1, 6, 2};
t = {1, 2, 5, 10, 12, 15};td = TemporalData[{s1, s2, s3}, {t}];Skewness[td[10]]Find the skewness of TimeSeries:
Skewness[TemporalData[TimeSeries, {{{2.3, 1.2, 6.7, 5.8, 7.1, 4.6}}, {{0, 5, 1}}, 1, {"Discrete", 1},
{"Discrete", 1}, 1, {}}, False, 10.]]The skewness depends only on the values:
Skewness[TemporalData[TimeSeries, {{{2.3, 1.2, 6.7, 5.8, 7.1, 4.6}}, {{0, 5, 1}}, 1, {"Discrete", 1},
{"Discrete", 1}, 1, {}}, False, 10.]["Values"]]Find the skewness of data involving quantities:
data = Quantity[RandomReal[1, 6], "Meters"]Skewness[data]Array Data (5)
Skewness for a matrix gives columnwise skewness:
Skewness[N@{{1, 3, 4}, {4, 6, 1}, {12, 1, 6}}]Skewness[RandomReal[1, 10 ^ 7]]Skewness[RandomReal[1, {10 ^ 6, 5}]]When the input is an Association, Skewness works on its values:
mat = RandomReal[1, {3, 2}];assoc = AssociationThread[Range[3], mat]
Skewness[assoc]SparseArray data can be used just like dense arrays:
Skewness[SparseArray[{{1} -> 1, {100} -> 1}]]Skewness[SparseArray[{{1, 1} -> 1, {2, 2} -> 2, {3, 3} -> 3, {1, 3} -> 4}]]Find the skewness of a QuantityArray:
data = QuantityArray[RandomReal[1, 6], "Pounds"]Skewness[data]Image and Audio Data (2)
Channelwise skewness value of an RGB image:
Skewness[[image]]RGBColor[%]Skewness intensity value of a grayscale image:
Skewness[[image]]On audio objects, Skewness works channelwise:
a = ExampleData[{"Audio", "Bee"}]AudioMeasurements[a, "Channels"]Skewness[a]Date and Time (5)
Compute skewness of a list of dates:
dates = WolframLanguageData[All, "DateIntroduced"];DateHistogram[dates]Skewness[dates]Compute the weighted skewness of dates:
dates = RandomDate[4]weights = {1, 1, 1, 3};Skewness[WeightedData[dates, weights]]Compute the skewness of dates given in different calendars:
dates = {DateObject[{2024, 2, 29}, CalendarType -> "Julian"], DateObject[{1524, 1, 1}, CalendarType -> "Islamic"], DateObject[{6024, 1, 15}, CalendarType -> "Jewish"]}Skewness[dates]Compute the skewness of times:
times = RandomTime[3]Skewness[times]Compute the skewness of times with different time zone specifications:
times = {TimeObject[{12}, TimeZone -> 0], TimeObject[{12}, TimeZone -> 2], TimeObject[{12}, TimeZone -> "Asia/Tokyo"]}Skewness[times]Distributions and Processes (4)
Find the skewness for univariate distributions:
Skewness[BinomialDistribution[n, p]]Skewness[ExponentialDistribution[μ]]Skewness[MultivariateHypergeometricDistribution[n, {Subscript[m, 1], Subscript[m, 2]}]]Skewness[DirichletDistribution[{a, b, c}]]//TogetherSkewness for derived distributions:
Skewness[TransformedDistribution[x^2, xNormalDistribution[μ, σ]]]Skewness[ProbabilityDistribution[8x ^ 7 / 255, {x, 1, 2}]]data = RandomVariate[NormalDistribution[], 10 ^ 3];Skewness[HistogramDistribution[data]]Skewness for distributions with quantities:
Skewness[QuantityDistribution[MaxwellDistribution[σ], "Meters" / "Seconds"]]Skewness[EmpiricalDistribution[QuantityArray[RandomChoice[{0, 5}, 1000], "Volts"]]]Skewness function for a random process:
Skewness[PoissonProcess[μ][t]]Plot[Evaluate[% /. {μ -> 2}], {t, 1, 7}]Applications (8)
Zero skewness indicates that the distribution is symmetric:
Skewness[NormalDistribution[]]Plot[PDF[NormalDistribution[], x], {x, -5, 5}, Filling -> Axis]Distributions with longer tails to the right have positive skewness:
Skewness[ChiSquareDistribution[5]]Plot[PDF[ChiSquareDistribution[5], x], {x, 0, 20}, Filling -> Axis]Distributions with longer tails to the left have negative skewness:
Skewness[GumbelDistribution[3, 2]]Plot[PDF[GumbelDistribution[3, 2], x], {x, -10, 10}, Filling -> Axis]The limiting distribution for BinomialDistribution as
is normal:
{μ, σ} = {Mean[BinomialDistribution[n, p]], StandardDeviation[BinomialDistribution[n, p]]}Block[{p = 1 / 3},
Table[Show[DiscretePlot[PDF[BinomialDistribution[n, p], k], {k, Ceiling[μ - 2σ], Floor[μ + 2σ]}, PlotRange -> {{μ - 3σ, μ + 2σ}, All}, AxesOrigin -> {μ - 3σ, 0}], Plot[PDF[NormalDistribution[μ, σ], x], {x, μ - 2σ, μ + 2σ}], Ticks -> {{{μ - 2σ, HoldForm[μ - 2σ]}, {μ, HoldForm[μ]}, {μ + 2σ, HoldForm[μ + 2σ]}}, Automatic}, PlotRange -> {{μ - 3σ, μ + 2σ}, All}, PlotLabel -> Row[{"n = ", n}]], {n, r = {5, 25, 50, 100}}]]The limiting value of skewness is 0:
N[Skewness[BinomialDistribution[#, 1 / 3]]]& /@ rBy the central limit theorem, skewness of normalized sums of random variables will converge to 0:
sum[n_] := TransformedDistribution[Total[Array[x, n]], Array[x, n]ProductDistribution[{GammaDistribution[3, 4], n}]]Table[Skewness[sum[n]], {n, 1, 10 ^ 3, 100}]//NDefine a Pearson distribution with zero mean and unit variance, parameterized by skewness and kurtosis:
stPearson[t_, β1_, β2_] = PearsonDistribution[t, 2 (9 + 6 β1 - 5 β2), -Sqrt[β1] (3 + β2), 6 + 3 β1 - 2 β2, -Sqrt[β1] (3 + β2), 3β1 - 4 β2];Obtain parameter inequalities for Pearson types 1, 4, and 6:
RegionFunc[β1_, β2_] = Table[Tooltip[Reduce[β2 > β1 + 1 && DistributionParameterAssumptions[stPearson[t, β1, β2]], {β1, β2}, Reals], Row[{Text["type -> "], t}]], {t, {1, 4, 6}}]The region plot for Pearson types depending on the values of skewness and kurtosis:
PearsonDiagram[data_List] := Module[{gr, sβ1, sβ2, β1, β2},
sβ1 = Skewness[data] ^ 2;
sβ2 = Kurtosis[data];
gr = Show[
RegionPlot[RegionFunc[β1, β2]//Evaluate, {β1, 0, Max[10, Ceiling[1.1 * sβ1, 5]]}, {β2, 0, Max[10, Ceiling[1.1 * sβ2, 5]]}, PlotPoints -> 50, Epilog -> {PointSize[0.02], Red, Point[{sβ1, sβ2}]}]
]
]Generate a random sample from a ParetoDistribution:
BlockRandom[SeedRandom[2010];
vec = RandomVariate[ParetoDistribution[2, 12.3], 10 ^ 5];]Determine the type of PearsonDistribution with moments matching the sample moments:
PearsonDiagram[vec]This time series contains the number of steps taken daily by a person during a period of five months:
stepdata = TemporalData[TimeSeries, {{{10785, 11753, 7092, 5290, 5022, 7438, 13386, 11195, 12499, 12495,
12004, 11833, 4097, 14270, 10280, 11947, 12699, 15634, 12332, 8399, 4680, 10034, 9173, 5309,
9552, 5605, 13294, 7600, 2417, 0, 1315, 9066, 11624 ... 1, 9618, 21243, 22273, 15869, 17687, 9263,
21162, 14724, 6386}}, {TemporalData`DateSpecification[{2013, 4, 1, 0, 0, 0.},
{2013, 9, 1, 0, 0, 0.}, {1, "Day"}]}, 1, {"Discrete", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1}}, True, 10.];DateListPlot[stepdata, Joined -> False, Filling -> 0]m = Mean[stepdata]//FloorAnalyze the skewness as an indication of a tail in the daily step distribution:
Skewness[stepdata]//NThe histogram of the frequency of daily counts confirms that the distribution has a longer left tail:
highlightbar[{{x0_, x1_}, {y0_, y1_}}, d_, meta___] := {If[x0 ≤ First[meta] < x1, Red, {}], Rectangle[{x0, y0}, {x1, y1}]}Histogram[stepdata -> m, 25, ChartElementFunction -> highlightbar, Ticks -> {{{m, "Mean", {0, .025}}}}]Find the skewness for the heights of children in a class:
heights = Quantity[{134, 143, 131, 140, 145, 136, 131, 136, 143, 136, 133, 145, 147,
150, 150, 146, 137, 143, 132, 142, 145, 136, 144, 135, 141}, "Centimeters"];ListPlot[heights, Filling -> Axis, AxesLabel -> Automatic]Skewness close to 0 indicates distribution symmetric around the mean:
Skewness[heights]//NProperties & Relations (2)
Skewness for data can be computed from CentralMoment:
data = RandomReal[10, 20];Skewness[data]CentralMoment[data, 3] / CentralMoment[data, 2] ^ (3 / 2)Skewness for a distribution can be computed from CentralMoment:
dist = ChiSquareDistribution[ν];ev = (CentralMoment[dist, 3]/CentralMoment[dist, 2]^3 / 2)skew = Skewness[dist]Simplify[skew == ev, Assumptions -> ν > 0]Possible Issues (1)
Neat Examples (1)
The distribution of Skewness estimates for 50, 100, and 300 samples:
Skewness[ExponentialDistribution[0.9]]SmoothHistogram[Table[Skewness[RandomVariate[ExponentialDistribution[0.9], {s, 1000}]], {s, {50, 100, 300}}], Filling -> Axis, PlotLegends -> {50, 100, 300}, PlotRange -> {{0, 5}, Automatic}]See Also
Tech Notes
Text
Wolfram Research (2007), Skewness, Wolfram Language function, https://reference.wolfram.com/language/ref/Skewness.html (updated 2024).
CMS
Wolfram Language. 2007. "Skewness." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Skewness.html.
APA
Wolfram Language. (2007). Skewness. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Skewness.html
BibTeX
@misc{reference.wolfram_2026_skewness, author="Wolfram Research", title="{Skewness}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Skewness.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_skewness, organization={Wolfram Research}, title={Skewness}, year={2024}, url={https://reference.wolfram.com/language/ref/Skewness.html}, note=[Accessed: 13-June-2026]}