Sensitivities#
- class rateslib.instruments.Sensitivities#
Bases:
object
Base class to add risk sensitivity calculations to an object with an
npv()
method.Methods Summary
cashflows_table
([curves, solver, fx, base])delta
([curves, solver, fx, base, local])Calculate delta risk of an Instrument against the calibrating instruments in a
Solver
.gamma
([curves, solver, fx, base, local])Calculate cross-gamma risk of an Instrument against the calibrating instruments of a
Solver
.Methods Documentation
- cashflows_table(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
- delta(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, **kwargs)#
Calculate delta risk of an Instrument against the calibrating instruments in a
Solver
.- Parameters:
curves (Curve, str or list of such, optional) –
A single
Curve
or id or a list of such. A list defines the following curves in the order:solver (Solver, optional) – The
Solver
that calibrates Curves from given Instruments.fx (float, FXRates, FXForwards, optional) – The immediate settlement FX rate that will be used to convert values into another currency. A given float is used directly. If giving a
FXRates
orFXForwards
object, converts from local currency intobase
.base (str, optional) – The base currency to convert cashflows into (3-digit code), set by default. Only used if
fx_rate
is anFXRates
orFXForwards
object.local (bool, optional) – If True will ignore
base
- this is equivalent to settingbase
to None. Included only for argument signature consistent with npv.
- Return type:
DataFrame
- gamma(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, **kwargs)#
Calculate cross-gamma risk of an Instrument against the calibrating instruments of a
Solver
.- Parameters:
curves (Curve, str or list of such, optional) –
A single
Curve
or id or a list of such. A list defines the following curves in the order:solver (Solver, optional) – The
Solver
that calibrates Curves from given Instruments.fx (float, FXRates, FXForwards, optional) – The immediate settlement FX rate that will be used to convert values into another currency. A given float is used directly. If giving a
FXRates
orFXForwards
object, converts from local currency intobase
.base (str, optional) – The base currency to convert cashflows into (3-digit code), set by default. Only used if
fx_rate
is anFXRates
orFXForwards
object.local (bool, optional) – If True will ignore
base
. This is equivalent to settingbase
to None. Included only for argument signature consistent with npv.
- Return type:
DataFrame