QQuant, Built

Act II · The Mathematical Toolkit

Part 8 of 43

Decisions and Control

Undergraduatestarts at this level66 min of film 22 chaptersprerequisites: Part 4, Part 5

You have an edge. How much of your wealth should you bet on it?

Too little wastes the edge and too much is ruin, and the curve between them has one peak: Kelly's fraction. The part reaches it from utility theory, then generalizes the question to choosing through time. Bellman's principle becomes the Hamilton-Jacobi-Bellman equation, Merton's portfolio problem is solved, transaction costs open a no-trade wedge, and optimal stopping gives the American option its exercise boundary. LTCM is the case of an edge sized without regard to the error in its own estimate. At the end a reinforcement-learning agent is trained on Merton's problem and compared with the closed form.

What you need. Parts 4 and 5 for the continuous-time chapters; the Kelly chapters need only logarithms.

What you will be able to do

Undergraduate

  • Compute the Kelly fraction of a bet and the growth rate of any other fraction.
  • Explain risk aversion with a utility function and a certainty equivalent.

Master's

  • Solve a finite dynamic program backwards; write and verify the HJB equation for Merton's problem.
  • Characterize an optimal stopping problem by its Snell envelope and smooth fit.

PhD

  • Quantify estimation risk in Merton's rule (the expected loss of the plug-in fraction); read viscosity solutions, BSDEs and mean-field games as extensions of the same principle.

Industry

  • Size a position under parameter uncertainty and a drawdown limit; say why practitioners use a fraction of Kelly.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 21 min · Master's 49 min · PhD 66 min · Industry 27 min.

  1. 0How much to bet, and how we got hereUndergraduate4 min
  2. 1Utility and risk aversionUndergraduate3 min
  3. 2Bellman's principle: solving backwardsUndergraduate3 min
  4. 3The HJB equation and the verification theoremMaster's3 min
  5. 4When the value function has kinks: viscosity solutionsPhD3 min
  6. 5Merton's problemMaster's3 min
  7. 6Consumption, and the martingale methodMaster's3 min
  8. 7Transaction costs: the no-trade wedgeMaster's3 min
  9. 8Kelly and BreimanUndergraduate3 min
  10. 9Fractional Kelly, estimation risk, and LTCMUndergraduate3 min
  11. 10Samuelson's objection, and ergodicityMaster's2 min
  12. 11Optimal stopping: the Snell envelopeMaster's2 min
  13. 12Free boundaries: smooth fit and the American putMaster's3 min
  14. 13How people decide: prospect theory and ambiguityUndergraduate3 min
  15. 14Backward stochastic differential equationsPhD3 min
  16. 15Mean-field games: the crowd that sells togetherPhD3 min
  17. 16Reinforcement learning on Merton's problemMaster's3 min
  18. 17Who sizes bets for a livingIndustry4 min
  19. 18The frontier, 2023 to 2026PhD2 min
  20. For the researcher: estimation risk in Merton's rulePhD5 min
  21. 19The sizing moduleIndustry2 min
  22. 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.

How much to bet, and how we got hereUndergraduate4 min

Part seven forecast how much the market will move. This part asks the question every trader faces next: given what you believe, how much should you bet?

Here is a game. You get twenty-five dollars and a coin that lands heads sixty percent of the time. For half an hour, you may bet any amount on either side at even odds, as often as you like, with a maximum cash payout of two hundred and fifty dollars. How much do you bet? In 2016 Victor Haghani and Richard Dewey gave this game to sixty-one people trained in finance and economics. About thirty percent lost their entire bankroll.

Let the game play itself first. Each column has a hundred and sixty players. Independent coin sequences are paired across the four fractions: ten, twenty, forty or a hundred percent. This is a three-hundred-flip illustration, with wealth capped at two hundred and fifty dollars and absorbed below one cent. Pause and predict: which column hits the bust threshold most often, forty or a hundred? Does forty grow without the cap? Three hundred flips, on a log scale.

All in: percent went bust, because one tail takes everything. At forty percent, uncapped expected log growth is slightly negative; percent nevertheless reached the absorbing cap and percent hit the lower threshold. At twenty percent, percent reached the cap and none hit that threshold in this sample. A fraction below one never makes positive wealth exactly zero in a finite number of flips.

The log-growth answer is older than the game. At a fixed fraction f, uncapped growth per flip is p log one plus f, plus q log one minus f. It peaks at p minus q, twenty percent: Kelly's 1956 criterion. At forty percent, exact expected log growth is already minus point two four five percent per flip. The second zero is near, but below, twice Kelly. The cap and finite horizon define a different objective. In twenty thousand simulated players per fraction, percent at twenty percent reach the cap and none hit the one-cent threshold; all in, percent go bust. These are sample frequencies.

How we got here. Daniel Bernoulli proposed log utility in 1738; von Neumann and Morgenstern built expected utility on axioms in 1944; John Kelly found the growth rule in 1956, and Richard Bellman the recursion behind every multi-stage decision in 1957. Robert Merton solved the investor's problem in 1969; in 1979 Paul Samuelson attacked Kelly, and Kahneman and Tversky showed how people really choose. Crandall and Lions made the Bellman equation rigorous in 1983, and 1990 brought Davis and Norman's trading costs and Pardoux and Peng's backward equations. Then games with a continuum of players, in 2006, and in 2017 the learning algorithm we will test. One tree, rooted in expected utility: how much to bet, how to decide over time, against a crowd, how people really decide, and how a machine learns it.

The plan. Utility and the price of risk. Bellman's recursion, the HJB equation and the theory behind it. Merton's problem with consumption and trading costs. Kelly, proved and criticized. When to stop, and how people really decide. Backward equations, crowds and a learning machine. And how funds size bets in practice.

In the House, this part builds the sizing module: utility, the Merton and Kelly fractions, and the solvers behind them. Every position the House takes, from Part ten's options to Part thirty's portfolios, will be sized by it.

1Utility and risk aversionUndergraduate3 min

In 1738 Daniel Bernoulli looked at a game with an infinite expected payout, a pot that doubles until a coin lands heads, that nobody would pay much to play. His answer: value money by a utility, the logarithm of wealth. In 1944 von Neumann and Morgenstern made it a theorem. If your preferences among gambles are complete, transitive, continuous, and independent, meaning that mixing two gambles with the same third never reverses their order, then you prefer A to B exactly when A has the larger expected utility. This is the standard representation for finite lotteries; extensions to unbounded outcomes need additional regularity and integrability.

Take a coin flip that leaves you with fifty or a hundred and fifty, from a hundred, and log utility. Hang the two outcomes on the curve as equal weights. Their balance point is the middle of the chord, and its height is the expected utility; because the curve bends, the chord lies below it. Slide left until you meet the curve: that sure wealth is worth as much as the gamble, the certainty equivalent, . The gap of is the risk premium, and the bend is risk aversion.

Economists usually give the curve one dial: power utility, wealth to the power one minus gamma, over one minus gamma, with the logarithm at gamma one. Someone with this utility takes the same gambles, in percentages, rich or poor. Scale the curve so the two outcomes stay at zero and one: then the chord never moves, and only the bend changes. Turn the dial. As gamma rises the curve bends harder, and the certainty equivalent slides left: at gamma three, and at thirty, , barely above the worst outcome. Gamma is positive for risk aversion; its empirical estimate depends strongly on the setting and model.

What is the bend worth in money? Pratt in 1964 and Arrow in 1965: define the premium pi so that a fair gamble is as bad as losing pi for sure. Expand the left side to second order; the mean is zero, so half the variance times u double prime remains. Expand the right side to first order. Equate: the premium is half the variance times the absolute risk aversion. Divide by wealth, and relative risk aversion appears: for power utility, exactly gamma. This is a local approximation for a small mean-zero gamble and sufficiently smooth utility, with the remainder controlled. Dollar variance gives a dollar premium; return variance gives the premium relative to wealth.

Check it. For a ten-dollar gamble the approximation is nearly exact; for fifty dollars it drifts: against at gamma one. Pause and predict: with gamma three, would you pay more or less than twenty to avoid the fifty-or-a-hundred-and-fifty flip? More: . One warning, from Matthew Rabin in 2000: utility of wealth cannot explain refusing small favourable bets without absurd refusals of large ones. Chapter thirteen takes that up. Utility ranks one decision. Most decisions repeat. Next: how to decide over time, backwards.

2Bellman's principle: solving backwardsUndergraduate3 min

Richard Bellman's principle of optimality says that an optimal plan remains optimal in the states it reaches, under the information and admissibility rules of the model. Work backward from terminal utility. At each node choose a feasible stock fraction to maximize expected next-period value. Here returns are independent across dates with the same opportunity set, utility is CRRA, gross wealth stays positive, and fraction constraints do not depend on wealth. Guess a power of wealth times a time coefficient. Wealth factors out of the one-period maximum. Under these assumptions the optimal fraction is independent of wealth and horizon. Stochastic investment opportunities can add hedging demand, so CRRA alone does not establish myopia.

Lab one: the House's solver. It takes Merton's market, a stock with eight percent expected return and eighteen percent volatility and a bond at two percent, and an investor with gamma three over ten years. Expectations come from fifteen Gauss-Hermite nodes. It steps backwards a month at a time; at every wealth on its grid it tries a hundred and fifty-one fractions, interpolates next month's value through its certainty equivalent, and keeps the best. Run it. Without a floor it chooses to percent across the whole grid: Merton's percent, to the grid's step, everywhere. A dumb search found the formula.

Now add a floor: the investor must end ten years with at least sixty cents of every starting dollar. The surface is the solver's decision at every wealth and date, built the way it is computed: backwards from year ten, slab by slab. The inset is the slab's choice at a wealth of one: next period's expected value against the fraction, a hump whose peak is the decision. It walks from percent near the deadline to today. The faint plane is Merton without a floor; with it, the decision falls toward zero near the floor, more steeply as the deadline nears.

Slice it at three dates. The solver invests Merton's fraction of the cushion, the wealth above what the floor costs today. Pause and predict: near the deadline, just above the floor, does the fraction rise or fall? It falls: the cushion shrinks, and so does the bet. The lines are the closed form, portfolio insurance; the dots, the solver, which never saw it. They differ by at most . Let the steps shrink to zero and Bellman's recursion becomes an equation. Next: the HJB.

3The HJB equation and the verification theoremMaster's3 min

Shrink Bellman's period to an instant. Over a short interval of length h, the value now is the best expected value at the end of the interval: the same principle. Expand that future value with Itô's formula from Part five. It is today's value, plus a drift integral, the time derivative plus the generator of wealth under the chosen fraction, plus a stochastic integral against the Brownian motion. The stochastic integral has mean zero. Subtract today's value from both sides and divide by h. Let h go to zero, and the average of the integrand becomes its value now: zero equals the time derivative plus the supremum, over the fraction, of the drift of wealth times V x plus half the variance times V x x. This is the Hamilton-Jacobi-Bellman equation, with utility as its terminal condition. The thing inside the supremum is a parabola in pi. When V is concave its vertex is the maximum, and the first-order condition gives the fraction. Now guess a power of wealth times a function of time. The x derivatives become multiples of V, the supremum becomes a number, and the equation collapses to an ordinary differential equation for f, equal to one at the end. The fraction is Merton's: the excess return over gamma times the variance. This formal derivation assumes smooth value, valid dynamic programming and admissible control processes over the interval. The stochastic integral needs localization and sufficient integrability to have zero expectation.

Here is the maximum as a picture: at every wealth, the bracket, divided by the positive number one minus gamma times V, is a parabola in the fraction, and the decision is its vertex. Move wealth. Without a floor the vertex never moves: percent everywhere. Switch on chapter two's floor: as wealth nears it the parabola narrows and the vertex slides to zero. Pause and predict: double the volatility, and the fraction? Falls fourfold, to about percent.

We guessed a smooth solution. Verification turns it into a value function under suitable growth and integrability conditions. Apply Itô along any admissible wealth process. HJB makes the drift nonpositive. If localization and uniform integrability justify expectations at the terminal time, expected utility is at most today's candidate value. An admissible, well-posed feedback attaining the supremum has zero drift and reaches that value. Thus it is optimal. Smoothness, the stochastic-integral condition, terminal limits and admissibility all matter; a martingale condition alone is not a general exclusion of doubling strategies. The next chapter handles nonsmooth value functions.

The equation can also be solved without guessing. The House's finite-difference solver, time steps by wealth nodes, alternates at each step: solve for the value given the fraction, move the fraction to each vertex, repeat. Most steps took passes. Its fraction is Merton's to points, its value within percent of the closed form, and the error falls as the grid is refined. But value functions are not always smooth. Next: what to do when they have kinks.

4When the value function has kinks: viscosity solutionsPhD3 min

The verification theorem needed a smooth value function. Real problems break that. A floor, a choice between stopping and waiting, a maximum of crossing branches: these can put a kink in the value, a point where the second derivative in the HJB equation does not exist. The simplest example shows how bad it gets. Ask for a function whose slope is plus or minus one everywhere on the interval, and zero at both ends. No smooth function does it. A tent does it, everywhere except its peak; so does a tent with a notch; so do infinitely many zig-zags. If almost everywhere is good enough, the equation has no unique answer, and a numerical scheme could converge to any of them, or to none. Pause and predict: which one will a computer find? The one we want is the tent: the distance to the boundary, the value of the fastest way out. We need a definition that picks it.

Crandall and Lions found it in 1983: never differentiate u. Touch it with smooth test functions instead, and put their derivatives into the equation. At a peak, a smooth function touches from above with any slope between minus one and one, and every one passes the subsolution test; from below nothing touches. The peak passes. At the valley, a flat parabola touches from below, and the supersolution test needs its slope's size minus one to be at least zero. It is minus one: the valley fails. Every downward kink fails, so only the tent survives.

The comparison principle, when it holds for the PDE and its boundary conditions, orders subsolutions below supersolutions and gives uniqueness. Under suitable continuity, dynamic-programming and boundary assumptions, the control value is a viscosity solution of HJB. Barles and Souganidis proved convergence for monotone, stable, consistent approximation schemes when the limiting equation has comparison, with the required boundary treatment. Monotone means the update preserves order in neighbouring values. Each hypothesis matters; consistency by itself does not imply convergence.

Test it. March the equation, u t plus the size of u x equals one, forward in time from zero until it settles. On the left, an upwind scheme that looks at each neighbour from the side the information comes from: monotone. On the right, the textbook central difference: consistent, but not monotone. The upwind profile rises like water filling a tent and stops exactly at the distance function. The central profile develops teeth between neighbouring nodes, and the teeth grow. On every grid the upwind error is at the level of rounding. The central error reaches ten to the on the finest grid: refining makes it worse. Consistency is not enough. Monotonicity is what makes a grid converge to the right kink, and it is why chapter two's solver, a maximum of positively weighted averages, found portfolio insurance. With the tools in place, the classic problem. Next: Merton's. The central-scheme plot uses a fixed display window: excursions beyond it are omitted; the error readout retains their full size.

