Stochastic volatility (Heston) preview
In basic geometric Brownian motion (GBM), volatility is constant. Real markets show volatility clustering:
calm periods and turbulent periods. Stochastic volatility models treat volatility (or variance) itself as a random process.
A widely used university-level model is the Heston model.
1) The Heston SDE system
The Heston model couples a price process \(S_t\) with a variance process \(v_t\):
\[
dS_t=\mu S_t\,dt+\sqrt{v_t}\,S_t\,dW_{1,t},
\qquad
dv_t=\kappa(\theta-v_t)\,dt+\xi\sqrt{v_t}\,dW_{2,t}.
\]
The Brownian motions are correlated:
\[
\mathrm{corr}(dW_{1,t},dW_{2,t})=\rho,\qquad -1<\rho<1.
\]
- \(\mu\): drift (expected growth rate, under the chosen measure).
- \(\kappa\): mean reversion speed pulling \(v_t\) toward \(\theta\).
- \(\theta\): long-run variance level.
- \(\xi\): “volatility of volatility” controlling randomness in \(v_t\).
- \(\rho\): correlation between price shocks and variance shocks (often negative in equities: leverage effect).
2) Why variance can go negative in numerics
In theory, \(v_t\) is designed to stay nonnegative (under conditions such as the Feller constraint).
But basic Euler discretizations can produce negative values because of finite step size:
the random term can overshoot below zero.
To reduce artifacts, practitioners often apply positivity fixes, such as:
- Absorption: compute \(v_{i+1}\) then set \(v_{i+1}\leftarrow \max(v_{i+1},0)\).
- Full truncation: use \(v^+=\max(v,0)\) inside drift/diffusion and clamp after update.
3) Euler–Maruyama discretization (what the calculator uses)
Use a grid \(t_i=i\Delta t\) with \(\Delta t=T/n\). Generate two independent \(Z_1,Z_2\sim N(0,1)\),
then form correlated increments:
\[
\Delta W_1=\sqrt{\Delta t}\,Z_1,
\qquad
\Delta W_2=\sqrt{\Delta t}\,\Big(\rho Z_1+\sqrt{1-\rho^2}\,Z_2\Big).
\]
A one-step Euler update is:
\[
v_{i+1}=v_i+\kappa(\theta-v_i)\Delta t+\xi\sqrt{v_i}\,\Delta W_2,
\qquad
S_{i+1}=S_i+\mu S_i\Delta t+\sqrt{v_{i+1}}\,S_i\,\Delta W_1.
\]
This calculator uses the same idea but applies your chosen positivity scheme for \(v_i\) to keep the simulation stable.
4) Reading the plots
- Top panel: multiple simulated price paths \(S_t\).
- Bottom panel: corresponding variance paths \(v_t\).
- Negative \(\rho\) often produces the “leverage effect”: price drops and variance spikes tend to coincide.
5) University extension: calibration
In practice, Heston parameters are often calibrated to option prices or implied volatility surfaces.
That is a more advanced task requiring optimization and market data; this tool focuses on simulation intuition.