Statistics for Analytics

Session 4: Probability Models & Sampling Uncertainty

Dr Zexun Chen

Today’s route

First: model an uncertain outcome. Then: describe how an estimate varies across samples.

Counts & Waiting

Recall the two-loan model

Last week, each of two independent loans defaulted with probability \(0.1\).

Let \(X\) count defaults over the next year.

Defaults \(x\) 0 1 2
\(P(X=x)\) \(0.81\) \(0.18\) \(0.01\)
  • What is the probability of at least one default?
  • How could we calculate these probabilities for 100 loans?

A named probability model gives a reusable rule for a whole family of problems.

Begin with the question

What do we record? Example Model
One yes/no outcome Does this loan default? Bernoulli
Successes in a fixed number of trials Defaults among 20 RBS loans Binomial
Trials up to the first success Monzo calls until a loan application Geometric
Events in a fixed exposure HSBC branch arrivals in one hour Poisson

Define the variable and the observation window before choosing a formula.

Bernoulli trial

One trial has two outcomes:

\[I=\begin{cases}1 & \text{success}\\0 & \text{failure}\end{cases}, \qquad P(I=1)=p,\quad P(I=0)=1-p.\]

\(p\)

\(E(I)\)

\(p(1-p)\)

\(\operatorname{Var}(I)\)

\(\sqrt{p(1-p)}\)

\(SD(I)\)

For a loan, \(I=1\) can mean default. “Success” names the coded event.

RBS: how many loans will default?

Suppose Royal Bank of Scotland (RBS) has issued 20 loans, each with a 5% chance of default over the next year.

Let \(X\) count defaults: \(X=I_1+\cdots+I_{20}\).

The binomial model assumes:

  1. A fixed number of loans: \(n=20\).
  2. Two outcomes: default or no default.
  3. The same default probability: \(p=0.05\).
  4. Independent outcomes across loans.

Thus \(X\sim\operatorname{Bin}(20,0.05)\).

Illustrative RBS scenario: the portfolio size and default probability are teaching assumptions.

Why a binomial probability counts arrangements

Let \(X\) count defaults among four of the RBS loans, each with default probability \(0.05\). Exactly one default can occur in four disjoint ways:

Default position Outcome Probability
1 DRRR \(0.05(0.95)^3=0.04286875\)
2 RDRR \(0.05(0.95)^3=0.04286875\)
3 RRDR \(0.05(0.95)^3=0.04286875\)
4 RRRD \(0.05(0.95)^3=0.04286875\)

\[P(X=1)=4(0.04286875)=0.171475.\]

Exactly two defaults: list every arrangement

For the same four loans, find \(P(X=2)\). \(D\) = default; \(R\) = no default.

Defaulting loans Outcome Multiply the four outcome probabilities
1 and 2 DDRR \(0.05\times0.05\times0.95\times0.95=0.00225625\)
1 and 3 DRDR \(0.05\times0.95\times0.05\times0.95=0.00225625\)
1 and 4 DRRD \(0.05\times0.95\times0.95\times0.05=0.00225625\)
2 and 3 RDDR \(0.95\times0.05\times0.05\times0.95=0.00225625\)
2 and 4 RDRD \(0.95\times0.05\times0.95\times0.05=0.00225625\)
3 and 4 RRDD \(0.95\times0.95\times0.05\times0.05=0.00225625\)

The six outcomes are disjoint, so add their probabilities:

\[P(X=2)=6\times0.00225625=\mathbf{0.0135375}.\]

From arrangements to the binomial formula

Both examples use number of arrangements × probability of one arrangement.

\[P(X=k)=\binom nk p^k(1-p)^{n-k},\qquad k=0,1,\ldots,n.\]

Component Meaning
\(\binom nk\) Ways to place \(k\) successes among \(n\) trials
\(p^k\) Contribution of the \(k\) successes
\((1-p)^{n-k}\) Contribution of the \(n-k\) failures

For the six pairs we listed, \(\binom42=6\).

Binomial centre and spread

For \(X=I_1+\cdots+I_n\), add the \(n\) Bernoulli means and, with independence, the \(n\) variances.

\(np\)

Expected successes

\(np(1-p)\)

Variance

\(\sqrt{np(1-p)}\)

Standard deviation

For the 20 RBS loans with \(p=0.05\), \(E(X)=1\) default and \(\operatorname{Var}(X)=0.95\) defaults².