5Merton's problemMaster's3 min

The last two chapters found Merton's answer two ways: hold a constant fraction, the excess return over gamma times the variance, percent in our market. What does constant mean in practice? Pause and predict: stocks just fell twenty percent. Does Merton buy or sell? Watch two glasses over five years of one simulated market, stock on top, bonds below. When the stock rises, its layer swells, and Merton pours it back to the line by selling. When it falls, he buys. He buys after falls: a contrarian by arithmetic, not by opinion. The second glass buys and holds, and its mix drifts wherever the market takes it, so its risk is whatever luck has made it.

With many stocks the derivation is the same, with a vector of fractions and a covariance matrix. The parabola becomes a quadratic form, and its vertex is the inverse covariance matrix times the excess returns, over gamma. Factor it. The direction of that vector does not depend on gamma at all: every investor, cautious or bold, holds the same mix of risky assets, and risk aversion only decides how much of it to hold against the bond. That is Merton's mutual-fund theorem, the continuous-time cousin of Tobin's separation; Part thirty builds that fund from data. This separation uses constant coefficients, a positive-definite covariance matrix and frictionless unconstrained trading. A portfolio normalized to weights summing to one also requires a nonzero sum of inverse-covariance times excess returns.

Now put in the American market's history: an excess return of percent a year over Treasury bills, and a volatility of . An investor with log utility should hold percent of wealth in stocks, borrowing to do it. With gamma three, percent; with gamma ten, . But the excess return is the least certain number in finance. After ninety-four years its standard error is still percent a year, as Merton himself pointed out in 1980, and the bars show what that does to the answer: for gamma three, anything from to percent. Variances are estimated well; means are not. The formula is exact; its inputs are not. Chapter thirteen meets an investor who takes that doubt seriously. Merton also asked how fast to spend. Next: consumption, and a second way to solve the problem. These fractions use full-sample historical moments retrospectively. The error bars use a nominal independent-return standard-error approximation, not a prospective recommendation or a complete measure of model risk.

6Consumption, and the martingale methodMaster's3 min

In 1971 Merton added the other half of a life: spending. The investor consumes at a rate c, gets utility from it, and discounts the future at a rate rho. Over an infinite horizon the equation no longer depends on time, and consumption appears as a drain on wealth. The first-order condition in c is a rule you can say aloud: eat until the marginal utility of eating equals the marginal value of a saved dollar. Guess the power form again. Consumption comes out proportional to wealth, and the stock fraction is exactly the same as before: spending and investing separate. Substitute and match the powers of wealth, and the spending rate is a constant, nu. With rho at three percent, log utility spends exactly rho; gamma three spends percent of wealth a year. With a finite life and nothing left to heirs, the same steps with a function of time give a rate that rises toward the end. The infinite-horizon solution requires a positive spending coefficient and the relevant transversality and admissibility conditions; gamma one is the logarithmic limit.

Over a forty-year life with gamma three, the investor spends percent of wealth in year one; the rate climbs slowly, then steeply, with the instantaneous consumption-to-wealth rate diverging like one over remaining time. The graph omits rates above thirty percent per year near the deadline. Across gammas the forever rate barely moves: a better market makes you richer, and saving more rewarding, and the two pull against each other. Pause and predict: a more patient investor, rho of one percent. More or less spending? Less: percent.

Return to chapter five's terminal-wealth problem. Cox and Huang, and independently Karatzas, Lehoczky and Shreve, gave a second method. In a complete market the state-price density xi combines discounting with a change-of-measure density. Choose an affordable, integrable terminal payoff attainable by an admissible strategy, subject to its discounted state-price budget. This is a static optimization. A consumption problem would add the spending stream to that budget. A Lagrange multiplier makes marginal utility proportional to xi. With CRRA, terminal wealth is xi to the power minus one over gamma, times a budget constant. In this constant-coefficient market it is a power claim on the stock. Continuous constant-fraction rebalancing manufactures that terminal claim.

Check it: two thousand investors rebalance daily for ten years; plot each one's state price against its final wealth. The dots land on the static curve, to within percent, the maximum discrepancy in this daily approximation. The displayed cloud selects up to twelve hundred in-window points from two thousand paths. Lower gamma tilts the curve: a bolder investor buys more wealth in the cheap states. All of this assumed trading is free. Next: what costs do to the rule.

7Transaction costs: the no-trade wedgeMaster's3 min

Merton's investor trades every instant to hold a constant fraction. If every trade costs one percent of the amount traded, that is ruinous: continuous rebalancing has infinite turnover. What should she do? Draw her wealth as a point in a plane: dollars in bonds across, dollars in stocks up. Merton's rule is a ray from the origin: every point on it has the same stock share. With costs, the ray opens into a wedge. Inside it, do nothing. When the market pushes the point to an edge, trade just enough to stay on the edge, never back to the middle. Watch fifteen years of one market. The point wanders freely inside the wedge, and each flash at an edge is a tiny trade. Count them against an investor who goes back to the ray every week. The wedge trades percent of wealth a year; staying on the ray, percent. Mathematically the point is a diffusion reflected at the edges of a cone. The path uses weekly trades with a band computed by a monthly finite-horizon approximation. It illustrates the wedge; it is not an exact simulation of the continuous singular-control optimum.

The mathematics. The controls are no longer rates but cumulative purchases and sales, each dollar costing epsilon: a singular control problem. The HJB equation becomes a variational inequality: the largest of three terms is zero. Where the first binds, the value obeys the no-trade equation; where the second binds, buying is worth exactly its cost; where the third binds, selling is. Three regions: buy, sell, and the wedge between them. Power utility again lets wealth factor out, so only the stock share matters. For small costs the band's half-width grows as the cube root of the cost: a tiny cost already buys a wide band. Michael Magill and George Constantinides saw the band in 1976; Mark Davis and Andrew Norman constructed the solution in 1990; and Steven Shreve and Mete Soner proved it in 1994, as a viscosity solution, with the tools of chapter four.

Lab two: the band by dynamic programming. Each month, from every share, the solver may trade to any share, paying the cost, before the market moves; the shares whose best move is to stay put are the band. At one percent the band runs from to percent: a half-width of points against the cube-root rule's , for this monthly finite-horizon grid and approximate proportional-cost rule. Grid, timing and cost approximations can all contribute to the difference.

Pause and predict: if costs double, does the band double? To leading order for small costs, the half-width grows by the cube root of two, about a quarter; this is not an exact finite-cost law. Is the band worth it? For a log-utility investor paying one percent and trading quarterly, the band, to percent, grows percent a year faster after costs than rebalancing to Merton, with percent turnover instead of . Merton maximizes a utility. Kelly asked a different question: what grows fastest? Next.

8Kelly and BreimanUndergraduate3 min

In 1956 John Kelly of Bell Labs asked how a gambler with a noisy private wire should bet. His answer: maximize the expected logarithm of wealth. In 1960 Claude Shannon showed the paper to Edward Thorp at MIT, who used it at blackjack and, from November 1969, to size an investment partnership. By Thorp's own 2006 account, through May 1998 it compounded at about twenty percent a year, with a standard deviation of about six and almost no correlation with the market.

For the coin, set the growth derivative to zero: the Kelly fraction is p minus q. For a continuously rebalanced stock in a constant-coefficient diffusion, Itô makes log wealth's drift a parabola. Its vertex is excess return over variance, Merton at gamma one, with excess growth half the squared Sharpe ratio. For fixed coin fractions with integrable independent and identically distributed log returns, the strong law makes log wealth over n converge to g. Against a distinct fixed fraction with strictly lower growth, the wealth ratio diverges exponentially. An identical rival is an immediate exception to any claim about every strategy. Breiman's broader results need their own strategy and market assumptions.

Watch it: half Kelly, Kelly and twice Kelly in the same simulated markets for forty years, on a log scale. Pause and predict: at twice Kelly, what is the median growth rate? Twice Kelly's best paths shoot above everyone, which is the temptation, but its median barely leaves the ground. Lay the time-average lines over the fans: each median follows its line, and twice Kelly's growth is the cash rate, percent: all that risk for nothing.

How long is eventually? Run Kelly against half and twice Kelly in ten thousand markets for a hundred years, and count where Kelly is ahead. Against twice Kelly it leads in percent of markets after ten years and after a hundred. Against half Kelly, only percent after ten years and after a hundred. The white lines are the closed form, from the normal distribution of log wealth. Breiman's theorem is true, and slow: half Kelly gives up so little growth that it takes a lifetime to fall behind.

And Kelly's parabola from history: rebalance monthly to a fixed fraction of the American market from 1926 to 2020, borrowing at the bill rate. All in grew at percent a year; the peak, at percent, grew at . At percent, September 1931 alone would have wiped you out. Hindsight found that peak; next, what happens when you must guess it.

9Fractional Kelly, estimation risk, and LTCMUndergraduate3 min

Practitioners rarely bet full Kelly. Bet c times Kelly and substitute: the excess growth is two c minus c squared times Kelly's, in this constant-coefficient, continuously rebalanced GBM model. Half Kelly keeps three quarters of the growth at half the volatility, and halves wealth from a peak within ten years percent of the time, against for full Kelly. The deeper reason: overestimate the edge k-fold and full Kelly on the estimate is k times Kelly on the truth; at two, its expected excess log growth is zero, assuming the variance was known correctly. William Benter, who ran a Hong Kong racing syndicate, wrote exactly that in 1994, and bet a half or a third of Kelly.

On real data: resample US history in one-year blocks four hundred times and find each best fraction. Ninety percent lie between and percent. Bet full Kelly on each estimate and score it on actual history: many land on the steep side, in red. Half of each estimate stays on the flat top. In general, full Kelly's excess growth hits zero at k equals two, half Kelly's at four, and simulated paths agree. Pause and predict: you estimate a Sharpe ratio of one; the truth is a half. Which grows faster? Half Kelly, which is exactly Kelly on the truth. History can be kind: the House's registered test chose percent on 1926 to 1972, and it grew at percent a year afterwards.

The crisis file. Long-Term Capital Management was founded in February 1994 by the bond trader John Meriwether; Robert Merton and Myron Scholes, who shared the Nobel prize in 1997, were among its partners. It bought cheap bonds and sold similar dear ones, betting that the spread between them would close: small, steady profits, levered many times. At the end of 1997 it had balance-sheet assets of a hundred and twenty-nine billion dollars on four point seven billion of capital, twenty-eight to one, and derivatives with a notional value of one point three trillion. In August 1998 Russia defaulted, investors fled to safety, and the spreads widened instead of closing: the fund lost forty-four percent of its value in that month alone. On September the twenty-third, fourteen banks and brokerage firms, brought together by the Federal Reserve Bank of New York, put in three point six billion dollars and took ninety percent of the fund.

Why so dangerous? An illustration, not the fund's books: a trade earning one percent a year with one percent volatility has a Kelly leverage of , so twenty-eight to one looks cautious. But Kelly leverage falls with the square of volatility. At times the calm volatility, twenty-eight is full Kelly; at three times, it is times Kelly, past the line where growth is zero. Sizing is only as good as the volatility forecast. Kelly has a famous critic. Next: Samuelson's objection. Assets-to-equity leverage at LTCM is not the same risk measure as a single-trade Kelly fraction. Holding the excess drift fixed is part of this illustration; liquidity and tail dependence are not reduced to a volatility dial.

10Samuelson's objection, and ergodicityMaster's2 min

Kelly's admirers argued that every long-horizon investor should maximize growth. Paul Samuelson challenged that in 1979. Compare fixed fractions in our diffusion: Kelly at percent and gamma-three Merton at . Kelly ends richer in percent of markets after ten years and after a hundred. Yet for that investor, Kelly's certainty-equivalent annual log rate is percent, against Merton's positive . These are log rates, not arithmetic percentage changes in wealth. Being ahead more often does not maximize this investor's expected utility.

The algebra behind the objection takes four lines. With a constant fraction, log wealth is normal, with a mean and a variance that both grow in proportion to time. The certainty equivalent for power utility is the expected wealth to the power one minus gamma, undone; the normal moment generating function computes it exactly. Its growth rate does not depend on the horizon at all: the cash rate, plus f times the excess return, minus gamma over two times f squared sigma squared. That parabola peaks at Merton's fraction for gamma, at every horizon. A long horizon does not turn anyone into a Kelly investor, unless gamma is one; Kelly's near-certain lead is bought with rare losses that a cautious investor weighs more heavily than all the small gains.

A modern form: heads, wealth rises fifty percent; tails, it falls forty. The average gain is five percent a toss. Give the coin to a hundred thousand players. The average runs right, carried by a lucky few; the median drifts left, since a head and a tail multiply wealth by point nine. After sixty flips percent have lost money. Ole Peters argues expected value misses this: the long-time average of log returns gives growth; it is not the time average of wealth. Meder and colleagues found in 2021 that people's risk taking shifted that way under multiplicative gambles; economists reply it is log utility by another name, and Alexis Akira Toda's 2023 paper critiques this interpretation. Pause and predict: what fraction should you stake? Kelly says percent, growing about percent a flip: negative full-stake log growth becomes positive at a quarter stake. So far the question was how much. Next: when, the problem of optimal stopping.

11Optimal stopping: the Snell envelopeMaster's2 min

For the finite-horizon stopping theorem, take an integrable adapted reward, a finite deadline N, and trivial initial information. At N stop; earlier, compare stopping with conditional expected continuation. Backward induction makes Snell's U the smallest supermartingale above the reward. At the first contact U equals g. Until contact, the stopped U is a martingale. The stopping time is bounded by N, so optional sampling gives the optimal expected payoff. Our visible random-walk example instead has no fixed deadline: it lives on the finite grid zero to twenty and must stop at absorbing endpoints. Under these boundary and integrability conditions, its value is the least concave majorant of the reward on that grid.

A payoff for every position, a skyline of pegs. Pause and predict: which pegs will the value touch? Value iteration: start at the payoff, and replace each value by the larger of its peg and the average of its neighbours. The curve lifts, like a rope pulled taut over the tallest pegs, and after sweeps it stops. Where the rope rests on a peg, stop; where it hangs above, wait. From position ten the right to choose is worth , though stopping pays .

Lab three. Two completely different routines in the House. One is the value iteration you just watched: a few lines of maxima and averages. The other knows nothing about random walks: it computes the upper convex hull of the pegs, the shape a rope really takes, and interpolates. Run both. Value iteration converges in sweeps, and the two answers agree to within ten to the minus . Probability and geometry give the same object.

The secretary problem: a known hundred candidates arrive in uniformly random order, with distinct ranks. Compare each with those already seen, then accept or reject immediately; there is no recall, and success means selecting the best. The optimal rule rejects a fixed number, then takes the first record. For a hundred candidates the best cutoff is , with success probability percent. As the number grows, the optimal rejected fraction and success probability tend to one over e. That is an asymptotic limit, not an exact probability at every finite n. Next: continuous-time exercise boundaries.

