Skip to main content

heston

Function heston 

Source
pub fn heston(
    mu: f64,
    kappa: f64,
    theta: f64,
    xi: f64,
    rho: f64,
) -> NdSDE<2, impl Fn(&SVector<f64, 2>, f64) -> SVector<f64, 2> + Send + Sync, HestonDiffusion>
Expand description

Heston stochastic volatility model. State: [log S, V]; use exp(paths[.., .., 0]) to recover S.

d(log S) = (mu - V/2) dt + sqrt(V) dW1 dV = kappa * (theta - V) dt + xi * sqrt(V) * (rho * dW1 + sqrt(1-rho^2) * dW2)

Parameters:

  • mu: risk-neutral drift of log-price
  • kappa: variance mean-reversion speed
  • theta: long-run variance
  • xi: volatility of variance (vol of vol)
  • rho: correlation between price and variance Brownian motions (typically -0.7)