SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 5.2.1 Random variables, PMFs and CDFsConcept · 25 min
      2. 5.2.2 Bernoulli, binomial and geometric distributionsConcept · 30 min
      3. 5.2.3 The Poisson distributionConcept · 30 min
      4. 5.2.4 Practice set: discrete distributionsPractice set · 25 min
      5. 5.2.5 Case study: the one-period binomial model, and counting defaultsCase study · 35 min

Level 5, Probability and statistics 5.2 Discrete random variables Lesson 3 of 5

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

The Poisson distribution

Counting rare events

Many counts have no fixed number of trials. Emails arriving in an hour, flaws in a metre of cable, goals in a football match: each can be 0, 1, 2 or more.

The Poisson distribution fits such counts when three things hold. Events come one at a time, independently of each other, at a steady average rate. The rate λ\lambda (lambda) is the average number of events per interval, a count per hour or per metre.

The Poisson pmf

Rule: Poisson distribution

P(X=k)=e−λ λkk!k=0,1,2,…\begin{gathered} P(X = k) = e^{-\lambda}\,\frac{\lambda^k}{k!} \\[4pt] k = 0, 1, 2, \ldots \end{gathered}

The number of events in an interval where they occur at average rate λ>0\lambda > 0. We write X∼Poisson⁡(λ)X \sim \operatorname{Poisson}(\lambda). Recall 0!=10! = 1 (lesson 5.1.2), so P(X=0)=e−λP(X = 0) = e^{-\lambda}.

For λ=2\lambda = 2, to four decimals:

kk01234567
P(X=k)P(X = k)0.13530.27070.27070.18040.09020.03610.01200.0034

The distribution function of lesson 5.2.1 adds these up: F(3)=0.8571F(3) = 0.8571, so P(X≥4)=1−F(3)=0.1429P(X \ge 4) = 1 - F(3) = 0.1429. The values never reach 0, but they shrink fast: k=8k = 8 has probability 0.0009.

Why it adds up to 1

The events {X=0},{X=1},{X=2},…\{X = 0\}, \{X = 1\}, \{X = 2\}, \ldots never overlap, and the list never ends. Together they cover every outcome. So by the third axiom for an endless list of disjoint events (lesson 5.1.1), their probabilities add up to P(Ω)=1P(\Omega) = 1.

By lesson 2.7.2, 1+λ+λ22!+λ33!+⋯=eλ1 + \lambda + \frac{\lambda^2}{2!} + \frac{\lambda^3}{3!} + \cdots = e^\lambda for every λ\lambda. Multiply by e−λe^{-\lambda}, and they do:

∑k=0∞e−λλkk!=e−λeλ=1\sum_{k=0}^{\infty} e^{-\lambda}\frac{\lambda^k}{k!} = e^{-\lambda}e^{\lambda} = 1

For λ=2\lambda = 2, the partial sums of ∑2kk!\sum \frac{2^k}{k!} are 5, 7.2667 and 7.389 after the terms up to k=2k = 2, 5 and 10. They settle on e2=7.3891e^2 = 7.3891.

Try it

The cell computes the pmf from the formula, then checks it with poisson.pmf. poisson.cdf and poisson.sf give F(3)F(3) and 1−F(3)1 - F(3).

The last lines add up 30 terms of the pmf, and the partial sums of the series for e2e^2.

⌘/Ctrl + Enter runs the cell

The shape

Each probability is the one before times λk\frac{\lambda}{k}:

P(X=k)P(X=k−1)=λk\frac{P(X = k)}{P(X = k - 1)} = \frac{\lambda}{k}

While k<λk < \lambda the ratio is above 1 and the bars rise; once k>λk > \lambda they fall. So the most likely count is the whole-number part of λ\lambda. When λ\lambda is a whole number, λ−1\lambda - 1 and λ\lambda tie.

For λ=2\lambda = 2 the ratios are 2, 1, 23\frac{2}{3}, …, so P(X=1)=P(X=2)=0.2707P(X = 1) = P(X = 2) = 0.2707. For λ=2.5\lambda = 2.5 the peak is at 2, with 0.2565. For λ=0.5\lambda = 0.5 the first ratio is already 12\frac{1}{2}, so the bars fall from the start: P(X=0)=0.6065P(X = 0) = 0.6065.

