FinancePy

FinancePy API Reference

swaption vol surface

financepy.market.volatility.swaption_vol_surface

Class

SwaptionVolSurface

SwaptionVolSurface( anchor_dt: Date, expiry_dts: List[financepy.utils.date.Date], fwd_swap_rates: numpy.ndarray, strike_grid: numpy.ndarray, vol_grid: numpy.ndarray, vol_func_type: VolFuncTypes = <VolFuncTypes.SABR: 1>, fin_solver_type: 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: 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, ) -> float
Compare the calibrated vol surface with the market vol grid and return the largest absolute difference between fitted and market vols. If verbose, print a report with one line per expiry and strike, flagging with an asterisk any point whose error exceeds tol.

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.