GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - incroyale/volatility_surface: SPX Option Implied Volatility Surface using SVI Parameterisation, its variants and the Heston Stochastic Volatiltiy Model. Implements and studies interpolation and smoothing techniques used by Bloomberg for Equity Option Vol Surface Construction.

BranchesTags
Open more actions menu

Latest commit

 

History

67 Commits
67 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
data
data
 
 
images
images
 
 
models
models
 
 
README.md
README.md
 
 

Repository files navigation

Implied Volatility Surface SPX Options

Calibration of implied volatility surfaces from live SPX options data using the SVI (Stochastic Volatility Inspired), SSVI (Surface SVI), and Heston stochastic volatility models. The project covers the full pipeline: data acquisition, OTM filtering, calibration, and 3D surface visualisation.


Data Pipeline

Options data is fetched live from Yahoo Finance via yfinance. For each expiry in the option chain, OTM calls and puts are selected and merged into a unified DataFrame.

Filtering rules applied:

  • Expiry range: configurable [min_days, max_days] window (e.g. 2 days to 2 months)
  • Strike range: within ±10% of spot by default
  • OTM selection: calls with K >= 0.99 * S, puts with K <= 1.01 * S
  • IV cleanup: 0.10 < IV < 0.50 to strip stale or illiquid quotes

For SVI and SSVI, strikes are converted to log-moneyness k = ln(K/F) where F = S * exp(r * T) is the forward price, and total variance w = IV^2 * T is used as the fitting target. This is the natural space for SVI and makes no-arbitrage conditions easier to enforce.

For Heston, raw strikes and market IVs are used directly, as the model prices in strike space via numerical integration.


Model 1: SVI (Stochastic Volatility Inspired)

Parametrisation

The raw SVI model fits total variance as a function of log-moneyness:

w(k) = a + b * ( rho * (k - m) + sqrt((k - m)^2 + sigma^2) )

Parameter interpretation:

Parameter Role
a Overall variance level (vertical shift)
b >= 0 Slope / wings steepness
rho in (-1, 1) Skew — left/right asymmetry
m Horizontal shift (ATM location)
sigma > 0 Curvature / smile smoothness
  • Each expiry slice is calibrated independently. The optimisation minimises squared total-variance residuals using non-linear least squares.

  • Uses PCHIP (Piecewise Cubic Hermite Interpolation Polynomial)

Results

SVI Smile Fit Per Expiry

SVI IV Surface


Model 2: SSVI (Surface SVI)

Parametrisation

SSVI extends SVI by directly modelling the entire surface with a single globally consistent parametrisation. Total variance is:

w(k, theta) = (theta / 2) * ( 1 + rho * phi(theta) * k + sqrt((phi(theta) * k + rho)^2 + (1 - rho^2)) )

where the power-law wings function is:

phi(theta) = eta / ( theta^gamma * (1 + theta)^(1 - gamma) )

and theta(T) is the ATM total variance at each maturity, extracted via linear interpolation.

Parameter interpretation:

Parameter Role
rho in (-1, 1) Global skew
eta > 0 Overall vol-of-vol level
gamma in (0, 1) Controls how wings decay with maturity
  • Unlike SVI, there is no per-slice fitting. rho, eta, and gamma are calibrated once across the entire surface simultaneously.
  • Optimisation uses a two-phase approach: differential evolution for global search followed by SLSQP for local refinement.
  • No-arbitrage is enforced via explicit constraints: calendar eta * (1 + |rho|) <= 2 and butterfly theta * phi^2 * (1 + |rho|)^2 <= 4.

Results

SSVI Smile Fit Per Expiry

SSVI IV Surface

About

SPX Option Implied Volatility Surface using SVI Parameterisation, its variants and the Heston Stochastic Volatiltiy Model. Implements and studies interpolation and smoothing techniques used by Bloomberg for Equity Option Vol Surface Construction.

Topics

blackscholesheston-modelheston-stochastic-volatilityimplied-volatilitiesimplied-volatilityimplied-volatility-forecastingimplied-volatility-surfaceimpliedvolatilityoption-pricingssvistochastic-volatility-modelssvi

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.