Shape changes with \(p\)

Binomial probability bars for twenty trials with probabilities 0.1, 0.5 and 0.9 show right skew, symmetry, and left skew.

With fixed \(n\), \(p\) changes the centre and shape. At \(p=0.5\), the distribution is symmetric.

RBS: predict the default count

Return to the 20 independent RBS loans, each with annual default probability \(p=0.05\).

  1. Define \(X\) and identify its distribution.
  2. Find the expected number of defaults.
  3. Find the chance of exactly two defaults.
  4. Find the chance of at least one, using the complement.

Which model assumption would you check first in a real loan portfolio?

Illustrative RBS scenario; the same one-year horizon applies to every loan.

RBS: work through the probabilities

Under \(X\sim\operatorname{Bin}(20,0.05)\),

\[E(X)=20(0.05)=1\text{ default}.\]

\[P(X=2)=\binom{20}{2}(0.05)^2(0.95)^{18}\approx0.1887.\]

\[P(X\ge1)=1-P(X=0)=1-(0.95)^{20}\approx0.6415.\]

Interpretation: about 18.9% of comparable 20-loan portfolios have exactly two defaults; about 64.2% have at least one under this model.

Illustrative RBS scenario: \(n=20\), \(p=0.05\), with defaults counted over one year.

Monzo: calls until a loan application

Monzo is a digital bank with no branches.

Suppose its call centre contacts potential customers to offer loans.

Each independent call has a 10% chance of prompting a loan application: \(p=0.1\).

Let \(T\) count calls up to and including the first application.

Why geometric? Each call is a Bernoulli trial; we stop at the first success.

Illustrative calling scenario and 10% rate. Bank context: Monzo.

Monzo: build the first few probabilities

Keep \(p=0.1\). Let \(T\) count calls through the first loan application.

First application on call… Required sequence Probability
1 Applies \(0.1\)
2 No, then applies \(0.9(0.1)=0.09\)
3 No, no, then applies \(0.9^2(0.1)=0.081\)

The number of calls varies because the stopping rule determines it.

Geometric probabilities: a long right tail

\[P(T=k)=(1-p)^{k-1}p,\qquad k=1,2,\ldots\]

Geometric probabilities for the first loan application on calls 1 to 30 with p equal to 0.1. The first call is most likely; probabilities decrease with waiting time.

To finish on call \(k\): first \(k-1\) calls fail, then one succeeds.

Call 1 is the most likely finishing point, but repeated failures can produce long waits.

After a failure, the next call still succeeds with probability \(p\).

Why is the expected wait \(1/p\)?

Let \(m=E(T)\). For Monzo, \(p=0.1\). Consider the first call:

First call Probability Average total calls
Applies: stop \(0.1\) \(1\)
Does not apply: start afresh \(0.9\) \(1+m\)

The average combines these two possibilities:

\[m=0.1(1)+0.9(1+m)=1+0.9m.\]

So \(0.1m=1\), giving \(m=10\) calls.

In general: \(m=1+(1-p)m\quad\Longrightarrow\quad E(T)=\dfrac1p\).

Variance: use the same first-call split

We know \(m=E(T)=1/p\). Write \(v=\operatorname{Var}(T)=E[(T-m)^2]\).

