Short mathematical animations that explain how actuarial models work and why their assumptions matter.
Watch the 42.8-second video — 1080 × 1350, 30 fps.
The first video follows the complete Lee-Carter idea in under one minute:
- mortality rates form an age-by-year surface;
a_xdescribes the average mortality pattern by age;b_xmeasures how strongly each age reacts to the time trend;- forecasting
k_tproduces a future mortality curve; - those projections feed survival and annuity calculations.
The scene fits the model with singular value decomposition. It uses a deterministic, illustrative mortality surface so the repository remains self-contained and does not redistribute licensed Human Mortality Database data.
The model is
log m(x,t) = a(x) + b(x) k(t) + epsilon(x,t)
with the usual identification constraints sum(b_x) = 1 and mean(k_t) = 0.
Requirements: Python 3.11+ and FFmpeg.
py -3.11 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\python.exe -m pytest
.\.venv\Scripts\python.exe -m manim --config_file manim.cfg `
src\actuarial_math_visualized\scene.py LeeCarterVisualizedThe final social-media render is copied to assets/lee-carter-visualized.mp4.
src/actuarial_math_visualized/model.py Lee-Carter fit and forecast
src/actuarial_math_visualized/scene.py 4:5 Manim animation
tests/test_model.py numerical contract tests
assets/ final video and thumbnail
Created by Amine Manai. MIT licensed.