FinancePy

FinancePy API Reference

Swaption Vol Surface

financepy.market.volatility.swaption_vol_surface

Classes

SwaptionVolSurface

SwaptionVolSurface(anchor_dt: financepy.utils.date.Date, expiry_dts: List[financepy.utils.date.Date], fwd_swap_rates: numpy.ndarray, strike_grid: numpy.ndarray, vol_grid: numpy.ndarray, vol_func_type: financepy.utils.global_types.VolFuncTypes = <VolFuncTypes.SABR: 1>, fin_solver_type: financepy.utils.global_types.SolverTypes = <SolverTypes.NELDER_MEAD: 1>) -> None
Class to perform a calibration of a chosen parametrised surface to the prices of swaptions at different expiry dates and swap tenors. There is a choice of volatility function from cubic in delta to full SABR and SSVI. Check out VolFuncTypes. Visualising the volatility curve is useful. Also, there is no guarantee that the implied pdf will be positive.

Methods

vol_from_strike_dt

vol_from_strike_dt(self, k: float, expiry_dt: financepy.utils.date.Date) -> float
Interpolates the Black-Scholes volatility from the volatility surface given call option strike and expiry date. Linear interpolation is done in variance space. The smile strikes at bracketed dates are determined by determining the strike that reproduces the provided delta value. This uses the calibration delta convention, but it can be overriden by a provided delta convention. The resulting volatilities are then determined for each bracketing expiry time and linear interpolation is done in variance space and then converted back to a lognormal volatility.

check_calibration

check_calibration(self, verbose: bool, tol: float = 1e-06) -> None
Compare calibrated vol surface with market and output a report which sets out the quality of fit to the ATM and 10 and 25 delta market strangles and risk reversals.

plot_vol_curves

plot_vol_curves(self) -> None
Generates a plot of each of the vol discount implied by the market and fitted.
Generated automatically from the FinancePy source code. Do not edit this file manually.