learn-bayesian-with-phoebe / Leader session 3 of 6
Learn Bayesian with Phoebe · Leader session 3 of 6

Borrowing strength

Northgate was flagged for closure on an observed redemption rate of 0.056, one voucher in eighteen. Session 2 showed what eighteen observations honestly support: an interval from 0.020 to 0.222, too wide to close anything or keep anything open. But Northgate is not alone. Halloway has eleven other outlets running the same voucher in the same month, and the question tonight is whether they are allowed to help. Treat each outlet alone and the twelve estimates miss the true rates by 0.054 on average. Treat them as one chain and the miss falls to 0.031. Let the eleven inform the twelfth, with the amount of trust learned from the data rather than asserted, and it falls to 0.025. Northgate's estimate under that third option is 0.124. It is still below the true 0.192, and it is the number that took the outlet off the closure list.

🔴 Hardest Whoever compares units of very different size Product, finance and analytics leads 45 min
0-3 · Welcome 3-20 · Three ways to treat twelve outlets 20-40 · Build-along: how much to trust one month 40-45 · Q&A
Part 0

Where tonight sits

Session 1 showed what an asserted prior costs: a belief worth a hundred pseudo-observations, centred on the chain-wide 0.12, was confidently wrong at Northgate. Session 2 took the belief away and showed what eighteen observations say alone: an honest interval too wide to act on. Tonight is the case in between, where the prior is neither asserted nor absent but learned from the other eleven outlets, and where how much it is allowed to pull is itself read off the data. Session 4 moves from estimating one rate to comparing two, the probability that B beats A and what it costs to be wrong. The example throughout is still Halloway Bakeries, twelve outlets, one voucher, one month, with every true rate known so every method can be scored.

Live = presented in the 45 minutes Self-study = the full depth, after class 🔍 Every diagram zooms

★ What you walk out with tonight. A three-rung ladder you can hold in your head: no pooling 0.054, complete pooling 0.031, partial pooling 0.025, root-mean-square error against the true rates. The mechanism behind the third rung, stated as a weight anyone can read: each outlet's own month counts n / (n + 116), which is 0.13 at Northgate and 0.89 at Westfield, and nobody chose 116, the data did. And the honest half that usually gets left off the slide: the method helped six outlets and hurt six, the helps were tenths and the hurts were thousandths, and Northgate is still under-estimated at 0.124 against 0.192.

LiveThree ways to treat twelve outlets4 min▶

Twelve outlets, twelve observed rates, one decision about how to read them. The first option is to treat each outlet alone: Northgate is 0.056, Westfield is 0.141, and the fact that they belong to the same chain is ignored. This is what the monthly pack does by default, and it scores 0.054. The second option is the opposite: treat the chain as one, give every outlet the grand rate of 0.141, and ignore the fact that outlets differ. It scores 0.031, better than the first, because most of the twelve observed rates are further from their own truth than the chain average is. That is a fact about small samples, not about the outlets.

The third option sits between them and is the subject of tonight. Each outlet's estimate is a blend of its own month and the chain, and the blend leans toward the chain for outlets with little data and toward the outlet's own month for outlets with a lot. It scores 0.025. The name for it is partial pooling, the eleven informing the twelfth, and its whole character is in one question: how much should one outlet's month be trusted? Under the first option the answer is completely; under the second, not at all; under the third, it depends on how big the month was and how different the outlets really are, and both of those can be measured.

Real world

Halloway's regional review ran on option one for six years without anyone naming it. Outlets were ranked by observed rate, the bottom two were reviewed, and the bottom two were almost always the smallest outlets, because the smallest outlets produce the most extreme numbers in both directions. Northgate, the best performer in the chain, sat in the review pile on 0.056. Nobody had asked how much one month at an eighteen-voucher outlet ought to be trusted.

