Mark Anthony Brown

The lab

How long does the money last?

I built this interactive Monte Carlo engine to test risk of ruin strategies under Kelly Criterion bet sizing. Tweak the assumptions below to see how bankroll curves react in real time.

It started as my Blackjack project, and it's really the same question an actuary asks about an insurer's surplus: you expect to make money, so what are the odds you run dry first? Run it in your browser, or send the job to the Python version on my Raspberry Pi.

Start from a scenario

Bet sizing

Where should it run?

Went broke (simulated)

–

Formula, forever

–

Median ending bankroll

–

Kelly fraction f*

–

Bankroll paths

Middle 90% Median Mean Sample paths

Where everyone ended up

Still in the game

Avg profit per round

–

Std. dev. per round

–

Sharpe per round

–

Mean ending bankroll

–

Exam FM, but interactive

Bond price, duration & convexity

I'm sitting for Exam FM in February, and bonds come up constantly. So I built the calculator I wanted while studying. Plug in a yield to get the price, or a price to back out the yield. The math runs in Python on the Pi (/api/bond).

Solve for

Price

–

Yield to maturity

–

Macaulay duration

–

Convexity

–

What each payment is worth today

If rates move

ΔyEst. priceChange

ΔP/P ≈ −Dmod·Δy + ½·C·Δy²