What does Regime Kelly, Drawdown Limits and Lifecycle Leverage conclude, in numbers, about “Hidden Regimes: How Fast a Bear Can Be Recognized and What a Regime-Aware Kelly Buys”?
Answer: Chapter 3 finds that even with the true parameters a bear regime takes about two months to recognize and 0.193 of bear spells are missed.
Scope of the numbers: Its model parameters are illustrative or synthetic; the only historical figure is a one-day fall in 1987; all calculations are generated by its programs; the book is not investment, legal or tax advice. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.193
| bear spells 6376, mean length 12.5 months | |||
| threshold | median delay | missed spells | false alarms/bull mo |
| 0.3 | 2 | 0.155 | 0.071 |
| 0.5 | 2 | 0.193 | 0.037 |
| 0.7 | 3 | 0.224 | 0.017 |
Show the full program
# Chapter 3. p05: How fast can a hidden bear regime be recognized? The
# Hamilton filter of the two-regime market (p02), with the true
# parameters known, updates the chance of "bear" each month from that
# month's excess return. Delay = months from the first bear month
# until the filtered chance first exceeds a threshold; a false alarm
# is a bull month whose filtered chance exceeds it. 400,000 months,
# seed 98.
import random
from math import exp, pi, sqrt
BULL, BEAR = (0.12 / 12, 0.13 / sqrt(12)), (-0.25 / 12, 0.28 / sqrt(12))
STAY = (0.98, 0.92)
def dens(x, m, sd):
return exp(-0.5 * ((x - m) / sd) ** 2) / (sd * sqrt(2 * pi))
def step(p_bear, x):
prior = p_bear * STAY[1] + (1 - p_bear) * (1 - STAY[0])
a = prior * dens(x, *BEAR)
b = (1 - prior) * dens(x, *BULL)
return a / (a + b)
if __name__ == "__main__":
rng = random.Random(98)
s, p, states, probs = 0, 0.2, [], []
for _ in range(400000):
if rng.random() > STAY[s]:
s = 1 - s
x = rng.gauss(*(BULL if s == 0 else BEAR))
p = step(p, x)
states.append(s)
probs.append(p)
starts = [i for i in range(1, len(states))
if states[i] == 1 and states[i - 1] == 0]
lens = []
i = 0
while i < len(states):
if states[i] == 1:
j = i
while j < len(states) and states[j] == 1:
j += 1
lens.append(j - i)
i = j
else:
i += 1
print(" bear spells {}, mean length {:.1f} months".format(
len(lens), sum(lens) / len(lens)))
print(" threshold median delay missed spells false alarms/bull mo")
for th in (0.3, 0.5, 0.7):
delays, missed = [], 0
for st in starts:
k = st
while k < len(states) and states[k] == 1 and probs[k] <= th:
k += 1
if k < len(states) and states[k] == 1:
delays.append(k - st + 1)
else:
missed += 1
delays.sort()
bull = [probs[i] for i in range(len(states)) if states[i] == 0]
print(" {:9.1f} {:12d} {:13.3f} {:20.3f}".format(
th, delays[len(delays) // 2], missed / len(starts),
sum(q > th for q in bull) / len(bull)))Single source and citation
Fan, Y. (2026). Regime-Switching Fractional Kelly, Maximum-Drawdown Constraints and Lifecycle Leverage Allocation (Version 1.0.0), Chapter 3: Hidden Regimes: How Fast a Bear Can Be Recognized and What a Regime-Aware Kelly Buys. 5D Library. https://doi.org/10.5281/zenodo.24090256
DOI: 10.5281/zenodo.24090256 · Read the monograph · 5DL-B-098 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026098,
author = {Fan, Yafu},
title = {Regime-Switching Fractional Kelly, Maximum-Drawdown Constraints and Lifecycle Leverage Allocation},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090256},
url = {https://doi.org/10.5281/zenodo.24090256}
}Other chapter answers in this book
- Chapter 1 · Full Kelly and the Optimistic Drift: Why a Good Year Breeds Overbetting
- Chapter 2 · Halving and Worse: First Passage of a Kelly Bettor
- Chapter 4 · Betting Under a Drawdown Limit: The Fraction of Kelly That Keeps a Promise
- Chapter 5 · Ralph Vince's Optimal f: Kelly in Trader's Units, and Its Drawdowns
- Chapter 6 · The Lifecycle Balance Sheet: Human Capital, Early Leverage and the Glide Path
- Chapter 7 · "When Things Flourish They Decline", Feng Xuan's Three Burrows, and Vince Reconsidered
- Chapter 8 · Practice: A Ten-Year Leverage Table, Gap Risk and a Drawdown Warning Rule