⚑ Stochastic Volatility Calibrator & Heston Simulator

A quantitative modeling package developed by Ramprasad Atluri for continuous-time stochastic volatility simulation and calibration.

πŸ“Œ Model Description

This model implements the bivariate continuous-time Heston Stochastic Volatility Model with full truncation discretization. It models the joint dynamics of an underlying asset price $S_t$ and its instantaneous variance $v_t$:

dSt=ΞΌStdt+vtStdWtSdS_t = \mu S_t dt + \sqrt{v_t} S_t dW_t^S

dvt=ΞΊ(ΞΈβˆ’vt)dt+ΞΎvtdWtvdv_t = \kappa (\theta - v_t) dt + \xi \sqrt{v_t} dW_t^v

Cov(dWtS,dWtv)=ρ dt\text{Cov}(dW_t^S, dW_t^v) = \rho \, dt

Parameters:

  • $\kappa$ (Mean Reversion Speed): Rate at which variance pulls back towards its long-term average $\theta$.
  • $\theta$ (Long-Term Variance): Long-run variance ceiling.
  • $\xi$ (Vol of Vol): Volatility of the variance diffusion process.
  • $\rho$ (Leverage Correlation): Asymmetric correlation capturing the financial leverage effect ($\rho < 0$).
  • $v_0$ (Initial Variance): Instantaneous starting variance.

πŸš€ Quick Start

Download and run simulations directly in Python:

from huggingface_hub import hf_hub_download
import json

# Download weights
weights_file = hf_hub_download(
    repo_id="At1uri/stochastic-volatility-calibrator",
    filename="calibrator_weights.json"
)

with open(weights_file, "r") as f:
    config = json.load(f)

print("Calibrated Parameters:", config["calibrated_parameters"])

Full Simulation using calibrator.py:

from calibrator import HestonStochasticVolatilityModel

# Initialize pre-calibrated model
model = HestonStochasticVolatilityModel.load_pretrained()

# Simulate 500 Monte Carlo price and variance paths
price_paths, var_paths = model.simulate_paths(s0=100.0, t_days=252, n_paths=500)
print(f"Mean Terminal Price: {price_paths[:, -1].mean():.2f}")

πŸ“Š Diagnostics & Feller Condition

The pre-calibrated parameter set guarantees the Feller Condition: 2ΞΊΞΈ>ΞΎ22 \kappa \theta > \xi^2 Ensuring the variance process $v_t$ remains strictly positive ($v_t > 0$) almost surely.

  • Feller Ratio: $2\kappa\theta / \xi^2 = 2.012$ (Strictly satisfied)
  • Calibration RMSE: $0.00318$

βš–οΈ License

MIT License. Free for academic, proprietary, and commercial quantitative development.

Downloads last month
22
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support