Try it

The first line prints the ratios 2k\frac{2}{k} for k=1k = 1 to 5. The loop prints, for each λ\lambda, the first five probabilities and the largest one.

For λ=2\lambda = 2, argmax reports the first of the two tied values, 1.

⌘/Ctrl + Enter runs the cell

λ\lambda is the long-run average count, and lesson 5.3.1 makes "average" precise; below, the dashed line sits at λ\lambda.

Set λ=2\lambda = 2 and the interval from 0 to 3, and read P(X≤3)=0.8571P(X \le 3) = 0.8571. Then move λ\lambda through 2.5, 3 and 3.5 and watch the tallest bar.

Explore

Each bar is the probability of one value. Change the parameters, then set an interval: the shaded bars add up to its probability.

05101500.10.2

The dashed line is the mean.

Probability
P(0 ≤ X ≤ 3) = 0.6472
Mean
3
Variance
3, so the standard deviation is 1.7321

Changing the interval

The rate belongs to an interval length. Events at rate λ\lambda per hour come at rate λt\lambda t per tt hours, so the count over tt hours is Poisson with parameter λt\lambda t.

Rule: Counts over a time t

Xt∼Poisson⁡(λt)P(no event by t)=e−λt\begin{gathered} X_t \sim \operatorname{Poisson}(\lambda t) \\[4pt] P(\text{no event by } t) = e^{-\lambda t} \end{gathered}

XtX_t is the number of events in a stretch of length tt, with λ\lambda per unit of length. The rate and the length must use the same unit. The second line is P(Xt=0)P(X_t = 0).

Emails arrive at 3 an hour on average. Over 20 minutes, t=13t = \frac{1}{3} hour and λt=1\lambda t = 1, so no email at all has probability e−1=0.3679e^{-1} = 0.3679. Over a whole hour that falls to e−3=0.0498e^{-3} = 0.0498; over two hours, λt=6\lambda t = 6 and exactly six emails has probability 0.1606.

e−λte^{-\lambda t} is also the chance that the first event comes after tt. Lesson 5.4.2 turns it into the exponential distribution of waiting times, and case study 5.2.5 counts defaults with the Poisson.

Try it

One hour is the unit, so 20 minutes is t = 1/3. The cell prints the three probabilities above, then five or more emails in one hour: 0.1847.

⌘/Ctrl + Enter runs the cell

The Poisson as a limit of the binomial

A Poisson count is like a binomial count with very many trials, each with a tiny chance. Split an hour into nn short slots, each holding an email with probability p=λnp = \frac{\lambda}{n}. The number of emails is Bin⁡(n,λn)\operatorname{Bin}\left(n, \frac{\lambda}{n}\right), and the average count np=λnp = \lambda stays fixed as nn grows.

Here is P(X=2)P(X = 2) for λ=2\lambda = 2 as the slots get shorter.

nn101001,00010,000Poisson
p=2np = \frac{2}{n}0.20.020.0020.0002
P(X=2)P(X = 2)0.30200.27340.27090.27070.2707

Algebra shows where e−λe^{-\lambda} comes from. Write the binomial pmf with p=λnp = \frac{\lambda}{n} and split it into four factors:

(nk)(λn)k(1−λn)n−k=n(n−1)⋯(n−k+1)nk⋅λkk!⋅(1−λn)n⋅(1−λn)−k\begin{gathered} \binom{n}{k}\left(\frac{\lambda}{n}\right)^k\left(1 - \frac{\lambda}{n}\right)^{n - k} \\[4pt] = \frac{n(n - 1)\cdots(n - k + 1)}{n^k} \cdot \frac{\lambda^k}{k!} \\[4pt] \cdot \left(1 - \frac{\lambda}{n}\right)^n \cdot \left(1 - \frac{\lambda}{n}\right)^{-k} \end{gathered}

The first factor has kk terms on top, each close to nn when nn is large, so it tends to 1. The third tends to e−λe^{-\lambda}, the limit of case study 2.1.5 with the negative rate −λ-\lambda. The last tends to 1, since kk stays fixed.

nnfirst factor(1−2n)n\left(1 - \frac{2}{n}\right)^n(1−2n)−2\left(1 - \frac{2}{n}\right)^{-2}P(X=2)P(X = 2)
100.90.10741.56250.3020
1000.990.13261.04120.2734
1,0000.9990.13511.0040.2709

