_WithAnalyticDelta#
- class rateslib.instruments.protocols._WithAnalyticDelta(*args, **kwargs)#
Bases:
_WithPricingObjs,ProtocolProtocol to determine the analytic rate delta of a particular Leg of an Instrument.
Attributes Summary
Methods Summary
analytic_delta(*[, curves, solver, fx, vol, ...])Calculate the analytic rate delta of a Leg of the Instrument.
Attributes Documentation
- kwargs#
Methods Documentation
- analytic_delta(*, curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, vol=NoInput.blank, base=NoInput.blank, local=False, settlement=NoInput.blank, forward=NoInput.blank, leg=1)#
Calculate the analytic rate delta of a Leg of the Instrument.
Examples
In [127]: curve = Curve({dt(2000, 1, 1): 1.0, dt(2010, 1, 1): 0.75}) In [128]: irs = IRS(dt(2000, 1, 1), "3Y", spec="usd_irs", fixed_rate=1.0, curves=[curve]) In [129]: irs.analytic_delta() Out[129]: 287.14750127899316 In [130]: irs.analytic_delta(local=True) Out[130]: {'usd': 287.14750127899316}
- Parameters:
curves (_Curves, optional) – Pricing objects. See Pricing on each Instrument for details of allowed inputs.
solver (Solver, optional) – A
Solverobject containing Curve, Smile, Surface, or Cube mappings for pricing.fx (FXForwards, optional) – The
FXForwardsobject used for forecasting FX rates, if necessary.vol (_Vol, optional) – Pricing objects. See Pricing on each Instrument for details of allowed inputs.
base (str, optional (set to settlement currency)) – The currency to convert the local settlement NPV to.
local (bool, optional (set as False)) – An override flag to return a dict of NPV values indexed by string currency.
settlement (datetime, optional) – The assumed settlement date of the PV determination. Used only to evaluate ex-dividend status.
forward (datetime, optional) – The future date to project the PV to using the
disc_curve.leg (int, optional (set as 1)) – The Leg over which to calculate the analytic rate delta.
- Return type:
float, Dual, Dual2, Variable or dict of such indexed by string currency.