Self-studyThe words that will keep coming back4 min▶
  • No pooling. Each outlet estimated from its own data alone. Twelve separate problems. RMSE 0.054 on the Halloway data.
  • Complete pooling. Every outlet given the chain-wide rate. One problem, twelve copies of the answer. RMSE 0.031.
  • Partial pooling. Each outlet blended with the chain, the blend set by its sample size and by how different the outlets are. RMSE 0.025.
  • Shrinkage. What partial pooling does to an estimate: pulls it from the observed rate toward the chain centre. Thin outlets are pulled a long way, thick ones barely.
  • mu. The centre the estimates are pulled toward. Learned from the twelve outlets: 0.135.
  • kappa. How hard they are pulled, expressed as a pseudo-count, the same currency as session 1. Learned from the twelve outlets: 116. An outlet's own month carries weight n / (n + 116).
  • Hierarchical model. The general name for a model in which the outlets are treated as draws from a chain-level distribution whose centre and spread are themselves estimated. Partial pooling is what it does for you; practitioner session 6 builds one.
  • RMSE. Root-mean-square error of the twelve estimates against the twelve true rates. The score every rung of the ladder is judged on, possible only because the truth was written into the data.
Part 1 · covers how the eleven inform the twelfth

Nobody set the weight. The data did.

10 min live

Every outlet's observed rate, every outlet's partially pooled estimate, and every outlet's true rate, on one axis. The arrows are the shrinkage: each estimate slides from what the outlet observed toward the chain centre of 0.135, and the length of the slide is set by the outlet's volume. Northgate slides a long way. Westfield does not visibly move.

Twelve outlets: observed rate against the partially pooled estimate. Every arrow points toward mu = 0.135. observed this month partially pooled true rate mu = 0.135, learned from the twelve Northgate · n = 18 0.124 vs truth 0.192 Riverside · n = 24 Old Quay · n = 31 Hillcrest · n = 40 Market Row · n = 55 Station · n = 70 Abbey Green · n = 95 Parkside · n = 140 Docklands · n = 210 Kingsway · n = 320 The Arcade · n = 540 unchanged to three decimals Westfield · n = 900 unchanged to three decimals 0.00 0.05 0.10 0.15 0.20 0.25 redemption rate Weight on the outlet's own month is n / (n + 116): 0.13 at Northgate, 0.89 at Westfield. Nobody set that; the data did.
🔍 Click to zoom - the long arrows are all on the thin outlets, and every one of them points toward its truth. The thick outlets did not move.
LiveHow partial pooling decides how much to pool4 min▶

Session 1 gave you the currency: a prior is worth a number of pseudo-observations, and an outlet's own data carry weight n over n plus that number. Tonight's method uses exactly that arithmetic, with one difference that changes everything. The prior's centre and its pseudo-count are not chosen by an analyst. They are learned from the twelve outlets themselves, by asking which chain-level centre and which spread of outlets around it make the twelve observed months most plausible. On the Halloway data the answer is a centre of mu = 0.135 and a pseudo-count of kappa = 116.

Every outlet then gets the same treatment. Its own month carries weight n / (n + 116); the chain centre carries the rest. At Northgate that is 18 / 134, which is 0.13: the outlet's own month is trusted thirteen percent, and the other eleven outlets supply the remaining eighty-seven. At Westfield it is 900 / 1016, which is 0.89: the flagship's own month is trusted almost entirely, because it has earned it. Nobody set 0.13 or 0.89. Nobody set 116. The question "how much should one outlet's month be trusted" was answered by measuring how much the outlets actually differ, and the same measurement would have produced a different answer on a different chain.

LiveNorthgate: flagged on 0.056, kept on 0.1243 min▶

Northgate's observed 0.056 carries weight 0.13; the chain centre of 0.135 carries 0.87; the blend is 0.124. Its error against the true 0.192 falls from 0.136 to 0.068. That is the number that took it off the closure list, and it is worth being precise about why. The method did not discover that Northgate is the best outlet in the chain. It could not: one redemption in eighteen does not contain that information, and 0.124 is still well below 0.192. What the method did was refuse to believe that an eighteen-voucher month could place an outlet at 0.056 when eleven neighbours running the same voucher sat around 0.135. It halved the error. It did not remove it.

That is the right way to describe what shrinkage buys a leader. It does not find the truth from thin data. It stops thin data from producing confident nonsense, by lending the thin outlet the chain's experience in proportion to how thin it is. Northgate stayed open not because the analysis proved it was good but because the analysis showed the case for closing it was made of noise.

Real world

