TQBTHEQUANTBATEMAN
TQB/ learn/ volatility/ stochastic volatilityEN · DARK
Volatility · advanced

Stochastic volatility

Adding an explicit random variance state and the dynamics a static surface cannot supply

BY THE END, YOU CAN

01Separate spot and variance state dynamics.

02Explain leverage correlation and vol-of-vol.

03Derive the first moments of mean-reverting variance.

04Identify simulation and calibration risks.

01
INTUITION

Identify the state variables and the behavior they add.

Stochastic-volatility models make variance a random state. Correlation between spot and variance innovations creates skew dynamics; mean reversion and vol-of-vol shape the term structure and distribution of future variance.

01

Variance becomes a hedge factor rather than a deterministic surface lookup.

02

Negative spot-variance correlation produces leverage-style downside skew.

03

The discretization scheme is part of the implemented model.

02
WHY MARKETS CARE

Ask which instruments can identify the dynamics.

Stochastic volatility improves forward smile dynamics and prices payoffs exposed to variance path and convexity.

INSTRUMENTS

forward-start options

cliquets

barriers

variance and volatility derivatives

QUOTE CONVENTION

Parameters are model states or risk-neutral dynamics, not directly observed market quotes. State whether calibration is in premium or implied-vol space.

03
MATHEMATICS

Write the dynamics before interpreting parameters.

Formula · Full derivation

Generic variance dynamics

dvt=κ(θ−vt)dt+ηg(vt)dWtvdv_t=\kappa(\theta-v_t)dt+\eta g(v_t)dW_t^v

Mean reversion plus state-dependent variance diffusion.

Open in Analytics
Formula · Definition

Leverage channel

d⟨WS,Wv⟩t=ρ dtd\langle W^S,W^v\rangle_t=\rho\,dt

Correlation transmits spot shocks into the variance state.

Open in Analytics
Formula · Short derivation

Conditional mean

Et[vt+τ]=θ+(vt−θ)e−κτ\mathbb E_t[v_{t+\tau}]=\theta+(v_t-\theta)e^{-\kappa\tau}

Variance shocks decay toward the long-run level at speed κ.

Open in Analytics
Short derivation
Short derivation

The mean-reverting variance state

Take conditional expectation of the variance SDE; the martingale diffusion term vanishes.

  1. 01

    Start from the SDE

    Use a drift pulling variance toward θ and a zero-mean diffusion innovation.

  2. 02

    Take conditional expectation

    The Itô integral has zero conditional expectation under integrability conditions.

    dm(τ)=κ(θ−m(τ))dτdm(\tau)=\kappa(\theta-m(\tau))d\tau
  3. 03

    Solve the linear ODE

    Apply an integrating factor or recognize exponential decay.

    m(τ)=θ+(vt−θ)e−κτm(\tau)=\theta+(v_t-\theta)e^{-\kappa\tau}
  4. 04

    Interpret term dynamics

    Large κ localizes variance shocks in short maturities; θ anchors the long end.

  5. 05

    Restore distributional risk

    The mean omits η, ρ and higher moments; pricing requires the full joint process and a risk-neutral parameterization.

Mean reversion explains level decay, while vol-of-vol and correlation determine smile curvature and leverage dynamics.

Inputs
  • v_t: instantaneous variance
  • κ: mean-reversion speed
  • θ: long-run variance
  • η: vol of variance
  • ρ: spot-variance correlation
Assumptions and limits
  • Parameters can be weakly identified.
  • Risk-neutral and physical dynamics differ.
  • Naive discretization biases variance and can cross zero.
05
MODEL / PRICING

Calibrate, compute, and challenge the dynamics.

METHOD

Choose a variance process compatible with the payoff and numerical engine; validate moments, positivity behavior and limiting cases.

CALIBRATION

Fit liquid surface nodes with constrained multi-start optimization, then evaluate parameter stability and exotic hedge behavior.

Implementation with current QuantLib

Current QuantLib separates market structures, processes, instruments, engines and calibration helpers. Use those abstractions only after the lesson’s conventions, domains and numerical checks are explicit.

