SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 5.3.1 Expectation and LOTUSConcept · 30 min
      2. 5.3.2 Variance, and linearity of expectationConcept · 35 min
      3. 5.3.3 Skewness and kurtosisConcept · 30 min
      4. 5.3.4 Practice set: expectation and momentsPractice set · 20 min
      5. 5.3.5 Case study: return moments and value at riskCase study · 35 min

Level 5, Probability and statistics 5.3 Expectation and moments Lesson 3 of 5

ConceptLesson 5.3.3 in Level 5, Probability and statistics. About 30 minutes.

Skewness and kurtosis

Moments

The mean and the variance describe where a distribution sits and how widely it spreads. Two more numbers describe its shape. All of them are moments.

The kk-th moment of XX is E[Xk]\mathbb{E}[X^k], found by LOTUS (lesson 5.3.1) with g(x)=xkg(x) = x^k. The first moment is the mean μ\mu. The kk-th central moment is E[(X−μ)k]\mathbb{E}[(X - \mu)^k], and the second is the variance.

Central moments carry units: E[(X−μ)3]\mathbb{E}[(X - \mu)^3] is in units cubed, so it grows 1003=106100^3 = 10^6 times when dollars become cents. Standardising first removes the units.

Rule: Standardised moments

E[Zk]Z=X−μσ\begin{gathered} \mathbb{E}[Z^k] \\[4pt] Z = \frac{X - \mu}{\sigma} \end{gathered}

ZZ counts standard deviations σ\sigma from the mean (lesson 5.3.2). Its moments have no units, and they do not change when XX is shifted or multiplied by a positive number.

The first two are always the same: E[Z]=0\mathbb{E}[Z] = 0 and E[Z2]=1\mathbb{E}[Z^2] = 1. So the new information starts with the third and the fourth.

Try it

std_moment standardises the values, then applies LOTUS to zkz^k. For the die, k=1k = 1 to 4 give 0, 1, 0 and 1.7314.

The second line does the same for 10X+310X + 3, with the same results: the shape has not changed.

⌘/Ctrl + Enter runs the cell

Skewness: which tail is longer

Cubing keeps the sign of each deviation and magnifies the large ones. If the large deviations lie mostly above the mean, the average cube is positive; if mostly below, negative. That average is the skewness.

Rule: Skewness

skew⁡(X)=E[Z3]\operatorname{skew}(X) = \mathbb{E}\big[Z^3\big]

Positive: a long tail to the right, made of rare values far above the mean. Negative: a long tail to the left. A symmetric distribution has skewness 0.

Take a Bernoulli variable with p=0.2p = 0.2: X=1X = 1 with probability 0.2 and 0 otherwise. Its mean is 0.2 and its standard deviation is 0.2×0.8=0.4\sqrt{0.2 \times 0.8} = 0.4 (lesson 5.3.2).

xx01
pX(x)p_X(x)0.80.2
z=x−0.20.4z = \frac{x - 0.2}{0.4}−0.5-0.52
z3z^3−0.125-0.1258

So skew⁡(X)=0.8×(−0.125)+0.2×8=−0.1+1.6=1.5\operatorname{skew}(X) = 0.8 \times (-0.125) + 0.2 \times 8 = -0.1 + 1.6 = 1.5. The rare 1, two standard deviations above the mean, outweighs the common 0 just below it. In general a Bernoulli variable has skewness 1−2pp(1−p)\frac{1 - 2p}{\sqrt{p(1 - p)}}: 1.5 at p=0.2p = 0.2, 0 at p=12p = \frac{1}{2} and −1.5-1.5 at p=0.8p = 0.8.

Three binomial distributions with 10 trials. A long tail to one side gives skewness of that sign, and pulls the mean towards it, away from the most likely value.

  • The mean follows the tail. With p=0.15p = 0.15 the most likely count is 1, but the mean is 1.5. Lesson 5.3.1's wait for a 5 or a 6 is the same: peak at 1, mean 3, skewness 2.0412.
  • A mirror flips the sign. −X-X has skewness −skew⁡(X)-\operatorname{skew}(X); shifting XX or multiplying it by a positive number changes nothing.
  • Same mean and spread, different shape. Lesson 4.6.1's three bets all have mean 0 and standard deviation 0.2. Their skewness is 0, 1.5 and −1.5-1.5, and the negative one, the rare big loss, was the one a concave utility minded most.

Try it

The first line is the Bernoulli table, then its formula. The loop gives the three binomials of the figure.

The last lines are the wait of lesson 5.3.1, summed over 400 terms, and lesson 4.6.1's three bets.

⌘/Ctrl + Enter runs the cell

Kurtosis: how heavy the tails are

Fourth powers magnify large deviations even more. A value 3 standard deviations from the mean adds 34=813^4 = 81, while one at half a standard deviation adds 0.54=0.06250.5^4 = 0.0625. So the fourth moment is driven by the rare, large deviations.

Rule: Kurtosis

kurt⁡(X)=E[Z4]\operatorname{kurt}(X) = \mathbb{E}\big[Z^4\big]

How much of the spread comes from rare values far from the mean, compared with common values near it. It is never below 1, and it is the same for XX, −X-X and any aX+baX + b with a≠0a \neq 0.

A family of examples shows it best. Let XX be 0 with probability 1−q1 - q, and aa or −a-a with probability q2\frac{q}{2} each, where a=1qa = \frac{1}{\sqrt{q}}. Then the mean is 0 and the variance is qa2=1q a^2 = 1 for every qq, so Z=XZ = X and the kurtosis is qa4=1qq a^4 = \frac{1}{q}.