The closure memo quoted 0.056 and a chain average of 0.141. The reply quoted 0.124 with the weight beside it: "Northgate's own month is worth 13 percent of this estimate; the other 87 percent is what the chain does. To close on the 0.056 you would have to argue that an eighteen-voucher month deserves more trust than the eleven outlets that produced 0.135." Nobody argued it.

Self-studyA prior that was learned, and the price it still paid3 min▶

Put tonight's learned prior next to session 1's asserted one. The asserted prior was Beta(12, 88): centre 0.120, worth 100 pseudo-observations, and it put Northgate at 0.110 with an interval that missed. The learned prior has centre 0.135 and is worth 116 pseudo-observations, a similar strength and a slightly higher centre, and it puts Northgate at 0.124. The difference between them is not mainly in the numbers. It is in where the numbers came from. The asserted 100 was a feeling about the chain's history; the learned 116 is a measurement of how much the twelve outlets differ from each other this month, and it would fall if they differed more.

And the learned prior still paid session 1's price at Northgate. Northgate really is unlike the chain, the one outlet whose truth sits far above the centre, and a prior worth 116 pseudo-observations pulled it toward the crowd anyway. The estimate of 0.124 is better than 0.056 and worse than the truth by 0.068. There is no version of borrowing strength that is free for the outlet that genuinely differs; the method's virtue is that it charges the thin outlets a fee proportional to their thinness and charges the thick ones almost nothing, and that the fee is set by the data rather than by whoever built the slide. Session 5 takes up the argument about whether a prior should be learned this way at all, and does not settle it.

Part 2 · covers the ladder, the other two worlds and the honest half

Helped six, hurt six, and adapts to the world it is in

7 min live

A method that pulls every estimate toward the middle should worry you. If the outlets really were identical, pulling toward the middle would be exactly right; if they were wildly different, it would be a disaster. So the same three methods were run in two more worlds built from the same twelve outlets, one where the true rates are identical and one where they are wildly spread, and scored against the truth in each. The bars below are the result. Partial pooling is the only method that is good in all three worlds, and the reason is that it read how different the outlets were before deciding how much to pool.

Root-mean-square error against the true rates, three worlds. Lower is better. no pooling complete pooling partial 0.054 0.031 0.025 0.034 0.0065 0.0051 0.033 0.145 0.030 Real spread, the Halloway data learns kappa = 116, pools by volume Outlets truly identical learns to pool almost completely Outlets wildly different learns kappa = 3.6, barely pools
🔍 Click to zoom - the dark bar is never the tallest. The middle bar is the shortest in one world and the tallest by far in another.
LiveThe honest half: six helped, six hurt4 min▶

A ladder score of 0.025 against 0.054 is an average, and averages hide who paid. Outlet by outlet, partial pooling made six estimates better and six worse. The helps were large and landed on the thin outlets: Northgate's error fell from 0.136 to 0.068, Hillcrest's from 0.088 to 0.021, Old Quay's from 0.058 to 0.023. The hurts were small and landed on the thick ones: Market Row's error rose from 0.000 to 0.007, Parkside's from 0.002 to 0.008, Docklands' from 0.007 to 0.009, and The Arcade and Westfield did not change to three decimals. Shrinkage buys tenths on the outlets that need it and costs thousandths on the ones that do not.

Say both halves. A slide that shows only the six helps is selling something; a manager who has only heard about the six hurts will veto the method and be wrong to. The trade is asymmetric in a way that favours the chain as a whole, and it is asymmetric for a reason you can explain: the thick outlets barely moved because the method trusted their own months, at weights near 0.89, and the thin ones moved a lot because the method did not trust theirs, at weights near 0.13. The hurts are the price of the trust; the helps are the price of the doubt. Northgate, the biggest winner, is still under-estimated at 0.124 against 0.192.

LiveAdaptive: it pools hard when it should and barely when it should not3 min▶

In the world where the twelve outlets are truly identical, complete pooling is the right answer by construction, and it scores 0.0065. Partial pooling learns that the outlets are the same, pushes its pseudo-count to the ceiling of what it was allowed to consider, pools almost completely, and scores 0.0051, a hair better still. In the world where the outlets are wildly different, complete pooling is the wrong answer by construction and collapses to 0.145, five times worse than doing nothing. Partial pooling learns a pseudo-count of 3.6, barely pools at all, and scores 0.030, level with treating each outlet alone.

