The lognormal distribution
Take a normal variable and exponentiate it. is lognormal: its log, , is normal. Since for every (lesson 1.4.1), a lognormal variable is always positive.
Rule: Lognormal distribution
For . and are the mean and standard deviation of , not of . keeps order, so exactly when , and the quantiles of are to the quantiles of .
The median is with , so it is . Take and : the median is 1, and .
The 0.05- and 0.95-quantiles are , about 0.439364 and 2.276017. They are not equally far from the median 1, but they are the same factor away: . On the log scale the distribution is symmetric; on the original scale it stretches out to the right.
The mean is above the median
Rule: Lognormal mean and variance
Stated here; case study 5.6.5 derives both from the normal's moment generating function. The mean is the median times : rare large values pull it up.
would be the natural guess, but , as lesson 5.3.1 warned for any curved . With , the gap grows quickly with :
| 0.1 | 0.5 | 1 | 1.5 | |
|---|---|---|---|---|
| median | 1 | 1 | 1 | 1 |
| mean | 1.005 | 1.1331 | 1.6487 | 3.0802 |
| 0.4801 | 0.4013 | 0.3085 | 0.2266 |
With , the mean is three times the median, and fewer than a quarter of the values exceed it.
Products stay lognormal. If and are independent lognormals, is a sum of independent normals, which is normal (lesson 5.4.3). So is lognormal, with the means and the variances of the logs added. Quantities that grow by multiplying, such as prices, are where the lognormal fits; case study 5.4.6 uses it there.
Raise and watch the dashed mean pull away to the right of the median, . Then switch to the Student t and the chi-squared, the other two distributions of this lesson.
Explore
The curve is a density: probabilities are areas under it. Change the parameters, then set an interval and read the shaded area.
The dashed line is the mean.
- Probability
- P(0.61 ≤ X ≤ 1.65) = 0.6827
- Mean
- 1.1331
- Variance
- 0.3647, so the standard deviation is 0.6039
Try it
SciPy's lognorm takes s and scale , the median. Its density is with ; lesson 5.6.1 shows where the in the denominator comes from.
The last lines draw a million values of in one seeded run. The mean, the median and the share above 2 land near 1.1331, 1 and 0.0828.
The Student t distribution
The Student t distribution with (nu) degrees of freedom is a bell centred at 0, like the standard normal. It has more probability far out, because its density is a power, not an exponential:
Here is the normalising constant of lesson 5.4.1, which depends on . Far out, shrinks like the power , much more slowly than the normal's . Data with more extreme values than a normal of the same variance are said to have fat tails.
Rule: Student t
The variance is above 1, and it is infinite for . The excess kurtosis is for , and infinite for . With 30 or more degrees of freedom the t is close to the normal.
The tails decide which moments exist, exactly as for the power tails of lesson 2.6.3. With the density falls like , so falls like , whose tail integral diverges.
That t, also called the Cauchy distribution, has no mean. Its half-mean reaches 0.7345, 1.4659 and 2.1988 at = 10, 100 and 1000, and keeps climbing like a log.
| 1 | 2 | 4 | 10 | 30 | normal | |
|---|---|---|---|---|---|---|
| 0.20483 | 0.09547 | 0.03994 | 0.01334 | 0.00539 | 0.0027 | |
| 0.975-quantile | 12.706 | 4.303 | 2.776 | 2.228 | 2.042 | 1.960 |
A t with 4 degrees of freedom lands beyond 3 about 15 times as often as a normal. Its 0.975-quantile is 2.776 instead of 1.96, which is why intervals from small samples are wider (lesson 5.8.2).
Part of that gap is the larger variance, . Scaled to variance 1, the t still has fatter tails than the normal; case study 5.4.6 makes that comparison on return data.
The standard normal against two Student t distributions: alike near the centre, they part in the tails. On a log scale, at the t with 4 degrees of freedom has 255 times the normal's tail.
Try it
t(df) is the Student t in SciPy. The loop prints the table: the two-sided tail beyond 3, the 0.975-quantile, the variance and the excess kurtosis. SciPy gives inf or nan for a moment that does not exist.
The next line compares the tails of and the normal beyond 3 and beyond 4. The last loop is the Cauchy's half-mean , by quad, growing without limit.
The chi-squared distribution
Square independent standard normals and add them up. The sum has the chi-squared distribution with degrees of freedom, written (chi is the Greek letter ).
Rule: Chi-squared
, and its density is skewed to the right. For large the shape is close to a normal.
Each has mean . Its variance is , since the normal's kurtosis is 3 (lesson 5.4.3). For independent terms means and variances add (lesson 5.3.2), giving and .
Two small cases link it to earlier lessons.
- One degree of freedom. exactly when , so : the 68% of lesson 5.4.3.
- Two degrees of freedom. is the exponential of lesson 5.4.2 with mean 2, that is . So .
The 0.95-quantiles are 3.841, 5.991, 7.815 and 18.307 for = 1, 2, 3 and 10. The first is : 95% of the time .
The t from a normal and a chi-squared
The t is built from the other two. Take standard normal and , independent of . Then
has the t distribution with degrees of freedom. has mean 1, so is divided by a random number near 1. Now and then that number is small, which makes large: those are the fat tails.
Lesson 5.8.2 meets this ratio when the standard deviation of a sample is estimated rather than known. Module 5.8 also uses for the spread of sample variances.
Try it
chi2(k) is in SciPy. The first lines check the two small cases and the 0.95-quantiles.
Then two seeded simulations. Sums of 3 squared normals have mean, variance and share above 7.815 near 3, 6 and 0.05. The ratio with matches t(4).
Where each is used
| distribution | built from | values | used for |
|---|---|---|---|
| lognormal | , normal | positive | prices and other quantities that grow by multiplying |
| Student t | any real | small samples; fat-tailed data such as daily returns | |
| chi-squared | 0 or more | sample variances and tests |
Case study 5.4.6 models prices as lognormal and compares daily returns with the normal and the t. Case study 5.9.4 fits a t to the same returns.
Common mistakes
- The lognormal's and belong to . The median is ; the mean is , not .
- Most lognormal values fall below the mean. is under one half.
- SciPy's
lognormtakessandscale, notscale. - A t's variance is , not 1. Compare tails at the same variance before calling them fat.
- Some t's have no variance, or no mean. For the variance is infinite; for there is no mean.
- Chi-squared needs standard normals. Squares of variables add to times a .
The lognormal, Student t and chi-squared distributions
0 of 12 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
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,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for 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
- Lognormal: with . , median , mean . Positive and skewed right; products of independent lognormals are lognormal. SciPy:
lognorm(s=sigma, scale=exp(mu)). - Student t with degrees of freedom: a bell with power tails, variance for , no mean for , the normal as . SciPy:
t(nu). - Chi-squared with degrees of freedom: , mean , variance ; is the exponential with mean 2. SciPy:
chi2(k). - with independent of is a t with degrees of freedom.