qqthe values and their chanceskurtosis
1−1-1 or 1, each 12\frac{1}{2}1
13\frac{1}{3}0 with 23\frac{2}{3}; −1.73-1.73 or 1.73, each 16\frac{1}{6}3
0.10 with 0.9; −3.16-3.16 or 3.16, each 0.0510

All three have mean 0 and variance 1. With q=0.1q = 0.1, XX is usually 0 but now and then jumps 3.16 standard deviations, and the kurtosis is 10 times the coin's.

Three distributions with the same mean and variance. The rarer and further out the jumps, the larger the kurtosis.

Kurtosis is often described as how peaked a distribution is. The q=0.1q = 0.1 case has both a tall spike at 0 and far-out jumps, but it is the jumps that make the number large. Read kurtosis as a measure of the tails.

A fair die has kurtosis 1.7314: it cannot stray far from its mean.

The normal's values, and excess kurtosis

The normal distribution, the bell curve of lesson 2.6.3, has skewness 0 and kurtosis 3 (lesson 5.4.3). Kurtosis is therefore often quoted relative to 3.

Rule: Excess kurtosis

kurt⁡(X)−3\operatorname{kurt}(X) - 3

0 for a normal. Positive means heavier tails than a normal, often called fat tails; negative means lighter tails.

distributionskewnessexcess kurtosis
the ±1\pm 1 coin0−2-2
a fair die0−1.2686-1.2686
a normal00
Bernoulli, p=0.2p = 0.21.50.25
wait for a 5 or a 62.04126.1667
the family with q=0.1q = 0.107

In the family, q=13q = \frac{1}{3} matches the normal's kurtosis exactly. Case study 5.3.5 measures the excess kurtosis of daily returns.

Try it

The loop prints the kurtosis of the family for each qq, then the die's. The middle line draws a million normal values in one seeded run: skewness 0.0016 and kurtosis 2.9989, close to 0 and 3.

norm.stats(moments="mvsk") asks SciPy for the mean, variance, skewness and kurtosis. Its last 0 is the excess kurtosis, and so are the 0.25 and 6.1667 on the last two lines.

⌘/Ctrl + Enter runs the cell

Sample skewness and kurtosis

For data x1,…,xnx_1, \ldots, x_n, treat each value as equally likely, with probability 1n\frac{1}{n}, and apply the same formulas. That uses the sample mean xˉ\bar{x} and the standard deviation that divides by nn. scipy.stats.skew and scipy.stats.kurtosis do exactly this by default.

Try it

10,000 seeded die rolls. The sample skewness is 0.0154 and the excess kurtosis −1.2678-1.2678, close to the die's 0 and −1.2686-1.2686.

The last line repeats both by hand with z=x−xˉsz = \frac{x - \bar{x}}{s}, where rolls.std() divides by nn. It matches SciPy's default.

⌘/Ctrl + Enter runs the cell

A sample kurtosis is noisy

A sample's kurtosis rests on its few most extreme values, so short samples give very different answers. Draw 100 values at a time from the family with q=0.1q = 0.1, whose kurtosis is 10. Five seeded samples give 12.5, 14.25, 5.79, 8.99 and 9.94.

Only big samples pin it down: 1,000,000 draws give 9.9996. The higher the moment, the more data it needs.

Try it

Each line of the loop is a separate sample of 100 draws. rng.choice draws from the three values with the given chances.

fisher=False asks for the plain kurtosis, so the target is 10.

⌘/Ctrl + Enter runs the cell

Where the measures break

  • No spread. If every value is the same, σ=0\sigma = 0 and ZZ is 00\frac{0}{0}. SciPy returns nan, "not a number", with a warning.
  • An infinite kurtosis. The sum for E[Z4]\mathbb{E}[Z^4] can diverge even when the variance is finite. The Student tt distribution with 4 degrees of freedom (lesson 5.4.4) is an example. Its sample kurtosis never settles, however long the sample.

Try it

warnings.catch_warnings hides SciPy's warning for the constant data, so only the two nan values print.

SciPy reports the tt distribution's variance, 2, and its excess kurtosis, inf.

⌘/Ctrl + Enter runs the cell

Common mistakes

  1. SciPy's kurtosis is excess kurtosis by default. Normal data gives about 0, not 3.
  2. Positive skewness means a long right tail. Most of the values then sit below the mean, as in the binomial with p=0.15p = 0.15.
  3. Standardise before cubing. E[(X−μ)3]\mathbb{E}[(X - \mu)^3] has units cubed and changes with the units; the skewness does not.
  4. A sign flip changes the skewness, not the kurtosis. −X-X has skewness −skew⁡(X)-\operatorname{skew}(X) and the same kurtosis.
  5. Kurtosis measures the tails, not the peak.
  6. Do not trust the kurtosis of a short sample. A few extreme values decide it.

Skewness and kurtosis

0 of 11 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • The kk-th moment is E[Xk]\mathbb{E}[X^k]; standardised moments E[Zk]\mathbb{E}[Z^k], with Z=X−μσZ = \frac{X - \mu}{\sigma}, have no units. The first two are always 0 and 1.
  • Skewness E[Z3]\mathbb{E}[Z^3]: positive for a long right tail, negative for a long left one, 0 when symmetric. The mean moves towards the tail. −X-X flips its sign.
  • Kurtosis E[Z4]≥1\mathbb{E}[Z^4] \ge 1 measures how much of the spread comes from rare, large deviations. Excess kurtosis is kurtosis −3- 3, which is 0 for a normal.
  • scipy.stats.skew and scipy.stats.kurtosis use divide-by-nn moments; kurtosis reports excess kurtosis unless fisher=False.
  • Sample kurtosis is noisy. It is undefined with no spread, and can be infinite, as for the Student tt with 4 degrees of freedom.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.