That is the property a leader is buying. It is not that partial pooling is the best method in every world; in the identical world complete pooling is nearly as good, and in the wild world no pooling is. It is that partial pooling is never the wrong method, because it asks the data how alike the units are before deciding how much to borrow. The analyst who chooses complete pooling is asserting that the outlets are alike; the one who chooses no pooling is asserting that they are not; the one who chooses partial pooling is declining to assert either and measuring instead.

Self-study"My number moved": the manager's objection, answered honestly3 min▶

The objection will come from the thick outlets, and it deserves a straight answer rather than a lecture. Yes, the number moved. At Market Row the error went from 0.000 to 0.007; at Parkside from 0.002 to 0.008; at Docklands from 0.007 to 0.009. Those are the movements. Now put them beside what session 2 showed about the same outlets: Westfield's own 89 percent interval, at 900 vouchers, was 0.037 wide, and Westfield did not move to three decimals. At a big outlet the estimate moved by less than the noise already in it, and the manager's month was never known to the precision the movement disturbs.

The honest version of the answer has three parts. The number moved by a few thousandths, which is less than the month-to-month noise at your volume. It moved because your outlet's month was trusted at nearly full weight, 0.89 at the flagship, and lent a little of its stability to outlets that had none. And in return, the outlets you are compared against are no longer swinging by tenths on eighteen vouchers, which makes the ranking you are judged on fairer to you as well. Nobody's number is now a fiction; every number now says how much it can be trusted. What that does to a monthly review is session 6's subject, and what it does to a comparison between two arms is session 4's.

Part 3 · build-along

How much should one unit's month be trusted?

20 min build-along

No laptop. Bring the neighbours you found for homework: the outlets, regions, products or cohorts measured the same way at the same time as the number you have been carrying since session 1, with their counts. The build-along works out, in words and one fraction, how much each unit's own month ought to be trusted, and ends with the reply you would send to a memo that ranks them.

Name the family. Which units were measured the same way in the same period and could reasonably be expected to resemble each other? Halloway: twelve outlets, one voucher, one month. If the honest answer is "none", you are in session 2's world and the interval is all you have.

Rank them by count, not by rate. Write the sample size next to each. Eighteen at one end, nine hundred at the other. The point of the exercise is to notice that the ranking by rate and the ranking by count are two different lists and only one of them is about performance.

Ask how alike the units are. Not in your opinion; in their numbers. Do the well-measured units, the ones with big counts, sit close together or far apart? Close together says pool hard. Far apart says pool little. On the Halloway data the answer was "fairly alike", and the data turned it into a pseudo-count of 116.

Write each unit's weight. Count over count plus the pseudo-count. Northgate 18 / 134 is 0.13; Westfield 900 / 1016 is 0.89. Say each one aloud as "this unit's own month is trusted this much". If a weight surprises you, it is because you had been trusting a tiny sample completely.

Find the six and the six. Which units will move a lot, and which barely? The thin ones move; the thick ones do not. Write down, before anyone runs anything, who will object and what the honest answer to them is: moved by less than the noise, in exchange for a fairer ranking.

Draft the reply to the ranking memo. "The bottom two are the two smallest units. At their counts a single month carries weight [w]; the rest of the estimate is what the family does. Before acting, here are the pooled estimates and the weights beside them." Northgate's version of that reply is the one that kept it open.

The question that changes the meeting. "How much should one month at that outlet be trusted?" It moves the argument from what the outlet did, which eighteen vouchers cannot settle, to how much eighteen vouchers can settle anything, which is a question with a measurable answer. At Northgate the answer was thirteen percent, and the closure case did not survive it.

Check yourself

Three questions

Twelve outlets, three ways to estimate their rates, scored against the known truth. Which is the measured ladder?

Root-mean-square error against the true rates falls down the ladder. Complete pooling beats no pooling because most small outlets' observed rates are further from their own truth than the chain centre is; partial pooling beats both because it trusts each outlet's month in proportion to its volume.

Under partial pooling, Northgate's own month carries weight 0.13 and Westfield's carries 0.89. Who decided those weights?

Nobody set 116. It is a measurement of how much the twelve outlets actually differ this month, and it would be different on a different chain: at the ceiling when the outlets are identical, 3.6 when they are wildly different. The weights follow from it and from each outlet's count, and from nothing else.

