abaquant.derivatives.advanced¶
Import path: abaquant.derivatives.advanced
Domain: Derivative pricing, simulation, calibration, diagnostics, and strategy analysis.
Purpose¶
Convenience imports for advanced derivative models.
When to use it¶
Use this package when valuing contingent claims, calculating Greeks, building option strategies, simulating stochastic processes, or fitting models to market observations.
Public objects¶
This source file primarily re-exports symbols or defines package metadata. Detailed definitions are documented in the implementation-module pages listed below.
Detailed reference¶
Convenience imports for advanced derivative models.
This module groups stochastic-volatility, jump-process, Levy-process, and SABR
models under abaquant.derivatives.advanced while keeping the concrete model
implementations in abaquant.derivatives.models.
- abaquant.derivatives.advanced.BachelierModel
alias of
NormalBachelierModel
- class abaquant.derivatives.advanced.CoxRossRubinsteinModel(spot_price, strike_price, maturity_years, risk_free_rate, volatility, dividend_yield=0.0, number_of_steps=200, allow_early_exercise=False)
Bases:
OptionDiagnosticsMixinRecombining Cox–Ross–Rubinstein lattice model for vanilla 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.
volatility (float) – Annualized lognormal volatility in decimal units.
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
number_of_steps (int, default=200) – Number of recombining time steps in the lattice.
allow_early_exercise (bool, default=False) – Whether the lattice applies the American early-exercise condition.
Initialize a Cox–Ross–Rubinstein option-pricing lattice.
- 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.
volatility (float) – Annualized lognormal volatility in decimal units.
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
number_of_steps (int, default=200) – Number of recombining time steps in the lattice.
allow_early_exercise (bool, default=False) – Whether the lattice applies the American early-exercise condition.
- price(option_type='call')
Return the model price of a call or put option.
- Parameters:
option_type (str, default='call') – Option type label, normally
"call"or"put".- Returns:
Computed 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.
- 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.
- full_tree(option_type='call', max_display=7)
Return the displayed portion of the recombining binomial valuation tree.
- Parameters:
option_type (str, default='call') – Option type label, normally
"call"or"put".max_display (int, default=7) – Maximum number of tree levels retained for display.
- Returns:
(underlying_price_tree, option_value_tree). Each outer-list position represents a time step and each inner-list position represents the number of downward moves at that step.- Return type:
tuple[list[list[float]], list[list[float] | None]]
Notes
Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.
- delta(option_type='call')
Estimate option delta from the first binomial-tree step.
- Parameters:
option_type (str, default='call') – Option type label, normally
"call"or"put".- Returns:
Computed delta in the units implied by the documented inputs.
- Return type:
float
- 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
- abaquant.derivatives.advanced.HestonModel
alias of
HestonStochasticVolatilityModel
- class abaquant.derivatives.advanced.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
- class abaquant.derivatives.advanced.MertonJumpDiffusionModel(spot_price, strike_price, maturity_years, risk_free_rate, volatility, dividend_yield=0.0, jump_intensity=1.0, mean_log_jump_size=0.0, jump_log_volatility=0.2, poisson_series_terms=50)
Bases:
OptionDiagnosticsMixinMerton jump-diffusion model for European vanilla 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.
volatility (float) – Diffusion volatility in annualized decimal units.
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
jump_intensity (float, default=1.0) – Poisson jump arrival intensity in events per year.
mean_log_jump_size (float, default=0.0) – Mean jump size in log-price units.
jump_log_volatility (float, default=0.2) – Standard deviation of log jump sizes.
poisson_series_terms (int, default=50) – Number of terms retained in the Poisson-mixture approximation.
Initialize the Merton jump-diffusion 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.
volatility (float) – Diffusion volatility in annualized decimal units.
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
jump_intensity (float, default=1.0) – Poisson jump arrival intensity in events per year.
mean_log_jump_size (float, default=0.0) – Mean jump size in log-price units.
jump_log_volatility (float, default=0.2) – Standard deviation of log jump sizes.
poisson_series_terms (int, default=50) – Number of terms retained in the Poisson-mixture approximation.
- price(option_type='call')
Return the model price of a call or put option.
- Parameters:
option_type (str, default='call') – Option type label, normally
"call"or"put".- Returns:
Computed 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.
- 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
- abaquant.derivatives.advanced.MertonModel
alias of
MertonJumpDiffusionModel
- abaquant.derivatives.advanced.NIGModel
alias of
NormalInverseGaussianModel
- class abaquant.derivatives.advanced.NormalBachelierModel(spot_price, strike_price, maturity_years, risk_free_rate, normal_volatility, dividend_yield=0.0)
Bases:
OptionDiagnosticsMixinBachelier normal-volatility model for European vanilla options.
- Parameters:
spot_price (float or array-like) – Current underlying asset price in currency units.
strike_price (float or array-like) – Option exercise price in currency units.
maturity_years (float or array-like) – Time to expiration in years.
risk_free_rate (float or array-like) – Continuously compounded annual risk-free rate in decimal units.
normal_volatility (float or array-like) – Annualized normal volatility in price units per square-root year.
dividend_yield (float, default=0.0) – Continuously compounded annual dividend or carry yield in decimal units.
Initialize the Bachelier normal-volatility model state.
- Parameters:
spot_price (float or array-like) – Current underlying asset price in currency units.
strike_price (float or array-like) – Option exercise price in currency units.
maturity_years (float or array-like) – Time to expiration in years.
risk_free_rate (float or array-like) – Continuously compounded annual risk-free rate in decimal units.
normal_volatility (float or array-like) – Annualized normal volatility in price units per square-root year.
dividend_yield (float, default=0.0) – Continuously compounded annual dividend or carry yield in decimal units.
- 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.
- greeks()
Return the model sensitivities implemented by this model.
- Returns:
Result of the greeks 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.
- implied_normal_vol(market_price, option_type='call', tol=1e-8)
Return the Bachelier normal implied volatility associated with the model price.
- Parameters:
market_price (float or array-like) – Observed option premium in the same currency units as spot and strike.
option_type (str, default='call') – Option type label, normally
"call"or"put".tol (float, default=1e-08) – Numerical convergence tolerance.
- Returns:
Result of the implied normal 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.
- lognormal_vol()
Compute the result defined by
lognormal_volunder this module’s documented convention.- Returns:
Result of the lognormal 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.
- 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
- class abaquant.derivatives.advanced.NormalInverseGaussianModel(spot_price, strike_price, maturity_years, risk_free_rate, tail_steepness, asymmetry_parameter, scale_parameter, dividend_yield=0.0)
Bases:
OptionDiagnosticsMixinNormal-inverse-Gaussian process model for European option valuation.
- 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.
tail_steepness (float) – NIG tail-steepness parameter \(\alpha\).
asymmetry_parameter (float) – NIG skewness parameter \(\beta\).
scale_parameter (float) – NIG scale parameter \(\delta\).
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
Initialize the normal-inverse-Gaussian 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.
tail_steepness (float) – NIG tail-steepness parameter \(\alpha\).
asymmetry_parameter (float) – NIG skewness parameter \(\beta\).
scale_parameter (float) – NIG scale parameter \(\delta\).
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
- characteristic_function(u)
Evaluate the model characteristic function at the supplied Fourier argument.
- Parameters:
u (float or array-like) – Fourier argument at which the characteristic function is evaluated.
- Returns:
Result of the characteristic function workflow.
- Return type:
object
- 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.
- implied_vol(option_type='call')
Return the Black–Scholes–Merton implied volatility associated with the model price.
- Parameters:
option_type (str, default='call') – Option type label, normally
"call"or"put".- 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.
- vol_smile(strikes, option_type='call')
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.
option_type (str, default='call') – Option type label, normally
"call"or"put".
- 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
- abaquant.derivatives.advanced.SABRModel
alias of
SABRVolatilityModel
- class abaquant.derivatives.advanced.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
- abaquant.derivatives.advanced.VarianceGammaModel
alias of
VarianceGammaProcessModel
- class abaquant.derivatives.advanced.VarianceGammaProcessModel(spot_price, strike_price, maturity_years, risk_free_rate, volatility, drift_parameter, activity_rate, dividend_yield=0.0)
Bases:
OptionDiagnosticsMixinVariance-gamma process model for European option valuation.
- 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.
volatility (float) – Diffusion-scale parameter in the variance-gamma process.
drift_parameter (float) – Variance-gamma asymmetry or drift parameter \(\theta\).
activity_rate (float) – Variance-gamma activity parameter \(\nu\).
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
Initialize the variance-gamma process 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.
volatility (float) – Diffusion-scale parameter in the variance-gamma process.
drift_parameter (float) – Variance-gamma asymmetry or drift parameter \(\theta\).
activity_rate (float) – Variance-gamma activity parameter \(\nu\).
dividend_yield (float, default=0.0) – Continuous annual dividend or carry yield in decimal units.
- characteristic_function(u)
Evaluate the model characteristic function at the supplied Fourier argument.
- Parameters:
u (float or array-like) – Fourier argument at which the characteristic function is evaluated.
- Returns:
Result of the characteristic function workflow.
- Return type:
object
- 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.
- implied_vol(option_type='call')
Return the Black–Scholes–Merton implied volatility associated with the model price.
- Parameters:
option_type (str, default='call') – Option type label, normally
"call"or"put".- 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.
- vol_smile(strikes, option_type='call')
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.
option_type (str, default='call') – Option type label, normally
"call"or"put".
- 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