abaquant.derivatives.models.heston¶
Import path: abaquant.derivatives.models.heston
Domain: Derivative pricing, simulation, calibration, diagnostics, and strategy analysis.
Purpose¶
Heston stochastic-volatility option pricing model.
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:
HestonStochasticVolatilityModel— Heston stochastic-volatility model for European options. *HestonStochasticVolatilityModel.call_price— Return the model price of a European call option. *HestonStochasticVolatilityModel.put_price— Return the model price of a European put option. *HestonStochasticVolatilityModel.vol_smile— Evaluate the model-implied volatility across the supplied strike grid. *HestonStochasticVolatilityModel.visualize— Return a backend-native visualization of this option-pricing model.
Detailed reference¶
Heston stochastic-volatility option pricing model.
Purpose¶
The module prices European options by numerical integration of the Heston characteristic function and produces a strike smile.
Conventions¶
v0 and theta are variances, kappa is mean-reversion speed, xi is volatility of variance, and rho is the instantaneous correlation. Maturity is in years.
References
[ 1 ] Heston, S. L. (1993), “A Closed-Form Solution for Options with Stochastic Volatility”.
- class abaquant.derivatives.models.heston.HestonStochasticVolatilityModel(spot_price, strike_price, maturity_years, risk_free_rate, dividend_yield, initial_variance, variance_mean_reversion_speed, long_run_variance, volatility_of_variance, price_variance_correlation)¶
Bases:
OptionDiagnosticsMixinHeston stochastic-volatility model for European options.
- Parameters:
spot_price (float) – Current underlying asset price in currency units.
strike_price (float) – Option exercise price in currency units.
maturity_years (float) – Time to expiration in years.
risk_free_rate (float) – Continuously compounded annual risk-free rate in decimal units.
dividend_yield (float) – Continuously compounded annual dividend or carry yield in decimal units.
initial_variance (float) – Initial instantaneous variance \(v_0\).
variance_mean_reversion_speed (float) – Mean-reversion speed \(\kappa\) of instantaneous variance.
long_run_variance (float) – Long-run variance level \(\theta\).
volatility_of_variance (float) – Variance-process volatility \(\xi\).
price_variance_correlation (float) – Instantaneous correlation \(\rho\) between price and variance shocks.
Initialize the Heston stochastic-volatility model state.
- Parameters:
spot_price (float) – Current underlying asset price in currency units.
strike_price (float) – Option exercise price in currency units.
maturity_years (float) – Time to expiration in years.
risk_free_rate (float) – Continuously compounded annual risk-free rate in decimal units.
dividend_yield (float) – Continuously compounded annual dividend or carry yield in decimal units.
initial_variance (float) – Initial instantaneous variance \(v_0\).
variance_mean_reversion_speed (float) – Mean-reversion speed \(\kappa\) of instantaneous variance.
long_run_variance (float) – Long-run variance level \(\theta\).
volatility_of_variance (float) – Variance-process volatility \(\xi\).
price_variance_correlation (float) – Instantaneous correlation \(\rho\) between price and variance shocks.
- 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