abaquant.derivatives.models.sabr¶
Import path: abaquant.derivatives.models.sabr
Domain: Derivative pricing, simulation, calibration, diagnostics, and strategy analysis.
Purpose¶
SABR implied-volatility approximation and option pricing.
When to use it¶
This module implements or supports one derivative model. Read the parameter constraints, pricing measure, numerical method, and limiting cases before comparing outputs across models.
Public objects¶
class:
SABRVolatilityModel— SABR implied-volatility model using the Hagan approximation. *SABRVolatilityModel.implied_vol— Return the Black–Scholes–Merton implied volatility associated with the model price. *SABRVolatilityModel.call_price— Return the model price of a European call option. *SABRVolatilityModel.put_price— Return the model price of a European put option. *SABRVolatilityModel.vol_smile— Evaluate the model-implied volatility across the supplied strike grid. *SABRVolatilityModel.visualize— Return a backend-native visualization of this option-pricing model.
Detailed reference¶
SABR implied-volatility approximation and option pricing.
Purpose¶
The module evaluates the Hagan SABR implied-volatility approximation and converts it to approximate Black prices.
Conventions¶
F and K are forward and strike; alpha, beta, rho, and nu are SABR parameters; maturity is in years.
References
[ 1 ] Hagan, P. S., D. Kumar, A. S. Lesniewski, and D. E. Woodward (2002), “Managing Smile Risk”.
- class abaquant.derivatives.models.sabr.SABRVolatilityModel(forward_price, strike_price, maturity_years, initial_volatility, elasticity_parameter, spot_forward_correlation, volatility_of_volatility, risk_free_rate=0.0, dividend_yield=0.0, spot_price=None)¶
Bases:
OptionDiagnosticsMixinSABR implied-volatility model using the Hagan approximation.
- Parameters:
forward_price (float) – Forward price associated with the option maturity.
strike_price (float) – Option exercise price in the same units as
forward_price.maturity_years (float) – Time to expiration in years.
initial_volatility (float) – SABR level parameter \(\alpha\).
elasticity_parameter (float) – SABR elasticity parameter \(\beta\).
spot_forward_correlation (float) – Correlation parameter \(\rho\) between forward and volatility shocks.
volatility_of_volatility (float) – SABR volatility-of-volatility parameter \(\nu\).
risk_free_rate (float, default=0.0) – Continuously compounded annual risk-free rate in decimal units.
dividend_yield (float, default=0.0) – Continuously compounded annual dividend or carry yield in decimal units.
spot_price (float or None, default=None) – Optional spot price used for Black–Scholes price conversion. When omitted, the forward price is used as the spot proxy.
Initialize the SABR model and its Black–Scholes conversion inputs.
- Parameters:
forward_price (float) – Forward price associated with the option maturity.
strike_price (float) – Option exercise price in the same units as
forward_price.maturity_years (float) – Time to expiration in years.
initial_volatility (float) – SABR level parameter \(\alpha\).
elasticity_parameter (float) – SABR elasticity parameter \(\beta\).
spot_forward_correlation (float) – Correlation parameter \(\rho\) between forward and volatility shocks.
volatility_of_volatility (float) – SABR volatility-of-volatility parameter \(\nu\).
risk_free_rate (float, default=0.0) – Continuously compounded annual risk-free rate in decimal units.
dividend_yield (float, default=0.0) – Continuously compounded annual dividend or carry yield in decimal units.
spot_price (float or None, default=None) – Optional spot price used for Black–Scholes price conversion.
- implied_vol()¶
Return the Black–Scholes–Merton implied volatility associated with the model price.
- Returns:
Result of the implied vol workflow.
- Return type:
object
Notes
Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.
- call_price()¶
Return the model price of a European call option.
- Returns:
Computed call price in the units implied by the documented inputs.
- Return type:
float
Notes
Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.
- put_price()¶
Return the model price of a European put option.
- Returns:
Computed put price in the units implied by the documented inputs.
- Return type:
float
Notes
Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.
- vol_smile(strikes)¶
Evaluate the model-implied volatility across the supplied strike grid.
- Parameters:
strikes (float or array-like) – Strike-price grid in the same currency units as the underlying or forward.
- Returns:
Numeric array ordered consistently with the supplied strikes, time grid, assets, or state labels.
- Return type:
numpy.ndarray
Notes
Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.
- visualize(*, option_type='call', chart='payoff', backend=None, theme=None, save_path=None, filename=None, lower_spot_multiple=0.5, upper_spot_multiple=1.5, grid_size=101, lower_volatility_multiple=0.5, upper_volatility_multiple=1.5, volatility_grid_size=31, greek_scale='raw')¶
Return a backend-native visualization of this option-pricing model.
- Parameters:
option_type ({"call", "put"}, default="call") – Vanilla option type used for payoff, price-profile, smile, or tree plots.
chart (str, default="payoff") – Visual diagnostic to create. Supported charts include payoff, price profile, extrinsic value, Greek curves, selected surfaces, volatility smile, and lattice tree when the model exposes a tree.
backend ({"matplotlib", "plotly"}, default="matplotlib") – Optional plotting backend. The returned figure is not shown automatically.
lower_spot_multiple (float, default=0.5, 1.5) – Price-grid bounds as multiples of the strike price.
upper_spot_multiple (float, default=0.5, 1.5) – Price-grid bounds as multiples of the strike price.
grid_size (int, default=101) – Number of spot-grid points for non-tree plots.
lower_volatility_multiple (float, default=0.5, 1.5) – Volatility-grid bounds expressed as multiples of the model’s base volatility.
upper_volatility_multiple (float, default=0.5, 1.5) – Volatility-grid bounds expressed as multiples of the model’s base volatility.
volatility_grid_size (int, default=31) – Number of volatility-grid points for surface plots.
greek_scale ({"raw", "standardized"}, default="raw") – Scaling mode for the multi-Greek curve chart.
- Returns:
Figure object created without mutating model state.
- Return type:
matplotlib.figure.Figure or plotly.graph_objects.Figure