_BaseSmile#

class rateslib.fx_volatility._BaseSmile#

Bases: _WithState, _WithCache[float, float | Dual | Dual2 | Variable]

Attributes Summary

ad

Int in {0,1,2} describing the AD order associated with the Smile.

Methods Summary

plot([comparators, labels, x_axis, f])

Plot volatilities associated with the Smile.

Attributes Documentation

ad#

Int in {0,1,2} describing the AD order associated with the Smile.

Methods Documentation

plot(comparators=NoInput.blank, labels=NoInput.blank, x_axis=NoInput.blank, f=NoInput.blank)#

Plot volatilities associated with the Smile.

Warning

The ‘delta’ x_axis type for a SabrSmile is calculated based on a forward, unadjusted delta and is expressed as a negated put option delta consistent with the definition for a FXDeltaVolSmile.

Parameters:
  • comparators (list[Smile]) – A list of Smiles which to include on the same plot as comparators. Note the comments on FXDeltaVolSmile.plot.

  • labels (list[str]) – A list of strings associated with the plot and comparators. Must be same length as number of plots.

  • x_axis (str in {"strike", "moneyness", "delta"}) – ‘strike’ is the natural option for this SabrSmile types while ‘delta’ is the natural choice for DeltaVolSmile types. If ‘delta’ see the warning. If ‘moneyness’ the strikes are converted using f.

  • f (DualTypes) – The FX forward rate at delivery.

Returns:

(fig, ax, line)

Return type:

Matplotlib.Figure, Matplotplib.Axes, Matplotlib.Lines2D