API authority: upstream QuantLib reference pinned in the source registry.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
ARCHITECTURE
  • Validate domains and units at the boundary.
  • Keep the numerical kernel framework-free and deterministic.
  • Return diagnostics with values.
  • Test analytical limits and failure states.
PYTHON 3 · NUMPY / SCIPY

Mean-reverting variance paths

Simulate a positive teaching process and verify the conditional mean direction.

REUSABLE EXAMPLE
01from __future__ import annotations
02
03import numpy as np
04
05def variance_paths(paths: int = 10_000, steps: int = 252, seed: int = 4) -> np.ndarray:
06 rng = np.random.default_rng(seed)
07 v = np.full(paths, 0.09)
08 dt, kappa, theta, eta = 1 / steps, 2.0, 0.04, 0.35
09 for _ in range(steps):
10 vp = np.maximum(v, 0.0)
11 v += kappa * (theta - vp) * dt + eta * np.sqrt(vp * dt) * rng.standard_normal(paths)
12 return np.maximum(v, 0.0)
13
14v = variance_paths()
15assert np.isfinite(v).all() and np.all(v >= 0.0)
16assert abs(float(v.mean()) - 0.04) < 0.03
17print(round(float(v.mean()), 5))
EXPECTED OUTPUTA deterministic terminal mean near the long-run variance.
SANITY CHECKS

✓ Seed is fixed.

✓ Diffusion uses non-negative variance.

✓ Mean-reversion direction is tested.

07
INTERACTIVE LAB

Shock one parameter and trace the full response.

RANDOM VARIANCE STATE AND MEAN REVERSION

Variance-state lab

Shock κ, θ, vol-of-vol and correlation; animate variance paths and surface response.

SYNTHETIC · CONTROLLED SCENARIOS
Long-run vol20.00%
κ3.20
Vol-of-vol0.35
Instantaneous variance by Simulation time

Fast reversion: Variance shocks decay rapidly.

  • conditional mean
  • path A
  • path B
Simulation time: 0.0Y. conditional mean: 0.0900. path A: 0.0900. path B: 0.0891.

Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.

ACTIVE STATE

Fast reversion — Variance shocks decay rapidly. Move the intensity control and inspect every series with pointer or touch.

08
FRONT OFFICE

Where the model meets the book.

ON THE DESK
“A parameter is hedgeable only through the instruments that move it.”
VISIBLE INPUTS

surface snapshot

variance proxy

parameter bounds

engine

weights

CALIBRATION

Fit liquid surface nodes with constrained multi-start optimization, then evaluate parameter stability and exotic hedge behavior.

RISK

variance delta

vol-of-vol

correlation

parameter drift

DAILY WORKFLOW
  1. select process
  2. calibrate
  3. validate moments
  4. simulate
  5. stress hedges
Production failure modes
  • negative variance scheme
  • optimizer traps
  • unstable Greeks
  • measure confusion
09MACRO CONNECTIONOpen the transmission channel.
MACRO CONNECTION

Volatility as a persistent state

Risk shocks lift a variance state that decays rather than disappearing at the next close, producing clustering and term-structure effects.

01Risk shocktransmits

raises variance state

02Vol-of-voltransmits

controls state dispersion

03Mean reversiontransmits

sets persistence

04Surface dynamicsoutput

moves level and skew

10COMMON PITFALLSOpen the failure checklist.
01

Reading risk-neutral parameters as physical forecasts.

02

Ignoring the variance discretization scheme.

03

Equating a good static fit with stable hedges.

04

Calibrating without multiple starts.

11SOURCES / FURTHER READINGOpen sources and continue the track.
research

Volatility, Monte Carlo and stochastic-volatility lectures

Research map for the mathematical progression and numerical experiments; prose, examples and code are original.

Source
Computational Finance Course
Author
L. A. Grzelak
Ref
main
OPEN ORIGINAL SOURCE ↗
implementation reference

Current volatility structures, processes, calibration helpers and tests

Implementation reference for production abstractions and validation patterns.

Source
QuantLib upstream
Author
QuantLib contributors
Ref
v1.42.1
OPEN ORIGINAL SOURCE ↗