With λ=2\lambda = 2 and k=2k = 2, the middle factor is 222!=2\frac{2^2}{2!} = 2. The third column approaches e−2=0.1353e^{-2} = 0.1353, and the last column approaches 2×0.1353=0.27072 \times 0.1353 = 0.2707.

Try it

The loop computes the three factors that depend on nn, then their product with the middle factor, 2. The last column matches binom.pmf with p=2np = \frac{2}{n}.

⌘/Ctrl + Enter runs the cell

Rule: Poisson approximation

Bin⁡(n,p)≈Poisson⁡(np)\operatorname{Bin}(n, p) \approx \operatorname{Poisson}(np)

For many trials with a small chance each. It replaces two numbers, nn and pp, by one, λ=np\lambda = np.

Binomial counts with np=2np = 2 against the Poisson with λ=2\lambda = 2. With p=0.2p = 0.2 the two differ by up to 0.0313 at one value; with p=0.02p = 0.02, by at most 0.0027.

When the approximation is good

What matters is that pp is small, not only that nn is large. With λ=2\lambda = 2 fixed, the largest gap between the two pmfs is 0.0313 for p=0.2p = 0.2, 0.0027 for p=0.02p = 0.02 and 0.0003 for p=0.002p = 0.002. Each tenfold drop in pp cuts it about ten times.

With n=20n = 20 and p=0.5p = 0.5 the approximation fails: the largest gap is 0.0511. The binomial gives P(X=10)=0.1762P(X = 10) = 0.1762, the Poisson with λ=10\lambda = 10 only 0.1251. The Poisson also puts probability 0.0016 on more than 20 events, which 20 trials cannot produce.

Try it

The first loop rebuilds the table of P(X=2)P(X = 2). The second prints the largest gap between the two pmfs, over every kk from 0 to nn. The next line shows the failure at n=20n = 20, p=0.5p = 0.5.

The last lines draw 200,000 binomial counts with n=1000n = 1000 and p=0.002p = 0.002, with a fixed seed. In this run the shares of 0 to 4 are within 0.0012 of the Poisson pmf.

⌘/Ctrl + Enter runs the cell

Common mistakes

  1. Match λ\lambda to the interval. Three an hour is one per 20 minutes: use λt\lambda t, with tt in the rate's unit.
  2. Keep both e−λe^{-\lambda} and k!k!. Without them the values do not add up to 1.
  3. The Poisson has no upper limit; the binomial stops at nn. That is one reason the approximation fails when pp is not small.
  4. Check the conditions. Events that come in bursts, such as calls to a help desk during an outage, are not independent. The Poisson then understates large counts.
  5. A whole-number λ\lambda has two most likely counts. For λ=2\lambda = 2, both 1 and 2.
  6. poisson.sf(k, lam) is P(X>k)P(X > k). For P(X≥k)P(X \ge k) use sf(k - 1, lam).

The Poisson distribution

0 of 12 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
  12. 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, 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

  • A Poisson count has P(X=k)=e−λλkk!P(X = k) = e^{-\lambda}\frac{\lambda^k}{k!} for k=0,1,2,…k = 0, 1, 2, \ldots, with λ\lambda the average count per interval. It adds up to 1 because ∑λkk!=eλ\sum \frac{\lambda^k}{k!} = e^\lambda.
  • Each value is the one before times λk\frac{\lambda}{k}, so the most likely count is the whole-number part of λ\lambda.
  • Over a length tt, the count is Poisson⁡(λt)\operatorname{Poisson}(\lambda t), and P(no event)=e−λtP(\text{no event}) = e^{-\lambda t}.
  • Bin⁡(n,λn)→Poisson⁡(λ)\operatorname{Bin}(n, \frac{\lambda}{n}) \to \operatorname{Poisson}(\lambda) as n→∞n \to \infty, because (1−λn)n→e−λ\left(1 - \frac{\lambda}{n}\right)^n \to e^{-\lambda}. The approximation Bin⁡(n,p)≈Poisson⁡(np)\operatorname{Bin}(n, p) \approx \operatorname{Poisson}(np) needs pp small.

Free further reading

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