Act II · The Mathematical Toolkit
Part 4 of 43Martingales and Measure
Can any betting system beat a fair game, and what exactly does 'fair' mean once you may stop when you like?
The part builds the language of information (filtrations, conditional expectation as a projection) in order to state one theorem: a bounded strategy on a martingale is a martingale. Doubling seems to beat it and does not; Barings in 1995 is doubling with a bank's balance sheet. Then the idea that carries all of derivatives pricing: a change of measure re-weights the same paths so that a different process becomes the fair game. The last chapters turn the theorem around and use betting as a statistical test that can be checked at any time.
What you need. A first probability course. Measure theory is introduced as needed, not assumed.
What you will be able to do
Undergraduate
- Explain why no betting system changes the expected value of a fair game, and where doubling hides its loss.
- Solve gambler's ruin for a fair and an unfair walk.
Master's
- Use conditional expectation, stopping times and the optional stopping theorem, and state when it fails.
- Change measure with a likelihood ratio and compute an expectation under either measure.
PhD
- Prove Doob's convergence theorem by upcrossings; state Radon-Nikodym and Kakutani's dichotomy; derive the law of the iterated logarithm and a time-uniform boundary from Ville's inequality.
Industry
- Recognize a doubling strategy in a trading record, and build an e-value monitor for a live strategy.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 15 min · Master's 47 min · PhD 64 min · Industry 22 min.
- 0Can you beat a fair game?Undergraduate2 min
- 1Information: σ-algebras and filtrationsMaster's3 min
- 2Conditional expectation is a projectionMaster's3 min
- 3Martingales: Ville's fair gamesUndergraduate3 min
- 4You can't beat the systemUndergraduate3 min
- 5Stopping times, and the walk that always winsMaster's3 min
- 6Optional stopping, provedMaster's3 min
- 7Doubling and admissible strategiesUndergraduate2 min
- 8Doubling down: Barings, 1995Industry2 min
- 9Gambler's ruin and bold playUndergraduate3 min
- 10Martingales convergePhD3 min
- 11Doob's decompositionMaster's3 min
- 12Change of measureMaster's4 min
- 13Radon–Nikodym, and the singular infinitePhD3 min
- 14Heavy tails as stable lawsPhD3 min
- 15Ville's inequality and testing by bettingMaster's3 min
- 16Learning to betMaster's3 min
- 17The house, the book and the marketIndustry4 min
- 18Frontier: anytime-valid inference, 2023–2026PhD2 min
- For the researcher: how far can a fair walk wander?PhD5 min
- Recap, desk questions, problemsAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Can you beat a fair game?Undergraduate2 min
The first act asked whether prices are a fair game. This act builds the mathematics that makes the question precise, and its first tool is the oldest idea in gambling: a fair bet.
Here is a historical betting score using yesterday's sign and transformed American market returns. A calibrated nonnegative test martingale has at most a five-percent chance of ever reaching twenty. This score uses estimated centering, clipping and a retrospective scale initialization; chapter fifteen checks why those choices matter. It crossed twenty in February 1929 and eventually reached roughly ten to the hundredth. Start the same gambler in 2000, and the wealth wanders and never reaches twenty. The contrast motivates testing by betting. By the end you will know when its anytime guarantee applies, and when a historical score alone does not supply it.
The question is older than the stock market. In 1654 Blaise Pascal was asked how to split the stakes of a game stopped early: first to three points wins sixty-four pistoles, and A leads two to one. Reason backwards. If A wins the next point, A takes sixty-four. If B wins it, the next point decides, so that position is worth thirty-two. Averaging, A's fair share is forty-eight; from two to nothing, it is fifty-six. The fair value of an unfinished game is its expected payout given what has happened: a conditional expectation. Point by point, those values form a martingale.
From Pascal the idea runs through de Moivre's gambler's ruin and Bachelier's fair prices. Kolmogorov gave probability its axioms in 1933, Ville named the martingale in 1939, Wald tested sequentially, and Doob wrote the theory. Samuelson, Harrison and Pliska made prices martingales. Barings showed what doubling does to a bank, and Shafer, Vovk and Ramdas turned Ville's betting into tests valid at any time.
The plan, in eighteen chapters: information and projection; martingales and why no system beats them; stopping, doubling and Barings; ruin and convergence; Doob, the change of measure and Radon-Nikodym; stable laws; testing and learning to bet; and the industry and the frontier.
In the House, this part adds a monitor to the data desk: an e-process for a specified bounded-outcome model over time, with a false-alarm guarantee when its null is correctly calibrated. The research desk will inherit it, when it starts testing hundreds of ideas at once.
1Information: σ-algebras and filtrationsMaster's3 min
Probability in finance is about information: what you know, and when. Toss a coin three times. There are eight possible worlds, and X counts the heads in each. Before any toss you cannot tell the worlds apart: they all sit in one block. Your best guess of X is its average, one and a half, in every world. After the first toss, the worlds split in two. If it was heads, the best guess is two; if tails, one. After the second toss, four blocks, and four guesses. After the third, you know X exactly. The growing sequence of partitions is called a filtration: the questions you can answer at each time. And the best guess on each block, the average over the worlds you can't yet tell apart, is the conditional expectation of X given what you know. Watch the guess: it moves only when information arrives, and on average it doesn't move at all.
Make that precise. A sigma-algebra contains the whole space and is closed under complements and countable unions. In this finite example, questions combine with not, and, and or. After n tosses the answerable events are exactly the unions of the blocks: each block is either in or out, so there are two to the power two to the n of them. Two before any toss, four after one, sixteen after two, two hundred and fifty-six after three. A random variable is measurable with respect to that information when you can compute it from what you know, which on a partition means it is constant on every block. The first toss's outcome passes: its bars are flat on each half. The number of heads fails: inside each block it still varies. A process whose value at every time is measurable at that time is called adapted; prices are adapted to the market's information, and a strategy's wealth must be too; the stake for the next toss must already be known before that toss. Check yourself: is the event that the first two tosses hold an even number of heads in F one? No. It needs the second toss, so it lives in F two.
What about infinitely many tosses? Here is the trick that makes probability on them concrete: write the sequence of tosses as the binary digits of a number between zero and one, heads as one and tails as zero. Fair tosses become length on the interval. Somewhere on this bar is the true world, the gold dot, and you don't know where. Each toss halves the block that holds it. Zoom in and keep tossing: after six tosses you know which of sixty-four slivers you are in, and nothing more. That sliver is your information, F six. In 1933 Andrei Kolmogorov built all of probability on this picture: a set of worlds, a sigma-algebra of events, and a measure that adds up over countably many pieces. Chapter thirteen reuses this grid to build the Radon-Nikodym derivative. With information defined, we can ask for the best forecast given it. Next.
2Conditional expectation is a projectionMaster's3 min
What is the best forecast of tomorrow's return, given today's? Kolmogorov's definition answers it. Y is the conditional expectation of X given G if Y can be computed from G and has the same average as X on every event of G. On a partition, apply it block by block: Y is the average of X over each positive-probability block. For square-integrable variables, the error, X minus Y, is orthogonal to every square-integrable variable computable from G: true for indicators by the definition, so for their sums and limits. Expand the squared distance from X to any computable Z, and the cross term vanishes: Pythagoras. So Y is the closest computable variable, the best forecast in mean square. What is known comes out as a constant. Conditioning on more and then on less is conditioning on less: the tower property. A convex function of a forecast is below the forecast of the convex function, Jensen's inequality; and independent information teaches nothing.
Here is that Pythagoras theorem as a picture. Three worlds with probabilities a half, three tenths and a fifth; a variable is an arrow, each coordinate stretched by the square root of its probability, so length is root mean square. If you can only tell whether the world is c, what you can compute is a plane. Drop a perpendicular from X: the foot, one point eight seven five, one point eight seven five, and one, is the conditional expectation. Turn the picture: a true right angle. Knowing nothing, you can compute only constants, a line. Project the foot onto it, or X directly: both land on . The tower property, as geometry.
Now the market. Let the information be one bit: was yesterday up or down? Estimate the two conditional means by retrospective group averages within each era; these are not out-of-sample forecasts. From 1926 to 1974: basis points after an up day, after a down day. Yesterday's sign was today's sign, on average. From 1975 to 1999, the same pattern, against . Since 2000 it has turned around: after an up day and after a down day. The white bars are how far each number moves when we resample twenty-day blocks: This is the hook's historical structure, viewed as a projection.
In the House this is five lines: average X over each block, weighted by probability, and give every world its block's average. On the three worlds it returns the foot of the perpendicular; on the market since 2000, with the sign of yesterday as the partition, it returns the two numbers we just drew. Regression in Part six is this same function with a richer partition. So, since 2000, after a down day, is the best forecast of today's return up, down or zero? , by basis points. A forecast that the past cannot improve is exactly what defines a fair game. Next: martingales.
3Martingales: Ville's fair gamesUndergraduate3 min
A martingale is a process whose best forecast of tomorrow is today. It is known at each time, it has a finite mean, and its conditional expectation one step ahead equals its current value. It is the mathematical form of a fair game. The name comes from Jean Ville's thesis of 1939, which borrowed it from the most famous betting system, the martingale, in which you double your stake after every loss. Joseph Doob read Ville and built the theory. Examples: a gambler's wealth in a fair game. The square of a random walk minus the number of steps. And, from the previous chapter, the conditional expectation of any integrable variable as information arrives: Doob's martingale.
Fair, unfavourable and favourable games have names. If tomorrow's forecast is at most today, a supermartingale: the gambler's wealth at a casino. If at least, a submartingale. Three examples, each proved in a line. For a fair walk, expand the square of the next position: the cross term averages to zero and the new step squared is one, so the walk squared minus the number of steps is a martingale. The exponential of theta times the walk grows on average by the hyperbolic cosine of theta per step, the moment generating function of a plus or minus one step; dividing by it gives the exponential martingale, which chapter five uses to time the walk. The forecast of anything, refined as information arrives, is a martingale by the tower property. And Jensen's inequality turns a convex function of a martingale into a submartingale when the transformed values remain integrable.
Here is a Doob martingale you can watch. Two players toss a fair coin twenty-one times, and heads wins if it comes up eleven times or more. After each toss, compute the chance that heads wins, given the tosses so far. Each line is one match. Every forecast starts at fifty percent, jumps with each toss, more sharply as the end approaches, and finishes at zero or one. Yet on average it never moves: today's forecast is the average of tomorrow's. A betting market's price behaves like this, and so, under the right measure, does an option's probability of finishing in the money.
That last fact has a price. A call on the walk struck at two pays a convex function, so its value can only rise with time. Watch it grow to after fifty steps, simulated walks landing on the exact curve. This is one martingale, one fixed strike and no discounting. Calendar constraints for market calls need consistent forwards and discount factors. Is the absolute value of the walk a martingale? No, a submartingale; its mean grows like the square root of two n over pi, at fifty. And Markov is not martingale: Markov is about memory, martingale about the mean. If the coin is fair, can a clever betting system make it unfair? Next.
4You can't beat the systemUndergraduate3 min
A betting system decides each stake from what has happened so far. Call the stake H. The gambler's wealth is the sum of stake times step: the martingale transform, with one rule, that the stake is fixed before the step is seen. Then, taking out what is known, the expected next gain is the stake times the expected next step, which is zero. The transform of a martingale is a martingale: no system turns a fair game favourable. On a roulette wheel each unit on red loses one thirty-seventh on average, so every system loses one thirty-seventh of what it stakes: the same tax per unit. A cheat who could stake after seeing the outcome would win every round. The whole theorem is the word before.
Here is the rule as a machine. Twelve fair tosses lie behind a curtain, and before each the doubling system sets its stake. Only then is the card turned and the wealth steps. Each step is a stake known in advance times a fair coin, and fair coins average out.
Now six famous systems on European roulette, all betting red. Flat betting. Doubling. D'Alembert, one unit more after a loss and one less after a win. Labouchère, which crosses numbers off a written line. Fibonacci. And Oscar's grind, which tries to win one unit per series. Each panel plays one session of two hundred spins, while the number under it is the loss divided by the amount staked, accumulated over twenty thousand sessions. The paths could not look more different: steady drifts, long climbs, sudden cliffs. The numbers all settle on the same value: minus one thirty-seventh, two point seven percent of everything staked.
The ledger. The systems differ in how much they stake and in the shape of their results. Doubling and Fibonacci win most sessions, and pay for it with rare large losses: their skew is strongly negative. But divide the loss by the amount staked, and , So, which loses more per unit staked, Labouchère or flat betting? Neither. Labouchère stakes far more and so loses more in total, while winning more of its sessions: a pleasant evening, most nights, paid for on the others.
In the House the transform is one line, and each system is a function from past outcomes to the next stake. On the twelve tosses it reproduces the curtain. Chapter sixteen turns this line into a test. Changing the stakes fails. What about choosing when to stop?
5Stopping times, and the walk that always winsMaster's3 min
Optional stopping needs a precise notion of when to stop. A stopping time decides whether to stop now using only what has happened up to now. A fair walk runs toward a curtain that hides the future. Rule A rings the first time the walk reaches plus one, the moment it happens. Rule B rings at the highest point of the first hundred steps. Pull back the curtain: to know this was the top, it needed the whole path ahead. Rule B is not a stopping time. The first time a target is hit, a fixed date, the first time wealth doubles: allowed. The peak, the last visit to zero, the day before a crash: forbidden, however tempting.
Two facts, with proofs. First, stopping a martingale leaves it a martingale: the stopped walk is the transform of chapter four with stake one until the stopping time and zero after. Whether you are still playing at step k is decided by step k minus one, so the stake is predictable. Second, a paradox. Let tau be the first time a fair walk reaches plus one. By the reflection principle, the chance it has not arrived after n steps is the chance the walk sits at zero or one, about the square root of two over pi n. So it arrives with probability one, but those chances fall so slowly that the expected time is infinite. Wald's identity proves it in a line: a finite expected time would make the expected position zero, but the position at tau is one. Stopping the exponential martingale gives tau's whole law through its generating function, and its slope at one, the mean, is infinite.
Here are walks, each frozen with a gold dot the moment it first reaches plus one. The counter climbs fast at first, then more and more slowly: a few walks wander deep below zero and take a very long time to come back. On log scales the chance of still waiting falls on a line of slope minus a half: ten thousand walks, followed to a hundred thousand steps, land on the exact curve. And the average waiting time never settles. Capped at a hundred steps it is ; at a thousand, ; at ten thousand, ; at a hundred thousand, . It grows like the square root of the cap, without limit. So: after a hundred fair steps, what fraction of walks has not yet been up one? About percent. The walk that always wins can make you wait longer than any bankroll. So when exactly does stopping fail to help? Next: the theorem, with its proof.
6Optional stopping, provedMaster's3 min
Now the theorem, with its proof. A martingale stopped at a finite stopping time keeps its starting mean if you stop by a fixed date, or the stopped process stays bounded, or the expected time is finite and each step is bounded. The proof is four lines. At every fixed n the stopped martingale has mean M zero: chapter five. As n grows, the stopped path freezes at its value at tau. Each hypothesis gives one integrable bound on the whole stopped path: a constant, or the start plus c times tau. So dominated convergence passes the limit inside the expectation. Without a bound it fails: the walk stopped at plus one has mean zero at every finite n, but at tau it is always one. Uniform integrability says no mass escapes to infinity. Here it does.
Watch the mass escape. These are the positions of ten thousand stopped walks at step n. Gold is the spike at plus one, the walks that have already won; red is the rest, still below zero. A fulcrum sits at the mean. As n grows, the gold spike swallows almost everything, while a thin red tail slides further and further to the left. The population mean stays zero; the displayed sample mean fluctuates. The leftmost bin retains the off-screen tail, and the readout uses unclipped positions. In the almost-sure limit the walk is at one, whose expectation is one. The expectations before the limit stay zero. That failure to interchange limit and expectation is uniform integrability failing, and it is the loophole the doubling system lives in.
Optional stopping also computes, by Bob Li's trick of 1980. How long until two heads in a row? Before every toss a new gambler bets a dollar on heads at fair odds, and lets winnings ride on heads again. When heads, heads appears, gambler four holds four dollars and gambler five holds two. Independent pairs have a one-in-four chance of HH, giving a geometric tail and finite expected waiting time. Now bounded-step optional stopping balances the casino's takings, one dollar a toss, against its payout of six: six tosses on average.
In general, the same argument gives a formula for any pattern: add up m to the k for every k where the pattern's first k letters equal its last k. Heads heads: two plus four, six. Heads tails: only the whole pattern overlaps itself, four. Heads tails heads: ten. Three heads: fourteen. Two hundred thousand simulated sequences agree, within sampling error. A monkey typing ABRACADABRA on a twenty-six key typewriter needs about thousand trillion keystrokes, an exercise from Williams. The overlaps also decide Penney's game: if you choose heads, heads, tails and I choose tails, heads, heads, I win percent of the time. So which takes longer to appear, heads heads or heads tails? Heads heads, six against four, though each has the same chance in any two tosses: heads heads overlaps itself, so its near-misses waste time. The theorem needs conditions. Next: the strategy that breaks them, doubling.
7Doubling and admissible strategiesUndergraduate2 min
The doubling system is the original martingale: bet one, and double the bet after every loss, until the first win. With unlimited credit you stop at the first win, after two tosses on average, always exactly one unit up. The theorem is not broken. The bets one, two, four, eight grow without limit, and so do the losses you carry before the win, so none of its three conditions holds. Give the gambler a real bankroll, a thousand and twenty-three units, enough for ten doublings. Now a thousand and twenty-three sessions in a thousand and twenty-four win one unit, and one loses everything. The expected gain is exactly zero. Each session ruins with probability one in a thousand and twenty-four, so the wait for the first ruin is geometric, with mean one thousand and twenty-four sessions, and the units won along the way are lost at once.
Watch a thousand doublers, each with a bankroll of a thousand and twenty-three, refilled whenever it is lost. Eighty are drawn. Gold staircases climb one unit per session. Then, at random moments, one turns into a red cliff, a thousand and twenty-three units straight down. The median doubler climbs happily for a long time; the mean stays near zero throughout, because the cliffs pay for every step. After three thousand sessions, percent have been ruined at least once, as the formula predicts, and the average result is , within sampling error of zero. With a bankroll of a thousand and twenty-three, how many sessions until the first ruin? On average a thousand and twenty-four; simulated, .
In idealized continuous-time models allowing infinitely many bets before a deadline, unlimited credit permits doubling constructions. Finance restricts admissible strategies: discounted wealth never falls below some fixed floor. Michael Harrison and Stanley Pliska showed in 1981 that when prices are martingales under an equivalent measure, admissible strategies cannot make something from nothing: their wealth is a supermartingale. Philip Dybvig and Chi-fu Huang showed in 1988 that this credit limit is exactly what rules out doubling; the proof belongs to Part nine. And remember the shape: selling options earns small premiums most days and pays a rare large loss. The staircase and the cliff. One trader tried doubling with a bank's money. Next: Barings.
8Doubling down: Barings, 1995Industry2 min
In February 1995 escalating derivatives exposures and concealed losses broke a bank. Barings, founded in 1762, failed after a single trader in Singapore, Nick Leeson, lost about eight hundred and thirty million pounds, more than twice the bank's capital. For about two and a half years he had hidden his losses in an error account numbered eight eight eight eight eight. The Dutch bank ING bought what was left for one pound. Leeson was arrested in Frankfurt and sentenced in Singapore to six and a half years in prison.
Here is the Nikkei through those months. Leeson was long Nikkei futures, and had sold options that paid him as long as the index stayed calm. On the seventeenth of January an earthquake struck Kobe. Within a week the index had fallen percent. Leeson increased exposure while seeking to recover losses. This resembles doubling, but his actual futures and options book was not the binary rule shown next. On the twenty-sixth of February Barings failed, and the next day the Nikkei fell again.
We do not have Leeson's book, so here is a schematic instead, labelled as one: a simple doubling rule run on the real index. Hold one unit of the Nikkei; after every down day, double it; once the account is back at its high, go back to one unit. Against it, a bank with a stated capital. Through the autumn the rule wins small amounts, again and again. Then Kobe. The position doubles day after day, to units, and
So the lesson is not that optional stopping failed. A bank's controls exist to enforce its hypotheses. Position limits keep the bets bounded. Funding margin only against positions that are reported keeps the bankroll bounded. And separating the people who trade from the people who settle the trades makes the losses visible. In Singapore, Leeson ran both the trading and the back office. The inquiry's summary put it plainly: clear segregation of duties is fundamental to any effective control system. Leeson's limit was his bank's capital. Every gambler has one. Next: the arithmetic of ruin.
9Gambler's ruin and bold playUndergraduate3 min
Optional stopping solves the oldest problem in probability in one line. A gambler starts with a units in a fair unit-step game and stops on reaching b or going broke. The stopped wealth stays between zero and b, and exit is almost surely finite, so optional stopping applies. At the end the wealth is either b or zero. So the chance of reaching b first is a over b. If the game is biased, with win probability p, the trick, due to de Moivre, is to find a different martingale: q over p raised to the power of the wealth. The same argument gives the general formula.
How long does it take? Use chapter three's other martingale, the walk squared minus the steps, started at zero between barriers at minus a and b minus a. Its expected value at the end is zero. The walk ends at one barrier or the other, with the probabilities we found. So the expected number of bets is a times b minus a: from fifty, aiming for a hundred, two thousand five hundred. Sixty games, gold at a hundred, red when broke. On European roulette the games end sooner, and only percent at a hundred. A bounded fair game has to settle somewhere. Next: why martingales converge.
Here is what that formula means at a casino. Start with fifty units, bet one at a time, and try to reach a hundred. In a fair game your chance is a half: a straight line. On a European roulette wheel, betting on red, you win eighteen times in thirty-seven, an edge against you of only one thirty-seventh. Yet the chance of doubling fifty units falls to six percent. On an American wheel, with its extra zero, to half a percent. Many small bets expose the bankroll repeatedly to the edge; failure is very likely here, though not certain.
Compare ways to reach twice a starting bankroll before ruin, without a deadline or table limit. Bet one unit at a time from a bankroll of a hundred, and your chance of doubling it is under half a percent; from five hundred units, about one in five hundred billion. The edge has more spins to work. Put everything on red once, and the chance is eighteen in thirty-seven, nearly forty-nine percent. Lester Dubins and Leonard Savage proved in 1965 that in a game biased against you, bold play is optimal for this target-before-ruin objective under the classic stake assumptions. Maximizing expected log growth is a different objective; Part eight studies Kelly.
10Martingales convergePhD3 min
Can a fair game wander forever without settling? Doob's answer is a trading strategy. Draw a band from a to b; buy one unit when the martingale dips below a, sell when it rises above b. Each completed round trip, an upcrossing, earns at least b minus a; the only loss is on a last trade still open. But the stake is decided from the past, so by chapter four the trader plays a fair game. A uniform bound on the martingale's mean absolute size then bounds expected upcrossings. Without that extra bound, an ordinary fair walk can keep crossing forever.
Written out, this is Doob's upcrossing lemma. The trader's wealth is at least b minus a times the number of upcrossings, minus the loss on the open trade. For a supermartingale the expected wealth is at most zero, so the expected number of upcrossings is bounded by the expected shortfall below a over the width of the band. If the martingale's mean size stays bounded, every band with rational ends is crossed only finitely often, so the path cannot oscillate: it converges. That is Doob's forward convergence theorem. But converging is not keeping the mean: in chapter twelve a fair gambler's wealth goes to zero while its mean stays one. Uniform integrability is exactly what keeps it.
The most famous convergent martingale is an urn. Start with one red ball and one blue. Draw a ball, put it back, and add another of the same colour. The expected number of red balls after the next draw grows by exactly the current red fraction, so the fraction itself is a martingale, bounded between zero and one. It must converge. Watch a hundred urns. Early on they jump about; then each one freezes at its own level. The rich get richer, and the urn remembers its first few draws forever. Where do they settle? Collect the limits of ten thousand urns, and the histogram is flat: the limit is uniform between zero and one, a fact the problems prove by induction. So the chance that the red fraction ends above ninety percent is ten percent; simulated, .
Lévy's upward theorem: a forecast refined by information converges to what full information would say. That is learning. A Bayesian estimates the market's mean return, from a prior centred on zero, updating under a working Gaussian model; the illustration plugs in EWMA variances and initializes them retrospectively over sixty days. Its credible band is not a calibrated confidence sequence for actual market returns. The model band narrows like one over the square root of time: plus or minus percent a year after ten years, after fifty. By 2020: percent a year, give or take . This history and model illustrate Merton's warning that estimating drift can be slow. Prices are not martingales: they drift. Next: how to split any process into a fair game plus a drift.
11Doob's decompositionMaster's3 min
Most processes are not martingales: prices drift. Doob showed that any process with finite means splits, in exactly one way, into a predictable part and a martingale. The predictable part adds up, step by step, the expected change given what was known the step before. What is left over is a fair game. Take a coin that lands heads fifty-five percent of the time, and a walk that steps up on heads and down on tails. Its expected step is a tenth, so the predictable part is a straight line of slope a tenth. And the walk minus that line is a martingale: all of the surprise, none of the drift.
Why unique? The predictable part adds up each step's forecast, so the rest has forecast zero. Two splits would differ by something both predictable and a martingale, and a step known in advance with forecast zero is zero. Applied to a squared martingale, the predictable part is the sum of conditional variances, the angle bracket. But the predictable part is a forecast, and a forecast depends on what you know.
A casino learned this in court. In August 2012 Phil Ivey won just over seven point seven million pounds at punto banco at Crockfords in London. The house edge on a player bet was one point two four percent. To the casino, a punter backing player every hand has a predictable part sloping down by that much a hand. But Ivey's partner sorted the cards, learning something about the first card before the deal. Choosing the side on that information, the same game has a predictable part sloping up about six and a half percent a hand, in the High Court's figures. The cards did not change; the filtration did. The courts, up to the Supreme Court in 2017, held it was cheating, and Ivey was not paid. So the drift is a property of what you know. And of the probabilities you use. Next: change them, and the drift goes away.
Now the market. Here is the logarithm of a dollar invested in the American market in 1926, with dividends reinvested. Illustrate the decomposition with an estimated drift: an expanding mean after a retrospective two-hundred-fifty-day initialization. Add those forecasts up. What remains is a forecast residual. It is a martingale only if the forecasts equal the true conditional means, which this chart does not establish. By the end of 2020 a dollar had become about . Of the nine log points, this chosen forecast assigns a little over seven to estimated drift and under two to the residual. That is an algebraic attribution, not an identified split between skill and luck.
For a square-integrable martingale, subtracting the sum of true conditional increment variances makes its square a martingale. This market example uses estimated residuals. The green line adds EWMA variance forecasts, initialized retrospectively over sixty days. Their total is close to the realized squared residuals: two point eight nine against two point eight nine. Close totals are a numerical comparison, not proof of correct conditional variances. Part five distinguishes predictable and realized quadratic variation when building Itô's calculus.
12Change of measureMaster's4 min
The same worlds can carry different probabilities. Toss a coin three times. Under P the coin is fair, and each of the eight worlds has probability one eighth. Under Q the coin lands heads sixty percent of the time, and the worlds with more heads are more likely. Divide one by the other, world by world. This ratio, L, is the Radon-Nikodym derivative of Q with respect to P. It converts one into the other: any expectation under Q is an expectation under P of the variable reweighted by L. And because Q's probabilities add up to one, L averages to one under P. Part nine uses an equivalent pricing measure under which discounted traded gains are martingales, subject to its market assumptions.
Over time the change of measure is a process: the likelihood ratio of the first n tosses, a Doob martingale under P. Conditional expectations under Q are those under P, reweighted and divided by the density so far: Bayes' rule. The drift changes: the walk minus two q minus one per step is a Q-martingale, Girsanov on a coin. On real returns, Esscher's method tilts by an exponential. Matching one asset's expected gross return is a one-period illustration, not a demonstration that every asset has the required conditional expectation.
Here is the picture to keep. Two hundred coin walks, drawn under the fair coin, every path equally likely. Now change the measure to the sixty-percent coin. No path moves. Each path is simply redrawn with a thickness proportional to its likelihood ratio: walks with many heads grow heavy, walks with many tails fade. The visible centre of the fan swings upward, and the distribution at the end slides with it. Equivalent finite-horizon measures reweight paths and preserve null sets both ways. One-way absolute continuity would not give that two-way preservation.
Now follow L as the tosses go on, say for three hundred. Under the fair coin, L is a martingale with mean one: we built it to average one. Yet look at the paths. Almost all of them sink toward zero. The median after three hundred tosses is about two thousandths, and two thirds of the paths end below a hundredth. The mean stays at one only because of a few paths that soar, so rare that two thousand simulated paths average under a half. A nonnegative martingale must converge, and this one converges to zero. If the coin really is the sixty-percent one, the same L grows: two thirds of the paths end above a hundred. Read L as the wealth of a gambler who bets, toss by toss, that the coin is Q. If it isn't, the gambler is playing a fair game and almost surely goes broke. If it is, the gambler gets rich. That is the idea behind testing by betting, in chapter fifteen.
Build one illustrative Q on historical days. Fit an exponential tilt in sample so expected gross market return matches the sample riskless-return target. This does not identify a unique pricing measure or a dynamic model. Theta is : Q leans toward bad days. The mean daily log return falls from basis points to . The weight went into the left tail: the worst one percent of days carry percent of Q's weight. So under this fitted Q bad days receive more weight. That property of the chosen tilt does not change physical crash probabilities or establish the market's risk premium. How far can a change of measure go? Next: the Radon–Nikodym theorem, and where it breaks.
13Radon–Nikodym, and the singular infinitePhD3 min
When can one probability be written as another, reweighted? The Radon-Nikodym theorem: whenever Q gives no weight to anything P calls impossible, Q has a density with respect to P. Martingales prove it. On the dyadic cells of chapter one, take the ratio of Q's mass to P's. A cell's two children share the parent's Q-mass, so the ratio is a P-martingale. It is nonnegative, so it converges, by chapter ten; absolute continuity makes it uniformly integrable, and the limit is the density. Measures absolutely continuous both ways are equivalent: they share their impossible events, and an arbitrage is defined by impossible events alone, so equivalent measures agree on it. For independent coin product laws with every coordinate probability strictly between zero and one, Kakutani's dichotomy applies: equivalent or completely singular, as a product of affinities stays positive or not.
Watch the density appear. P spreads probability evenly over a square; Q leans toward the far corner. On a two by two grid, each bar's height is Q's mass in the cell divided by P's. Split every cell into four: four by four, eight by eight, sixteen by sixteen. Each bar becomes four, and the four average to their parent: that is the martingale. The city of bars smooths into a surface, the Radon-Nikodym derivative. Now try a Q that puts all its mass on the diagonal. P gives the diagonal zero area, so Q is not absolutely continuous. The bars along the diagonal double at every split, the rest fall to zero, and no surface ever forms. Q and P are singular: each lives where the other says nothing can happen.
Kakutani's dichotomy, simulated. Under a fair coin, follow the likelihood ratio of a sixty-percent coin for ten thousand tosses. It collapses: the median ends near ten to the , as the relative entropy of point zero two a toss predicts. At every finite time the two coins are equivalent, but on the infinite sequence they are singular: the strong law of large numbers tells them apart with certainty. Now let the tilt fade: heads with probability one half plus point two over k on toss k. The squared tilts add up to something finite, the product of affinities stays positive, and the likelihood ratio settles to a positive limit, with mean . These two measures are equivalent forever. So is a fair coin equivalent to a fifty point one percent coin, tossed forever? No. This is why, in Part five, Girsanov changes the drift of Brownian motion only within a fixed horizon, and why no change of measure can change its volatility. Changing measure reweights the tails. Next: how heavy the real tails are.
14Heavy tails as stable lawsPhD3 min
Part one measured how heavy the tails of returns are. Here is the family of distributions Benoit Mandelbrot proposed for them. The iid central limit theorem says that normalized sums of independent copies look Gaussian when the variance is finite. Paul Lévy asked which shapes survive being added up: if you sum independent copies, you get the same shape, only wider. The answer is the stable family, indexed by alpha between zero and two. Alpha equal to two is the Gaussian. Below two, the tails fall like a power of x, so slowly that the variance is infinite. The symmetric alpha-one member is Cauchy. In 1963 Mandelbrot fitted cotton prices with alpha near one point seven, and in 1965 Eugene Fama's thesis found alphas below two for the thirty stocks of the Dow. If they were right, volatility would not exist as a number, and the whole of option pricing would need rebuilding.
For a symmetric, zero-location stable law, the sum of n independent copies is one copy stretched by n to the one over alpha. Characteristic functions turn sums into products, and e to the minus c t to the alpha is its own nth power, stretched: the symmetric stable law, the limit of sums with power tails below two. Take logs twice and alpha is a slope, Koutrouvelis's estimator. Average e to the i t r over median and IQR-standardized returns. The arrow shows only the modulus; the displayed bootstrap resamples individual days and ignores serial dependence. The Gaussian control gives ; the American market, .
Measure it. The House fits a stable law to daily returns from five quantiles, a method published by J. Huston McCulloch in 1986 that ignores the most extreme days. The American market, decade by decade: alpha between one point four and one point six, never near two. Over the whole sample, one point four. Bitcoin, lower still: one point two seven. In 1995 Rosario Mantegna and Eugene Stanley found the same one point four in the S and P 500 minute by minute. By this measure, the center of the return distribution is shaped like a stable law.
A third estimator: a finite-budget likelihood search, with the stable density computed numerically for every candidate. Watch it learn. Each evaluation tries a new alpha, beta, scale and location, starting from the Gaussian corner, alpha near two. On the right, the best fit so far; on the left, the alpha being tried, for three random samples of fifteen hundred days. The search has a budget of a hundred fifty evaluations per sample; convergence to a global optimum is not established. It ends at alpha on average.
A descriptive check: iid stable sums keep their standardized distribution. Below alpha two, population variance and the fourth moment diverge, so standardized kurtosis is undefined. This sample-kurtosis plot is descriptive, not a calibrated stability test. The Gaussian control is near zero. The market starts at for one day. A stable-looking centre need not imply stable tails. Changing volatility also affects aggregation, the subject of Parts seven and thirteen. Heavy tails make classical tests fragile. Next: a test that holds whenever you look, built from a fair game.
15Ville's inequality and testing by bettingMaster's3 min
Ville's thesis contained a second idea, ignored for sixty years. If a gambler's wealth is a nonnegative martingale starting at one, the chance that it ever reaches twenty is at most one in twenty, ever, over the whole infinite future. Turn that into a test. State the null hypothesis as a claim that some game is fair. Let a gambler bet against it, never risking more than they have. If the null is true, the gambler's wealth is a nonnegative martingale, an e-process. Reject the null when the wealth reaches twenty. By Ville's inequality you will be wrong at most five percent of the time, however often you look, and whenever you decide to stop. Glenn Shafer and Vladimir Vovk rebuilt probability on this idea, and since 2020 it has become a field: anytime-valid inference.
The proof uses only what you have. Let tau be the first time wealth reaches c. Stop at tau or n: optional stopping keeps the mean at most one, and on the event that tau came first the wealth is at least c. Let n run to infinity: Ville's inequality. A single bet's payoff with mean at most one under the null is an e-value, a test by Markov's inequality. And the law of the iterated logarithm says a fair walk's statistic crosses one point nine six forever: check daily and you eventually reject a true null.
Why does that matter? Because people look. Simulate two thousand perfectly fair games, each twenty-five hundred days long. Starting on day twenty, compare a known-variance z statistic with plus or minus one point nine six, the nominal five-percent normal cutoff. For coin data that cutoff is a normal approximation. The statistic wanders, and sooner or later crosses the line. Half of these fair games, percent, are declared unfair at some point, just because someone checked every day. Now watch an e-process on the same games. It reaches twenty in percent of them, under five, as Ville promised. A researcher, or a risk committee, that reviews a strategy every morning needs the second kind of test.
Shafer and Vovk rebuilt probability as a game. Forecaster announces prices, Skeptic bets against them without risking more than it has, Reality moves. Large capital is evidence against Forecaster's commitments, with a threshold controlling false alarms. The skeptic still has to choose its bets. Next: learning them.
Back to the opening historical scores. The mixture bets on transformed, demeaned returns using yesterday's sign. Estimated centering and clipping define a particular null; the first sixty days also initialize the scale retrospectively. These charts therefore do not certify the theorem's five-percent calibration for a raw-return martingale. Started in 1926, it passes twenty within three years. Started in 1975, within fifteen months: the index's returns had positive serial association, consistent with Part one's stale-price explanation. Started in 2000 it never gets there, and neither does a bettor on Bitcoin from 2018. Non-crossing does not prove fairness. The exact anytime guarantee requires conditionally mean-zero bounded outcomes and past-only calibration. Clipping a skewed mean-zero return can change its mean, so checking that assumption is part of building a valid test.
16Learning to betMaster's3 min
The House's monitor bets a fixed menu of stakes. Can a bettor learn its stake instead? Its wealth multiplies by one plus stake times outcome, each stake chosen from the past, so under the null of mean zero it is a nonnegative martingale, and Ville's inequality holds for any rule at all. What the rule decides is speed. A second-order approximation makes expected log growth a parabola, peaking at edge over second moment if that stake is allowed. For a small stationary edge, log twenty divided by approximate growth gives about two thousand four hundred days at daily Sharpe point zero five. This is a growth-rate estimate for an oracle; actual hitting times are random. A real bettor learns the stake online, here by an online Newton step on its own log wealth. For the confidence sequence, use bounded observations with a common conditional mean. Give each one-sided bettor half the error budget and retain all past constraints. Rounding numerical grid crossings outward also covers means between grid points.
Watch one learner. A strategy with a true daily Sharpe ratio of point zero five, simulated for ten thousand days. On the left, the bettor's stake as a needle on a dial, with Kelly's fraction marked in gold; on the right, its wealth on a log scale, with the line at twenty. At first the needle swings wildly: the bettor knows nothing. Then it settles near the gold mark, and the wealth begins to climb.
Now a fair race. Four bettors: the House's fixed menu, the online Newton learner, a second learner called aGRAPA that plugs in running estimates of the edge, and an oracle that knows the true edge. Four strategies, from no edge at all to a daily Sharpe of point one; eight seeds of a hundred runs each, drawn as bars from the lowest seed to the highest. With no edge, every bettor flags at most about five percent of the runs: With an edge, the oracle is fastest in this experiment, averaging days across the seed medians at Sharpe point zero five.
Back to the hook's historical diagnostic, now with a learner on the same transformed outcomes. Chapter fifteen's calibration caveats still apply.
And the corrected confidence sequence. Clip daily log returns to minus point two through point two. Assume these bounded observations share one conditional mean. Under that model, predictable one-sided bets give ninety-five percent coverage simultaneously over time; the grid bounds are rounded outward. This does not establish that Bitcoin satisfies the mean assumption. The display clips early wide bands at a hundred fifty basis points. At the end of 2020 the interval runs from to basis points a day.
In the House the learner is ten lines. Its false-alarm guarantee requires bounded outcomes, past-only stakes and a correctly specified conditional-mean null. On the simulated strategy its stake settles near . The trial counter reads , and Rule five gains a clause: the stake may be learned. The corrected confidence sequence has a separate registration; the legacy record is preserved and no sealed hold-out was opened. Next: the people who live on these ideas: casinos, bookmakers, markets and testers.
17The house, the book and the marketIndustry4 min
A casino is a portfolio of martingales with a drift in its favour. Nevada's roulette tables kept seventeen point three four percent of the cash exchanged for chips in 2024, by the University of Nevada's figures. Yet a double-zero wheel's edge is five point two six percent. Under that constant-edge approximation, hold divided by edge implies wagered dollars per dollar of drop, about ; this is not a direct count of bets. Table limits bound stakes, but optional stopping also needs its stopping-time or integrability conditions. A limit alone is insufficient.
How sure is the house in this fixed-unit model? Subtract the known drift. The centered outcomes have conditional range length two, so a Hoeffding-Azuma bound applies. For even-money bets on a single-zero wheel the house is behind after a hundred bets about percent of the time, after ten thousand bets percent, and after a hundred thousand, essentially never. Azuma's bound is looser than the iid binomial answer. Its assumptions are bounded conditional ranges and the stated conditional drift, not just a cap on bets. The monthly hold still swings by three points. Spin-by-spin luck would explain that only if a whole month were about equal bets. Unequal stakes, high rollers and turnover can matter; this toy calculation does not identify how much each caused the observed variation.
The house's enemies change the filtration. Edward Thorp showed in 1962 that the blackjack deck remembers, and a counter sometimes faces a positive drift. In 1982 New Jersey's Supreme Court held in Ken Uston's case that card counting was for the Casino Control Commission to regulate, so a casino could not exclude a counter on its own. In Britain, edge sorting was held to be cheating.
Bookmakers run the same business on sport. In 2017 Kaunitz, Zhong and Kreiner used consensus odds to estimate probabilities and bet where an offered price looked favourable: a three and a half percent return over fifty-six thousand backtested bets, and a profit with real money, until the bookmakers began, in their words, to severely limit their accounts. Flutter reports that its American sportsbook kept seven point nine percent of fifty-one billion dollars staked in 2024. Bill Benter's racing syndicate blended a model with the public's odds and, as reported by Bloomberg Businessweek, made close to a billion dollars.
Prediction markets trade contracts paying a dollar if an event happens. Their prices are often read as probabilities, though risk premia and trading frictions can separate prices from beliefs. In 2024 Judge Jia Cobb held that the CFTC had exceeded its authority in barring Kalshi's contracts on control of Congress, and the appeals court declined to stay her ruling. Polymarket's presidential market traded nearly three point seven billion dollars, as reported by The Block. Is such a price a martingale? Ned Augenblick and Matthew Rabin turned chapter eleven into a test: for a Bayesian, expected squared movement equals the uncertainty resolved. On chapter three's forecasts the ratio is , as it must be; a forecaster who overreacts by thirty percent scores . On eleven million Betfair trades they found consistent excess movement. On Kalshi, Bürgi, Deng and Whelan find prices that sharpen near the close, and a favourite-longshot bias, stronger for those who take liquidity.
Testing while you watch is old, and now industrial. Abraham Wald's sequential probability ratio test, from the war years, watched chapter twelve's likelihood ratio and stopped as soon as the evidence sufficed. Optimizely's always-valid p-values serve website experiments that people check every hour, and Netflix uses anytime-valid tests to decide, while a new version rolls out, whether it is safe. Such monitoring can be adapted to strategy decay when its null and dependence assumptions are appropriate. Implementation and calibration are application-specific. Last, the frontier.
18Frontier: anytime-valid inference, 2023–2026PhD2 min
Ville's idea is now a fast-moving field. Its foundations: Ruodu Wang and Aaditya Ramdas showed in 2022 that e-values control false discoveries under any dependence, and a 2023 survey by Ramdas, Grünwald, Vovk and Shafer mapped the subject. Ruf, Larsson, Koolen and Ramdas extended Ville's theorem to composite hypotheses: an event is impossible exactly when some e-process blows up on it. Waudby-Smith and Ramdas estimated means by betting, the confidence sequences of chapter sixteen, and Shekhar and Ramdas tested whether two distributions differ. Grünwald, de Heide and Koolen's safe testing was read before the Royal Statistical Society in 2024, and Grünwald showed post-hoc decision guarantees with e-values. A data-chosen level must not be read as an ordinary pre-fixed type-I error bound. Larsson, Ramdas and Ruf linked log-optimal e-variables for specified hypothesis classes to numéraire portfolios; Fischer and Ramdas made permutation tests anytime-valid, which matters for backtests; and in 2025 Ramdas and Wang collected it all in a monograph.
That bridge deserves a picture. On simulated bounded outcomes, choose a fixed linear stake from a grid between zero and one half, maximizing estimated expected log growth under the alternative. This is a restricted Kelly illustration. Under a conditional mean-zero null the same wealth is a valid test. General numéraire theory studies log-optimal e-values for specified null and alternative classes; it does not promise uniformly greatest finite-sample power.
Finally the frontier at work on a desk problem. Two hundred strategies are watched every day for ten years; twenty have a true daily Sharpe of point zero eight, the rest none. Each is monitored by a learning e-process; the desk reviews e-BH every twenty-one trading days at ten percent. The rule is five lines: sort the e-values, and reject the largest k whose values clear the number of strategies over alpha times k. On the left, the false discovery proportion over twenty seeds; on the right, discoveries. The ordinary approach, Benjamini and Hochberg on one-sided known-variance z p-values, finds more and faster. Suppose each method acts at its first review with ten discoveries. In these twenty seeds, No action by the horizon counts as zero false discovery proportion. The guarantee at a common stopping time requires each e-process to be valid in the joint filtration. That condition holds in this independent-strategy simulation; the numerical average is not a proof.
For the researcher: how far can a fair walk wander?PhD5 min
For the researcher: Chapter 15 said a test checked forever rejects a true null. Here is the theorem that says how far a fair walk wanders, and what an always-valid test must pay for it.
The theorem is Khinchin's, from 1924. A sum of independent fair steps, divided by the square root of two t log log t, has a lim sup of exactly one. The central limit theorem describes the walk at one time. The limsup describes all times: every envelope slightly below this scale is crossed infinitely often, and every envelope slightly above it only finitely often. It does not settle crossing of the exact envelope. Because log log t grows without bound, the walk eventually crosses one point nine six standard deviations, or any fixed number, with probability one.
For Gaussian or one-sub-Gaussian steps, the upper half has a short martingale proof. The general finite-variance result needs additional truncation. Doob's maximal inequality, applied to the exponential martingale with the best exponent, gives the running maximum of the walk a Gaussian tail. Check only at geometric times, theta to the k, against a boundary a little above the law's. The chance the walk crosses anywhere in a block is then bounded by a power of k. Those bounds are summable whenever theta is close enough to one, so by Borel and Cantelli only finitely many blocks are ever crossed. The matching lower half uses the second Borel-Cantelli lemma on the independent increments between blocks.
See it happen. A thousand fair walks, each checked at every step against the fixed-sample boundary, one point nine six root t, starting at step one. This uses Gaussian rather than Chapter fifteen's coin steps. The share that has crossed keeps climbing. By a hundred thousand steps it is three quarters. The law of the iterated logarithm says it reaches one, but slowly: log log t is less than two and a half at a hundred thousand.
How should a test look forever and stay honest? Herbert Robbins answered in 1970. For Gaussian null steps, the exponential of lambda S minus lambda squared t over two is a mean-one martingale; conditional one-sub-Gaussian steps give the same bound through a supermartingale. Average it over a normal distribution of lambdas. The average is still a martingale, and completing the square does the integral in closed form. Ville's inequality bounds the chance it ever reaches one over alpha by alpha. Solve for the walk, and the result is a boundary that holds at every time at once: it grows like the square root of t log t, a little faster than the law of the iterated logarithm allows a true walk to go.
Now the same thousand walks against the always-valid boundaries. Robbins's mixture, and a stitched boundary built by allocating error across exponential bounds on geometric time blocks, as in Howard, Ramdas, McAuliffe and Sekhon in 2021. Over a hundred thousand steps, the mixture is crossed by about five percent of the walks, within the sampling error of a thousand paths, and the stitched boundary by fewer than one percent. The guarantee holds whenever the test is read, because it was built for every time at once.
The price of looking forever is width. The fixed boundary stays at one point nine six standard deviations, valid only if you look once. Robbins's mixture widens like the square root of log t. The stitched boundary widens like the square root of log log t, the law of the iterated logarithm's own rate, in white, which no always-valid boundary can beat. But rates are asymptotic. At a hundred thousand steps the mixture is three point six standard deviations and the stitched boundary four point three with these tuning choices. Their ordering depends on the time horizon and tuning; this comparison is not a universal optimum. Both pay extra width for simultaneous coverage.
Three open questions. Which always-valid boundary is best? The law of the iterated logarithm fixes the rate, but the constants, and how a boundary trades early power for late power, are choices with no single answer. For composite nulls, such as 'the mean is at most zero, whatever the distribution', the theory of e-values is still being written. And returns are neither light-tailed nor independent; boundaries for them are recent, and loose.
Pause and predict. With rho of a hundred and alpha of five percent, how many standard deviations is Robbins's boundary at a hundred steps, and at ten thousand? Compare with one point nine six.
Reveal the comparison. Divide the boundary by root t. At a hundred steps, the square root of two times log eight hundred is about three point six six standard deviations. At ten thousand, the answer is about three point two seven. Both exceed one point nine six because they protect repeated looks. The normalized width need not increase monotonically at these early times; rho tunes where the boundary is efficient.
Recap, desk questions, problemsAll tracks3 min
Part four in twelve lines. A sigma-algebra is the set of questions you can answer, and conditional expectation is a projection onto it. A martingale's forecast of tomorrow is today. No predictable stake turns a fair game favourable, and roulette taxes every system the same. Optional stopping holds with its stopping-time and integrability conditions; bounded bets alone do not suffice. Doubling needs unbounded credit, which finance forbids and Barings found in a hidden account. Ruin is a over b, and bold play solves the classic subfair target-before-ruin model. Martingales that stay bounded converge. Doob splits a process into drift and martingale, and the drift depends on what you know. A change of measure moves weight, not paths, and martingales build the Radon-Nikodym derivative. The stable-fit diagnostics are evidence, not proof of finite population moments. Properly calibrated e-processes allow learned stakes and repeated looks.
Five desk questions. A martingale starts at one and stops at zero or three: the chance it hits three is a third, by optional stopping. The expected number of fair tosses until two heads in a row is six, by the casino of gamblers. With a hundred dollars at a European roulette table in the classic target-before-ruin model, one all-in red bet has higher success probability than one-unit bets. In Penney's game, if you choose heads, heads, tails, I choose tails, heads, heads and win three times in four. And a fair walk stopped the first time it is up one takes, on average, forever. Full solutions are in the notes.
And nine problems: the time for a walk to leave a strip, the ruin probability for a biased game, the doubling system's real record, why likelihood ratios collapse, a proof of Ville's inequality, the limit of Pólya's urn, Wald's identity, and two at the level of a qualifying exam: the upper half of the law of the iterated logarithm, and Robbins's always-valid boundary. Solutions, in English and Chinese, are in the notes.
Where this comes back: quadratic variation in Parts five and seven; the risk-neutral world in nine, ten and twenty-three; admissibility in nine; calendar spreads in twelve; the numéraire portfolio in eight; heavy tails in seven, thirteen and forty; and e-processes in twenty-six and the finale.
The textbook chapters this part covers, and the papers it draws on; the notes map every textbook section to its chapter. Every number was computed by the series' own code: Kenneth French's daily market since 1926, Binance's Bitcoin, and the Nikkei from the St. Louis Fed.
The House has its monitor. Next, Part five: stochastic calculus. We let the coin tosses become infinitely fast, and the random walk becomes Brownian motion, with its own calculus, built on the quadratic variation we met in this part.
Where it goes next. The change of measure prices every derivative from Part 9 on; testing by betting returns as the live monitor of Part 26.
Key results
The part's results in one place, for revision.
Try it
Lab 4 · The doubling system against a fair coin
Play the doubling system ten thousand times with a finite bankroll. Count the winners, weigh the ruins, and check the expected profit against optional stopping and the gambler's-ruin formula.
python -m videos.quant.labs 4
needs numpy, scipy, matplotlib, numba · download lab04.py ·
source on GitHubReached +100 90.9% of 10,000 players (fair-game bound a/b = 91.1%)
Mean profit -2.54 +- 6.34 (optional stopping: exactly 0)
Median profit; worst +100; -1,023
Most players win a little, a few lose everything, and the mean is zero: a bounded-bankroll strategy on a martingale is a martingale.
The code (49 lines; it asserts its own result)
"""Lab 4: you cannot beat a fair game: the doubling system, and gambler's ruin."""
import numpy as np
from videos.quant import labs
from explainer.quant.house import martingale
TITLE = "The doubling system against a fair coin"
GOAL = ("Play the doubling system ten thousand times with a finite bankroll. Count the winners, weigh the ruins, "
"and check the expected profit against optional stopping and the gambler's-ruin formula.")
TASKS = [
"Give the house an edge (p = 18/37 on red). How does the mean change, and gamblers_ruin(a, b, p)?",
"Raise the bankroll from 1,023 to 65,535. Does the share of winners change the expected profit?",
"Replace doubling by martingale.system_stakes with another betting system and repeat.",
]
def run(seed=0):
rng = np.random.default_rng(seed)
bankroll, target, n = 1023.0, 1123.0, 10000
final, stopped, sample = np.empty(n), np.empty(n), []
for i in range(n):
out = martingale.doubling(rng.random(4000) < 0.5, base=1.0, bankroll=bankroll, target=target)
final[i], stopped[i] = out["wealth"][-1], out["stopped"]
if i < 60:
sample.append(out["wealth"])
profit = final - bankroll
won = np.mean(final >= target)
se = profit.std(ddof=1) / np.sqrt(n)
ruin = martingale.gamblers_ruin(int(bankroll), int(target), 0.5)
lab = labs.Lab()
lab.row("Reached +100", f"{100 * won:.1f}% of {n:,} players (fair-game bound a/b = {100 * ruin:.1f}%)")
lab.row("Mean profit", f"{profit.mean():+.2f} +- {1.96 * se:.2f} (optional stopping: exactly 0)")
lab.row("Median profit; worst", f"{np.median(profit):+.0f}; {profit.min():+,.0f}")
lab.note = ("Most players win a little, a few lose everything, and the mean is zero: a bounded-bankroll "
"strategy on a martingale is a martingale.")
assert abs(profit.mean()) < 3 * se and abs(won - ruin) < 0.02
fig, ax = labs.figure(2, size=(11, 4.2))
for w in sample:
ax[0].plot(w, color=labs.LOSS if w[-1] < bankroll else labs.GAIN, lw=0.7, alpha=0.7)
ax[0].axhline(target, color=labs.P, ls="--", lw=0.9)
ax[0].set(title="Sixty players doubling after every loss", xlabel="round", ylabel="wealth")
ax[1].hist(profit, bins=60, color=labs.SPOT)
ax[1].set_yscale("log")
ax[1].axvline(profit.mean(), color=labs.P, ls="--")
ax[1].set(title="Profit: many +100s, a few -1,023s, mean zero", xlabel="profit", ylabel="players (log)")
lab.fig = fig
return lab
Now change it
- Give the house an edge (p = 18/37 on red). How does the mean change, and gamblers_ruin(a, b, p)?
- Raise the bankroll from 1,023 to 65,535. Does the share of winners change the expected profit?
- Replace doubling by martingale.system_stakes with another betting system and repeat.
Problems, with solutions
Try each problem before opening its solution; the last two of each set are at qualifying-exam level.
Desk questions, with solutions
- A martingale starts at 1 and stops at 0 or 3. The stopped process is bounded between 0 and 3, so optional stopping applies: E[M_τ] = 1. With p = P(hit 3), 3p + 0·(1 − p) = 1 and p = 1/3.
- Expected tosses to see HH. Before every toss a new gambler arrives with $1 and bets it on heads at fair odds. If heads comes, the gambler bets the $2 on heads again, and otherwise leaves with nothing. Checking disjoint two-toss blocks gives a geometric tail, hence E τ < ∞ before invoking optional stopping. The casino's net take is a martingale with bounded steps. When HH first appears at time τ, the casino has taken in τ dollars and owes $4 to the gambler who arrived at τ − 1 and $2 to the one who arrived at τ. So E[τ] − 6 = 0, and E[τ] = 6. (For HT the answer is 4: only the gambler at τ − 1 is paid.)
- $100 at European roulette, $200 needed. One bet of everything on red succeeds with probability 18/37 ≈ 48.6%. One-unit bets succeed with probability (1 − (q/p)¹⁰⁰)/(1 − (q/p)²⁰⁰) ≈ 0.45%. Bold play is optimal in the classic subfair, even-money target-before-ruin model with freely divisible stakes, no table limit and no hard deadline (Dubins and Savage).
- Penney's game: HHT against THH. Unless the first two tosses are HH (probability 1/4, and then HHT must come
first, since the run of heads ends with a T), a T has appeared before any HH, so the first HH is preceded by a T:
THH appears no later than HHT. P(THH first) = 3/4. Conway's formula (
penney_odds) agrees, and so does a simulation (0.749). - A fair walk stopped the first time it is up 1: E τ? Infinite. If E τ were finite, Wald's identity would give E S_τ = 0 · E τ = 0, but S_τ = 1. (Equivalently, P(τ > n) ≈ √(2/(πn)) is not summable.)
Problems, with worked solutions
-
Exit time. Show that \(S_n^2 - n\) is a martingale for a fair \(\pm 1\) walk. Use optional stopping to find the expected time for the walk to first reach \(\pm a\).
Solution
E[S²_{n+1} − (n + 1) | F_n] = S²_n + 2S_n·E[ξ] + E[ξ²] − n − 1 = S²_n − n, so S²_n − n is a martingale. First stop at τ ∧ n, where τ is the first time |S| = a. Bounded-time optional stopping gives E[τ ∧ n] = E[S²_{τ∧n}] ≤ a². Monotone convergence gives E[τ] ≤ a² < ∞, so τ is finite almost surely. Dominated convergence for the bounded positions then gives E[τ] = a². Bounded steps alone would not justify stopping the squared martingale.
-
Biased ruin. For a game with win probability \(p\), show \((q/p)^{X_n}\) is a martingale and derive the ruin probability. Evaluate it for European roulette, \(a = 10\), \(b = 20\).
Solution
E[(q/p)^{X_{n+1}} | F_n] = (q/p)^{X_n}·(p·(q/p) + q·(p/q)) = (q/p)^{X_n}. Optional stopping gives (q/p)^a = P(hit b)(q/p)^b + (1 − P(hit b)), so P(hit b) = (1 − (q/p)^a)/(1 − (q/p)^b). With p = 18/37, a = 10 and b = 20 this is 36.8% (a simulation of 4,000 games gives 36.4%).
-
Doubling with 2^k − 1. Doubling with a bankroll of \(2^k - 1\): show each session's expected gain is zero, and find the expected number of sessions before ruin.
Solution
A session wins 1 unless the first k tosses are all losses (probability 2^{−k}), which loses 2^k − 1. The expected gain is (1 − 2^{−k}) − 2^{−k}(2^k − 1) = 0. The number of sessions up to and including the first ruin is geometric with mean 2^k: about 1,024 sessions for k = 10 (simulated 1,026).
-
Collapse of the likelihood ratio. For coins \(p = 0.5\) and \(q = 0.6\), show \(\mathbb{E}_P[L_n] = 1\) but \(\tfrac{1}{n}\log L_n \to -D(P\,\|\,Q)\). Compute \(D\) and predict the median of \(L_{300}\).
Solution
E_P[L_n] = Σ_ω P(ω)Q(ω)/P(ω) = 1. log L_n is a sum of i.i.d. terms with mean E_P[log(Q/P)] = −D(P‖Q). Here D = ½ ln(0.5/0.6) + ½ ln(0.5/0.4) = 0.0204 nats a toss, so L_n → 0 almost surely. The median of L₃₀₀ is about e^{−300 × 0.0204} = 0.0022, which matches the simulated 0.002; after 10,000 tosses, log₁₀ L ≈ −10,000 × 0.0204/ln 10 = −88.6 (simulated median −88.3).
-
Ville's inequality and peeking. Prove Ville's inequality from optional stopping at \(\min(\tau, n)\). Why does a fixed \(z\) cutoff checked every day eventually reject a true null with probability one?
Solution
Let τ be the first n with W_n ≥ c. Optional stopping at the bounded time min(τ, n) gives 1 ≥ E[W_{τ∧n}] ≥ c·P(τ ≤ n), so P(τ ≤ n) ≤ 1/c. Let n → ∞, and take c = 1/α. A daily known-variance z-statistic is S_n/√n. By the law of the iterated logarithm, S_n/√(2n log log n) has limsup 1, so |S_n|/√n exceeds any fixed level infinitely often, and a test checked forever rejects a true null with probability one.
-
Pólya's limit. P'olya's urn from one red and one blue ball: show \(P(R_n = k) = 1/(n + 1)\) for \(k = 1, \dots, n + 1\), so the limit of the red fraction is Uniform\((0, 1)\).
Solution
By induction: if P(R_n = k) = 1/(n + 1) for k = 1, …, n + 1 (with n + 2 balls), then P(R_{n+1} = k) = P(R_n = k)·(n + 2 − k)/(n + 2) + P(R_n = k − 1)·(k − 1)/(n + 2) = (1/(n + 1))·(n + 1)/(n + 2) = 1/(n + 2). So R_n/(n + 2) is uniform on {1/(n + 2), …, (n + 1)/(n + 2)}, and its limit is Uniform(0, 1).
-
Wald's identity. Prove Wald's identity \(\mathbb{E}S_\tau = \mu\,\mathbb{E}\tau\) when \(\mathbb{E}\tau < \infty\), from the martingale \(S_n - n\mu\) and optional stopping.
Solution
With i.i.d. steps of mean μ and E|ξ| < ∞, M_n = S_n − nμ is a martingale with increments bounded in mean: E[|ΔM| | F] ≤ E|ξ| + |μ|. If E τ < ∞, then |M_{τ∧n}| ≤ Σ_{k≤τ} |ΔM_k|, whose mean is at most (E|ξ| + |μ|) E τ (by Tonelli and the independence of ξ_k from {τ ≥ k}), so dominated convergence for this integrable bound gives E[S_τ − τμ] = 0, i.e. E S_τ = μ E τ.
-
(qual) The LIL's upper half. (qual) For iid \(N(0, 1)\) steps, prove \(\limsup S_t/\sqrt{2t\log\log t} \le 1\) a.s. by Doob's maximal inequality on geometric blocks and Borel–Cantelli.
Solution
Fix \(\epsilon > 0\) and \(1 < \theta < (1 + \epsilon)^2\); let \(t_k = \theta^k\) and \(x_k = (1 + \epsilon)\sqrt{2t_k\log\log t_k}\). For Gaussian steps \(e^{\lambda S_t}\) is a submartingale, so Doob gives \(\Pr(\max_{t \le n}S_t \ge x) \le e^{-\lambda x}E e^{\lambda S_n} = e^{-\lambda x + \lambda^2 n/2}\), minimised at \(\lambda = x/n\): \(e^{-x^2/2n}\). If \(S_t \ge (1 + \epsilon)\sqrt{2t\log\log t}\) for some \(t \in (t_k, t_{k+1}]\) then \(\max_{t \le t_{k+1}}S_t \ge x_k\), which has probability at most \(\exp(-x_k^2/2t_{k+1}) = (k\log\theta)^{-(1 + \epsilon)^2/\theta}\), summable in \(k\). By Borel–Cantelli only finitely many blocks see a crossing, so \(\limsup \le 1 + \epsilon\) a.s.; let \(\epsilon \downarrow 0\) along a sequence.
-
(qual) Robbins's boundary. (qual) Derive Robbins's mixture \(M_t\) and show \(\Pr\big(\exists t: |S_t| \ge \sqrt{(t + \rho)\log\frac{t + \rho}{\rho\alpha^2}}\big) \le \alpha\).
Solution
\(\int e^{\lambda S - \lambda^2 t/2}\sqrt{\rho/2\pi}\,e^{-\rho\lambda^2/2}d\lambda = \sqrt{\rho/2\pi}\int e^{-\frac{t+\rho}{2}(\lambda - \frac{S}{t+\rho})^2}d\lambda\;e^{S^2/2(t+\rho)} = \sqrt{\rho/(t + \rho)}\,e^{S^2/2(t+\rho)}\). A mixture of mean-one nonnegative martingales is one (Fubini), so Ville gives \(\Pr(\exists t: M_t \ge 1/\alpha) \le \alpha\), and \(M_t \ge 1/\alpha\) iff \(S_t^2 \ge (t + \rho)[\log((t + \rho)/\rho) + 2\log(1/\alpha)]\).
Reading and notes
The part's papers
from READING.md
- Kolmogorov, A. N. (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung.
- Ville, J. (1939). Étude critique de la notion de collectif.
- Doob, J. L. (1953). Stochastic Processes.
- Fama, E. F. (1965). "The behavior of stock-market prices." Journal of Business.
- Mantegna, R., Stanley, H. E. (1995). "Scaling behaviour in the dynamics of an economic index." Nature.
- Shafer, G., Vovk, V. (2001). Probability and Finance: It's Only a Game!; (2019) Game-Theoretic Foundations for Probability and Finance.
- Ramdas, A., Grünwald, P., Vovk, V., Shafer, G. (2023). "Game-theoretic statistics and safe anytime-valid inference." Statistical Science.
- Bank of England (1995). Report of the Board of Banking Supervision Inquiry into the Circumstances of the Collapse of Barings.
- Radon, J. (1913); Nikodym, O. (1930). "Sur une généralisation des intégrales de M. J. Radon." Fundamenta Mathematicae 15.
- Esscher, F. (1932). "On the probability function in the collective theory of risk." Skandinavisk Aktuarietidskrift.
- Wald, A. (1945). "Sequential tests of statistical hypotheses." Annals of Mathematical Statistics.
- Kakutani, S. (1948). "On equivalence of infinite product measures." Annals of Mathematics.
- Mandelbrot, B. (1963). "The variation of certain speculative prices." Journal of Business.
- Thorp, E. O. (1962). Beat the Dealer.
- Dubins, L., Savage, L. J. (1965). How to Gamble If You Must.
- Azuma, K. (1967). "Weighted sums of certain dependent random variables." Tôhoku Mathematical Journal.
- Li, S.-Y. R. (1980). "A martingale approach to the study of occurrence of sequence patterns in repeated experiments." Annals of Probability 8(6):1171–1176.
- Koutrouvelis, I. A. (1980). "Regression-type estimation of the parameters of stable laws." JASA.
- Merton, R. C. (1980). "On estimating the expected return on the market." Journal of Financial Economics 8.
- Harrison, J. M., Pliska, S. R. (1981). "Martingales and stochastic integrals in the theory of continuous trading." Stochastic Processes and their Applications.
- McCulloch, J. H. (1986). "Simple consistent estimators of stable distribution parameters." Communications in Statistics: Simulation.
- Dybvig, P., Huang, C. (1988). "Nonnegative wealth, absence of arbitrage, and feasible consumption plans." RFS 1(4):377–401.
- Benter, W. (1994). "Computer based horse race handicapping and wagering systems: a report." In Hausch, Lo, Ziemba (eds.), Efficiency of Racetrack Betting Markets.
- Gerber, H. U., Shiu, E. S. W. (1994). "Option pricing by Esscher transforms." Transactions of the Society of Actuaries 46:99–191.
- Kaunitz, L., Zhong, S., Kreiner, J. (2017). "Beating the bookies with their own numbers, and how the online sports betting market is rigged." arXiv:1710.02824.
- Cutkosky, A., Orabona, F. (2018). "Black-box reductions for parameter-free online learning in Banach spaces." COLT.
- Augenblick, N., Rabin, M. (2021). "Belief movement, uncertainty reduction, and rational updating." QJE 136(2):933–985.
- Vovk, V., Wang, R. (2021). "E-values: calibration, combination and applications." Annals of Statistics.
- Johari, R., Koomen, P., Pekelis, L., Walsh, D. (2022). "Always valid inference: continuous monitoring of A/B tests." Operations Research.
- Lindon, M., Sanden, C., Shirikian, V. (2022). "Rapid regression detection in software deployments through sequential testing." KDD.
- Wang, R., Ramdas, A. (2022). "False discovery rate control with e-values." JRSS B 84(3):822–852.
- Ruf, J., Larsson, M., Koolen, W., Ramdas, A. (2023). "A composite generalization of Ville's martingale theorem using e-processes." Electronic Journal of Probability 28.
- Waudby-Smith, I., Ramdas, A. (2024). "Estimating means of bounded random variables by betting." JRSS B 86(1).
- Shekhar, S., Ramdas, A. (2024). "Nonparametric two-sample testing by betting." IEEE Trans. Information Theory 70(2).
- Grünwald, P., de Heide, R., Koolen, W. (2024). "Safe testing." JRSS B 86(5).
- Grünwald, P. (2024). "Beyond Neyman–Pearson: e-values enable hypothesis testing with a data-driven alpha." PNAS 121(39).
- Larsson, M., Ramdas, A., Ruf, J. (2024). "The numeraire e-variable and reverse information projection." arXiv:2402.18810.
- Fischer, L., Ramdas, A. (2025). "Sequential Monte-Carlo testing by betting." JRSS B.
- Ramdas, A., Wang, R. (2025). Hypothesis Testing with E-values. Foundations and Trends in Statistics.
- Bürgi, C., Deng, W., Whelan, K. (2025–26). "Makers and takers: the economics of the Kalshi prediction market." CESifo WP 12122.
- Industry and public record: Ivey v Genting Casinos [2014] EWHC 3394 (QB), [2017] UKSC 67; Uston v. Resorts International Hotel, 89 N.J. 163 (1982); UNLV Center for Gaming Research, Nevada Table Games: Historical Hold Percentage Variations (2026); Flutter Entertainment, Form 10-K (FY2024); KalshiEX v. CFTC (D.D.C. 2024); Reserve Bank of Australia, Bulletin (Nov. 1995) on the Barings report.
Papers and sources
Facts checked for this part
- Barings: the Board of Banking Supervision's report (18 July 1995), as summarized by the Reserve Bank of Australia (Bulletin, November 1995): £827 m of unreported losses by 27 February 1995, group capital about £350 m, unauthorised activity for about 2½ years, Leeson controlling front and back office; "clear segregation of duties is fundamental to any effective control system". Account 88888: FIA (2020). ING for £1, founding in 1762, the six-and-a-half-year sentence: public record. The positions' sizes and strikes are not shown (not checked).
- Ivey v Genting [2014] EWHC 3394 (QB): house edge 1.24% (player) and 1.06% (banker), perfect edge sorting about 6.5%, just over £7.7 m won at Crockfords on 20–21 August 2012; [2017] UKSC 67.
- Uston v. Resorts International Hotel, 89 N.J. 163, 445 A.2d 370 (1982): the Casino Control Act left rules on card counting to the Casino Control Commission, which had adopted none, so the casino could not exclude Uston for counting on its own.
- UNLV Center for Gaming Research, Nevada Table Games: Historical Hold Percentage Variations (March 2026): roulette hold 17.34% (2024), monthly average 18.84% (Jan. 2004 – Feb. 2026), s.d. 3.15; blackjack 14.30% (2024).
- Flutter Entertainment plc, Form 10-K for fiscal 2024 (US segment): sportsbook net revenue margin 7.9% (7.5% in 2023), amounts staked $50,876 m.
- Kaunitz, Zhong and Kreiner (2017), arXiv:1710.02824: 56,435 backtested bets, 3.5% return; 265 live bets, $957.50, 8.5%; accounts "severely" limited.
- Kalshi: KalshiEX v. CFTC (D.D.C., September 2024, Judge Jia Cobb); the D.C. Circuit declined to stay it. Polymarket's 2024 presidential market: "nearly $3.7 billion" traded and one trader's net profit of about $79 m (Chainalysis), as reported by The Block.
- Bürgi, Deng and Whelan (CESifo WP 12122): only the qualitative findings (sharper prices near the close, a favourite–longshot bias, stronger for takers) are used; the return figures are not.
- Larsson, Ramdas and Ruf (2024) is cited by its arXiv number (2402.18810); its journal is not given.
- Waudby-Smith and Ramdas, JRSS B 86(1) (2024).
For the researcher
- The theorems. Khinchin (1924), Kolmogorov (1929), Hartman and Wintner (1941) for the LIL; Robbins (1970) and Robbins and Siegmund (1970) for mixture boundaries; Ville (1939); Howard, Ramdas, McAuliffe and Sekhon (2021) for stitched, LIL-rate confidence sequences.
- Simplifications. The video proves only the upper half for Gaussian steps; sub-Gaussian steps change only constants, and the lower half needs the second Borel–Cantelli lemma on independent block increments. The simulated boundaries are checked over 100,000 steps, not forever.
- Open problems. Optimal boundaries for a given use; e-values for composite and nonparametric nulls (Wasserman, Ramdas and Balakrishnan 2020; Grünwald, de Heide and Koolen 2024); heavy-tailed and dependent data (Wang and Ramdas 2023).
Labs, replays and simulations in the film
Labs (House code on screen, then run): cond_exp (2), martingale_transform + system_stakes (4), pattern_wait
(6), esscher_tilt (12), ONSBettor (16), e_bh (18). Fits and learners replayed: the stable-law maximum
likelihood (14, TrainingReplay, three seeds), the ONS bettor (16, TrainingReplay), the Bayesian drift learner (10,
scrubbed by a ValueTracker). Live simulations: the hook's wealth, the next-step fan, six systems, 120 first-passage
walks, the leaking balance, 80 doublers, 60 ruin games, 100 Pólya urns, two peeking counters, the confidence sequence.
3D: the projection (2), the dyadic Radon–Nikodym city (13).
Textbook audit
| Textbook section | Chapter |
|---|---|
| Williams, Probability with Martingales, ch. 0 (branching process) | 10 (convergent martingales), README |
| Williams ch. 1–3 (measure spaces, events, random variables) | 1 |
| Williams ch. 4 (independence; §4.9 the monkey typing Shakespeare) | 1, 6 (ABRACADABRA) |
| Williams ch. 5–6 (integration, MON, DOM) | 6 (dominated convergence in the proof) |
| Williams ch. 7–8 (strong law, product measure) | 13 (L_n → 0, Kakutani) |
| Williams ch. 9 (conditional expectation, least squares, properties) | 2 |
| Williams ch. 10 (filtrations, martingales, "you can't beat the system", stopping times, optional stopping, hitting times) | 3, 4, 5, 6 |
| Williams ch. 11 (upcrossings, Doob's forward convergence theorem) | 10 |
| Williams ch. 12 (L²-bounded martingales, Doob decomposition, ⟨M⟩) | 11 |
| Williams ch. 13 (uniform integrability) | 6, 10 |
| Williams ch. 14 (UI martingales, Lévy upward, Doob's inequalities, Kakutani, Radon–Nikodym, likelihood ratios) | 10, 13, 15, 12 |
| Williams ch. 15 (applications: representation, discrete Black–Scholes, filtering) | Parts 5, 7, 9 |
| Williams ch. 16–18 (characteristic functions, weak convergence, CLT) | 14 |
| Shreve I, §2.1–2.2 (finite probability spaces) | 1 |
| Shreve I, §2.3 (conditional expectations) | 2 |
| Shreve I, §2.4–2.5 (martingales; Markov processes) | 3 |
| Shreve I, §3.1–3.2 (change of measure, Radon–Nikodym derivative process) | 12 |
| Shreve I, §5.2–5.3 (first passage times, reflection) | 5 |
| Shreve I, ch. 4 and §5.4 (American claims) | Parts 8, 10 |
| Shreve II, §1.1–1.3 (infinite probability spaces, coin tosses and Lebesgue measure) | 1 |
| Shreve II, §1.4 (convergence of integrals) | 6 |
| Shreve II, §1.6 (change of measure) | 12 |
| Shreve II, §2.2–2.4 (information, independence, conditional expectation) | 1, 2 |
| Föllmer–Schied, §1.2 (arbitrage and martingale measures, preview) | 7, 13 (full treatment Part 9) |
| Föllmer–Schied, App. A.2 (absolutely continuous and equivalent measures) | 13 |
| Durrett, Probability: Theory and Examples, ch. 4 (martingales) | 3–6, 10 |
Section numbers in Williams are given at chapter level, except §4.9; the chapter titles were checked against the book's contents.
Data, scope and reproducibilityInterpretation and reproducibility boundaries
The market curves in the opening, Chapter 15 and Chapter 16 are historical diagnostic scores. Estimated centering, clipping and retrospective 60-day scale initialization do not establish a calibrated test of zero raw-return conditional means. Ville requires the actual bounded outcome to have conditional mean zero and all stakes and scales to be predictable. Noncrossing does not establish market fairness. The Doob market split is likewise an estimated drift/residual decomposition after a retrospective 250-day initialization, not proof that its residual is a martingale. The Gaussian drift learner displays model-based credible bands, not a confidence sequence.
The confidence-sequence correction removes candidate-dependent clipping and normalizing, uses two one-sided wealths with a common predictable stake rule and α/2 in each direction, and rounds grid brackets outward. Its assumptions are bounded observations with one common conditional mean; that working model is not established for market returns. btc_mean_confseq_bounded_v2 records the correction separately. All previous registrations, sealed datasets and opened records remain unchanged; no holdout is opened. confseq_valid replaces the legacy display item, and the trial count increases once to 232.
The e-BH simulation reviews every 21 trading days, uses one-sided known-variance z p-values for BH, and assigns FDP zero when no action occurs by the horizon. Its twenty-seed FDR estimates are not a calibration proof. Common stopping requires e-process validity in the joint filtration. The Kelly bridge optimizes fixed linear stakes on a grid under a simulated alternative; it is not a claim of uniformly greatest finite-sample power.
The general iid finite-variance LIL fixes the limsup: every (1−ε) envelope is crossed infinitely often and every (1+ε) envelope only finitely often; the exact envelope is not decided by the limsup alone. The displayed exponential upper-bound proof assumes Gaussian or conditional 1-sub-Gaussian increments; general finite variance needs additional truncation. Robbins's boundary assumes the same conditional MGF bound. The worked comparison at ρ=100, α=0.05 gives 3.66 standard deviations at t=100 and 3.27 at t=10,000, against 1.96 for one look. The Gaussian research simulation starts at step 1; Chapter 15's coin experiment starts at step 20.
Chapter notesChapters (about 64 minutes)
- Can you beat a fair game? A bettor wagers every day since 1926 that today's US return keeps yesterday's sign; a retrospective diagnostic, drawn live: its score passes 20 in February 1929 and reaches about 10¹⁰¹; started in 2000 it peaks at 6.7. The problem of points (Pascal to Fermat, 29 July 1654) as a tree: 2–1 is worth 48 : 16, 2–0 is worth 56 : 8. The era strip from 1654 to 2023; objectives; the House.
- 1. Information: σ-algebras and filtrations. Eight worlds and refining partitions; |F_n| = 2^(2^n); measurability as "constant on every block" (the first toss passes, the number of heads fails); adapted processes. The coin space as the unit interval, zoomed six tosses deep; Kolmogorov (1933).
- 2. Conditional expectation is a projection. Kolmogorov's definition, the partition formula, orthogonality,
Pythagoras (best mean-square forecast), taking out what is known, the tower, Jensen and independence, each with a
reason. In 3D: Ω = {a, b, c}, P = (0.5, 0.3, 0.2), coordinates √p_i x_i; X = (3, 0, 1) projects to (1.875, 1.875, 1)
and then to 1.7, as does X directly. On the market, E[r_{t+1} | sign r_t]: 1926–74 +13.5 / −9.4 bp, 1975–99
+16.0 / −5.0 bp, 2000–20 −0.3 / +7.9 bp, with 200 resamples of 20-day blocks, fitted retrospectively within each era. Lab 1:
cond_exp. - 3. Martingales: Ville's fair games. Definition, super- and submartingales, Ville and Doob; S_n² − n, the exponential martingale, Doob's martingale and Jensen, each proved. The best-of-21 forecast drawn live with the next-step fan (tomorrow's two values, their mean = today). E(S_n − 2)⁺ rises to 1.92 at n = 50, E|S_50| = 5.61; Markov ≠ martingale.
- 4. You can't beat the system. The martingale transform (Williams, ch. 10) and the cheat who stakes after
peeking. The curtain desk: twelve tosses, stakes set before each card turns. Six systems on European red over
20,000 sessions of 200 spins (limit 500): loss ÷ staked = −0.0267 (flat), −0.0250 ± 0.0025 (doubling), −0.0266
(d'Alembert), −0.0274 (Labouchère), −0.0255 ± 0.0028 (Fibonacci), −0.0268 (Oscar): all within two standard errors
of −1/37. Lab 2:
martingale_transformandsystem_stakes. - 5. Stopping times, and the walk that always wins. The bell and the curtain (a hitting time rings; "the top of the path" needs the future). Stopped martingales; reflection P(τ₁ > n) = P(S_n ∈ {0, 1}) ≈ √(2/(πn)); E τ₁ = ∞ by Wald; the generating function (Shreve I, ch. 5). 10,000 walks to 10⁵ steps: P(τ₁ > 100) = 0.0757 (exact 0.0796); the mean of τ₁ ∧ n is 14, 45, 146, 483 for n = 10², 10³, 10⁴, 10⁵.
- 6. Optional stopping, proved. The three conditions and uniform integrability; the leaking balance (S_{τ₁∧n}
for n = 10 … 10⁴: 76% → 99% at +1, the population mean stays 0 (Monte Carlo means fluctuate; all paths and the +1 atom are retained)). Li's (1980) casino of gamblers: E τ(HH) = 6; simulated
waits 6.00, 4.00, 10.01, 14.05 for HH, HT, HTH, HHH; Penney: THH beats HHT 3/4 of the time (simulated 0.749);
ABRACADABRA: 26¹¹ + 26⁴ + 26. Lab 3:
pattern_wait. - 7. Doubling and admissible strategies. Why doubling escapes optional stopping; bankroll 2^k − 1 makes the game fair; 1,000 doublers × 3,000 sessions drawn live: 94.2% ruined at least once (theory 94.7%), mean P&L +9.9 ± 55, mean wait for the first ruin 1,026 (theory 1,024). Admissibility (Harrison–Pliska 1981; Dybvig–Huang 1988).
- 8. Doubling down: Barings, 1995. The crisis file with the Board of Banking Supervision's figures (via the RBA Bulletin, Nov. 1995): £827 m of unreported losses by 27 February 1995, group capital about £350 m. FRED's Nikkei through Kobe. A schematic doubling rule on the real index (labelled as such): it reaches 256 units and crosses a stated capital six days after Kobe; with unlimited credit it would have recovered within days, capped at 16 units it never does. Segregation of duties as the control that enforces the theorem's hypotheses.
- 9. Gambler's ruin and bold play. a/b and de Moivre's (q/p)^X; expected duration a(b − a) = 2,500 (4,000 games: 2,481 ± 31; roulette 1,598 vs 1,618); the roulette curves (50%, 6.3%, 0.51%); bold play (Dubins–Savage 1965).
- 10. Martingales converge. The upcrossing trader and Doob's lemma (Gaussian walks: mean upcrossings of [−3, 3] 1.46 against the bound 1.87); Doob's forward convergence theorem; uniform integrability. 100 Pólya urns live and the limits of 10,000 (K–S distance from uniform 0.007; P(limit > 0.9) = 0.097). Lévy's upward theorem as learning: a Bayesian learner of the market's mean, scrubbed from 1926: ±7.8% a year after ten years, 9.5% ± 2.0% by 2020.
- 11. Doob's decomposition. Existence, uniqueness, ⟨M⟩, and the filtration's role. Ivey v Genting with the court's figures (house edge 1.24%, sorting edge about 6.5%): one simulated punto banco game, two drifts. The US market: 9.06 = 7.28 + 1.78; the compensator 2.893 against realized quadratic variation 2.894.
- 12. Change of measure. P, Q and L on three tosses; the density process, Bayes' rule, discrete Girsanov, Esscher;
200 paths recoloured, not moved; L collapses under P (median 0.002) and grows under Q. The Esscher measure of US
returns: θ = −2.60, mean daily log return 3.64 → 0.60 bp, the worst 1% of days carry 1.13% of Q's weight.
Lab 4:
esscher_tilt. - 13. Radon–Nikodym, and the singular infinite. The theorem by dyadic martingales; equivalence and arbitrage; Kakutani's dichotomy. In 3D: bars Q(cell)/P(cell) refine from 2×2 to 16×16 into the density (1 + 2xy)/1.5, while a diagonal Q never forms a surface. Simulated: a constant 60% tilt sends log₁₀ L to about −88 in 10,000 tosses; a fading tilt ½ + 0.2/k keeps L positive with mean 0.99.
- 14. Heavy tails as stable laws. Lévy, Mandelbrot, Fama; McCulloch's α (1.40 US, 1.27 Bitcoin; Mantegna and Stanley's 1.40 on screen); the characteristic function and Koutrouvelis's regression (US 1.75 [1.74, 1.78], Gaussian control 2.00); a maximum-likelihood fit replayed for three samples (α̂ = 1.45, 1.45, 1.51 against McCulloch's 1.35, 1.35, 1.41); the kurtosis of h-day sums falls from 17.7 (h = 1) to 5.3 (h = 60): descriptive evidence of changing standardized shape, not proof of finite variance. For α < 2, stable variance and fourth moments diverge; standardized population kurtosis is undefined.
- 15. Ville's inequality and testing by betting. The theorem and its proof; e-values (Vovk–Wang calibration); the law of the iterated logarithm. Two live counters over 2,000 fair coin games, checking from step 20: daily known-variance z checks 50% false alarms, e-process 3.2%. Shafer and Vovk's game. Real data, as in the hook.
- 16. Learning to bet. Kelly growth and the time to reject (2 log 20 / SR², about 2,400 days at a daily Sharpe of
0.05); the online Newton step bettor replayed over 10,000 days (crosses 20 on completed day 2,542; stake near 0.21 against
Kelly 0.20; replay sampled every twenty days through completed day 9,981); a race of four bettors × four edges × 8 seeds (no edge: 3.1–4.5% false alarms; at SR 0.05 the fixed
menu, median 3,054 days, beats ONS 3,393 and aGRAPA 3,475, the oracle needs 1,865); the hook's tests with the
learner; a corrected two-sided betting confidence sequence for the common conditional mean of Bitcoin log returns clipped to [−0.2, 0.2] (−28 to +40 bp a day at the end of 2020, with 4 bp outward grid brackets). Lab 5:
ONSBettor; Rule 5 gains "the stake may be learned"; trial counter 232 (including the separately registered correction). - 17. The house, the book and the market. Nevada roulette hold 17.34% (2024) against a 5.26% edge: an implied wager/drop ratio of about 3.3 under that assumed edge (UNLV); Azuma's bound against the exact chance the house is behind; Thorp, Uston v. Resorts, Ivey; Kaunitz, Zhong and Kreiner's bookmaker study; Flutter's US sportsbook margin (7.9%, 2024); Benter (as reported); Kalshi and Polymarket; Augenblick–Rabin's movement test (Bayesian forecasts 1.00, a 30% overreactor 1.47); Bürgi–Deng–Whelan on Kalshi; sequential testing at Optimizely and Netflix.
- 18. Frontier: anytime-valid inference, 2023–2026. Ten papers on screen; the numéraire bridge (the Kelly
portfolio is the log-optimal e-variable); e-BH on 200 strategies × 2,520 days × 20 seeds: reviewing every 21 trading days and stopping on the first review
with ten discoveries, e-BH's FDR is 2.5% and BH's 17.8%. Lab 6:
e_bh. - For the researcher: how far can a fair walk wander? Khinchin's law of the iterated logarithm; the upper half proved from Doob's maximal inequality on geometric blocks and Borel–Cantelli. 1,000 null walks of 100,000 N(0, 1) steps: the fixed boundary \(1.96\sqrt t\) checked at every step is crossed by 60% by \(t \approx 3{,}000\) and 74% by 100,000. Robbins's normal mixture \(M_t = \sqrt{\rho/(t+\rho)}\,e^{S_t^2/(2(t+\rho))}\) derived and its Ville boundary \(\sqrt{(t+\rho)\log((t+\rho)/(\rho\alpha^2))}\): crossed by 5.5% (\(\pm 0.7\)); the stitched boundary of Howard, Ramdas, McAuliffe and Sekhon (2021) by 0.6%. Widths at 100,000 steps: 1.96 (valid once), 3.6 (mixture), 4.3 (stitched, the LIL rate but a larger constant). Three open problems.
- Recap, desk questions, problems.
中文讲义
本讲的中文说明、交易台问题与习题解答(与英文版对应)。
导言量化金融,从零搭建 — 第4部分:鞅与测度
本部分是第二幕“数学工具箱”的第一部分,以研究生课程的深度把“公平博弈”变得精确:σ代数与过滤,条件期望即投影,鞅与鞅变换,停时与可选停止定理 (附证明),加倍下注与容许策略,巴林银行,赌徒破产,鞅收敛,杜布分解,测度变换,拉东–尼科迪姆定理与角谷二分法,稳定分布,维尔不等式与以下注来检验, 学会下注,赌场、博彩公司和预测市场如何与这一切共处,以及2023–2026年的研究前沿。所有数字都由本系列自己的代码根据公开数据算出;模拟和示意在屏幕上 标明,公司、判例和事件来自公开记录,二手报道标明“据报道”。
讲的是方法,不构成投资建议,也不构成任何博彩建议。
Chapter notes各章(约64分钟)
- 你能战胜公平博弈吗? 1926年以来每天押“今天与昨天同号”的赌徒,财富在1929年2月越过20;从2000年开始最高只到6.7。点数问题 (帕斯卡致费马,1654年7月29日):二比一值48比16,二比零值56比8。1654–2023年的时间线。
- 1. 信息:σ代数与过滤。 八个世界与不断细分的划分;|F_n| = 2^(2^n);可测即“在每一块上为常数”;适应过程;单位区间上的掷币空间;科尔莫戈罗夫。
- 2. 条件期望是一种投影。 定义、划分公式、正交性、勾股定理、提出已知量、塔性质、詹森与独立性。三维投影:X = (3, 0, 1) → (1.875, 1.875, 1) → 1.7。
市场上E[r_{t+1} | sign r_t]:1926–74年 +13.5 / −9.4个基点,1975–99年 +16.0 / −5.0,2000–20年 −0.3 / +7.9。实验1:
cond_exp。 - 3. 鞅:维尔的公平博弈。 上鞅、下鞅;S_n² − n、指数鞅、杜布鞅、詹森;二十一局十一胜制的实时预测与“下一步扇形”;E(S_50 − 2)⁺ = 1.92。
- 4. 你赢不了这个系统。 鞅变换;幕布后的十二次掷币;六个系统在欧式轮盘上各两万局:损失/注额都在−1/37的两个标准误之内。实验2:
martingale_transform。 - 5. 停时,以及永远会赢的随机游走。 敲钟与幕布;反射原理;E τ₁ = ∞(沃尔德);一万条游走走到10⁵步:P(τ₁ > 100) = 0.0757(精确值0.0796)。
- 6. 可选停止定理的证明。 三个条件与一致可积;“漏掉的天平”;李硕彦的赌徒赌场:E τ(HH) = 6;彭尼游戏3/4。实验3:
pattern_wait。 - 7. 加倍下注与容许策略。 一千位加倍下注者×三千局:94.2%至少破产一次,平均盈亏+9.9 ± 55,首次破产平均1,026局;哈里森–普利斯卡,迪布维格–黄。
- 8. 加倍下注:巴林银行,1995。 银行监管委员会的数字:到1995年2月27日未申报亏损8.27亿英镑,集团资本约3.5亿英镑;日经指数与神户地震; 在真实指数上的示意加倍规则(明确标注);职责分离。
- 9. 赌徒破产与大胆下注。 a/b与棣莫弗鞅;期望持续时间a(b − a) = 2,500(模拟2,481 ± 31);大胆下注(Dubins–Savage)。
- 10. 鞅会收敛。 上穿交易者与杜布引理;一百个波利亚罐子;列维向上定理即学习:贝叶斯学习者到2020年估计市场年均收益9.5% ± 2.0%。
- 11. 杜布分解。 存在性、唯一性、⟨M⟩、过滤的作用;艾维案(法院认定的1.24%与6.5%);美国市场9.06 = 7.28 + 1.78。
- 12. 测度变换。 密度过程、贝叶斯法则、离散吉尔萨诺夫、埃舍尔变换;美国收益的埃舍尔测度:θ = −2.60,最差1%的日子承载Q的1.13%权重。实验4:
esscher_tilt。 - 13. 拉东–尼科迪姆,以及奇异的无穷。 二进鞅证明;等价与套利;角谷二分法;三维柱状城市收敛到密度。
- 14. 作为稳定分布的厚尾。 麦卡洛克α = 1.40;特征函数回归1.75;最大似然拟合回放;h日收益的峰度从17.7降到5.3:这是标准化形态变化的描述性证据,并非有限方差的证明。
- 15. 维尔不等式与以下注来检验。 证明;e值;重对数律;每日已知方差z检验误报50%,e过程3.2%;沙弗–沃夫克博弈。
- 16. 学会下注。 凯利增长与拒绝时间;在线牛顿步下注者回放;回放使用实际天数推进,每20天取样至第9,981天,首次越过20为完成第2,542天;四种下注者的比赛;对裁切至[−0.2, 0.2]的比特币对数收益,在共同条件均值模型下构造置信序列:2020年末为[−28, +40]基点,4基点网格向外取界。更正单独登记,累计试验232次。实验5:
ONSBettor。 - 17. 赌场、庄家与市场。 内华达轮盘留存率17.34%对5.26%优势;东和敬不等式;索普、乌斯顿案、艾维案;考尼茨等人的博彩研究;Flutter 7.9%; Kalshi与Polymarket(据报道);奥根布利克–拉宾检验;Optimizely与Netflix。
- 18. 前沿:随时有效的推断。 十篇论文;计价单位之桥;两百个策略上的e-BH:每21个交易日评审,以“首次评审有十个发现”为停止规则,e-BH的FDR为2.5%,BH为17.8%。实验6:
e_bh。
教科书对照表见英文部分。
Desk questions, with solutions交易台问题与解答
- 一个鞅从1出发,首次碰到0或3时停止。 停止过程夹在0和3之间,可选停止定理成立:E[M_τ] = 1。设p = P(碰到3),则3p = 1,p = 1/3。
- 期望掷多少次才出现两个连续正面? 每次掷币前来一位新赌徒,拿1美元按公平赔率押正面;若中,再把2美元押正面,否则离开。先对不相交的两次投掷分块,以几何尾界证明E τ < ∞。赌场净收入为步长有界的鞅。HH在τ时刻首次出现时,赌场收进τ美元,要付τ − 1时刻到来的赌徒4美元、τ时刻到来的赌徒2美元:E[τ] = 6。(HT的答案是4。)
- 经典先达目标再破产模型,手上100美元,目标200美元。 全部押红一次,成功概率18/37 ≈ 48.6%;每次押1美元,成功概率约0.45%。在经典劣势、等额赔率且下注额可任意细分、无赌桌限额和硬性期限的模型中,大胆下注最优。
- 彭尼游戏:正正反对反正正。 除非前两次都是正面(概率1/4,此时正正反必然先出现),否则在任何正正之前已出现过反面,于是第一个正正前面是反面: 反正正不晚于正正反出现。P(反正正先出现) = 3/4(模拟0.749)。
- 公平游走在第一次领先1时停止,E τ是多少? 无穷大。若E τ有限,沃尔德恒等式给出E S_τ = 0,但S_τ = 1。
Problems, with worked solutions习题与解答
-
离开区间的时间。 证明对公平的\(\pm 1\)游走,\(S_n^2 - n\)是鞅。用可选停止求游走首次到达\(\pm a\)的期望时间。
解答
S²_n − n是鞅;先在τ ∧ n停止,τ为首次|S| = a。E[τ ∧ n] = E[S²_{τ∧n}] ≤ a²,单调收敛给出Eτ有限,再对有界位置用控制收敛得到Eτ = a²。
-
有偏博弈的破产概率。
解答
(q/p)^{X_n}是鞅,可选停止给出P(碰到b) = (1 − (q/p)^a)/(1 − (q/p)^b);p = 18/37、a = 10、b = 20时为36.8%。
-
本金2^k − 1的加倍下注。 本金为\(2^k - 1\)的加倍下注:证明每一轮的期望收益为零,并求破产前的期望轮数。
解答
期望收益(1 − 2^{−k}) − 2^{−k}(2^k − 1) = 0;直到第一次破产的轮数服从均值2^k的几何分布(k = 10时模拟为1,026)。
-
似然比的崩塌。 对硬币\(p = 0.5\)和\(q = 0.6\),证明\(\mathbb{E}_P[L_n] = 1\)但\(\tfrac{1}{n}\log L_n \to -D(P\,\|\,Q)\)。计算\(D\)并预测\(L_{300}\)的中位数。
解答
E_P[L_n] = 1,而(1/n) log L_n → −D(P‖Q) = −0.0204;L₃₀₀的中位数约0.0022;一万次后log₁₀ L ≈ −88.6(模拟中位数−88.3)。
-
维尔不等式与反复查看。
解答
在有界时刻min(τ, n)应用可选停止:1 ≥ c·P(τ ≤ n),令n → ∞。由重对数律,每天查看的已知方差z检验终将拒绝真实的原假设。
-
波利亚罐子的极限。 从一红一蓝开始的Pólya罐:证明对 \(k = 1, \dots, n + 1\) 有 \(P(R_n = k) = 1/(n + 1)\),因此红球比例的极限服从均匀分布\((0, 1)\)。
解答
归纳:若P(R_n = k) = 1/(n + 1),则P(R_{n+1} = k) = 1/(n + 2);所以红球比例在极限上服从Uniform(0, 1)。
-
沃尔德恒等式。 当 \(\mathbb{E}\tau < \infty\) 时,从鞅 \(S_n - n\mu\) 和可选停止证明Wald恒等式 \(\mathbb{E}S_\tau = \mu\,\mathbb{E}\tau\)。
解答
M_n = S_n − nμ是鞅;若E τ < ∞,停止后的过程由Σ_{k≤τ}|ξ_k − μ|控制;Tonelli及增量与{τ ≥ k}独立说明此量可积,由控制收敛得E S_τ = μ E τ。
-
(资格考试)高斯增量重对数律的上半部分。 (资格考试)独立同分布\(N(0,1)\)增量下,用几何分块的杜布最大不等式和博雷尔–坎泰利,证明\(\limsup S_t/\sqrt{2t\log\log t}\le1\)几乎必然成立。
解答
取\(\epsilon > 0\)与\(1 < \theta < (1 + \epsilon)^2\),\(t_k = \theta^k\),\(x_k = (1 + \epsilon)\sqrt{2t_k\log\log t_k}\)。由杜布不等式,\(\Pr(\max_{t \le n}S_t \ge x) \le e^{-x^2/2n}\);区间\((t_k, t_{k+1}]\)内越界 意味着\(\max_{t \le t_{k+1}}S_t \ge x_k\),概率至多\((k\log\theta)^{-(1 + \epsilon)^2/\theta}\),对\(k\)可求和。由博雷尔–坎泰利, \(\limsup \le 1 + \epsilon\)几乎必然成立。
-
(资格考试)罗宾斯边界。
解答
配方得\(M_t = \sqrt{\rho/(t + \rho)}\,e^{S_t^2/2(t+\rho)}\);均值为一的非负鞅的混合仍是这样的鞅, 由维尔不等式\(\Pr(\exists t: M_t \ge 1/\alpha) \le \alpha\),而\(M_t \ge 1/\alpha\)等价于\(S_t^2 \ge (t + \rho)[\log((t + \rho)/\rho) + 2\log(1/\alpha)]\)。
For the researcher写给研究者
重对数律(辛钦1924;柯尔莫哥洛夫1929;Hartman与Wintner 1941);混合边界(罗宾斯1970);维尔(1939);拼接的、达到重对数律速度的置信序列 (Howard、Ramdas、McAuliffe与Sekhon 2021)。开放问题:针对给定用途的最优边界;复合与非参数原假设的e值;厚尾与相依数据。
Data, scope and reproducibility解释与复现边界
开场、第15和16章的市场曲线为历史诊断得分;估计中心、裁切和回溯60天尺度初始化,不能确立对原始收益条件均值为零的校准检验。维尔不等式要求实际有界结果的条件均值为零,所有下注额和尺度均可预测;未越界不证明市场公平。杜布市场分解是在回溯250天初始化后的估计漂移与残差,不证明残差是鞅。高斯漂移学习者的带状区间是模型可信带,并非置信序列。
置信序列更正移除依赖候选均值的裁切和归一化,以共同可预测下注规则构造两个单侧财富,各分配α/2,并将网格交点向外取界。它需要有界观测具有共同条件均值,市场收益尚未被证明满足此模型。更正单独登记为btc_mean_confseq_bounded_v2;先前登记、封存数据及开启记录均不变,不开启留出数据,试验数仅增加一次至232。
e-BH实验每21个交易日评审,BH使用单侧已知方差z检验的p值;到期未行动则FDP为零。20个种子的FDR均值不是校准证明;共同停止要求每个e过程在联合滤过下有效。凯利桥只对固定线性下注额作网格优化,不声称有限样本功效一致最强。
一般独立同分布、有限方差的重对数律刻画上极限:每个(1−ε)包络被越过无穷多次,每个(1+ε)包络仅有限次,不能仅由上极限判断精确包络。屏幕上的指数上界证明及罗宾斯边界要求高斯或条件1次高斯增量;一般有限方差还需截断论证。ρ=100、α=0.05时,解答给出t=100的3.66个标准差和t=10,000的3.27,对照单次查看的1.96。研究章高斯实验从第1步查看,第15章硬币实验从第20步开始。稳定分布α<2时方差及四阶矩发散,标准化总体峰度未定义。
Build the film
python -m videos.quant.quant4.compute # the part's numbers, into .cache/quant4
python tools/make.py quant4 # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant4 Hook # one chapter, silent, with a contact sheet
Scenes: videos/quant/quant4. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.