Skip to content

Arhayout/sabr-calibration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sabr-calibration

SABR model calibration pipeline for FX options
SABR (Hagan 2002) · Vanna-Volga · Multi-expiry surface · FX convention

CI Python 3.10+ License: MIT

Production-grade SABR calibration pipeline with multi-expiry surface fitting, Vanna-Volga FX pricing, smile extrapolation, and calibration diagnostics. Built during quant dev work on FX exotic option pricing.


Models

SABR (Hagan et al., 2002)

$$dF_t = \alpha_t F_t^\beta dW_t^1, \quad d\alpha_t = \nu \alpha_t dW_t^2, \quad \langle dW^1, dW^2 \rangle = \rho , dt$$

Parameters: α (initial vol), β ∈ [0,1] (CEV exponent), ρ (correlation/skew), ν (vol of vol)

Calibration RMSE on FX surfaces (typical):

Expiry RMSE (vol pts) Max Error
1W 0.08 0.22
1M 0.12 0.31
3M 0.09 0.24
6M 0.11 0.28
1Y 0.14 0.35

Vanna-Volga (Castagna & Mercurio, 2007)

Standard FX market method for pricing vanillas and exotics.
Calibrated to 3 market pillars: 25Δ put, ATM, 25Δ call.


Quick Start

from sabr import SABRModel, calibrate_sabr_surface
from sabr.calibration import generate_fx_surface
import numpy as np

# Single expiry
model = SABRModel(beta=0.5)
K = np.array([0.95, 0.97, 1.00, 1.03, 1.05]) * 1.08  # EUR/USD
iv_market = np.array([0.092, 0.085, 0.080, 0.083, 0.089])
params = model.fit(F=1.08, T=0.5, strikes=K, market_vols=iv_market)
print(model)
# SABRModel(α=0.1312, β=0.50, ρ=-0.2891, ν=0.4123)

# Full surface
expiries, forwards, strikes_list, vols_list = generate_fx_surface()
models, summary = calibrate_sabr_surface(expiries, forwards, strikes_list, vols_list)
print(summary[["expiry", "alpha", "rho", "nu", "rmse_vols"]])

# Vanna-Volga FX pricing
from sabr import VannaVolga
from sabr.vanna_volga import FXSmileQuote
vv = VannaVolga()
quote = FXSmileQuote(atm_vol=0.08, rr25=-0.005, bf25=0.001,
                     S=1.08, T=0.5, r_dom=0.05, r_for=0.03)
vv.calibrate(quote)
prices = vv.price(K, call=True)
ivols  = vv.implied_vol_surface(K)

References

  1. Hagan, P.S. et al. (2002). Managing Smile Risk. Wilmott Magazine.
  2. Castagna, A. & Mercurio, F. (2007). The Vanna-Volga Method for Implied Volatilities. Risk Magazine.
  3. Oblój, J. (2008). Fine-tune your smile: correction to Hagan et al. arXiv.

License

MIT © Abdelmalek Rhayoute

About

SABR/SABR-LMM model calibration toolkit in Python — FX vol surface fitting, Hagan approximation, SciPy optimizer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages