Math Atom · M-C04

The binomial distribution

8 minMath AtomProbability

By the end you will be able to

  1. 1Recognise a binomial setting: a fixed number of independent trials with the same probability, and a count of successes.
  2. 2Compute P(X = k) with n choose k, and cumulative probabilities P(X ≤ k) and P(X ≥ k).
  3. 3Use the mean np and the variance np(1 − p).
  4. 4Use binomial probabilities to judge a count of VaR exceptions, including the Basel green, amber and red zones.

Why you need it

A 99% VaR should be beaten on about 1 day in 100. Over a year of 250 days you expect 2.5 such days. So is 6 a sign the model is broken, or just a bad year? The binomial distribution answers that.

These Core Path lessons use it:

  • L3.2.14: Backtesting

    Backtesting counts the VaR exceptions over 250 days and judges the count with binomial probabilities: the traffic light and Kupiec's test.

  • M3.3: Credit risk

    Coming later: the number of defaults in a portfolio of loans, where the independence assumption is the weak point.

You need probability and expectation from M-C01: Probability basics and M-C02: Expectation, and variance from M-C03: Variance and standard deviation. Turning a count into a formal test is M-D04: Confidence intervals and hypothesis tests.

The idea

Same model, different years

Imagine a VaR model that is exactly right: each day, independently, there is a 1% chance that the loss beats it. Run a year and count the exceptions. Then run another. The count jumps around, even though nothing about the model changed.

A year of trading days

250 days, 1% chance each
Year1
Exceptions this year3
Expected: 250 × 1%2.5

Red squares are exception days. Same model, same 1%, yet the count changes from year to year.

binomial probability of k exceptions share of your 1 year
0123456789+

Number of exceptions in a year. With more years the dots settle on the bars: 25.7% of years have exactly 2, and 8.1% have none at all.

The pattern the counts settle into is the binomial distribution. Its job is to say how much a count can wobble by chance alone, so that you can tell bad luck from a bad model.

The rules

The setting. Four conditions make a count binomial. Each repetition is a trial.

The probabilities. One pattern's probability, times the number of patterns, counted with n choose k. Adding them up gives the cumulative probability.

Mean and spread. A count is a sum of 0-or-1 trials, so its mean and variance follow.

The rules, for reference

X∼Bin(n,p):P(X=k)=(nk)pk(1−p)n−k,(nk)=n!k! (n−k)!X \sim \text{Bin}(n, p): \quad P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}, \quad \binom{n}{k} = \frac{n!}{k!\,(n-k)!}
P(X≥k)=1−P(X≤k−1)E[X]=npVar⁡(X)=np(1−p)P(X \ge k) = 1 - P(X \le k-1) \qquad E[X] = np \qquad \operatorname{Var}(X) = np(1-p)

In the calculator: binompmf(k, n, p) gives P(X = k), binomcdf(k, n, p) gives P(X ≤ k), and combinations(n, k) gives n choose k.

Try it

Set n and p and read any probability. It opens on a year of backtesting: 250 days at 1%. Things to try: find the k where P(X ≤ k) first passes 95%; then change p to 2% (a model that is wrong by a factor of two) and see how likely the count still is to look green.

Probability p of a success (an exception)

Event

green amber: P(X ≤ k) ≥ 95% red: P(X ≤ k) ≥ 99.99%
012345678910111213

Bars from 0 to 13; bright bars are in the event. Beyond 13 the probabilities are negligible.

P(X≤4)=∑j=04P(X=j)=0.8922P(X \le 4) = \sum_{j=0}^{4} P(X = j) = 0.8922

Probability

0.8922

As a percentage89.22%
Mean np2.5
sd √(np(1 − p))1.573
Zone of k = 4green

Worked examples

1. Two exceptions in ten days

Step 1 of 5
  1. 1

    The set-up

    A 95% one-day VaR should be beaten on 5% of days. Over 10 days, what is the chance of exactly 2 exceptions, if the model is right and days are independent?

2. The Basel traffic light

Step 1 of 4
  1. 1

    The set-up

    A bank backtests its 99% one-day VaR over the last 250 trading days. If the model is right, the number of exceptions X is Bin(250, 0.01). Mean np = 2.5, standard deviation 1.573.

3. When the model is wrong

Step 1 of 3
  1. 1

    The set-up

    Suppose the VaR is too low and the true exception rate is not 1% but higher. The zones stay where they are. How likely is the count to raise the alarm?

Common mistakes

Each line below is a tempting slip. Spot what is wrong, then check.

Reaction

Check what stuck

Question 1 · objective 2

In how many ways can 2 exception days fall in a week of 6 trading days? (6 choose 2)

Question 2 · objective 2

Toss a fair coin 4 times. What is the probability of exactly one head? Give a decimal.

Question 3 · objective 3

A 99% VaR is backtested over 500 days. How many exceptions do you expect if the model is right?

Question 4 · objective 3

X ~ Bin(100, 0.1). What is its standard deviation?

Question 5 · objective 4

A correct 99% VaR model is backtested over 250 days. Roughly how often will it land outside the green zone?

Glossary

Trial
One go of a repeated experiment with two outcomes, such as one trading day that is or is not an exception.
Binomial distribution
The distribution of the number of successes X in n independent trials, each a success with the same probability p. Written Bin(n, p).
n choose k
C(n, k) or (n k), read “n choose k”: the number of ways to pick k items out of n, n! / (k!(n − k)!).
Cumulative probability
P(X ≤ k): the probability of k or fewer successes, the sum of P(X = j) for j = 0 to k.
Exception
A day on which the actual loss is larger than the VaR. At 99% confidence a correct model has one on about 1% of days.
Traffic-light zones
The Basel traffic light for a 99% VaR over 250 days: green for 0 to 4 exceptions, amber for 5 to 9, red for 10 or more.