12Free boundaries: smooth fit and the American putMaster's3 min

In continuous time the stopping rule becomes a boundary in space, and nobody tells you where it is. Take the simplest case: an American put that never expires, the right to sell a stock at K whenever you like. While you hold it, above some exercise level b, its value obeys the Black-Scholes equation with no time derivative. Try a power of S. The exponent solves a quadratic with roots one and minus beta, and only the negative root keeps the put worthless when the stock is huge. Value matching: at the level b you exercise and receive K minus b, which fixes the constant. Henry McKean solved this in 1965. Which level? The one that makes the value largest. Differentiate in b, and the condition is the same as asking the value to leave the payoff with the payoff's own slope, minus one, with no kink: smooth fit. With five percent rates and thirty percent volatility, the boundary is .

Watch the choice. The grey line is the payoff; the blue curve is the value of the rule 'exercise the first time the stock falls to b', for a level we can slide. With a low level the curve meets the payoff at a kink, coming in too steeply; the readout is the gap between the two slopes. Raise the level and the value at a hundred rises; raise it too far and the curve meets the payoff too flatly, and the value falls again. The best level, , is exactly where the gap closes and the curve kisses the payoff. The put is worth . A forty-year binomial tree that knows nothing of smooth fit puts its boundary at and its price at . Pause and predict: if rates rise, does the boundary move up or down? Up: beta grows and the boundary moves toward the strike, to at seven percent. Waiting to receive K costs more interest, so you exercise sooner.

With an expiry, the boundary rises toward the strike as time runs out. The right to choose when is worth on a one-year put. In general the value solves a variational inequality, is a viscosity solution, and is the value of a reflected backward equation: chapter fourteen's subject. First, a question no solver answers: how people actually decide.

13How people decide: prospect theory and ambiguityUndergraduate3 min

Does anyone actually choose by expected utility? In 1953 Maurice Allais offered two choices. A sure million, or ten percent of five million, eighty-nine of one million, one of nothing: most take the sure million. Eleven percent of a million, or ten percent of five: most take the five. But the second pair is A and B with their common eighty-nine percent chance of a million replaced by zero in both. Independence says the order cannot flip; people flip it.

Kahneman and Tversky's prospect theory, 1979, and its cumulative form, 1992, makes three changes. Value is measured from a reference point, concave for gains, convex for losses, with a kink: the illustrative parameter makes the loss side two and a quarter times as steep in magnitude. These are fitted example parameters, not universal constants. Probabilities are weighted, so the extremes count for more, ranked from the tails inward. Related models study holding losers, selling winners and demand for lottery-like payoffs; those interpretations do not by themselves establish market causation.

Benartzi and Thaler proposed in 1995 that stocks are shunned because people check them too often. Pause and predict: looking every five years instead of every month, would a loss-averse investor hold more stocks, or fewer? The House's registered test, on ninety-four years of US returns. Over a month, half the returns sit on the steep loss side of the curve; over two years, the distribution slides into gains. Score stocks and bills every h months: bills win for short periods, and the curves cross at months. Benartzi and Thaler found about a year, against bonds. This pure-stock versus bill comparison does not solve the optimal mixed allocation or the uncomputed five-year case. How often you look is itself a decision.

Second, people dislike unknown odds apart from risk: Ellsberg's urn, 1961, and Gilboa and Schmeidler's theory, 1989: choose the action whose worst plausible model is best. Applied to Merton by Pascal Maenhout in 2004, after Hansen and Sargent: nature may lower the stock's drift, paying an entropy cost. The inner minimum is a parabola. With Maenhout's scaling, the bigger your stake, the more pessimistic the worst case. The result is Merton with gamma plus theta: doubt acts like extra risk aversion. The gamma-plus-theta result uses this particular homothetic entropy penalty. Theta here measures ambiguity; it is not the Sharpe-ratio symbol used elsewhere.

The game on US numbers, gamma three: in red, nature's worst drift for each position; in blue, the investor's Merton response to each drift. They cross at percent, against with no doubt. How much doubt? Choose a calibration convention: choose theta so the worst case would be mistaken for the estimate twenty percent of the time in ninety-four years of data. Then theta is . Next: the equations behind robust preferences and the American put alike: backward SDEs. Detection error is an equal-prior normal likelihood-test error for constant drifts and known volatility: Phi of minus the absolute drift difference times square-root years over twice sigma. Twenty percent is a chosen calibration, not an empirically established plausibility boundary.

14Backward stochastic differential equationsPhD3 min

The control problems so far ran forward in time and were solved backwards. A backward stochastic differential equation makes that the definition. Find a pair of processes, Y and Z, that use only the information available at each time and end at a given payoff. Étienne Pardoux and Shige Peng proved in 1990 that a square-integrable adapted pair exists uniquely in a Brownian filtration with representation, for a uniformly Lipschitz driver, square-integrable terminal payoff and suitable integrability of the driver at zero. With a linear driver, Y is the Black-Scholes value; in a smooth Markov model Z is sigma S times delta: Nicole El Karoui, Peng and Marie-Claire Quenez showed in 1997 that pricing and hedging are exactly this. The point is the nonlinear case. Suppose the hedger borrows at six percent and lends at one. The driver gains a term that switches on only when the hedge's cash account is negative, and the price is no longer linear in the payoff. The comparison theorem says a larger driver gives a larger price, so it is at least the Black-Scholes price at the lending rate. To solve it, simulate the stock forward, then step backwards, replacing each conditional expectation by a regression across the simulated paths: the method of Gobet, Lemor and Warin. Comparison also requires compatible scalar-driver assumptions and the same terminal payoff.

Here is the scheme running, on a ratio call spread: long one call at ninety-five, short two at a hundred and five, half a year. First twenty thousand stock paths are simulated forward. Then, backwards from the last step: each grey cloud is the next step's value on every path, plotted against today's stock price. The regression through the cloud is the conditional expectation, and after the driver's correction it becomes the value one step earlier, which feeds the next cloud. Watch the payoff's corners round off as we move toward today. Pause and predict: will the price lie between the Black-Scholes prices at one and at six percent? No: , above both, and . The spread's hedge borrows in some states and lends in others, and each side is charged its own rate: funding depends on the cash sign, so this pricing operator is not one uniform linear-rate operator. The ratio spread has negative unbounded payoff at high stock prices. The regression panel shows stock prices from seventy-five to one hundred and twenty-five and values from minus twelve to twelve; points outside that window are omitted, not placed on its edges.

As path counts increase, these estimates approach the PDE reference in this fixed discretization. Three repetitions at each size give the displayed plus-or-minus two standard deviations, a dispersion summary, not a confidence interval or proof of convergence. The degree-six polynomial estimate is ; local hat functions are closer here. This comparison alone does not isolate the source of the basis error. Han, Jentzen and E demonstrated high-dimensional neural BSDE methods in 2018. Part seventeen trains one. Next: investors interacting with a crowd.

15Mean-field games: the crowd that sells togetherPhD3 min

Now many traders face each other. In a mean-field game each player solves a control problem backwards, taking the crowd as given, while the crowd moves forwards, driven by everyone's choices. Lasry and Lions, and Huang, Malhamé and Caines, introduced it in 2006. A case with a closed form: N funds each sell a block by time T; selling fast costs a premium, and everyone's selling pushes the price down. A plan's cost depends on the others' average selling rate. The best response solves an Euler-Lagrange equation. Consistency, the others do the same, gives one linear equation. With zero inventory penalty, alone sell in a straight line; in a crowd, sell in a rush, before the others' selling lands in the price. This example uses deterministic symmetric open-loop plans, inventory one initially and zero at the deadline. The straight-line single-agent schedule assumes zero inventory penalty.

How does a crowd find that equilibrium? One answer is damped best-response iteration. On the left, a trader's plan, solved backwards from the deadline; on the right, the crowd's selling rate, rolled forwards. Start by assuming the crowd does nothing. The best response to a passive crowd is a straight line. Then let the crowd adopt that plan, and respond again; each round mixes half of the new crowd into the old. The curves overshoot, then settle, round by round, onto the grey equilibrium, where the plan produces exactly the crowd it assumed. Here each response is mixed half-and-half with the previous plan, a damped fixed-point iteration rather than the classical history-average fictitious-play algorithm. Convergence shown is for this parameter instance.

Lab four: given the crowd's rate, the best response is one tridiagonal solve; the crowd's new rate is its slope; mix and repeat. The residual falls geometrically, below ten to the minus after rounds, matching the closed form to grid error. In the first fifth of the time: percent alone, with two funds, with ten, in the limit.

Pause and predict: you know nine other funds are selling the same stock this week. Do you sell faster or slower than you would alone? Faster. Alone, the straight line; with two funds the curve bends; with ten, more; in the mean-field limit the block goes in a rush. On the right, five hundred funds with different block sizes, each responding to the same crowd: the whole distribution of inventories runs toward zero early, and every fund pays for the others' haste. This is the mathematics of crowded trades. Pierre Cardaliaguet and Charles-Albert Lehalle modelled crowding this way in 2018; Carlin, Lobo and Viswanathan studied predatory trading among a few; and Lacker and Zariphopoulou showed that funds judged against each other take more risk. Parts thirty-six and thirty-seven return to it. Next: can a machine learn these rules from experience alone?

16Reinforcement learning on Merton's problemMaster's3 min

The learner receives the simulated market and reward, without Merton's analytic optimum. State: time and log wealth. Action: a fraction. Reward: log gross wealth, floored at one millionth before taking the log. With suitable differentiation and integrability, the true finite-horizon policy gradient sums action scores times true advantages across the episode. We estimate advantage using a one-step TD error from a learned critic; this estimate can be biased. PPO clips its surrogate objective. It does not enforce a hard bound on each policy update or KL divergence.

Lab five: a thousand and twenty-four ten-year episodes per iteration, three hundred iterations. Actions are unbounded Gaussian fractions; gross wealth is floored at one millionth. That is a numerical simulator, not an admissibility theorem for leveraged GBM. Five seeds finish with mean fractions from to percent. The finite-quadrature benchmark is percent. The displayed gap, at most percent a year, compares continuous-growth formulas at mean fractions. It does not measure the full learned policy's quarterly performance.

Here is the training, scrubbed checkpoint by checkpoint. On the right, the average fraction the policy chooses, for five seeds, the band showing their spread, against the finite-quadrature reference. On the left, the policy itself, over time and wealth, at the same checkpoint. It starts near fifty percent. It climbs, overshoots on some seeds, and wanders around the reference, in this fixed training protocol. The map flattens: by the end the fraction barely depends on time or wealth, which is what Merton's theorem says, though the learner never heard of it.

Now add trading costs: a one percent cost on every trade. The dynamic program says: a band from to percent, do nothing inside, trade to the edge outside. Pause and predict: will the learner find it? Five learned policies, against the band.

17Who sizes bets for a livingIndustry4 min

First the bettors, from their own accounts. Thorp's 1994 sports-betting test: fifty thousand dollars, sized by Kelly with deliberately conservative edges, made a hundred and twenty-three thousand in a hundred and one days. William Benter's syndicate bet about four hundred and seventy Hong Kong races a year against a nineteen percent track take, profitably in four of five seasons, at a conservative fraction of Kelly, because at full Kelly losing half the bankroll is, in his words, a common occurrence. Elwyn Berlekamp worked under Kelly at Bell Labs as a student and in 1989 took control of Axcom, which traded for Jim Simons's Medallion Fund. How Medallion sizes its bets is not public, and we do not guess.

Most institutions work inside risk budgets, which are control constraints. Norway's oil fund caps its expected volatility relative to its benchmark at one and a quarter points; Bridgewater's All Weather, from 1996, puts equal risk on four economic environments. As reported by the Wall Street Journal in 2024, a Millennium manager who loses five percent has capital halved, and at seven and a half is likely let go; the firm did not comment. Grossman and Zhou solved the drawdown problem in 1993: never fall below a fraction alpha of the peak by holding Merton's fraction of the cushion above it: chapter two's floor, ratcheting up. The logarithmic Grossman-Zhou result constrains discounted wealth in a continuous diffusion. Our following weekly simulation uses a nominal-wealth cushion inspired by it; discrete trading and jumps need not preserve the floor.

One path each: Kelly in red, Grossman and Zhou with a floor at eighty percent of the peak in blue. As she falls toward the floor she sells, and on this illustrated path she stays above it. Over two thousand paths, Kelly's worst drawdown is percent, hers . The price: percent median growth against . Pause and predict: down four point nine against a five percent limit? Hold almost nothing: the cushion is a tenth of a percent. This nominal weekly illustration is not the exact discounted-wealth optimization. No breach in these sampled paths is not a guarantee.

Volatility targeting here scales exposure by inverse lagged realized variance. Moreira and Muir studied related rules in 2017. This existing registered historical calculation uses ninety-four years of French data. Although the variance signal is lagged, exposure is normalized to average one using the full sample, so the whole procedure uses hindsight. Gross returns omit trading and funding costs.

Execution desks solve a control problem daily: Almgren and Chriss, 2001; and Almgren, Thum, Hauptmann and Li fitted its impact on Citigroup's trades, a three-fifths power of size. And Victor Haghani, of the coin experiment, now sizes clients' portfolios with Merton's rule; his 2023 book with James White, The Missing Billionaires, blames lost fortunes on bad sizing and spending. Last, the frontier.

18The frontier, 2023 to 2026PhD2 min

The chapters of this part form a graph, and current research lives on its edges. Between learning and the HJB equation: Yanwei Jia and Xun Yu Zhou's 2023 paper in the Journal of Machine Learning Research works out what Q-learning means when time is continuous.

Min Dai, Yuchao Dong, Jia and Zhou showed that the best randomized policy for Merton's problem has Merton's fraction as its mean, so an actor-critic learner can find it from data without ever estimating the expected return, the input chapter five called the least certain number in finance. Avoiding an explicit drift estimate does not remove statistical uncertainty; the claim is specific to the randomized-control model and objective.

In a 2026 paper the same group finds, for a recursive version of the problem, a closed-form Gaussian policy that does not depend on wealth, and whose spread shrinks as risk aversion and volatility rise: exploration, priced into the objective.

Between dynamic programming and deep learning: Jeonggyu Huh, Jaegi Jeon, Hyeng Keun Koo and Byung Hwa Lim use Pontryagin's maximum principle to steer neural networks to constrained portfolio optima with a hundred assets, far beyond what a grid can handle.

Huh and Koo's 2026 follow-up studies parameter uncertainty and reports that its model-free PPO baseline remains far from the targets in that model and protocol. This is a benchmark result, not a universal limit on reinforcement learning.

For crowds, a survey by Mathieu Laurière and colleagues maps how agents can learn mean-field equilibria without a model, the way our damped best-response example did with one.