After a failure, \(T'\) is a fresh wait, with the same mean \(m\) and variance \(v\).

First call Probability Total wait \(T\) Average \((T-m)^2\)
Applies: stop \(p\) \(1\) \((1-m)^2\)
Does not apply \(1-p\) \(1+T'\) \(1+v\)

Both rows measure squared distance from the same overall mean \(m\).

Why \(1+v\)? Fresh deviations average zero; their squares average \(v\):

\[E[(1+T'-m)^2] =1+2\underbrace{E(T'-m)}_{0}+\underbrace{E[(T'-m)^2]}_{v} =1+v.\]

Solve for variance, then SD

Weight the two rows by their probabilities:

\[v=p(1-m)^2+(1-p)(1+v).\]

Substitute \(m=1/p\) and collect the terms:

\[v=(1-p)v+\frac{(1-p)^2}{p}+(1-p) =(1-p)v+\frac{1-p}{p}.\]

So \(pv=(1-p)/p\). Divide by \(p\) to obtain variance; take its square root for SD.

\(\operatorname{Var}(T)=\dfrac{1-p}{p^2},\qquad SD(T)=\sqrt{\operatorname{Var}(T)}=\dfrac{\sqrt{1-p}}{p}.\)

For \(p=0.1\): variance \(90\) calls²; SD \(\approx9.49\) calls.

HSBC: why model branch arrivals?

Suppose an HSBC branch receives an average of 10 customers per hour.

For the next hour, let \(X\) count customer arrivals.

The observation window is fixed; the count can be \(0,1,2,\ldots\)

  • How likely is a quiet hour with no arrivals?
  • How likely are exactly two arrivals?

To build a model, assume independent arrivals at a stable rate.

Illustrative HSBC scenario; 10 customers per hour is a model input.

Build an hour from small time slots

Divide one hour into \(n\) equal slots. Approximate each slot by 0 or 1 arrival, independently, with a stable rate of 10 customers per hour.

Set the model’s arrival probability to \(p=10/n\) so that \(np=10\):

Slots \(n\) Length of each slot Arrival probability \(p\) Expected total \(np\)
100 36 seconds 0.1 10
1,000 3.6 seconds 0.01 10
10,000 0.36 seconds 0.001 10

Let \(I_j=1\) for an arrival in slot \(j\), and \(0\) otherwise. The model count is

\[X_n=I_1+\cdots+I_n\sim\operatorname{Bin}(n,10/n).\]

Shorter slots improve this approximation when two or more arrivals in a very short slot are negligible.

Exactly two arrivals: start with binomial

Choose two arrival slots; all the other slots must be empty:

\[P(X_n=2)=\binom{n}{2}\left(\frac{10}{n}\right)^2 \left(1-\frac{10}{n}\right)^{n-2}.\]

Part of the probability As the slots get shorter (\(n\to\infty\))
Choose the two slots and get their arrivals \(\binom{n}{2}(10/n)^2=50(1-1/n)\to50\)
No arrivals in the remaining slots \((1-10/n)^{n-2}\to e^{-10}\)

Multiply the limiting factors:

\[P(X=2)=\frac{10^2}{2!}e^{-10}\approx0.00227.\]

This limiting count model is the Poisson distribution.

From two arrivals to the Poisson formula

For rate \(r\) over time \(t\), write \(\lambda=rt\) for the expected count in the window.

\[X\sim\operatorname{Pois}(\lambda):\qquad P(X=k)=e^{-\lambda}\frac{\lambda^k}{k!},\quad k=0,1,2,\ldots\]

Poisson probability bars for a one-hour HSBC customer arrival count with mean 10. The bar at two arrivals is highlighted and has probability about 0.00227.

For HSBC, one hour gives \(\lambda=10\). The highlighted bar is \(P(X=2)\approx0.00227\).

Choose \(k\) slots and get arrivals:

\(\binom nk(\lambda/n)^k\longrightarrow\lambda^k/k!\).

Keep the other \(n-k\) slots empty:

Each is empty with probability \(1-\lambda/n\). Independence gives \(A_n=(1-\lambda/n)^{n-k}\).

Use natural logs: \(\log(1-x)\approx-x\) for small \(x\):

\(\log A_n\approx-(n-k)\lambda/n\longrightarrow-\lambda\).

Exponentiating gives \(A_n\to e^{-\lambda}\), with \(\lambda\) and \(k\) fixed as \(n\) grows.

Why do mean and variance both equal \(\lambda\)?

Reuse the binomial moments for the count from short slots, with \(p=\lambda/n\):

\[E(X_n)=np=n\frac{\lambda}{n}=\lambda.\]

\[\operatorname{Var}(X_n)=np(1-p) =\lambda\left(1-\frac{\lambda}{n}\right)\longrightarrow\lambda.\]

Each slot contributes \(p\) to the mean and \(p(1-p)\) to the variance. As \(p\) becomes tiny, these are almost equal; independence lets us add the variances.

For \(X\sim\operatorname{Pois}(\lambda)\): \(E(X)=\lambda,\quad \operatorname{Var}(X)=\lambda,\quad SD(X)=\sqrt{\lambda}\).

For HSBC in one hour: mean 10 arrivals, variance 10 arrivals², and SD \(\sqrt{10}\approx3.16\) arrivals.

HSBC: rate and exposure

Keep the HSBC model: independent customer arrivals at 10 per hour.

Window Expected count \(\lambda\) Probability of no arrivals
30 minutes 5 \(e^{-5}\approx0.00674\)
1 hour 10 \(e^{-10}\approx4.54\times10^{-5}\)
2 hours 20 \(e^{-20}\approx2.06\times10^{-9}\)

In one hour, \(P(X\ge1)=1-e^{-10}\approx0.99995\).

Doubling the window doubles the mean and variance; SD increases by a factor of \(\sqrt2\).

Illustrative HSBC model. Use the same time unit for rate and exposure; check for clustered arrivals and changing rates.

Choose the probability model

Match each question to Bernoulli, binomial, geometric or Poisson.

  1. Is one transaction fraudulent?
  2. How many of the 20 RBS loans default?
  3. How many Monzo calls until the first loan application?
  4. How many customers arrive at an HSBC branch in an hour?

Name one assumption needed for each choice.

Model choice: explain what is fixed

Question Model Key assumption
One transaction: fraud or no fraud Bernoulli One defined binary outcome
Defaults among 20 RBS loans Binomial Independent trials with a common \(p\)
Monzo calls until the first application Geometric Independent trials with a constant \(p\)
HSBC arrivals during one hour Poisson Independent arrivals at a stable rate

Similar data can require different models when the question or stopping rule changes.

Continuous Models

Uniform: equal chances, two kinds of outcome

Choose one of 10 files Choose a time in the next 10 minutes
Variable File ID: \(1,2,\ldots,10\) Time \(T\in[0,10]\)
Model Discrete uniform Continuous uniform
Probability \(P(X=3)=1/10\) \(P(2<T<5)=3/10\)
Equal probability applies to… Individual file IDs Intervals of equal length

For a continuous variable, probability is area, and \(P(T=t)=0\) at an exact point.

Uniform probability is a rectangle

Uniform density from zero to ten minutes. The interval from two to five minutes has width 3, height 0.1 per minute and shaded area 0.30.

\[P(2<T<5)=\underbrace{(5-2)}_{\text{width}}\times\underbrace{\frac1{10-0}}_{\text{height}}=0.30.\]

For \(T\sim U(a,b)\), \(f(t)=1/(b-a)\) on \([a,b]\), and \(0\) outside.

Uniform centre and spread

Model Mean Variance
Continuous on \([a,b]\) \((a+b)/2\) \((b-a)^2/12\)
Discrete on integers \(a,\ldots,b\) \((a+b)/2\) \(\big[(b-a+1)^2-1\big]/12\)

Compare two distributions on the range from 1 to 2:

  • Both have mean 1.5.
  • Continuous \(U(1,2)\) has variance \(1/12\).
  • Equal probabilities at \(\{1,2\}\) give variance \(1/4\): all mass is at the ends.

The normal family

Three normal models of settlement forecast errors show how changing the mean shifts the curve and changing the standard deviation changes its spread.

\[X\sim N(\mu,\sigma^2)\]

Mean \(\mu\) sets the centre; SD \(\sigma\) sets the spread.

Illustrative models of settlement forecast errors, measured in £ thousands.

Read the normal model

\[X\sim N(\mu,\sigma^2)\qquad\text{means mean }\mu\text{ and variance }\sigma^2.\]

  • The curve is symmetric, with one peak at \(\mu\).
  • Mean, median and mode all equal \(\mu\).
  • The standard deviation is \(\sigma\), in the same units as \(X\).

Settlement forecast error: \(X\sim N(0,5^2)\), measured in £ thousands.

Mean \(=0\); SD \(=5\) (£5,000); variance \(=25\).

Standardise: measure distance in SDs

\[Z=\frac{X-\mu}{\sigma}\sim N(0,1)\qquad\text{when }X\sim N(\mu,\sigma^2).\]

Subtract the centre; divide by the standard deviation.

Error \(x\) (£ thousands) \(z=(x-0)/5\) Interpretation
\(0\) \(0\) At the mean
\(10\) \(2\) Two SDs above the mean
\(-5\) \(-1\) One SD below the mean

Standardising preserves the event’s probability while changing its scale.

What does \(\Phi(z)\) tell us?

\(\Phi(z)=P(Z\le z)\) is the area to the left of \(z\) under \(N(0,1)\).

Standard normal curve with all area to the left of z equals 2 shaded. The left area is 0.9772; the remaining right area is 0.0228.

Left of \(z\) Right of \(z\) Between \(a\) and \(b\)
\(\Phi(z)\) \(1-\Phi(z)\) \(\Phi(b)-\Phi(a)\)

A cumulative normal table or software gives \(\Phi(z)\).

Read a standard normal cumulative table

For \(Z\sim N(0,1)\), each entry is \(\Phi(z)=P(Z\le z)\): the area to the left of \(z\).

Standard normal cumulative probability table for z from 0.00 to 1.59. Rows give units and tenths; columns add hundredths from 0.00 to 0.09. Row 1.0 and column 0.00 are highlighted, meeting at 0.8413.

Standard normal curve with area to the left of z equals 1.00 shaded orange. This cumulative probability is 0.8413.

Read \(z=1.00\):

Row 1.0 + column 0.00

\(\Phi(1.00)\approx\mathbf{0.8413}\).

Symmetry:

\(\Phi(-1)=1-\Phi(1)\approx0.1587\).

Table entries are rounded to four decimal places. Rows 0.0–1.5; the table continues on the next slide.

Use the table for our \(z=2\) example

The same cumulative table continues below. Row + column gives \(z\); the cell gives \(\Phi(z)\).

Standard normal cumulative probability table for z from 1.60 to 3.09. Row 2.0 and column 0.00 are highlighted, meeting at 0.9772. In row 2.0, column 0.03 gives 0.9788 for z equals 2.03.

Standard normal curve with area to the left of z equals 2.00 shaded orange. This cumulative probability is 0.9772; the right tail is unshaded.

Read \(z=2.00\):

Row 2.0 + column 0.00

\(\Phi(2.00)\approx\mathbf{0.9772}\).

\(z=2.03\): read 0.9788 in column 0.03.

Table entries are rounded to four decimal places. For a right-tail question, subtract the table entry from 1.

Forecast error: mark the event first

Suppose \(X\sim N(0,5^2)\) in £ thousands.

What is the chance that tomorrow’s forecast error exceeds £10,000?

Two normal curves shade matching right tails: errors above 10 thousand pounds on the original scale and z above 2 on the standard scale.

Translate the question: \(P(X>10)\), an upper-tail probability.

Forecast error: calculate and interpret

  1. Standardise the threshold: \(z=(10-0)/5=2\).
  2. Read the left area: \(\Phi(2)=0.9772\).
  3. Take the right tail:

\[P(X>10)=P(Z>2)=1-0.9772=0.0228.\]

Under the model, about 2.28% of days exceed this threshold.

Interval probability: subtract two left areas

For the same model, what proportion of errors lies between −£5,000 and £10,000?

Standard normal curve shades the area between z equals minus 1 and z equals 2, corresponding to errors between minus 5 and 10 thousand pounds.

\[P(-5<X<10)=P(-1<Z<2)=\Phi(2)-\Phi(-1).\] \[\approx0.97725-0.15866=0.81859\approx\mathbf{81.86\%}.\]

Percentile: work backwards from an area

What threshold is exceeded on only 5% of days under the error model?

Normal error curve shades 95 percent to the left of an unknown threshold c and 5 percent to its right.

Find \(c\) such that \(P(X\le c)=0.95\): the 95th percentile.

Percentile: return to the original units

  1. Find the standard-normal percentile: \(z_{0.95}=1.64485\).
  2. Undo standardisation: \(c=\mu+z_{0.95}\sigma\).
  3. Substitute the error-model parameters:

\[c=0+1.64485(5)=8.2243\text{ (£ thousands)}\approx\mathbf{£8,224}.\]

The model places 95% below this threshold and 5% above it.

Three Sigma Rule

A standard normal curve shades the intervals within one, two, and three standard deviations of the mean.

Interval Approximate probability
\(\mu\pm\sigma\) 68.27%
\(\mu\pm2\sigma\) 95.45%
\(\mu\pm3\sigma\) 99.73%

Choosing & Checking

Barclays: why model balances on a log scale?

Suppose Barclays is analysing customers’ positive account balances.

In this scenario, most balances are modest; a few are very large. This produces a long right tail.

Let \(X\) be the balance in £ thousands, so \(X>0\).

If \(\ln X\) is approximately normal, a log-normal model is a useful candidate for \(X\).

Illustrative Barclays scenario. Zero balances and overdrafts need separate treatment.

Barclays: the same balances on two scales

\(X\) is log-normal when \(\ln X\) is normal.

The illustrative Barclays positive-balance model has a long right tail; the natural log of the balance in thousands of pounds follows a symmetric normal curve.

Taking logs compresses large balances. Check whether the logged values look normal.

Illustrative Barclays model: \(\ln X\) has mean 1.5 and SD 0.8; \(X\) is the balance in £ thousands.

Barclays: log parameters, mean and median

For the same balance \(X\) in £ thousands, suppose \(\ln X\sim N(1.5,0.8^2)\).

Quantity Formula Value
Median balance \(e^\mu\) \(e^{1.5}=4.48\)
Mean balance \(e^{\mu+\sigma^2/2}\) \(e^{1.82}=6.17\)

The right tail pulls the mean (£6,172) above the median (£4,482).

Multiplication becomes addition on the log scale: \(\ln(AB)=\ln A+\ln B\).

Check the process, the shape and the decision

Candidate What to check in the data or design
Binomial / geometric Comparable trials, common \(p\), independence
Poisson Stable rate; counts and variability at the same exposure
Normal Rough symmetry, one peak, plausible tails and range
Log-normal Positive values; approximately normal natural logs

Check the part of the distribution that matters for the decision—especially a risk threshold or tail.

Poisson can approximate a rare-event count

Suppose 10,000 independent transactions each have fraud probability \(0.0003\) (0.03%). Let \(X\) count fraudulent transactions.

  • Each transaction is a fraud / no-fraud trial, so the total count is binomial.
  • Many transactions + rare frauds reproduce our Poisson short-slot construction.

\[X\sim\operatorname{Bin}(10{,}000,0.0003),\qquad \lambda=E(X)=np=3.\]

For large \(n\) and small \(p\), use \(Y\sim\operatorname{Pois}(3)\): 3 expected frauds per batch.

Event: no fraudulent transactions Probability
Exact binomial: \((1-0.0003)^{10{,}000}\) \(0.04976\)
Poisson approximation: \(e^{-3}\) \(0.04979\)

When can a normal curve approximate counts?

Suppose RBS receives 245 independent loan applications, each with a 25% chance of needing manual review. Let \(X\) count these reviews.

Many independent review/no-review outcomes can add up to a bell-shaped count.

Expected count Practical check: at least 10 of each type
Manual reviews: \(np\) \(245\times0.25=61.25\ge10\)
No manual review: \(n(1-p)\) \(245\times0.75=183.75\ge10\)

Match the binomial mean and variance:

\[Y\sim N\!\left(np,\ np(1-p)\right)=N(61.25,\ 45.9375).\]

Earlier fraud example: \(np=3<10\); it fails this check despite having 10,000 trials.

Continuity correction: give each count its width

Binomial bars for the number of RBS applications needing manual review, with n equals 245 and p equals 0.25, and an overlaid matching normal density. The event X at most 70 includes the full bar centred at 70, ending at 70.5.

Count event Matching continuous area
\(X\le70\) \(Y<70.5\)
\(X\ge70\) \(Y>69.5\)
\(X=70\) \(69.5<Y<70.5\)

Here \(X\) counts RBS manual reviews; each bar has width one.

Compare the approximation with the exact answer

RBS can handle 70 manual reviews among the 245 applications. For \(X\sim\operatorname{Bin}(245,0.25)\), find \(P(X\le70)\).

\[z=\frac{70.5-61.25}{\sqrt{45.9375}}=1.3648.\]

Method \(P(X\le70)\)
Exact binomial CDF \(0.9123\)
Normal, boundary at \(70\) \(0.9016\)
Normal, corrected boundary at \(70.5\) \(0.9138\)

The corrected estimate is 91.38% that 70 review slots are enough.

Relationships among common distributions

Relationship map of common probability distributions. Solid arrows show transformations and special cases; dashed arrows show limiting relationships. The map connects Bernoulli, binomial, Poisson, normal, log-normal and other distributions. The original caption credits an adaptation of Leemis (1986).

Open the diagram at full size · Solid arrows: transformations and special cases. Dashed arrows: limits.

Sampling Uncertainty

A new question: how stable is our estimate?

Let \(X_1, X_2, \ldots, X_n\) be a random sample from a population. For review times, \(X_i\) is the duration of review \(i\).

The sample mean combines the \(n\) observations:

\[\bar{X}=\frac{X_1+X_2+\cdots+X_n}{n}=\frac1n\sum_{i=1}^{n}X_i.\]

Population target: parameter Sample rule: estimator
Mean \(\mu\) Sample mean \(\bar X\)
Variance \(\sigma^2\) Sample variance \(s^2\)
Proportion \(p\) Sample proportion \(\hat p\)

Observed values \(x_1, x_2, \ldots, x_n\) give a numerical estimate, such as \(\bar{x}\).

From a stable target to sampling uncertainty

Recall Session 3: with independent trials and constant \(p\), the running proportion converges to \(p\).

View What varies? Question
Law of large numbers Length of a growing sequence Where does the running estimate settle?
Sampling distribution Which sample of a fixed size we observe How much do estimates vary across samples?

A stable target can still produce different estimates in repeated samples.

Repeated samples give different means

Imagine a population with review times 4, 8, 12 and 16 minutes, each equally likely.

Draw \(X_1\) and \(X_2\) independently with replacement. Their mean is \(\bar{X}=(X_1+X_2)/2\).

Observed sample \((x_1,x_2)\) Observed mean \(\bar x=(x_1+x_2)/2\)
\(4,4\) \((4+4)/2=4\)
\(4,12\) \((4+12)/2=8\)
\(8,16\) \((8+16)/2=12\)
\(16,16\) \((16+16)/2=16\)

Repeat this process: the distribution of \(\bar X\) is its sampling distribution.

Individual values and means have different distributions

Left: four equally likely individual review times, 4, 8, 12 and 16 minutes. Right: means of all 16 ordered samples of size two, with probabilities 1, 2, 3, 4, 3, 2, 1 divided by 16 at 4, 6, 8, 10, 12, 14 and 16 minutes.

Both distributions have mean 10 minutes. The sample means cluster more tightly.

For example, four ordered pairs give \(\bar X=10\), so \(P(\bar X=10)=4/16\).

Standard error is the SD of an estimator

Let \(X_1, X_2, \ldots, X_n\) be independent observations from the same population, with \(E(X_i)=\mu\) and \(\operatorname{Var}(X_i)=\sigma^2<\infty\).

For their sample mean \(\bar{X}=(X_1+X_2+\cdots+X_n)/n\):

\[E(\bar X)=\mu,\qquad \operatorname{Var}(\bar X)=\frac{\sigma^2}{n}, \qquad SE(\bar X)=\frac{\sigma}{\sqrt n}.\]

For the two-review example:

\[SE(\bar X)=\frac{\sqrt{20}}{\sqrt2}=\sqrt{10}\approx3.16\text{ minutes}.\]

The mean estimates the same target; averaging reduces its variability.

SD and SE answer different questions

Observation SD \(\sigma\) Standard error \(\sigma/\sqrt n\)
Describes variation in… Individual observations Sample means
For review times How different are individual times? How different are repeated sample averages?
Increase \(n\) for the same population Population SD stays the same SE decreases

To halve SE, multiply the sample size by four.

Sampling a large share of a finite population

For a simple random sample without replacement, from \(N\) records:

\[SE(\bar X)=\frac{\sigma}{\sqrt n}\sqrt{\frac{N-n}{N-1}}.\]

Sample Consequence
Small fraction, such as \(n/N\le0.05\) Correction is close to 1
Large fraction of the population Less uncertainty about that population mean
All \(N\) records No sampling uncertainty about that finite mean

Larger samples make the mean more stable

Illustrative right-skewed individual review times and distributions of their means for sample sizes 5 and 30. All are centred at 20 minutes, while the means become more concentrated and approximately bell-shaped. All panels use the same horizontal scale.

Each panel uses minutes on the same horizontal scale.

The individual distribution stays skewed; averages become tighter and more symmetric.

Illustrative exponential review-time model: mean = SD = 20 minutes. Orange: exact densities; green: normal approximations for sample means.

Central limit theorem

Let \(X_1, X_2, \ldots, X_n\) be independent observations from the same distribution, with \(E(X_i)=\mu\) and \(0<\operatorname{Var}(X_i)=\sigma^2<\infty\).

First form the sample mean:

\[\bar{X}=\frac{X_1+X_2+\cdots+X_n}{n}=\frac1n\sum_{i=1}^{n}X_i.\]

As \(n\to\infty\), standardise the sum or, equivalently, the mean:

\[Z_n=\frac{(X_1+X_2+\cdots+X_n)-n\mu}{\sigma\sqrt n} =\frac{\bar{X}-\mu}{\sigma/\sqrt n}\ \xrightarrow{d}\ N(0,1).\]

For sufficiently large \(n\): \(\displaystyle \bar{X}\ \text{approximately follows}\ N\!\left(\mu,\frac{\sigma^2}{n}\right)\).

Sampling distribution of \(\bar{X}\)

Read down each column: keep the population fixed and increase the sample size.

Three columns compare normal, exponential and uniform populations. The top row shows individual observations, the middle row means of two independent observations, and the bottom row means of thirty. Means from a normal population are exactly normal for every sample size. Exponential means remain right-skewed at n equals two and become closer to normal at thirty. Uniform means are triangular at two and close to normal at thirty. Orange curves are exact densities; dashed green curves are matched normal references. Horizontal scales change between rows to make shapes visible.

Different population shapes can give approximately normal sample means.

Orange: exact density. Dashed green: normal reference. Horizontal scales change between rows. Adapted from the original SOA Week 5 comparison.

When is the normal approximation useful?

For independent \(X_1, X_2, \ldots, X_n\) from the same population:

Population shape Rule for the distribution of \(\bar{X}\)
Normal Exactly normal for every \(n\), including small samples
Non-normal, with finite variance Approximately normal for sufficiently large \(n\); \(n\ge30\) is a starting guide
Strong skew or outliers May need \(n\ge50\) or far more; inspect the approximation

Use the population mean and the variance of the mean:

\[\bar{X}\ \text{is exactly or approximately}\ \mathcal{N}\!\left(\mu,\frac{\sigma^2}{n}\right).\]

30 and 50 are guides. Check the fit for the probability you need.

Real bank balances: inspect the approximation

Simulated means from real bank balances, standardised by their standard error, become closer to a normal reference as sample size increases from five to thirty to four hundred.

The CLT describes sample means. Individual balances keep their original skew.

6,000 samples with replacement at each size from UCI Bank Marketing, seed 202604. Green curve: standard normal density.

One day’s error or a 25-day average?

Return to daily settlement errors: \(X_i\sim N(0,5^2)\) in £ thousands.

Assume 25 independent days from the same model.

Which is more likely: one day’s error exceeds £2,000, or the 25-day average error exceeds £2,000?

Before calculating, identify the relevant spread:

  • Individual error: \(SD(X_i)=5\).
  • Average error: \(SE(\bar X)=5/\sqrt{25}=1\).

Same threshold, different uncertainty

Quantity Distribution Standardised threshold
One error \(X_i\) \(N(0,5^2)\) \(2/5=0.4\)
Average \(\bar X\) of 25 errors \(N(0,1^2)\) \(2/1=2\)

\[P(X_i>2)=1-\Phi(0.4)=0.3446.\] \[P(\bar X>2)=1-\Phi(2)=0.0228.\]

Identify the random quantity first: its SD or SE determines the calculation.

Separate customer variation from sampling uncertainty

For planning, suppose account balances have SD £3,000.

Random sample size 100 400
Standard error of the mean ? ?

Calculate both standard errors. Does a larger sample make individual balances less variable or less skewed?

Sampling exercise: interpret the answer

With population SD £3,000 and independent observations:

Sample size Standard error Individual balance SD
\(n=100\) \(3{,}000/\sqrt{100}=£300\) £3,000
\(n=400\) \(3{,}000/\sqrt{400}=£150\) £3,000

Four times as many observations halves the spread of repeated sample means.

The individual balance distribution keeps its original spread and shape.

What becomes approximately normal?

We draw independent samples from the same skewed balance distribution with finite variance. As sample size grows, what does the central limit theorem describe?

  1. Individual balances become symmetric
  2. The sampling distribution of the mean becomes approximately normal
  3. The largest balance becomes normal
  4. The sample mean equals the population mean every time

Session 4 takeaway

  • Match the model to the process and its assumptions.
  • Continuous probabilities are areas; standardise normal outcomes.
  • Standard error describes how estimates vary across samples.
  • The CLT concerns sample means, not the shape of the original data.

Next: express sampling uncertainty with confidence intervals and assess benchmark claims.