The primary objective of the deep-quant project is to develop a high-performance, production-grade pricing engine for American-style options under the computationally demanding class of rough stochastic volatility models, with a particular focus on the rough Bergomi model. While foundational to modern financial theory, simpler models fail to capture the steep volatility skews and term structures observed in the market for short-dated options. Rough volatility models, characterized by a low Hurst parameter ($H < 0.5$), provide a state-of-the-art framework for accurately modeling these empirical phenomena.
However, the mathematical sophistication of these models introduces significant numerical challenges that are not present in traditional frameworks. A naive implementation is prone to numerical instability, high variance in price estimates, and computationally prohibitive runtimes, rendering it impractical for real-world applications such as live calibration or comprehensive risk management.
The purpose of this document is to provide a detailed account of the key numerical hurdles encountered during the development of the deep-quant pricing engine. It will detail the hierarchy of sophisticated solutions that were systematically implemented to ensure the final engine is accurate, stable, and efficient.
The foundational challenge in pricing with the rough Bergomi model is the numerical simulation of its variance process. The model defines variance as an exponential of a fractional Brownian motion, as shown in the equation:
\[V_t = v_0 \exp\left(\eta W_t^H - \frac{1}{2}\eta^2 t^{2H}\right)\]where $W_t^H$ is a fractional Brownian motion. A naive, vectorized implementation of this can lead to the exponent becoming very large, causing the variance to overflow to inf or NaN values. This catastrophic instability makes any subsequent pricing calculation impossible. Early attempts to mitigate this with a simple upper clamp on the variance were found to be suboptimal, as a fixed clamp can introduce significant bias, especially when simulating over a wide range of model parameters.
The definitive solution was to implement a stable hybrid simulation scheme that is both mathematically sound and numerically robust. This approach completely abolishes the need for artificial clamps. The method consists of two key components:
Vectorized Log-Variance Path: The variance process is handled by first simulating its logarithm, which is a numerically well-behaved process:
\[\log(V_t) = \log(v_0) + \eta W_t^H - \frac{1}{2}\eta^2 t^{2H}\]The full path of $\log(V_t)$ is calculated in a single, vectorized operation. The final variance path is then obtained by exponentiating, $V_t = \exp(\log(V_t))$, which mathematically guarantees its positivity.
Iterative Log-Euler for Stock Price: With a stable, positive variance path now available, the stock price path, which follows the SDE:
\[\frac{dS_t}{S_t} = r dt + \sqrt{V_t} dB_t\]is simulated using a step-by-step for loop. The iterative Log-Euler scheme discretizes the logarithm of the stock price, which is more stable than a direct discretization of $S_t$:
This hybrid approach combines the speed of vectorization where it is safe (for the variance process) with the stability of an iterative loop where it is necessary (for the price process), ensuring the generation of robust and accurate paths.
# --- Pseudocode for the Hybrid Scheme ---
# 1. Vectorized Log-Variance Generation
W_H = generate_fractional_brownian_path(...)
log_V_path = log(v0) + eta * W_H - 0.5 * eta**2 * t**(2*H)
V_path = exp(log_V_path)
# 2. Iterative Stock Price Generation
log_S = array_of_zeros
log_S[0] = log(s0)
for t in range(num_steps):
sqrt_V = sqrt(V_path[t])
log_S_increment = (r - 0.5 * V_path[t]) * dt + sqrt_V * delta_B[t]
log_S[t+1] = log_S[t] + log_S_increment
S_path = exp(log_S)
Even with a stable path simulation, the inherent randomness of the Monte Carlo method presents a major performance bottleneck. The high variance of rough volatility paths means that a huge number of simulations are required for the price estimates to stabilize. Simply increasing the number of paths leads to impractically long runtimes, during which the estimates tend to oscillate in a noisy band without reaching a clear convergence point. The core challenge is that standard pseudo-random sampling is inefficient; it can create clusters of sample points and leave large areas of the probability space unexplored, requiring a massive number of paths to achieve even coverage.
The solution to this performance bottleneck is a two-pronged strategy. Instead of relying on a fixed, brute-force number of simulations, we developed an adaptive framework that is both smarter and more efficient.
These two components work together to dramatically accelerate the convergence of the simulation.
To improve the quality of our samples, we replaced the standard pseudo-random number generator with a method that combines two powerful techniques: Randomized Quasi-Monte Carlo and antithetic variates.
Formally, the fundamental improvement comes from replacing purely pseudo-random numbers with a low-discrepancy sequence, such as a Sobol sequence, and then randomizing it.
This RQMC method is then combined with antithetic variates, a technique that uses “mirror-image” paths to cancel out noise, further reducing the variance of each sample.
To avoid running the simulation longer than necessary, we implemented an intelligent adaptive stopping rule within the simulate_paths_adaptive_rqmc function. Instead of waiting for the confidence interval of the price estimate to shrink below an arbitrarily small tolerance (which may never happen due to the oscillation), the algorithm monitors the rate of improvement. It tracks the best confidence interval achieved so far and stops automatically if it fails to make a significant improvement after a set number of new path batches (patience). This “stagnation detection” correctly identifies when the simulation has reached the point of diminishing returns, saving a vast amount of computational effort.