Daniel Chee, Noufel Frikha and Libo Li join stopping, exploration and reflected backward equations in a 2026 paper on American options, with rates of convergence.

And on the Kelly branch, Alexis Akira Toda's 2023 critique of ergodicity economics keeps chapter ten's argument open. Notice the pattern: almost every edge is a learning method meeting a classical structure, the HJB, the boundary, the fixed point, and the structure is what makes the learning work. Each of these was checked at its source; their assumptions and numerical settings differ. Next: the House's sizing module, put together.

For the researcher: estimation risk in Merton's rulePhD5 min

For the researcher: Chapter 9 asked what happens if you overestimate your edge by a fixed factor. But the error in an estimated edge is random, and it has a law. Here is the exact cost of betting on an estimate, and the fraction that minimizes it.

Start with one risky asset and known volatility. Replace the mean excess return in Merton's fraction by its Gaussian estimate from T years. CE is the exact annual CRRA certainty-equivalent log rate above cash for a constant fraction in GBM. Averaging this score across estimated means is a different criterion from unconditional expected utility. The estimated mean's second moment is the true mean squared plus sigma squared over T. At fixed T, averaging over estimates retains that variance penalty: expected CE is theta squared minus one over T, divided by twice gamma. The oracle score is theta squared over twice gamma, so estimation costs one over twice gamma T. At theta point four, the plug-in's expected CE is negative below six and a quarter years. Negative CE does not imply negative expected arithmetic profit.

So consider a fixed scaling. Expected CE across estimated means is a parabola in c. With volatility known, its vertex is T theta squared over T theta squared plus one. At theta point four it is seventy-six percent after twenty years and forty-four percent after five. This oracle needs the true Sharpe ratio. It optimizes expected CE across estimation samples, a different criterion from unconditional expected utility. Its expected CE is nonnegative, strictly positive when theta is nonzero; arbitrary shrinkage need not share that property. Kan and Zhou's 2007 work studies related portfolio combinations under multi-asset parameter uncertainty. Its estimated-covariance formulas require their own assumptions.

These curves use known volatility. The plug-in crosses zero at six and a quarter years, then approaches the oracle score from below. Half the plug-in beats full below about nineteen years, then gives up too much growth as estimation improves. The gold oracle uses the true Sharpe ratio and is at least as good as either fixed choice under this same expected-CE criterion. White dots estimate volatility as well as the mean. They are close to the known-volatility formula at long histories; at five years the extra variance-estimation penalty is visible. Under iid normal returns with enough observations, inverse chi-squared moments give the adjusted formula in problem nine.

The table mixes two explicitly labelled calculations: estimated-variance simulations, and an analytic known-volatility oracle column. At five years the plug-in's mean CE is percent, half's is , and percent of plug-in estimates have negative true CE. These are CE scores, not arithmetic profits. At fifty years the plug-in is close to the oracle column and half has fallen behind. The purple estimated scaling uses the same data. It increases with squared estimated Sharpe and is itself noisy. In these simulations it underperforms plain half at the displayed horizons through twenty years; knowing an oracle scaling is different from estimating it.

Now a retrospective, frictionless US illustration at gamma two, scored from July 1936. Each month's estimate uses earlier data, starting with July 1926 through June 1936. Realized mean-minus-half-gamma-variance scores are percent for plug-in, for half, and for estimated scaling. These realized proxies are not exact finite-sample utility. The plug-in wins among those three on this path. Windows grow from ten years to about ninety-five, and the subsequent Sharpe ratio is , against over the whole sample. One path does not test an expectation by itself. Simply holding the market beats the three estimated rules here. Full-sample Merton uses hindsight. Neither result identifies a single cause or includes trading costs.

Three open questions. The optimal multiple needs the true Sharpe ratio. Estimating it is noisy, as we saw. Compare feasible scaling rules under an explicit loss, strategy class and parameter range rather than claiming universal dominance. A Bayesian investor learns while investing, and Nicholas Barberis showed in 2000 that parameter uncertainty makes the horizon matter. If the edge itself drifts, how much history to use and how far to shrink must be chosen together. And with fat tails and clustered volatility, the cost of estimation to Kelly's growth rate depends on the specified model and estimator; our Gaussian formula does not automatically extend.

Pause and predict. A Sharpe ratio of point three, estimated from twenty-five years. If that were the truth, what fixed multiple maximizes our known-volatility expected-CE criterion? The oracle calculation is two point two five over three point two five, about point six nine. This substitutes a hypothetical true Sharpe ratio, not a guarantee from an estimate.

19The sizing moduleIndustry2 min

The House's sizing module collects this part's tools, every one tested against a closed form or a second method, because a sizing rule that is wrong is wrong on every position at once. Utility and certainty equivalents. Merton by dynamic programming and by finite differences on the HJB equation. The scheme comparison of the viscosity chapter. Consumption and the no-trade band. Kelly and realized growth. Stopping three ways: value iteration, the convex hull, and smooth fit. Prospect theory and robust fractions. The backward equation and the crowd. And the learners, which must agree with the answers before they are trusted with anything harder. Everything rebuilds from one command, and a viewer can change any input and rerun it.

Here is how the House sizes a position, on the US market's own numbers, with log utility as the ceiling. Kelly on the estimated edge: percent, more than twice levered. Half of it, for the doubt in the estimate: . The robust fraction, with doubt calibrated to a twenty percent detection error, is percent; the House takes the smaller of the two. Then trade only when the position leaves its no-trade band; apply a nominal drawdown floor that ratchets up; and recompute whenever the volatility forecast moves, while recognizing that forecast updates cannot prevent sudden jumps. This is an illustrative governance pipeline, not a jointly optimal control solution or a drawdown guarantee. That is rule nine. This part registered three tests on the House's data, the split-sample Kelly fraction, myopic loss aversion and volatility targeting, and the trial counter now reads .

Recap, desk questions, problemsAll tracks3 min

Part eight in ten lines. Twenty percent maximizes uncapped log growth for the sixty-percent coin; forty percent has slightly negative growth. A small fair dollar gamble has approximate risk premium gamma times dollar variance over twice wealth. Bellman and smooth verification need admissibility; nonsmooth HJB uses viscosity comparison and suitable convergent schemes. Merton's full-sample US plug-in at gamma three is percent, with nominal error bars. Small costs open a band with a cube-root leading order. Fixed-fraction Kelly eventually beats strictly lower-growth fractions under the model; expected utility can prefer less risk at every horizon. Stopping, robust control, backward equations and crowd games need their stated assumptions. Our PPO checks are numerical benchmarks, with simulator floors. Practical sizing combines forecasts and risk constraints, without guarantees against jumps.

Four desk questions. The sixty percent coin: bet twenty percent, which grows your wealth about two percent a flip; at forty percent you stop growing. A strategy with a Sharpe ratio of one at ten percent volatility: Kelly says ten times leverage. Don't: four years of a Sharpe of one is barely evidence, and volatility can triple. Why might a patient investor refuse Kelly? Because maximizing growth is maximizing the expected log, which is right only for one particular risk aversion. And with a one percent cost, your stock weight drifted from sixty-two to sixty-six percent: do nothing, you are still inside the band. Full solutions are in the notes.

And nine problems: Kelly's formula for any odds, Merton's value function, fractional Kelly, the secretary's one over e, how much to stake on Peters' coin, smooth fit for the perpetual put, and the liquidating crowd. Two are qualifying-exam problems: the exact cost of an estimated edge, and the correction when the variance is estimated too. Solutions, in English and Chinese, are in the notes.

Where this comes back. Optimal stopping prices the American option in Parts ten and sixteen. Backward equations return in deep hedging, and in Part twenty-one, where funding at different rates is exactly the nonlinearity we priced. Kelly and Merton size the portfolios of Parts thirty and thirty-one. Mean-field games model order books and execution. Reinforcement learning hedges, executes and trades in later parts. And Part forty-one tells LTCM's story in full.

The textbook chapters and papers are listed in the notes. Numerical illustrations use our code, public French market returns, and simulations with fixed seeds. Historical anecdotes and published results are quotations with sources, not computations from those datasets.

The House can now forecast risk and size its bets. That completes the toolkit. Next, Part nine, and the start of the derivatives act: no arbitrage. Why there is one price for a replicable payoff, the fundamental theorem of asset pricing, and the risk-neutral measure, built from the martingales of Part four.

Where it goes next. Control returns as hedging under costs (Parts 10-11), optimal execution (Part 37) and market making (Part 38); Kelly returns in portfolio construction (Part 30).

Key results

The part's results in one place, for revision.

Kelly\[f^\ast=\frac{\mu-r}{\sigma^2}\quad\text{(continuous)},\qquad f^\ast=p-\frac{1-p}{b}\quad\text{(binary)}\]
Merton's fraction\[\pi^\ast=\frac{\mu-r}{\gamma\,\sigma^2}\]
HJB\[0=\sup_{\pi}\Bigl\{V_t+\bigl(r+\pi(\mu-r)\bigr)wV_w+\tfrac12\pi^2\sigma^2w^2V_{ww}\Bigr\}\]
Growth rate\[g(f)=r+f(\mu-r)-\tfrac12 f^2\sigma^2\]

Try it

Lab 8 · How much to bet: Kelly, half Kelly, double Kelly

A coin pays even money and lands heads 55% of the time. Compute the growth rate of every fixed fraction, simulate a thousand bets at four of them, and see why nobody bets full Kelly on an estimate.

Figure produced by Lab 8: How much to bet: Kelly, half Kelly, double Kelly
Produced by the lab below, seed 0, in 0.5 s. Simulated data.
python -m videos.quant.labs 8 needs numpy, scipy, matplotlib, numba · download lab08.py · source on GitHub
Kelly fraction f* = 2p - 1  0.10
half Kelly                  f = 0.05   growth +0.375% a bet   median wealth x42.6   paths below start 1%
Kelly                       f = 0.10   growth +0.501% a bet   median wealth x150   paths below start 6%
double Kelly                f = 0.20   growth -0.014% a bet   median wealth x0.871   paths below start 51%
triple Kelly                f = 0.30   growth -1.620% a bet   median wealth x9.18e-08   paths below start 95%

Double Kelly grows at about zero; beyond it the median path goes broke. Half Kelly keeps three quarters of the growth for half the risk.
The code (58 lines; it asserts its own result)
"""Lab 8: how much to bet: Kelly's fraction, half of it and twice it."""

import numpy as np

from videos.quant import labs
from explainer.quant.house import control

TITLE = "How much to bet: Kelly, half Kelly, double Kelly"
GOAL = ("A coin pays even money and lands heads 55% of the time. Compute the growth rate of every fixed "
        "fraction, simulate a thousand bets at four of them, and see why nobody bets full Kelly on an estimate.")
TASKS = [
    "You only think p = 0.55; the truth is 0.52. What is full Kelly's growth rate now? Half Kelly's?",
    "Use control.merton_fraction for a stock with 6% excess return and 18% volatility at gamma = 1, 2, 5.",
    "Cap wealth (cap=100) as in the Haghani-Dewey experiment. How many paths reach the cap at each fraction?",
]


def run(seed=0):
    p, n_bets, n_paths = 0.55, 1000, 4000
    f_star = control.kelly_binary(p)
    names = {"half Kelly": 0.5 * f_star, "Kelly": f_star, "double Kelly": 2 * f_star, "triple Kelly": 3 * f_star}
    rng = np.random.default_rng(seed)
    wins = rng.random((n_paths, n_bets)) < p
    lab = labs.Lab()
    lab.row("Kelly fraction f* = 2p - 1", f"{f_star:.2f}")
    paths = {}
    for name, f in names.items():
        logw = np.cumsum(np.where(wins, np.log1p(f), np.log1p(-f)), axis=1)
        paths[name] = logw
        g = control.growth_binary(f, p)
        lab.row(name, f"f = {f:.2f}   growth {100 * g:+.3f}% a bet   median wealth x{np.exp(np.median(logw[:, -1])):,.3g}"
                      f"   paths below start {100 * np.mean(logw[:, -1] < 0):.0f}%")
        se = 1.25 * np.sqrt(p * (1 - p) * n_bets / n_paths) * np.log((1 + f) / (1 - f))
        assert abs(np.median(logw[:, -1]) - n_bets * g) < 4 * se, "the median path grows at the Kelly growth rate"
    lab.note = ("Double Kelly grows at about zero; beyond it the median path goes broke. Half Kelly keeps three "
                "quarters of the growth for half the risk.")
    g = {k: control.growth_binary(f, p) for k, f in names.items()}
    assert abs(g["double Kelly"]) < 5e-4 and g["triple Kelly"] < 0 and abs(g["half Kelly"] / g["Kelly"] - 0.75) < 0.01

    fig, ax = labs.figure(2, size=(11, 4.2))
    f = np.linspace(0, 0.33, 300)
    ax[0].plot(f, 100 * control.growth_binary(f, p), color=labs.P)
    ax[0].axhline(0, color=labs.MUTED, lw=0.8)
    colors = dict(zip(names, (labs.GAIN, labs.P, labs.IMPLIED, labs.LOSS)))
    for name, ff in names.items():
        ax[0].plot(ff, 100 * control.growth_binary(ff, p), "o", color=colors[name])
        ax[0].annotate(name, (ff, 100 * control.growth_binary(ff, p)), textcoords="offset points", xytext=(4, 6),
                       color=colors[name], fontsize=9)
    ax[0].set(title="Growth rate per bet against the fraction staked", xlabel="fraction of wealth bet", ylabel="% a bet")
    t = np.arange(1, n_bets + 1)
    for name in names:
        q = np.percentile(paths[name], [10, 50, 90], axis=0) / np.log(10)
        ax[1].fill_between(t, q[0], q[2], color=colors[name], alpha=0.12, lw=0)
        ax[1].plot(t, q[1], color=colors[name], label=name)
    ax[1].set(title="Wealth over 1,000 bets: median and 10-90% band", xlabel="bet", ylabel="log10 wealth")
    ax[1].legend(fontsize=8)
    lab.fig = fig
    return lab

