13 July 202613 juillet 2026article
Rebuilding the Genesis of Quant Finance in PythonReconstruire la genèse de la finance quantitative en Python
A step-by-step numerical reproduction of Louis Bachelier's 1900 model: Random walks, Martingales, and Option Pricing.Une reproduction numérique étape par étape du modèle de Louis Bachelier de 1900 : marches aléatoires, martingales et valorisation d'options.
Quantitative FinancePythonOptions Pricing
To truly understand quantitative finance, one must build its foundational models from scratch. Following our theoretical breakdown of Louis Bachelier's 1900 thesis, Théorie de la Spéculation, we are now transitioning from theory to pure code.
Bachelier modeled asset prices as an arithmetic random walk. Using modern Python, we will empirically test his three major mathematical claims step-by-step: the Martingale property, the linear growth of variance, and the very first option pricing formula in history.
Step 1: Simulating the Arithmetic Random Walk
Bachelier defined the price Pₜ as:
Pₜ = P₀ + σ Wₜ
Where Wₜ is a standard Brownian motion (Wiener process). We simulate 5,000 different market paths over 250 trading days (one year) to observe the macroscopic behavior of the market.
- The Speculator's Expectation is Zero (Martingale): Across our 5,000 simulated paths, the maximum deviation between the expected price E[Pₜ] and the initial price P₀ is merely 0.037 on a price scale of 100.
- Variance Scales Linearly: The relative error between the theoretical variance and our Monte Carlo empirical variance is 1.56%, which is purely standard statistical noise.
- The Flaw of the Model: Because it is an arithmetic walk, the model theoretically allows prices to drop below zero. In our specific sample, the probability of hitting a negative price at t = T was 0.000%, but analytically, the risk is always present.
Step 2: The 1900 Option Pricing Formula
70 years before Black-Scholes, Bachelier derived the closed-form solution to price a European call option. Under his framework, the price C is:
C = (P₀ - K) N(d) + σ√T φ(d)
We implement his closed-form mathematical formula, a Monte Carlo pricing engine to verify it, and the Black-Scholes formula for historical comparison.
- Analytical vs. Empirical Pricing: When comparing Bachelier's closed-form formula against our Monte Carlo engine (using 2 million paths), the price gap is only 0.0008, falling perfectly within the Monte Carlo standard error.
- The Square Root of Time Rule: For an at-the-money option (K = P₀), the formula exactly reduces to C = σ√T φ(0). Our code registers a numerical error of 0.00e+00, proving the exact scaling identity.
- Convergence with Black-Scholes: If we look at a low-volatility environment (e.g., 2% geometric volatility), the maximum price difference between Bachelier's 1900 model and the Black-Scholes 1973 model across a strike grid of [80, 120] is a negligible 0.0048.
Pour vraiment comprendre la finance quantitative, il faut construire ses modèles fondamentaux à partir de zéro. Suite à notre analyse théorique de la thèse de Louis Bachelier de 1900, Théorie de la Spéculation, nous passons maintenant de la théorie au code pur.
Bachelier a modélisé les prix des actifs comme une marche aléatoire arithmétique. À l'aide de Python, nous allons tester empiriquement ses trois affirmations mathématiques majeures : la propriété de martingale, la croissance linéaire de la variance, et la toute première formule de valorisation d'options de l'histoire.
Étape 1 : Simulation de la marche aléatoire arithmétique
Bachelier a défini le prix Pₜ comme :
Pₜ = P₀ + σ Wₜ
Où Wₜ est un mouvement brownien standard. Nous simulons 5 000 trajectoires de marché sur 250 jours de cotation pour observer le comportement macroscopique du marché.
- L'espérance du spéculateur est nulle (Martingale) : Sur nos 5 000 trajectoires, l'écart maximum entre le prix attendu E[Pₜ] et le prix initial P₀ n'est que de 0,037 sur une échelle de 100.
- Croissance linéaire de la variance : L'erreur relative entre la variance théorique et notre variance empirique Monte Carlo est de 1,56 %.
- Le défaut du modèle : S'agissant d'une marche arithmétique, le modèle permet théoriquement aux prix de devenir négatifs.
Étape 2 : La formule de valorisation d'options de 1900
70 ans avant Black-Scholes, Bachelier a dérivé la solution fermée pour évaluer une option d'achat européenne. Sous son cadre, le prix C est :
C = (P₀ - K) N(d) + σ√T φ(d)
- Valorisation analytique vs empirique : En comparant la formule fermée de Bachelier à notre moteur Monte Carlo (2 millions de tirages), l'écart n'est que de 0,0008.
- Scaling temporel : Pour une option à la monnaie (K = P₀), la formule se réduit à C = σ√T φ(0). Notre code enregistre une erreur numérique parfaite de 0,00e+00.
- Convergence avec Black-Scholes : Dans un environnement à faible volatilité (2 %), la différence de prix maximale entre le modèle de Bachelier et celui de Black-Scholes est négligeable (0,0048).