A manager at a large outlet objects that partial pooling moved their number. What is the honest reply?

Market Row's error went from 0.000 to 0.007, Parkside's from 0.002 to 0.008, Docklands' from 0.007 to 0.009. Westfield's 89 percent interval alone is 0.037 wide. The hurts are real and small and land on the well-measured outlets; the helps are large and land on the thin ones. Denying the hurts is as dishonest as hiding the helps.

Homework

Before session 4

30 min

Find one comparison your area is about to make between two versions of something: two designs, two offers, two processes, two regions. Write down what "B is better than A" would be worth to you if it were true, and what acting on it would cost if it were false. Bring both. Session 4 moves from estimating one rate to comparing two: the probability that B beats A, the expected cost of choosing wrongly, and the measured case at Westfield where a probability of 0.915 was not enough to stop, because a probability alone is not a decision. A probability times a stake is.

Sources covered

What tonight maps to

✓ The pooling ladder, scored against a known truth No pooling 0.054, complete pooling 0.031, partial pooling 0.025, root-mean-square error of twelve estimates against twelve true rates. Statistical Rethinking's "Multilevel Models" and "Multilevel Adventures" lectures, kept to the one ladder a leader needs.
✓ How much to pool, learned rather than asserted The method learns mu = 0.135 and kappa = 116 from the twelve outlets; each outlet's month carries weight n / (n + 116), 0.13 at Northgate and 0.89 at Westfield. Kappa is a pseudo-count, session 1's currency, but measured.
✓ Adaptiveness across three worlds Identical outlets: partial pooling 0.0051 against complete pooling 0.0065. Wildly different outlets: partial pooling 0.030 while complete pooling collapses to 0.145 and kappa falls to 3.6.
✓ The honest half: helped six, hurt six Helps by tenths on thin outlets (Northgate 0.136 to 0.068, Hillcrest 0.088 to 0.021, Old Quay 0.058 to 0.023); hurts by thousandths on thick ones (Market Row 0.000 to 0.007, Parkside 0.002 to 0.008, Docklands 0.007 to 0.009; The Arcade and Westfield unchanged). Northgate still under-estimated at 0.124 against 0.192.
◐ Building the hierarchical model and reading its diagnostics Practitioner session 6, with the bench live in session 10. Tonight is the ladder, the weight and the honest half; the model that produces them is built there. Also the session that learn-ai-sports-with-phoebe b3 points at when it names hierarchical pooling of player effects.
◐ Whether a prior should be learned this way at all Session 5, taught as the unsettled argument it is: subjective, reference and weakly-informative positions, and Gelman, Simpson and Betancourt's resolution. Tonight shows the learned prior working and the price it still paid at Northgate; it does not declare the argument won.
· Whether the outlets should be compared at all, and what caused the differences Not covered by design. Nothing tonight is causal; why Northgate's true rate is 0.192 and Old Quay's is 0.090 is learn-causal-inference-with-phoebe's territory. Tonight estimates the rates; it does not explain them.
· Frequentist estimation of the same twelve rates Not covered by design. learn-statistics-with-phoebe owns estimation and its intervals from the frequentist side; tonight's estimates are posterior means and the ladder is scored on them alone.

Session 3 cheat sheet

The ladder: 0.054, 0.031, 0.025No pooling, complete pooling, partial pooling. RMSE against the true rates. Lower is better.
The questionNot "what did this outlet do" but "how much should one outlet's month be trusted". That number can be learned.
mu = 0.135, kappa = 116Learned from the twelve. Each outlet's month carries n / (n + 116): 0.13 at Northgate, 0.89 at Westfield.
Northgate: 0.056 to 0.124, truth 0.192Error halved, 0.136 to 0.068, not removed. The 0.124 is what kept it open.
Helped six, hurt sixTenths on the thin outlets, thousandths on the thick ones. Say both halves.
Adaptive, not always bestIdentical world 0.0051 vs 0.0065. Wild world 0.030 while complete pooling collapses to 0.145.
"My number moved"By thousandths, less than the noise at that volume. Westfield did not move to three decimals.
The meeting question"How much should one month at that outlet be trusted?" At Northgate: thirteen percent.