Now change it

  1. You only think p = 0.55; the truth is 0.52. What is full Kelly's growth rate now? Half Kelly's?
  2. Use control.merton_fraction for a stock with 6% excess return and 18% volatility at gamma = 1, 2, 5.
  3. Cap wealth (cap=100) as in the Haghani-Dewey experiment. How many paths reach the cap at each fraction?

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

  1. A 60% coin at even odds. Maximize g(f) = 0.6 log(1 + f) + 0.4 log(1 − f): g′(f) = 0.6/(1 + f) − 0.4/(1 − f) = 0 gives f* = 0.2, and g(0.2) = 0.6 log 1.2 + 0.4 log 0.8 ≈ 2.0% a flip. g(0.4) ≈ −0.2%: twice Kelly no longer grows. With a cap and a time limit the target is reaching the cap, not long-run growth, so slightly less than Kelly does as well. In 300 flips with a $250 cap, 10% and 20% both reach it about 94% of the time.

  2. Sharpe 1 at 10% volatility. f* = (μ − r)/σ² = SR/σ = 10, and Kelly's excess growth is SR²/2 = 50% a year on paper. But a Sharpe ratio measured over four years has a standard error near √(1.5/4) ≈ 0.6 (Part 6). If the true Sharpe is 0.5, ten times leverage is twice Kelly and grows no faster than cash. Volatility can also triple, which divides Kelly by nine (chapter 9). Use half Kelly or less on the estimate, and recompute as the volatility forecast changes.

  3. Why not Kelly. Kelly maximizes E log W, the expected utility of an investor with γ = 1. For γ = 3 the optimal fraction is a third of Kelly's at every horizon. Kelly ends richer with a probability that tends to one, but its rare losses are so large in that investor's utility that its certainty equivalent is lower (chapter 10: −3.6% against +3.9% a year).

  4. A drifted weight, with costs. With a 1% cost per dollar traded and γ = 3 (μ = 8%, r = 2%, σ = 18%), the no-trade band from dynamic programming (monthly) is 55.8% to 67.8% around Merton's 61.7% (chapter 7). 66% is inside it: do nothing. Rebalancing to 62% would pay 1% on 4% of wealth for a gain of second order in the distance from the optimum; only when the weight leaves the band is trading worth its cost, and then only to the nearest edge.

Problems, with worked solutions

  1. Kelly for any odds. For a bet that pays \(b\) per unit with probability \(p\), derive \(f^* = p - q/b\) and show that, for a small edge, growth is zero again at about \(2f^*\).

    Solution

    g(f) = p log(1 + bf) + q log(1 − f). g′(f) = pb/(1 + bf) − q/(1 − f) = 0 gives pb(1 − f) = q(1 + bf), so f* = (pb − q)/b = p − q/b. For a small edge, expand to second order: g(f) ≈ f(pb − q) − f²(pb² + q)/2. This is zero again at f ≈ 2(pb − q)/(pb² + q). Near fair odds pb² + q ≈ b, so this is approximately 2(pb − q)/b = 2f*.

  2. Merton's value function. Write the HJB equation for Merton's problem and show that \(V = e^{a(T - t)}\,w^{1-\gamma}/(1 - \gamma)\) solves it with \(\pi^* = (\mu - r)/(\gamma\sigma^2)\); find \(a\).

    Solution

    HJB: V_t + max_π {(r + π(μ − r))wV_w + ½π²σ²w²V_ww} = 0. Substitute V = e^{a(T−t)}w^{1−γ}/(1 − γ), so that V_t = −aV, wV_w = (1 − γ)V and w²V_ww = −γ(1 − γ)V. Dividing by (1 − γ)V, the HJB becomes −a/(1 − γ) + max_π {r + π(μ − r) − ½γπ²σ²} = 0. The maximum is at π* = (μ − r)/(γσ²), where it equals r + (μ − r)²/(2γσ²). So a = (1 − γ)(r + (μ − r)²/(2γσ²)), and V(T) = u(w).

  3. Fractional Kelly in constant-coefficient, continuously rebalanced GBM.

    Solution

    Excess growth is g(f) − r = f(μ − r) − ½f²σ², maximized at f* = (μ − r)/σ² with g* − r = (μ − r)²/(2σ²). At f = cf* it is c(μ − r)²/σ² − ½c²(μ − r)²/σ² = (2c − c²)(g* − r). The volatility is cf*σ. At c = ½: 75% of the growth and half the volatility. At c = 2: none of the growth and twice the volatility.

  4. The secretary. Show that the secretary rule's success probability tends to \(-x\log x\) with \(x = k/n\), maximized at \(x = 1/e\).

    Solution

    If the best candidate is at position j > k, the rule picks them exactly when the best of the first j − 1 lies among the first k, which has probability k/(j − 1). So P(k) = (k/n)Σ_{j=k+1}^{n} 1/(j − 1). With x = k/n this is a Riemann sum for x∫_x^1 dt/t = −x log x. Its derivative, −log x − 1, is zero at x = 1/e, where the value is 1/e ≈ 36.8%. For n = 100 the best k is 37, with 37.1%.

  5. Peters' coin. In Peters' coin (+50%, \(-40\%\)), what fraction of wealth should you stake each flip, and at what growth rate?

    Solution

    Staking a fraction f each flip gives g(f) = ½log(1 + 0.5f) + ½log(1 − 0.4f). g′(f) = 0.25/(1 + 0.5f) − 0.2/(1 − 0.4f) = 0 gives 0.25 − 0.1f = 0.2 + 0.1f, so f* = 0.25. Then g = ½log(1.125 × 0.9) = ½log 1.0125 ≈ +0.62% a flip, where staking everything loses ½log(1/0.9) ≈ 5.3%. Staking a quarter turns a losing gamble into a growing one.

  6. Smooth fit for the perpetual put. For the perpetual American put, show that maximizing \((K - b)\,b^{\beta}\) over \(b\) gives \(b^* = \beta K/(1 + \beta)\), and that this is equivalent to smooth fit \(V'(b^*) = -1\).

    Solution

    Exercising at level b gives V_b(S) = (K − b)(S/b)^{−β} for S ≥ b, with β = 2r/σ². For fixed S this is S^{−β}(K − b)b^{β}, so maximize h(b) = (K − b)b^{β}: h′(b) = b^{β−1}(β(K − b) − b) = 0 gives b* = βK/(1 + β). The slope of V_b at S = b is −β(K − b)/b, which equals −1 exactly when β(K − b) = b, the same condition: choosing the best boundary and pasting smoothly onto the payoff are one equation. With r = 5%, σ = 30%, K = 100: β = 1.11, b* = 52.6, V(100) = 47.4 × (100/52.6)^{−1.11} = 23.2.

  7. The liquidating crowd. For \(N\) symmetric traders with \(\phi = 0\), solve \(2\eta Q'' + \kappa\frac{N-1}{N}Q' = 0\), \(Q(0) = 1\), \(Q(T) = 0\), and find the share sold by \(T/5\) when \(\kappa T/(2\eta) = 2\) and \(N \to \infty\).

    Solution

    With φ = 0 the equation is Q″ + aQ′ = 0, a = κ(N − 1)/(2Nη), so Q′ = Ce^{−at} and Q(t) = (e^{−at} − e^{−aT})/(1 − e^{−aT}) with Q(0) = 1, Q(T) = 0. As N → ∞, aT = κT/(2η) = 2, and the share sold by T/5 is 1 − Q(T/5) = (1 − e^{−0.4})/(1 − e^{−2}) = 0.3297/0.8647 = 38.1%, against 20% for one trader alone (a = 0, a straight line) and 28.7% for two (aT = 1).

  8. (qual) The cost of an estimated edge. (qual) With \(\hat\mu \sim N(\mu, \sigma^2/T)\) and \(\sigma\) known, show that the expected certainty equivalent of \(c\,\hat\mu/(\gamma\sigma^2)\) is \([c\theta^2 - c^2(\theta^2 + 1/T)/2]/\gamma\), that the plug-in loses in expectation when \(T < 1/\theta^2\), and that \(c^* = T\theta^2/(T\theta^2 + 1)\).

    Solution

    CE(π) = πμ − ½γπ²σ². With π = cμ̂/(γσ²), E[π]μ = cμ²/(γσ²) = cθ²/γ and ½γσ²E[π²] = c²E[μ̂²]/(2γσ²) = c²(μ² + σ²/T)/(2γσ²) = c²(θ² + 1/T)/(2γ). So E CE = [cθ² − ½c²(θ² + 1/T)]/γ. At c = 1 this is (θ² − 1/T)/(2γ), negative exactly when T < 1/θ². The derivative in c vanishes at c* = θ²/(θ² + 1/T) = Tθ²/(Tθ² + 1), where E CE = (θ²/2γ)·c* ≥ 0, strictly positive for θ ≠ 0. With θ = 0.4, T = 5, γ = 1: plug-in −2.0%, c* = 0.44 earning 3.6%.

  9. (qual) Estimating the variance too. (qual) Now estimate \(\sigma^2\) by \(s^2\) from \(n\) iid normal returns. Using \(\mathbb E[\sigma^2/s^2] = (n - 1)/(n - 3)\) and \(\mathbb E[\sigma^4/s^4] = (n - 1)^2/((n - 3)(n - 5))\), find the plug-in's expected certainty equivalent, and show it is negative for \(\theta = 0.4\), \(T = 5\) years of monthly data.

    Solution

    For iid normal returns and n > 5, (n − 1)s²/σ² ~ χ²_k with k = n − 1, independent of μ̂. For X ~ χ²_k, E[1/X] = 1/(k − 2) and E[1/X²] = 1/((k − 2)(k − 4)), so E[σ²/s²] = (n − 1)/(n − 3) = a₁ and E[σ⁴/s⁴] = (n − 1)²/((n − 3)(n − 5)) = a₂. With π̂ = μ̂/(γs²), E CE = [a₁θ² − ½a₂(θ² + 1/T)]/γ. For 60 months, a₁ = 59/57 = 1.035 and a₂ = 3481/3135 = 1.110, so at θ = 0.4: 1.035 × 0.16 − 1.110 × 0.18 = −3.4% a year, against −2.0% with σ known; the simulation gives −3.7% ± 0.1%.

Reading and notes

The part's papers

from READING.md

  • von Neumann, J., Morgenstern, O. (1944). Theory of Games and Economic Behavior.
  • Kelly, J. L. (1956). "A new interpretation of information rate." Bell System Technical Journal.
  • Bellman, R. (1957). Dynamic Programming.
  • Breiman, L. (1961). "Optimal gambling systems for favorable games." Fourth Berkeley Symposium.
  • Ellsberg, D. (1961). "Risk, ambiguity, and the Savage axioms." QJE.
  • Pratt, J. (1964). "Risk aversion in the small and in the large." Econometrica; Arrow, K. (1965). Aspects of the Theory of Risk-Bearing.
  • Merton, R. C. (1969). "Lifetime portfolio selection under uncertainty: the continuous-time case." REStat; (1971) "Optimum consumption and portfolio rules in a continuous-time model." JET.
  • Samuelson, P. A. (1979). "Why we should not make mean log of wealth big though years to act are long." J. Banking & Finance.
  • Kahneman, D., Tversky, A. (1979). "Prospect theory: an analysis of decision under risk." Econometrica; Tversky, A., Kahneman, D. (1992). "Advances in prospect theory." J. Risk and Uncertainty.
  • Crandall, M., Lions, P.-L. (1983). "Viscosity solutions of Hamilton–Jacobi equations." Transactions of the AMS.
  • Gilboa, I., Schmeidler, D. (1989). "Maxmin expected utility with non-unique prior." J. Mathematical Economics.
  • Davis, M., Norman, A. (1990). "Portfolio selection with transaction costs." Mathematics of Operations Research.
  • Pardoux, E., Peng, S. (1990). "Adapted solution of a backward stochastic differential equation." Systems & Control Letters.
  • El Karoui, N., Peng, S., Quenez, M.-C. (1997). "Backward stochastic differential equations in finance." Mathematical Finance.
  • Hansen, L. P., Sargent, T. (2001). "Robust control and model uncertainty." AER.
  • Huang, M., Malhamé, R., Caines, P. (2006). "Large population stochastic dynamic games." Communications in Information and Systems.
  • Thorp, E. O. (2006). "The Kelly criterion in blackjack, sports betting and the stock market." Handbook of Asset and Liability Management.
  • Lasry, J.-M., Lions, P.-L. (2007). "Mean field games." Japanese Journal of Mathematics.
  • Schulman, J., et al. (2017). "Proximal policy optimization algorithms." arXiv.
  • Peters, O. (2019). "The ergodicity problem in economics." Nature Physics.
  • Snell, J. L. (1952). "Applications of martingale system theorems." Transactions of the AMS.
  • Allais, M. (1953). "Le comportement de l'homme rationnel devant le risque." Econometrica.
  • Dynkin, E. B. (1963). "The optimum choice of the instant for stopping a Markov process." Soviet Mathematics Doklady.
  • McKean, H. P. (1965). "A free boundary problem for the heat equation arising from a problem in mathematical economics." Industrial Management Review (appendix to Samuelson 1965).
  • Mossin, J. (1968). "Optimal multiperiod portfolio policies." Journal of Business; Samuelson, P. A. (1969). "Lifetime portfolio selection by dynamic stochastic programming." REStat.
  • Magill, M., Constantinides, G. (1976). "Portfolio selection with transactions costs." JET.
  • Merton, R. C. (1980). "On estimating the expected return on the market." JFE.
  • Karatzas, I., Lehoczky, J., Shreve, S. (1987). "Optimal portfolio and consumption decisions for a 'small investor' on a finite horizon." SIAM J. Control and Optimization.
  • Cox, J., Huang, C.-f. (1989). "Optimal consumption and portfolio policies when asset prices follow a diffusion process." JET.
  • Barles, G., Souganidis, P. (1991). "Convergence of approximation schemes for fully nonlinear second order equations." Asymptotic Analysis.
  • Grossman, S., Zhou, Z. (1993). "Optimal investment strategies for controlling drawdowns." Mathematical Finance.
  • Shreve, S., Soner, H. M. (1994). "Optimal investment and consumption with transaction costs." Annals of Applied Probability.
  • Benter, W. (1994). "Computer based horse race handicapping and wagering systems: a report." In Hausch, Lo, Ziemba (eds.), Efficiency of Racetrack Betting Markets.
  • Benartzi, S., Thaler, R. (1995). "Myopic loss aversion and the equity premium puzzle." QJE.
  • Bergman, Y. (1995). "Option pricing with differential interest rates." RFS.
  • Rabin, M. (2000). "Risk aversion and expected-utility theory: a calibration theorem." Econometrica.
  • Almgren, R., Chriss, N. (2001). "Optimal execution of portfolio transactions." Journal of Risk.
  • Anderson, E., Hansen, L. P., Sargent, T. (2003). "A quartet of semigroups for model specification, robustness, prices of risk, and model detection." JEEA.
  • Janeček, K., Shreve, S. (2004). "Asymptotic analysis for optimal investment and consumption with transaction costs." Finance and Stochastics.
  • Rogers, L. C. G. (2004). "Why is the effect of proportional transaction costs O(δ^{2/3})?" Mathematics of Finance, Contemporary Mathematics 351, AMS.
  • Maenhout, P. (2004). "Robust portfolio rules and asset pricing." RFS.
  • Gobet, E., Lemor, J.-P., Warin, X. (2005). "A regression-based Monte Carlo method to solve backward stochastic differential equations." Annals of Applied Probability.
  • Almgren, R., Thum, C., Hauptmann, E., Li, H. (2005). "Equity market impact." Risk 18(7) (Citigroup's US equity trades).
  • Carlin, B., Lobo, M., Viswanathan, S. (2007). "Episodic liquidity crises: cooperative and predatory trading." Journal of Finance.
  • MacLean, L., Thorp, E., Ziemba, W. (eds.) (2011). The Kelly Capital Growth Investment Criterion. World Scientific.
  • Haghani, V., Dewey, R. (2016). "Rational decision-making under uncertainty: observed betting patterns on a biased coin." arXiv 1701.01427.
  • Peters, O., Gell-Mann, M. (2016). "Evaluating gambles using dynamics." Chaos.
  • Moreira, A., Muir, T. (2017). "Volatility-managed portfolios." Journal of Finance.
  • Cardaliaguet, P., Lehalle, C.-A. (2018). "Mean field game of controls and an application to trade crowding." Mathematics and Financial Economics.
  • Han, J., Jentzen, A., E, W. (2018). "Solving high-dimensional partial differential equations using deep learning." PNAS.
  • Lacker, D., Zariphopoulou, T. (2019). "Mean field and n-agent games for optimal investment under relative performance criteria." Mathematical Finance.
  • Wang, H., Zariphopoulou, T., Zhou, X. Y. (2020). "Reinforcement learning in continuous time and space: a stochastic control approach." JMLR.
  • Doctor, J., Wakker, P., Wang, T. (2020). "Economists' views on the ergodicity problem." Nature Physics.
  • Meder, D., et al. (2021). "Ergodicity-breaking reveals time optimal decision making in humans." PLoS Computational Biology.
  • Haghani, V., White, J. (2023). The Missing Billionaires: A Guide to Better Financial Decisions. Wiley.
  • Frontier (checked at the source, November 2026): Jia, Y., Zhou, X. Y. (2023). "q-Learning in continuous time." JMLR 24(161); Dai, M., Dong, Y., Jia, Y., Zhou, X. Y. (2023, rev. 2026). "Data-driven Merton's strategies via policy randomization." arXiv 2312.11797; Dai, Dong, Jia, Zhou (2026). "Merton's problem with recursive perturbed utility." arXiv 2602.13544; Huh, J., Jeon, J., Koo, H. K., Lim, B. H. (2025). "Breaking the dimensional barrier for constrained dynamic portfolio choice." arXiv 2501.12600; Huh, J., Koo, H. K. (2026). "Breaking the dimensional barrier: dynamic portfolio choice with parameter uncertainty via Pontryagin projection." arXiv 2601.03175; Laurière, M., et al. "Learning in mean field games: a survey." arXiv 2205.12944; Chee, D., Frikha, N., Li, L. (2026). "A monotone limit approach to entropy-regularized American options." arXiv 2602.18062; Toda, A. A. (2023). "'Ergodicity economics' is pseudoscience." arXiv 2306.03275.

Papers and sources

Papers

On screen, with what each found: von Neumann–Morgenstern (1944); Allais (1953); Snell (1952); Kelly (1956); Bellman (1957); Breiman (1961); Ellsberg (1961); Dynkin (1963); Pratt (1964); Arrow (1965); McKean (1965); Merton (1969, 1971, 1980); Mossin (1968); Samuelson (1969, 1979); Magill and Constantinides (1976); Kahneman and Tversky (1979); Tversky and Kahneman (1992); Crandall and Lions (1983); Karatzas, Lehoczky and Shreve (1987); Cox and Huang (1989); Gilboa and Schmeidler (1989); Davis and Norman (1990); Pardoux and Peng (1990); Barles and Souganidis (1991); Grossman and Zhou (1993); Shreve and Soner (1994); Benter (1994); Benartzi and Thaler (1995); Bergman (1995); El Karoui, Peng and Quenez (1997); Rabin (2000); Hansen and Sargent (2001); Almgren and Chriss (2001); Anderson, Hansen and Sargent (2003); Janeček and Shreve (2004); Rogers (2004); Maenhout (2004); Gobet, Lemor and Warin (2005); Almgren, Thum, Hauptmann and Li (2005); Huang, Malhamé and Caines (2006); Thorp (2006); Lasry and Lions (2007); Carlin, Lobo and Viswanathan (2007); Haghani and Dewey (2016); Schulman et al. (2017); Moreira and Muir (2017); Cardaliaguet and Lehalle (2018); Han, Jentzen and E (2018); Lacker and Zariphopoulou (2019); Peters (2019); Doctor, Wakker and Wang (2020); Meder et al. (2021); Haghani and White (2023).

Frontier (checked at the source, November 2026): Jia and Zhou (2023), "q-Learning in Continuous Time," JMLR 24(161); Dai, Dong, Jia and Zhou, "Data-Driven Merton's Strategies via Policy Randomization," arXiv 2312.11797 (2023, revised 2026); Dai, Dong, Jia and Zhou (2026), "Merton's Problem with Recursive Perturbed Utility," arXiv 2602.13544; Huh, Jeon, Koo and Lim (2025), "Breaking the Dimensional Barrier for Constrained Dynamic Portfolio Choice," arXiv 2501.12600; Huh and Koo (2026), "Breaking the Dimensional Barrier: Dynamic Portfolio Choice with Parameter Uncertainty via Pontryagin Projection," arXiv 2601.03175; Laurière et al., "Learning in Mean Field Games: A Survey," arXiv 2205.12944; Chee, Frikha and Li (2026), "A Monotone Limit Approach to Entropy-Regularized American Options," arXiv 2602.18062; Toda (2023), "'Ergodicity Economics' is Pseudoscience," arXiv 2306.03275. Background: Wang, Zariphopoulou and Zhou (2020), JMLR (exploratory control).

Reading only: Kramkov and Schachermayer (1999) on duality in incomplete markets; Fleming and Soner (2006) for viscosity solutions in control; Crandall, Ishii and Lions (1992), the user's guide; MacLean, Thorp and Ziemba (2011), the Kelly anthology; Peters and Gell-Mann (2016).

For the researcher

  • The theorems. Klein and Bawa (1976) and Brown (1976) on estimation risk; Kan and Zhou (2007), "Optimal Portfolio Choice with Parameter Uncertainty," JFQA 42(3), for related multi-asset portfolio combinations under parameter uncertainty; Barberis (2000) on learning and the horizon; MacLean, Thorp and Ziemba (eds., 2011) on fractional Kelly.
  • Simplifications. One risky asset, iid normal returns, a constant scaling chosen with the true θ; the expected CE across estimation samples, rather than unconditional expected utility; σ is known in the oracle derivation, and θ = 0 gives CE = 0. Many assets are Part 30.
  • Open problems. Compare feasible scaling rules under an explicit loss, strategy class and parameter range; shrinkage and window length chosen together when the edge drifts; model-specific estimation costs to Kelly growth under fat tails and volatility clustering.
Labs, replays and simulations in the filmHands-on
Kind Where What
Lab 1 ch 2 bellman_merton: Merton by dynamic programming
Lab 2 ch 7 no_trade_band: the Davis–Norman band by DP
Lab 3 ch 11 snell_envelope against concave_majorant
Lab 4 ch 15 mfg_liquidation: damped best-response iteration
Lab 5 ch 16 the core of ppo_merton
Replays ch 2, 11, 14, 15, 16 backward slabs; the rope; regression clouds; damped best-response iteration; PPO (5 seeds, TrainingReplay)
Live simulations hook, ch 5, 6, 7, 8, 10, 17 coin columns; rebalancing glasses; martingale scatter; the wedge; Kelly fans; Peters' histogram; drawdown floor
3D ch 2 the policy surface built backwards
Textbook audit
Book · section Chapter
Pham (2009) ch 1, stochastic analysis Part 5
Pham ch 2, control problems and financial examples 2, 3
Pham ch 3, DPP, HJB, verification, Merton, investment–consumption 2, 3, 5, 6
Pham ch 4, viscosity solutions (definition, comparison) 4 (superreplication under constraints: Part 9)
Pham ch 5, optimal switching and stopping, free boundary, smooth fit 11, 12 (switching: not covered)
Pham ch 6, BSDEs and control; reflected BSDEs 14 (reflected: named in 12, 14)
Pham ch 7, martingale and convex-duality methods 6 (duality in incomplete markets: Kramkov–Schachermayer, reading only)
Touzi (2013), control and DP; optimal stopping; verification examples 2, 3, 11
Touzi, viscosity solutions and the DPE in the viscosity sense 4
Touzi, stochastic target problems Part 9 (superhedging)
Touzi, BSDEs; quadratic BSDEs; probabilistic numerics 14 (quadratic BSDEs: not covered)
Touzi, finite differences 3, 4; Part 16
Karatzas–Shreve, Methods, ch 1 (the Brownian market) Part 9
Karatzas–Shreve, Methods, ch 3 (single-agent consumption/investment, martingale method) 6
Karatzas–Shreve, Methods, ch 4 (equilibrium) Part 23
Karatzas–Shreve, Methods, ch 6 (constrained consumption/investment) 2 (floor), 6 (note)
Karatzas–Shreve, Brownian Motion and Stochastic Calculus, optional sampling 11
Björk, Arbitrage Theory in Continuous Time: stochastic optimal control, the martingale approach to optimal investment, optimal stopping 3, 5, 6, 11 (the linear regulator: 15)
Merton, Continuous-Time Finance, the 1969 and 1971 papers 5, 6
Øksendal, optimal stopping; stochastic control 11, 12; 2, 3
Bertsekas, Dynamic Programming and Optimal Control I: the DP algorithm, dynamic portfolio analysis, optimal stopping, approximate DP 2, 11, 16
Sutton–Barto (2nd ed.) ch 3 MDPs, 4 DP, 6 TD, 13 policy gradient 2, 16 (AI, Built Part 26 in full)
Back, Asset Pricing and Portfolio Choice Theory, ch 1 utility, ch 2 portfolio choice, dynamic programming, ch 14 continuous time 1, 5, 2, 3, 6
Carmona–Delarue vol. I, MFG by examples; MFG and FBSDEs 15 (McKean–Vlasov control: reading only)
Shreve II ch 8, American derivatives 11, 12 (pricing: Parts 10, 16)
Kahneman–Tversky; Wakker, Prospect Theory (rank dependence) 13
Data, scope and reproducibilityData and reproducibility
  • Kenneth French's Fama–French factors, monthly and daily (market excess return and T-bill), July 1926 to December 2020. The hold-out from 2021 is sealed (Part 6).
  • Registered with the trial counter: the split-sample Kelly test, myopic loss aversion on US data, and volatility targeting on US data (one configuration each).
  • Compute: about an hour of CPU on one thread per process, almost all of it PPO (ten runs of 300 iterations × 1,024 ten-year episodes, two 32-unit hidden layers). Everything is seeded.
  • Facts and their sources. LTCM: U.S. Treasury testimony presenting the President's Working Group's figures (Gensler, 6 May 1999: $129 billion of assets on $4.7 billion of capital, 28 to 1, $1.3 trillion notional) and Federal Reserve History (a 44% loss in August 1998; fourteen firms, $3.6 billion, 23 September). Haghani and Dewey: their paper (arXiv 1701.01427). Thorp: his own chapter, Thorp (2006), Handbook of Asset and Liability Management vol. 1, ch. 9, pp. 385–428: Shannon and the Kelly paper (MIT, 1960), 3 November 1969, "approximately 20% annually with a standard deviation of about 6%" through May 1998, about $80 billion of trades in some 1.25 million bets, and the 1994 sports test ($50,000, a $123,000 profit in 101 days, estimates "deliberately chosen to be conservative"). Benter: his chapter in Hausch, Lo and Ziemba (eds.), Efficiency of Racetrack Betting Markets (1994), pp. 191 and 195 (the factor-of-two warning, downswings of more than 50% under full Kelly, "a conservative fractional Kelly betting strategy was employed throughout", about 470 races a year, a track take of about 19%, four of five seasons profitable). Berlekamp: Wikipedia and the University of California Senate memorial (Bell Labs under Kelly in 1960 and 1962; control of Axcom in 1989). NBIM: the fund's risk-management page (a 1.25-percentage-point limit on expected relative volatility). Bridgewater: "The All Weather Story" (launched 1996; "equal risk on each scenario"; "leverage is an implementation tool"). Millennium: reported by the Wall Street Journal, as relayed by Business Insider (October 2024); the firm declined to comment; a report, not a disclosure. Almgren et al.: "Equity market impact," Risk 18(7), 2005 (Citigroup's US equity trades). Haghani and White, The Missing Billionaires (Wiley, 2023).
  • Not on screen because they could not be verified: that Medallion uses Kelly sizing; a "≈15% a year after fees" figure for Princeton Newport Partners (reported from Thorp's 2017 book only by secondary sources; the screen uses his 2006 chapter instead).

Chapter notesChapters (about 67 minutes)
  • How much to bet, and how we got here. Haghani and Dewey (2016) gave 61 people $25 and a 60% coin at even odds; about 30% went bust. Live: 160 independent coin sequences are paired across four fraction columns for 300 flips on a log-wealth axis (all in: 91% bust; 40%: 18% bust, 74% at the cap; 20%: 96% at the cap, none hit the one-cent threshold in this sample). Kelly's curve g(f) with 20,000 players per fraction (20%: 94% reach $250, none bust; 100%: 87% bust). The history, 1738–2017, as one tree rooted in expected utility; objectives; the House.
  • 1. Utility and risk aversion. St Petersburg; the vNM axioms card. Visual: the gamble as two weights on the utility curve, the chord's balance point dropping to the certainty equivalent (86.6 at log utility); a γ dial bends the CRRA curve live and the CE slides (67.1 at γ = 3, 51.2 at 30). Arrow–Pratt derived in five steps; exact against ½γσ²/W (13.4 vs 12.5 for ±50 at γ = 1; 32.9 vs 37.5 at γ = 3). Rabin's calibration warning.
  • 2. Bellman's principle (Lab 1). A three-period tree with values flowing back; the CRRA guess makes the policy myopic (Mossin, Samuelson). Lab: bellman_merton on screen, run: 62% at every wealth (Merton 61.7%). Replay: the floor problem's policy surface built backwards slab by slab in 3D, with the inset hump EV_{n+1} at w = 1 whose peak walks from 25% to 31%. Slices against portfolio insurance: largest gap 0.005.
  • 3. The HJB equation and the verification theorem. The HJB derived (DPP → Itô → h → 0 → FOC → ansatz). Visual: the Hamiltonian as a parabola in π whose vertex never moves without a floor and slides to 0 near a floor. The verification theorem card. Experiment: implicit finite differences with policy iteration (400 × 401; mostly 3 passes a step): π within 0.002 points of Merton, value within 0.07% of the closed form, error falling 0.27% → 0.07% as the grid is refined.
  • 4. Viscosity solutions. Kinks from floors, stopping and maxima; |u′| = 1 has infinitely many a.e. solutions. Visual: test functions touching a peak (passes) and a valley (fails). Comparison, the value function as a viscosity solution, Barles–Souganidis. Experiment: u_t + |u_x| = 1 marched by upwind (error at rounding level on 21, 81, 321 nodes) and central differences (error 10^6 to 10^131, worse as the grid is refined).
  • 5. Merton's problem. Live: two glasses (Merton rebalancing monthly, buy-and-hold drifting) on a five-year path. Over 20,000 thirty-year paths, γ = 3: certainty-equivalent growth 3.86% vs 3.77%; buy-and-hold's final stock share ranges from 63% to 95% (10th–90th percentile). Mutual-fund separation. US data: 238% at γ = 1, 79% at γ = 3, with ±2 SE from 42% to 116%.
  • 6. Consumption, and the martingale method. Merton (1971) derived: ν = 3.0% (log), 3.57% (γ = 3), 2.90% for a more patient investor (ρ = 1%); the finite-life instantaneous consumption/wealth rate starts at 4.7% and diverges like 1/(T−t); the plot omits rates above 30% a year. Cox–Huang / KLS: X_T = (yξ_T)^{-1/γ}, a power claim on the stock. Live: 2,000 daily-rebalanced investors land on the static curve (largest gap 0.34%).
  • 7. Transaction costs (Lab 2). Live: the wealth point diffusing in the Davis–Norman wedge, reflected at its edges (35 trades in 15 years; turnover 0.9% a year against 24% for weekly rebalancing). Singular control, the variational inequality, the ε^{1/3} asymptotics. Lab: no_trade_band: at γ = 3, monthly, the band is 59.4–64.0%, 57.2–66.2%, 55.8–67.8% and 54.0–69.6% for ε = 0.1%, 0.5%, 1% and 2% (half-widths 2.3, 4.5, 6.0, 7.8 points against 3.0, 5.2, 6.5, 8.2 from the asymptotics). Log utility, 1%, quarterly: band 158–202%, growing 0.29% a year faster than quarterly rebalancing to Merton net of costs, with 10% turnover against 44%.
  • 8. Kelly and Breiman. Kelly (1956); Shannon showed Thorp the paper in 1960; Thorp's partnership from 3 November 1969 compounded at about 20% a year, standard deviation about 6%, through May 1998 (Thorp 2006). Kelly derived for the coin and the stock; the strong-law proof for distinct fixed fractions with integrable iid log returns and a strictly positive growth gap. Live: fans at ½, 1, 2 × Kelly for 40 years with the time-average lines (growth 6.2%, 7.6%, 2.0% = the cash rate). Breiman's race: Kelly ahead of 2× Kelly in 70% of markets at 10 years and 95% at 100; ahead of ½ Kelly in 60% and 80%. US realized growth: 100% at 9.7%, the best 218% at 12.6%; 348% ruined by September 1931.
  • 9. Fractional Kelly, estimation risk, and LTCM. (2c − c²) derived; overestimating the edge k-fold: full Kelly earns nothing at k = 2, half Kelly at k = 4 (closed form and 2,000 paths); Benter's warning, quoted. Visual: the bootstrap cloud of best fractions (90% between 116% and 302%) under the US parabola, full vs half Kelly on each draw. The registered split-sample test (198% chosen on 1926–1972 grew 13.4% a year afterwards). The LTCM crisis file ($129bn of assets on $4.7bn, 28:1, $1.3tn notional; −44% in August 1998; $3.6bn from fourteen firms), and a volatility slider: Kelly leverage 100 → 11 as volatility triples; 28:1 becomes 2.5 × Kelly.
  • 10. Samuelson's objection, and ergodicity. Kelly ends richer than the γ = 3 Merton investor 64%/87% of the time at 10/100 years, yet its CE log rate is −3.6% vs +3.9% a year; the CE growth rate derived. Live: Peters' coin, the histogram of 100,000 players flipping 60 times, with the mean running right and the median left; 82% lose money. Peters (2019), Meder et al. (2021), Doctor–Wakker–Wang (2020), Toda (2023). Kelly stakes 25% (+0.62% a flip).
  • 11. Optimal stopping: the Snell envelope (Lab 3). Snell's recursion, supermartingale, optional sampling, and the least concave majorant for a random walk. Replay: value iteration as a rope pulled taut over 21 pegs (226 sweeps). Lab: snell_envelope against concave_majorant: agreement to 5 × 10^-14. The secretary problem (37 → 37.1%).
  • 12. Free boundaries: smooth fit. McKean's perpetual put derived: β = 1.11, b* = 52.6, V(100) = 23.21. Visual: an exercise-level slider with the slope-gap readout closing at b*; a 40-year CRR tree gives 52.5 and 23.01. Rates up to 7%: b* = 60.9. The one-year put's boundary (9.87 vs 9.35) and the variational inequality.
  • 13. Prospect theory and ambiguity. Allais; CPT (TK 1992). Experiment (registered): Benartzi–Thaler redone on French 1926–2020: stocks' CPT value overtakes bills' at an 18-month evaluation period. Ellsberg, Gilboa–Schmeidler, Hansen–Sargent; Maenhout's robust Merton derived. Visual: investor and nature's best replies crossing; with θ set by detection error on 94 years of data, 20% → θ = 1.9, π = 48%; 10% → θ = 4.4, π = 32%; no doubt 79%.
  • 14. Backward SDEs. Definition, the linear case = Black–Scholes, Bergman's two-rate driver, the comparison theorem, Gobet–Lemor–Warin. Replay: regression clouds stepping backwards over 20,000 paths to Y0 = 1.219, above both Black–Scholes prices (1.050 at 1%, 0.605 at 6%); convergence to the PDE's 1.230.
  • 15. Mean-field games (Lab 4). The deterministic symmetric open-loop liquidation game, hard initial/terminal inventory constraints and zero inventory penalty in the plotted example: 2ηQ″ + κ(N−1)/N Q′ − 2φQ = 0. Replay: damped best-response iteration, plan backwards and crowd forwards, settling on the equilibrium. Lab: mfg_liquidation: residual below 10^-12 in 48 rounds; share sold in the first fifth (κT/2η = 2): 20% alone, 28.7% (N = 2), 36.2% (N = 10), 38.1% (mean field), matching the closed form to 10^-7. A crowd of 500 traders with different blocks.
  • 16. Reinforcement learning (Lab 5). The MDP, policy gradient, one-step advantages, the PPO clip. Lab: the core of ppo_merton; five seeds end with mean fractions 162–184% against a finite-quadrature benchmark of 184%. The reported ≤0.09% annual gap is a continuous-growth proxy evaluated at mean fractions, not the full learned policy's quarterly performance. Gaussian actions are unbounded and gross wealth is floored at 10⁻⁶; this is a numerical surrogate, not the exact admissible leveraged-GBM problem. Replay: TrainingReplay of the five seeds with the policy map. Costs: ppo_rebalance (ε = 1%, five seeds) does not find the band: it trades part of the way, leaving a strip of about 5 points alone; net growth 7.30–7.34% a year against 7.42% for the DP band and 7.13% for quarterly rebalancing to Merton (all on the same 200,000 markets).
  • 17. Who sizes bets for a living. Thorp's 1994 sports test ($50,000 → $123,000 profit in 101 days); Benter's fractional Kelly; Berlekamp and Axcom (Medallion's sizing is not public); NBIM's 1.25-point tracking-error limit; Bridgewater's All Weather; Millennium's drawdown rules as reported by the WSJ (via Business Insider, 2024). Experiments: a Grossman–Zhou-inspired nominal-wealth cushion at α = 0.8 vs Kelly (worst drawdown 17% vs 99%; median growth 3.6% vs 7.4%); volatility targeting on French daily data (registered): Sharpe 0.51 vs 0.44, gross alpha 3.5% a year (homoskedastic OLS t = 2.9, not HAC), exposure 0.01–10.5. Its full-sample average-weight normalization uses hindsight despite the lagged variance signal; funding and trading costs are omitted. Almgren–Chriss and Almgren et al. (2005); Haghani and White (2023).
  • 18. The frontier, 2023–2026. A graph of the part's chapters with each paper lighting the edge it builds (list below).
  • 19. The sizing module. The new House functions; the sizing pipeline (Kelly 238% → half 119%; the robust fraction at a 20% detection error, 145%, is not smaller; the band; the drawdown floor; recompute on volatility); Rule 9 extended. The trial counter reads 310 (this part registered three tests).
  • For the researcher: estimation risk in Merton's rule. The plug-in fraction μ̂/(γσ²), with μ̂ ~ N(μ, σ²/T), has expected certainty equivalent (θ² − 1/T)/(2γ): estimation costs exactly 1/(2γT) a year, and the plug-in loses against cash in expectation when T < 1/θ² (6¼ years at a Sharpe ratio of 0.4). Scaling by c gives a parabola with vertex c* = Tθ²/(Tθ² + 1) (a known-volatility, expected-CE oracle; related to parameter-risk work including Kan and Zhou 2007): 0.44 at five years, 0.76 at twenty; fractional Kelly as optimal shrinkage. Simulation (20,000 monthly histories per horizon, both moments estimated, γ = 1, θ = 0.4): plug-in −3.7/2.5/5.4/7.0% a year at 5/10/20/50 years (the chi-squared-corrected formula gives −3.4/2.6/5.4/7.0), half 3.2/4.7/5.4/5.7, an estimated multiple ĉ −0.9/2.3/4.4/6.5, analytic known-σ c* column 3.6/4.9/6.1/7.1 (other columns simulate estimated σ); the plug-in loses to cash in 39% of five-year histories. The US market, expanding window from July 1926–June 1936, scored July 1936 to December 2020 at γ = 2: plug-in CE 4.9%, half 3.0%, ĉ 4.2%, 100% market 5.6%, full-sample Merton (hindsight) 6.2%; the Sharpe ratio after 1936 was 0.52 (0.44 over the century). Three open problems; pause: θ = 0.3 over 25 years gives c* = 0.69.
  • Recap, four desk questions, nine problems (two at qualifying-exam level), payoffs, references.

中文讲义

本讲的中文说明、交易台问题与习题解答(与英文版对应)。

导言量化金融,从零搭建 — 第8部分:决策与控制

第7部分预测了市场会动多大,本部分问该下多大的注、何时停止。这是一场约67分钟的讲座,十九章加开场和结尾,可以替代研究生课程中随机控制与组合选择的相应章节:

  • 期望效用(冯·诺伊曼-摩根斯坦公理)、风险厌恶,推导阿罗-普拉特溢价;
  • 贝尔曼递推,从动态规划原理和伊藤公式推导HJB方程,验证定理,以及黏性解(为什么单调格式收敛);
  • 带消费的默顿问题,用HJB和鞅方法两种方式求解;两基金分离;
  • 交易成本与戴维斯-诺曼不交易区间,用动态规划求解;
  • 凯利与布雷曼定理的证明;分数凯利与估计风险(索普、本特);LTCM;萨缪尔森的反驳与遍历性之争;
  • 最优停止(斯内尔包络即最小凹优函数)与光滑粘合(麦基恩的永续看跌期权);
  • 前景理论(用数据重做贝纳茨-塞勒的短视损失厌恶)与稳健控制(梅恩豪特);
  • 双利率下的BSDE、平均场清仓博弈,以及有无交易成本时默顿问题上的PPO;
  • 基金、投注团队和交易台如何定仓位,以及2023至2026年的前沿。

数值示例由本系列代码计算;历史事实与论文结果则是注明来源的引用:历史部分用肯尼斯·弗伦奇的美国市场收益(月度与日度,1926–2020),其余用带种子的模拟,并在屏幕上标明。

讲的是方法,不构成投资建议。

既有数值协议与市场试验登记保持不变:46个计算项目,第8部分累计310次试验,其中本部分登记3项。本次不打开2021年起封存样本。事后示例的登记计数,不等于未经使用的前瞻检验。

贝尔曼短视结论需要独立同分布机会、CRRA终端效用和不依赖财富的约束。光滑HJB验证需要可容许性与可积条件;黏性格式收敛需要比较原理、稳定性、单调性、一致性与适当边界。月度不交易网格、每周名义财富缓冲与带下限的PPO模拟器近似不同问题。Grossman–Zhou原理论约束贴现财富;对数效用的缓冲乘数正确,保持不变。

Chapter notes各章(约67分钟)
  • 该下多大的注,以及我们如何走到这里。 哈加尼和杜威(2016)的硬币游戏,约30%的人输光。现场模拟:160条独立硬币序列在四种比例间配对、各抛300次(全押91%输光;押40%有18%输光;押20%有96%达到上限、无人输光)。凯利曲线;1738–2017年的历史,以期望效用为根的一棵树。
  • 1. 效用与风险厌恶。 公理卡片;赌博作为挂在效用曲线上的两个砝码,确定性等价86.6(对数效用);伽马旋钮实时弯曲曲线(伽马为3时67.1,为30时51.2)。推导阿罗-普拉特;精确值对比近似值;拉宾的警告。
  • 2. 贝尔曼原理(实验一)。 三期树上的倒向归纳;幂效用下的短视性。实验:bellman_merton,处处62%(默顿61.7%)。回放:带下限问题的策略曲面在三维中一片片倒着搭建,财富为1时的最优比例从25%走到31%;与投资组合保险的最大差距0.005。
  • 3. HJB方程与验证定理。 推导HJB;哈密顿量是比例的抛物线,无下限时顶点不动,有下限时滑向零;验证定理。有限差分加策略迭代(400 × 401):比例与默顿相差0.002个百分点以内,价值误差0.07%。
  • 4. 黏性解。 |u′| = 1的无穷多几乎处处解;检验函数接触峰顶(通过)与谷底(不通过);比较原理、Barles–Souganidis。迎风格式误差在舍入水平,中心差分误差从10^6到10^131。
  • 5. 默顿问题。 两个杯子:每月再平衡与买入持有;20,000条三十年路径上,伽马为3的确定性等价增长3.86%对3.77%。共同基金定理。美国数据:伽马1为238%,伽马3为79%(±2个标准误:42%–116%)。
  • 6. 消费与鞅方法。 推导默顿(1971):ν = 3.0%(对数)、3.57%(伽马3)、更有耐心时2.90%;有限寿命下从4.7%升到全部。考克斯-黄 / KLS:终值是股票的幂次权益;2,000名每日再平衡的投资者落在静态曲线上(最大差距0.34%)。
  • 7. 交易成本(实验二)。 戴维斯-诺曼楔形中被反射的财富点(15年35笔交易,年换手0.9%对24%)。奇异控制、变分不等式、ε^{1/3}渐近。实验:no_trade_band,伽马3、按月:成本0.1%、0.5%、1%、2%时区间为59.4–64.0%、57.2–66.2%、55.8–67.8%、54.0–69.6%。对数效用、1%、按季:区间158–202%,扣成本后每年比按季再平衡到默顿多增长0.29%,换手10%对44%。
  • 8. 凯利与布雷曼。 凯利(1956);香农1960年把论文给了索普;索普的合伙企业自1969年11月3日起到1998年5月每年复利约20%、标准差约6%(Thorp 2006)。推导与证明。现场:½、1、2倍凯利的扇形与时间平均线(6.2%、7.6%、2.0%即现金利率)。布雷曼的赛跑:10年/100年后凯利领先2倍凯利70%/95%,领先半凯利60%/80%。美国实现增长:100%为9.7%,最优218%为12.6%。
  • 9. 分数凯利、估计风险与LTCM。 推导(2c − c²);优势高估k倍:常系数GBM中全凯利在k = 2时超额对数增长为零,半凯利在k = 4;本特的警告。自助法最优比例云(90%在116%–302%之间)。登记过的样本分割检验。LTCM危机档案;波动率三倍时凯利杠杆从100降到11。
  • 10. 萨缪尔森的反驳与遍历性。 凯利更富的概率64%/87%,但确定性等价增长−3.6%对+3.9%;推导。现场:十万名玩家的彼得斯硬币直方图,82%亏钱;Peters、Meder等、Doctor–Wakker–Wang、Toda。凯利押25%(每次+0.62%)。
  • 11. 最优停止:斯内尔包络(实验三)。 价值迭代像绳子拉紧搭在21根木桩上(226次扫描);实验:与上凸包相差5 × 10^-14。秘书问题(37 → 37.1%)。
  • 12. 光滑粘合。 麦基恩永续看跌期权:β = 1.11,b* = 52.6,V(100) = 23.21;40年二叉树给出52.5和23.01。利率升到7%时b* = 60.9。
  • 13. 前景理论与模糊性。 阿莱悖论;累积前景理论;登记检验:股票的前景价值在18个月的评估周期上超过国库券。埃尔斯伯格、吉尔博阿-施迈德勒、汉森-萨金特;推导梅恩豪特的稳健默顿:检测误差20%时θ = 1.9、比例48%;10%时θ = 4.4、32%;无怀疑79%。
  • 14. 倒向随机微分方程。 回放:两万条路径上的回归点云一步步倒推,Y0 = 1.219,高于两个Black–Scholes价格(1.050和0.605);收敛到PDE的1.230。
  • 15. 平均场博弈(实验四)。 推导清仓博弈;每轮混合一半的阻尼最佳响应回放;实验:48轮残差低于10^-12;前五分之一时间卖出:单独20%、两家28.7%、十家36.2%、平均场38.1%。
  • 16. 强化学习(实验五)。 五个种子最终平均比例162%–184%,有限求积基准184%。不超过每年0.09%的差距是平均比例处的连续增长代理,不是完整策略的季度绩效;模拟器有财富下限;TrainingReplay回放。有成本时:PPO没有找到区间,净增长7.30–7.34%,区间7.42%,按季再平衡到默顿7.13%。
  • 17. 谁以定仓位为生。 索普1994年的体育投注测试;本特的分数凯利;伯利坎普与Axcom(大奖章的仓位方法未公开);挪威主权基金1.25个百分点的跟踪误差上限;桥水全天候;据《华尔街日报》报道的千禧年回撤规则。格罗斯曼-周启发的每周名义缓冲对凯利(最大回撤17%对99%);波动率目标(夏普0.51对0.44,阿尔法每年3.5%,t = 2.9)。
  • 18. 前沿,2023–2026。 各章构成一张图,每篇论文点亮它所建立的那条边。
  • 19. 仓位模块。 新函数;定仓位流程(凯利238% → 一半119%;20%检测误差下的稳健比例145%并不更小);扩展的第九条规则;试验计数器310。
  • 写给研究者:默顿规则中的估计风险。 代入比例μ̂/(γσ²)(μ̂ ~ N(μ, σ²/T))的确定性等价期望为(θ² − 1/T)/(2γ):估计每年恰好花掉1/(2γT);T < 1/θ²时(夏普0.4时为6¼年)期望上不如现金。乘以c得到一条抛物线,顶点c* = Tθ²/(Tθ² + 1)(Raymond Kan与周国富2007):五年0.44,二十年0.76;分数凯利即最优收缩。模拟(每个期限20,000条月度历史,两个矩都估计,γ = 1,θ = 0.4):代入规则在5/10/20/50年为每年−3.7/2.5/5.4/7.0%(卡方修正后的公式为−3.4/2.6/5.4/7.0),一半3.2/4.7/5.4/5.7,估计倍数ĉ为−0.9/2.3/4.4/6.5,已知c为3.6/4.9/6.1/7.1;五年历史中39%代入规则不如现金。美国市场,扩展窗口从1926–35年开始,1936年7月至2020年12月计分,γ = 2:代入4.9%,一半3.0%,ĉ 4.2%,全仓市场5.6%,全样本默顿(事后)6.2%;1936年后的夏普比率0.52(整个世纪0.44)。三个开放问题;暂停题:25年、θ = 0.3时c = 0.69。
  • 回顾、四道交易台问题、九道习题(两道为资格考试水平)、应用、参考文献。
Desk questions, with solutions交易台问题与解答
  1. 六成的硬币,赔率一赔一。 最大化g(f) = 0.6 log(1 + f) + 0.4 log(1 − f)。令g′(f) = 0.6/(1 + f) − 0.4/(1 − f) = 0,得f* = 0.2, g(0.2) ≈ 每次2.0%。g(0.4) ≈ −0.2%:两倍凯利就不再增长。有上限和时间限制时,目标是达到上限而不是长期增长,略低于凯利同样好。 在300次、上限250美元的设定下,押10%和20%达到上限的概率都约为94%。

  2. 波动率10%、夏普为1。 f* = (μ − r)/σ² = SR/σ = 10,纸面上凯利的超额增长为SR²/2 = 每年50%。但四年测得的夏普比率, 标准误约为√(1.5/4) ≈ 0.6(第6部分)。若真实夏普为0.5,十倍杠杆就是两倍凯利,增长不比现金快。波动率还可能变成三倍, 使凯利杠杆除以九(第9章)。应按估计值用半凯利或更低,并随波动率预测重新计算。

  3. 为什么不用凯利。 凯利最大化E log W,即伽马为1的投资者的期望效用。对伽马为3的投资者,最优比例在每个期限上都是凯利的三分之一。 凯利最终更富的概率趋于一,但它少见的亏损在该投资者的效用中代价极大,所以它的确定性等价更低(第10章:每年−3.6%对+3.9%)。

  4. 成本下漂移的权重。 每交易一美元成本1%、伽马为3(μ = 8%,r = 2%,σ = 18%)时,按月动态规划得到的不交易区间是55.8%到67.8%, 围绕默顿的61.7%(第7章)。66%在区间内:什么都不做。只有权重离开区间时交易才值得付出成本,而且只交易到最近的边缘。

Problems, with worked solutions习题与解答
  1. 任意赔率下的凯利。 对于一个以概率\(p\)每单位赢\(b\)的赌注,推导\(f^* = p - q/b\),并证明优势较小时,增长在约\(2f^*\)处再次为零。

    解答

    g(f) = p log(1 + bf) + q log(1 − f)。令g′(f) = pb/(1 + bf) − q/(1 − f) = 0,得pb(1 − f) = q(1 + bf), 即f* = (pb − q)/b = p − q/b。小优势时展开到二阶:g(f) ≈ f(pb − q) − f²(pb² + q)/2,在f ≈ 2(pb − q)/(pb² + q)处再次为零, 接近公平赔率时pb² + q ≈ b,因此近似为2(pb − q)/b = 2f*。

  2. 默顿的价值函数。 写出默顿问题的HJB方程,证明\(V = e^{a(T - t)}\,w^{1-\gamma}/(1 - \gamma)\)在\(\pi^* = (\mu - r)/(\gamma\sigma^2)\)下是它的解;求\(a\)。

    解答

    HJB方程为V_t + max_π {(r + π(μ − r))wV_w + ½π²σ²w²V_ww} = 0。代入V = e^{a(T−t)}w^{1−γ}/(1 − γ), 则V_t = −aV,wV_w = (1 − γ)V,w²V_ww = −γ(1 − γ)V。除以(1 − γ)V后,HJB化为−a/(1 − γ) + max_π {r + π(μ − r) − ½γπ²σ²} = 0。 最大值在π* = (μ − r)/(γσ²)处取得,等于r + (μ − r)²/(2γσ²)。所以a = (1 − γ)(r + (μ − r)²/(2γσ²)),且V(T) = u(w)。

  3. 常系数、连续再平衡GBM中的分数凯利。

    解答

    超额增长g(f) − r = f(μ − r) − ½f²σ²,在f* = (μ − r)/σ²处取最大,此时g* − r = (μ − r)²/(2σ²)。 在f = cf处它等于(2c − c²)(g − r),波动率为cf*σ。c = ½时得到75%的增长和一半的波动率;c = 2时增长为零,波动率翻倍。

  4. 秘书问题。 证明秘书规则的成功概率趋于\(-x\log x\),其中\(x = k/n\),在\(x = 1/e\)处取最大。

    解答

    若最佳者在位置j > k,当且仅当前j − 1人中最好的那位落在前k人之中时规则会选中他,概率为k/(j − 1)。 所以P(k) = (k/n)Σ_{j=k+1}^{n} 1/(j − 1)。记x = k/n,这是x∫_x^1 dt/t = −x log x的黎曼和。其导数−log x − 1在x = 1/e处为零, 此时值为1/e ≈ 36.8%。n = 100时最优k为37,成功率37.1%。

  5. 彼得斯的硬币。 在彼得斯的硬币(+50%,\(-40\%\))中,每次应押上财富的多大比例,增长率是多少?

    解答

    每次押比例f,增长率g(f) = ½log(1 + 0.5f) + ½log(1 − 0.4f)。令g′(f) = 0.25/(1 + 0.5f) − 0.2/(1 − 0.4f) = 0, 得0.25 − 0.1f = 0.2 + 0.1f,即f* = 0.25。此时g = ½log(1.125 × 0.9) = ½log 1.0125 ≈ 每次+0.62%,而全押每次损失½log(1/0.9) ≈ 5.3%。 只押四分之一,就把一个亏损的赌博变成了增长的赌博。

  6. 永续看跌期权的光滑粘合。

    解答

    在水平b行权,S ≥ b时V_b(S) = (K − b)(S/b)^{−β},β = 2r/σ²。固定S时它等于S^{−β}(K − b)b^{β}, 所以最大化h(b) = (K − b)b^{β}:h′(b) = b^{β−1}(β(K − b) − b) = 0,得b* = βK/(1 + β)。V_b在S = b处的斜率是−β(K − b)/b, 它等于−1恰好当β(K − b) = b,即同一个条件:选最优边界与光滑地粘到收益上是同一个方程。r = 5%、σ = 30%、K = 100时, β = 1.11,b* = 52.6,V(100) = 23.2。

  7. 清仓的人群。 对 \(\phi = 0\) 的 \(N\) 个对称交易者,求解 \(2\eta Q'' + \kappa\frac{N-1}{N}Q' = 0\),\(Q(0) = 1\),\(Q(T) = 0\),并求 \(\kappa T/(2\eta) = 2\)、\(N \to \infty\) 时到 \(T/5\) 卖出的份额。

    解答

    φ = 0时方程为Q″ + aQ′ = 0,a = κ(N − 1)/(2Nη),所以Q′ = Ce^{−at},Q(t) = (e^{−at} − e^{−aT})/(1 − e^{−aT}), 满足Q(0) = 1、Q(T) = 0。N → ∞时aT = κT/(2η) = 2,到T/5时卖出的份额为(1 − e^{−0.4})/(1 − e^{−2}) = 38.1%, 单独一家(a = 0,直线)为20%,两家(aT = 1)为28.7%。

  8. (资格考试)估计优势的代价。 (资格考试)设\(\hat\mu \sim N(\mu, \sigma^2/T)\)且\(\sigma\)已知,证明\(c\,\hat\mu/(\gamma\sigma^2)\)的确定性等价期望为\([c\theta^2 - c^2(\theta^2 + 1/T)/2]/\gamma\),代入规则在\(T < 1/\theta^2\)时期望亏损,且\(c^* = T\theta^2/(T\theta^2 + 1)\)。

    解答

    CE(π) = πμ − ½γπ²σ²。取π = cμ̂/(γσ²),则E[π]μ = cθ²/γ,½γσ²E[π²] = c²(μ² + σ²/T)/(2γσ²) = c²(θ² + 1/T)/(2γ),所以E CE = [cθ² − ½c²(θ² + 1/T)]/γ。c = 1时为(θ² − 1/T)/(2γ),恰在T < 1/θ²时为负。对c求导为零得 c* = Tθ²/(Tθ² + 1),此时E CE = (θ²/2γ)·c* ≥ 0,θ非零时严格为正。θ = 0.4、T = 5、γ = 1时:代入规则−2.0%,c* = 0.44,挣3.6%。

  9. (资格考试)方差也要估计。 (资格考试)现在用\(n\)个独立同分布正态收益的\(s^2\)估计\(\sigma^2\)。利用\(\mathbb E[\sigma^2/s^2] = (n - 1)/(n - 3)\)和\(\mathbb E[\sigma^4/s^4] = (n - 1)^2/((n - 3)(n - 5))\),求代入规则的确定性等价期望,并证明在\(\theta = 0.4\)、\(T = 5\)年月度数据时它为负。

    解答

    n > 5且独立同分布正态收益时,(n − 1)s²/σ² ~ χ²_k,k = n − 1,且与μ̂独立。X ~ χ²_k时E[1/X] = 1/(k − 2), E[1/X²] = 1/((k − 2)(k − 4)),所以E[σ²/s²] = (n − 1)/(n − 3) = a₁,E[σ⁴/s⁴] = (n − 1)²/((n − 3)(n − 5)) = a₂。 π̂ = μ̂/(γs²)时E CE = [a₁θ² − ½a₂(θ² + 1/T)]/γ。60个月时a₁ = 1.035,a₂ = 1.110,θ = 0.4时为1.035 × 0.16 − 1.110 × 0.18 = 每年−3.4%,σ已知时为−2.0%;模拟给出−3.7% ± 0.1%。

For the researcher写给研究者
  • 定理。 克莱因与巴瓦(1976)、布朗(1976)论估计风险;Raymond Kan与周国富(2007),《参数不确定性下的最优组合选择》,JFQA 42(3),研究多资产参数不确定性下的相关组合规则;巴伯里斯(2000)论学习与投资期限;麦克莱恩、索普与津巴(编,2011)论分数凯利。
  • 简化。 单一风险资产,独立同分布正态收益,用真实θ选的常数缩放;以估计样本之间的平均CE作准则,不等于无条件期望效用;真值推导假设波动率已知。多资产见第30部分。
  • 开放问题。 在指定损失、策略类与参数范围下比较可行缩放规则;优势漂移时同时选择收缩与窗口长度;指定肥尾与波动聚集模型下,估计对凯利增长的代价。

Build the film

python -m videos.quant.quant8.compute      # the part's numbers, into .cache/quant8
python tools/make.py quant8                # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant8 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/quant/quant8. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.