ZeroFloatPeriod#
- class rateslib.periods.ZeroFloatPeriod(*, float_spread=NoInput.blank, rate_fixings=NoInput.blank, fixing_method=NoInput.blank, method_param=NoInput.blank, spread_compound_method=NoInput.blank, fixing_frequency=NoInput.blank, fixing_series=NoInput.blank, schedule, notional=NoInput.blank, currency=NoInput.blank, convention=NoInput.blank, pair=NoInput.blank, fx_fixings=NoInput.blank, delivery=NoInput.blank, index_base=NoInput.blank, index_lag=NoInput.blank, index_method=NoInput.blank, index_fixings=NoInput.blank, index_only=NoInput.blank)#
Bases:
_BasePeriodStaticA Period defined by compounded floating rate Periods.
The expected unindexed reference cashflow under the risk neutral distribution is defined as,
\[\mathbb{E^Q}[\bar{C}_t] = - N \left ( \prod_{i=1}^n \left ( 1 + r_i(\mathbf{C}, R_j, z) d_i \right ) - 1 \right )\]For analytic delta purposes the \(\xi=-z\).
Examples
In [1]: fixings.add("MY_RATE_INDEX_6M", Series( ...: index=[dt(2000, 1, 1), dt(2000, 7, 1), dt(2001, 1, 1), dt(2001, 7, 1)], ...: data=[1.0, 2.0, 3.0, 4.0] ...: )) ...: In [2]: period = ZeroFloatPeriod( ...: schedule=Schedule(dt(2000, 1, 1), "2Y", "S"), ...: fixing_method="IBOR", ...: rate_fixings="MY_RATE_INDEX", ...: convention="Act360", ...: method_param=0, ...: ) ...: In [3]: period.cashflows() Out[3]: {'Type': 'ZeroFloatPeriod', 'Ccy': 'USD', 'Payment': datetime.datetime(2002, 1, 3, 0, 0), 'Notional': 1000000.0, 'Period': 'Stub', 'Convention': 'Act360', 'DCF': 2.0305555555555554, 'Acc Start': datetime.datetime(2000, 1, 1, 0, 0), 'Acc End': datetime.datetime(2002, 1, 1, 0, 0), 'DF': None, 'Cashflow': -51714.953622833185, 'NPV': None, 'FX Rate': 1.0, 'Base Ccy': 'USD', 'NPV Ccy': None, 'Collateral': None, 'Rate': 2.498648062230746, 'Spread': 0.0}
For more details of the individual compounded periods one can compose a
CustomLegand view the pseudo-cashflows.In [4]: CustomLeg(period.float_periods).cashflows() Out[4]: Type Ccy Payment Notional Period Convention DCF Acc Start Acc End DF Cashflow NPV FX Rate Base Ccy NPV Ccy Collateral Rate Spread 0 FloatPeriod USD 2000-07-03 1000000.0 Regular Act360 0.505556 2000-01-01 2000-07-01 None -5055.555556 None 1.0 USD None None 1.0 0.0 1 FloatPeriod USD 2001-01-03 1000000.0 Regular Act360 0.511111 2000-07-01 2001-01-01 None -10222.222222 None 1.0 USD None None 2.0 0.0 2 FloatPeriod USD 2001-07-03 1000000.0 Regular Act360 0.502778 2001-01-01 2001-07-01 None -15083.333333 None 1.0 USD None None 3.0 0.0 3 FloatPeriod USD 2002-01-03 1000000.0 Regular Act360 0.511111 2001-07-01 2002-01-01 None -20444.444444 None 1.0 USD None None 4.0 0.0
- Parameters:
. –
Note
The following define generalised settlement parameters.
currency (str, optional (set by ‘defaults’)) – The physical settlement currency of the Period.
notional (float, Dual, Dual2, Variable, optional (set by ‘defaults’)) –
The notional amount of the Period expressed in
notional currency.Note
The following parameters are scheduling period parameters
schedule (Schedule, required) –
The
Scheduledefining the individual Periods, including the payment and ex-dividend dates.Note
The following define floating rate parameters.
fixing_method (FloatFixingMethod, str, optional (set by ‘defaults’)) – The
FloatFixingMethoddescribing the determination of the floating rate for the period.method_param (int, optional (set by ‘defaults’)) – A specific parameter that is used by the specific
fixing_method.fixing_frequency (Frequency, str, optional (set by ‘frequency’ or ‘1B’)) – The
Frequencyas a component of theFloatRateIndex. If not given is assumed to match the frequency of the period for an IBOR typefixing_methodor ‘1B’ if RFR type.fixing_series (FloatRateSeries, str, optional (implied by other parameters)) – The
FloatRateSeriesas a component of theFloatRateIndex. If not given inherits attributes given such as thecalendar,convention,method_parametc.float_spread (float, Dual, Dual2, Variable, optional (set as 0.0)) – The amount (in bps) added to the rate in the period rate determination. If not given is set to zero.
spread_compound_method (SpreadCompoundMethod, str, optional (set by ‘defaults’)) – The
SpreadCompoundMethodused in the calculation of the period rate when combining afloat_spread. Used only with RFR typefixing_method.rate_fixings (float, Dual, Dual2, Variable, Series, str, optional) –
The value of the rate fixing. If a scalar, is used directly. If a string identifier, links to the central
fixingsobject and data loader.Note
The following parameters define non-deliverability. If the Period is directly deliverable do not supply these parameters.
pair (str, optional) – The currency pair of the
FXFixingthat determines settlement. The reference currency is implied frompair. Must includecurrency.fx_fixings (float, Dual, Dual2, Variable, Series, str, optional) – The value of the
FXFixing. If a scalar is used directly. If a string identifier will link to the centralfixingsobject and data loader.delivery (datetime, optional (set as ‘payment’)) –
The settlement delivery date of the
FXFixing.Note
The following parameters define indexation. The Period will be considered indexed if any of
index_method,index_lag,index_base,index_fixingsare given.index_method (IndexMethod, str, optional (set by ‘defaults’)) – The interpolation method, or otherwise, to determine index values from reference dates.
index_lag (int, optional (set by ‘defaults’)) – The indexation lag, in months, applied to the determination of index values.
index_base (float, Dual, Dual2, Variable, optional) – The specific value set of the base index value. If not given and
index_fixingsis a str fixings identifier that will be used to determine the base index value.index_fixings (float, Dual, Dual2, Variable, Series, str, optional) – The index value for the reference date. If a scalar value this is used directly. If a string identifier will link to the central
fixingsobject and data loader.index_only (bool, optional (set as False)) – A flag which determines non-payment of notional on supported Periods.
Attributes Summary
An overload for the calculation of the DCF, replacing period_params.dcf.
The individual
FloatPeriodthat are compounded.The float spread parameter of each
FloatPeriod.The
_IndexParamsof the Period, if any.Check whether the Period has indexation applied, which means it has
index_params.Check whether the Period is non-deliverable, which means it has
non_deliverable_params.The
_NonDeliverableParamsof the Period., if any.The
_PeriodParamsof the Period.The
_FixedRateParamsof the Period.The
Scheduleobject for this Period.The
_SettlementParamsof the Period.Methods Summary
analytic_delta(*[, rate_curve, index_curve, ...])Calculate the analytic rate delta of the Period converted to any other base accounting currency.
cashflow(*[, rate_curve, disc_curve, ...])Calculate the cashflow for the Period with settlement currency adjustment and indexation.
cashflows(*[, rate_curve, disc_curve, ...])Return aggregated cashflow data for the Period.
convert_deliverable(value, fx)Apply settlement currency conversion to a Static Period using its
non_deliverable_params.immediate_local_npv(*[, rate_curve, ...])Calculate the NPV of the Period in local settlement currency.
index_up(value, index_curve)Apply indexation to a Static Period value using its
index_params.local_analytic_rate_fixings(*[, rate_curve, ...])Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in local settlement currency of the Period.
local_fixings(identifiers[, scalars, ...])Calculate the sensitivity to fixings of the Instrument, expressed in local settlement currency.
local_npv(*[, rate_curve, index_curve, ...])Calculate the NPV of the Period in local settlement currency.
npv(*[, rate_curve, index_curve, ...])Calculate the NPV of the Period converted to any other base accounting currency.
rate(*[, rate_curve])Calculate a single rate representation for the Period's cashflow.
reference_cashflow(*[, rate_curve, ...])Calculate the cashflow for the Static Period before settlement currency adjustment but after indexation.
reset_fixings([state])Resets any fixings values of the Period derived using the given data state.
try_cashflow(*[, rate_curve, disc_curve, ...])Replicate
cashflow()with lazy exception handling.try_cashflow_analytic_delta(*[, rate_curve, ...])Calculate the cashflow for the Period with settlement currency adjustment and indexation.
try_cashflow_analytic_rate_fixings(*[, ...])Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in settlement currency of the Period, adjusted for indexation but unadjusted by timing of the cashflow.
try_convert_deliverable(value, fx)Replicate
convert_deliverable()with lazy exception handling.Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in local settlement currency of the Period with immediate value, with lazy error raising.
try_immediate_local_analytic_delta(*[, ...])Calculate the immediate, analytic rate delta of a Period expressed in local settlement currency, with lazy error raising.
try_immediate_local_npv(*[, rate_curve, ...])Replicate
immediate_local_npv()with lazy exception handling.try_index_up(value, index_curve)Replicate
index_up()with lazy exception handling.try_local_analytic_delta(*[, rate_curve, ...])Calculate the analytic rate delta of a Period expressed in local settlement currency, with lazy error raising.
try_local_npv(*[, rate_curve, index_curve, ...])Replicate
local_npv()with lazy exception handling.try_rate(*[, rate_curve])try_reference_cashflow(*[, rate_curve, ...])Replicate
reference_cashflow()with lazy exception handling.try_reference_cashflow_analytic_delta(*[, ...])Calculate the cashflow analytic delta for the Static Period before settlement currency adjustment but after indexation, with lazy error raising.
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in reference currency of the Period,adjusted for indexation but unadjusted by timing of the cashflow.
try_unindexed_cashflow(*[, rate_curve, ...])Replicate
unindexed_cashflow()with lazy exception handling.try_unindexed_cashflow_analytic_delta(*[, ...])Calculate the cashflow analytic delta for the Static Period with settlement currency adjustment but without indexation, with lazy error raising.
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in settlement currency of the Period, unadjusted by timing of the cashflow and indexation.
try_unindexed_reference_cashflow(*[, ...])Replicate
unindexed_reference_cashflow()with lazy exception handling.Calculate the cashflow analytic delta for the Static Period before settlement currency adjustment and indexation, with lazy error raising.
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in reference currency of the Period, unadjusted by timing of the cashflow and by indexation.
unindexed_cashflow(*[, rate_curve, ...])Calculate the cashflow for the Static Period with settlement currency adjustment but without indexation.
unindexed_reference_cashflow(*[, rate_curve])Calculate the cashflow for the Static Period before settlement currency and indexation adjustments.
Attributes Documentation
- dcf#
An overload for the calculation of the DCF, replacing period_params.dcf.
- float_periods#
The individual
FloatPeriodthat are compounded.
- float_spread#
The float spread parameter of each
FloatPeriod.
- index_params#
The
_IndexParamsof the Period, if any.
- is_indexed#
Check whether the Period has indexation applied, which means it has
index_params.
- is_non_deliverable#
Check whether the Period is non-deliverable, which means it has
non_deliverable_params.
- non_deliverable_params#
The
_NonDeliverableParamsof the Period., if any.
- period_params#
The
_PeriodParamsof the Period.
- rate_params#
The
_FixedRateParamsof the Period.
- settlement_params#
The
_SettlementParamsof the Period.
Methods Documentation
- analytic_delta(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, base=NoInput.blank, local=False, settlement=NoInput.blank, forward=NoInput.blank)#
Calculate the analytic rate delta of the Period converted to any other base accounting currency.
This method converts a local settlement currency value to a base accounting currency according to:
\[A^{bas}(m_s, m_f) = f_{loc:bas}(m_f) A(m_s, m_f)\]Hint
If the cashflows are unspecified or incalculable due to missing information this method will raise an exception. For a function that returns a Result indicating success or failure use
try_local_analytic_delta().- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
base (str, optional) – The currency to convert the local settlement NPV to.
local (bool, optional) – An override flag to return a dict of values indexed by string currency.
settlement (datetime, optional, (set as immediate date)) – The assumed settlement date of the PV determination. Used only to evaluate ex-dividend status.
forward (datetime, optional, (set as
settlement)) – The future date to project the PV to using thedisc_curve.
- Return type:
- cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Calculate the cashflow for the Period with settlement currency adjustment and indexation.
\[I_r f(m_d)\mathbb{E^Q}[\bar{C}_t]\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows, if necessary.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
- cashflows(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, base=NoInput.blank, settlement=NoInput.blank, forward=NoInput.blank)#
Return aggregated cashflow data for the Period.
Warning
This method is a convenience method to provide a visual representation of all associated calculation data. Calling this method to extracting certain values should be avoided. It is more efficient to source relevant parameters or calculations from object attributes or other methods directly.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
base (str, optional) – The currency to convert the local settlement NPV to.
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.
- Return type:
dict of values
- convert_deliverable(value, fx)#
Apply settlement currency conversion to a Static Period using its
non_deliverable_params.
- immediate_local_npv(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Calculate the NPV of the Period in local settlement currency.
This method does not adjust for ex-dividend and is an immediate measure according to,
\[P_0 = v(m_t) I_r f(m_d) \mathbb{E^Q} [\bar{C}_t]\]for non-deliverable delivery, \(m_d\), and index ratio, \(I_r\).
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, an class:~rateslib.fx.FXRates object purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
- index_up(value, index_curve)#
Apply indexation to a Static Period value using its
index_params.
- local_analytic_rate_fixings(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, settlement=NoInput.blank, forward=NoInput.blank)#
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in local settlement currency of the Period.
If the Period has no sensitivity to rates fixings this DataFrame is empty.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
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.
- Return type:
DataFrame
- local_fixings(identifiers, scalars=NoInput.blank, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, settlement=NoInput.blank, forward=NoInput.blank)#
Calculate the sensitivity to fixings of the Instrument, expressed in local settlement currency.
- Parameters:
indentifiers (Sequence of tuple[str, Series], required) – These are the series string identifiers and the data values that will be used in each Series to determine the sensitivity against.
scalars (Sequence of floats, optional (each set as 1.0)) – A sequence of scalars to multiply the sensitivities by for each on of the
identifiers.rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, an class:~rateslib.fx.FXRates object purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
settlement (datetime, optional (set as immediate date)) – The assumed settlement date of the PV determination. Used only to evaluate ex-dividend status.
forward (datetime, optional (set as
settlement)) – The future date to project the PV to using thedisc_curve.
- Return type:
DataFrame
- local_npv(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, settlement=NoInput.blank, forward=NoInput.blank)#
Calculate the NPV of the Period in local settlement currency.
This method adjusts the immediate NPV for ex-dividend, settlement and forward projected value, according to,
\[\begin{split}P(m_s, m_f) = \mathbb{I}(m_s) \frac{1}{v(m_f)} P_0, \qquad \; \mathbb{I}(m_s) = \left \{ \begin{matrix} 0 & m_s > m_{ex} \\ 1 & m_s \leq m_{ex} \end{matrix} \right .\end{split}\]for forward, \(m_f\), settlement, \(m_s\), and ex-dividend, \(m_{ex}\).
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, an class:~rateslib.fx.FXRates object purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
settlement (datetime, optional (set as immediate date)) – The assumed settlement date of the PV determination. Used only to evaluate ex-dividend status.
forward (datetime, optional (set as
settlement)) – The future date to project the PV to using thedisc_curve.
- Return type:
- npv(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, base=NoInput.blank, local=False, settlement=NoInput.blank, forward=NoInput.blank)#
Calculate the NPV of the Period converted to any other base accounting currency.
This method converts a local settlement currency value to a base accounting currency according to:
\[P^{bas}(m_s, m_f) = f_{loc:bas}(m_f) P(m_s, m_f)\]Hint
If the cashflows are unspecified or incalculable due to missing information this method will raise an exception. For a function that returns a Result indicating success or failure use
try_local_npv().- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
base (str, optional) – The currency to convert the local settlement NPV to.
local (bool, optional) – An override flag to return a dict of NPV values indexed by string currency.
settlement (datetime, optional, (set as immediate date)) – The assumed settlement date of the PV determination. Used only to evaluate ex-dividend status.
forward (datetime, optional, (set as
settlement)) – The future date to project the PV to using thedisc_curve.
- Return type:
float, Dual, Dual2, Variable or dict of such indexed by string currency.
Notes
If
baseis not provided then this function will return the value obtained fromlocal_npv().If
baseis provided this then anFXForwardsobject may be required to perform conversions. AnFXRatesobject is also allowed for this conversion although best practice does not recommend it due to possible settlement date conflicts.
- rate(*, rate_curve=NoInput.blank)#
Calculate a single rate representation for the Period’s cashflow.
The rate is determined from the compounded Period rates according to:
\[\left ( 1 + \frac{r}{f} \right )^{df} = \prod_{i=1}^n \left ( 1 + r_i(\mathbf{C}, R_j, z) d_i \right )\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
- Return type:
- reference_cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Calculate the cashflow for the Static Period before settlement currency adjustment but after indexation.
\[I_r\mathbb{E^Q}[\bar{C}_t]\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows, if necessary.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
- reset_fixings(state=NoInput.blank)#
Resets any fixings values of the Period derived using the given data state.
Examples
In [5]: fp = FloatPeriod( ...: start=dt(2026, 1, 12), ...: end=dt(2026, 1, 16), ...: payment=dt(2026, 1, 16), ...: frequency="M", ...: fixing_method="rfr_payment_delay", ...: method_param=0, ...: rate_fixings="sofr" ...: ) ...: In [6]: fixings.add( ...: name="sofr_1B", ...: series=Series( ...: index=[dt(2026, 1, 12), dt(2026, 1, 13), dt(2026, 1, 14), dt(2026, 1, 15)], ...: data=[3.1, 3.2, 3.3, 3.4] ...: ) ...: ) ...: # value is populated from given data In [7]: assert 3.245 < fp.rate_params.rate_fixing.value < 3.255 In [8]: fp.reset_fixings() # private data related to fixing is removed and requires new data lookup In [9]: fp.rate_params.rate_fixing._value Out[9]: <NoInput.blank: 0> In [10]: fp.rate_params.rate_fixing._populated Out[10]: Series([], dtype: float64)
- Parameters:
state (int, optional) – The state id of the data series that set the fixing. Only fixings determined by this data will be reset. If not given resets all fixings.
- try_cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Replicate
cashflow()with lazy exception handling.
- try_cashflow_analytic_delta(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Calculate the cashflow for the Period with settlement currency adjustment and indexation.
\[I_r f(m_d) \frac{\partial \mathbb{E^Q}[\bar{C}_t]}{\partial \xi}\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
- try_cashflow_analytic_rate_fixings(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in settlement currency of the Period, adjusted for indexation but unadjusted by timing of the cashflow.
If the Period has no sensitivity to rates fixings this DataFrame is empty.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
Result[DataFrame]
- try_convert_deliverable(value, fx)#
Replicate
convert_deliverable()with lazy exception handling.
- try_immediate_analytic_rate_fixings(rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in local settlement currency of the Period with immediate value, with lazy error raising.
If the Period has no sensitivity to rates fixings this DataFrame is empty.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
Result[DataFrame]
- try_immediate_local_analytic_delta(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Calculate the immediate, analytic rate delta of a Period expressed in local settlement currency, with lazy error raising.
This method does not adjust for ex-dividend and is an immediate measure according to,
\[A_0 = \frac{\partial P_0}{\partial \xi}, \quad \text{for some, } \xi\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, an class:~rateslib.fx.FXRates object purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
- try_immediate_local_npv(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Replicate
immediate_local_npv()with lazy exception handling.
- try_index_up(value, index_curve)#
Replicate
index_up()with lazy exception handling.
- try_local_analytic_delta(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, settlement=NoInput.blank, forward=NoInput.blank)#
Calculate the analytic rate delta of a Period expressed in local settlement currency, with lazy error raising.
This method adjusts the immediate NPV for ex-dividend and forward projected value, according to,
\[\begin{split}A(m_s, m_f) = \mathbb{I}(m_s) \frac{1}{v(m_f)} A_0, \qquad \; \mathbb{I}(m_s) = \left \{ \begin{matrix} 0 & m_s > m_{ex} \\ 1 & m_s \leq m_{ex} \end{matrix} \right .\end{split}\]for forward, \(m_f\), settlement, \(m_s\), and ex-dividend, \(m_{ex}\).
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, an class:~rateslib.fx.FXRates object purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
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.
- Return type:
- try_local_npv(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank, settlement=NoInput.blank, forward=NoInput.blank)#
Replicate
local_npv()with lazy exception handling.
- try_rate(*, rate_curve=NoInput.blank, **kwargs)#
- try_reference_cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Replicate
reference_cashflow()with lazy exception handling.
- try_reference_cashflow_analytic_delta(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank)#
Calculate the cashflow analytic delta for the Static Period before settlement currency adjustment but after indexation, with lazy error raising.
\[I_r \frac{\partial \mathbb{E^Q}[\bar{C}_t]}{\partial \xi}\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
- Return type:
- try_reference_cashflow_analytic_rate_fixings(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in reference currency of the Period,adjusted for indexation but unadjusted by timing of the cashflow.
If the Period has no sensitivity to rates fixings this DataFrame is empty.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
Result[DataFrame]
- try_unindexed_cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Replicate
unindexed_cashflow()with lazy exception handling.
- try_unindexed_cashflow_analytic_delta(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank)#
Calculate the cashflow analytic delta for the Static Period with settlement currency adjustment but without indexation, with lazy error raising.
\[f(m_d) \frac{\partial \mathbb{E^Q}[\bar{C}_t]}{\partial \xi}\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.
- Return type:
- try_unindexed_cashflow_analytic_rate_fixings(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in settlement currency of the Period, unadjusted by timing of the cashflow and indexation.
If the Period has no sensitivity to rates fixings this DataFrame is empty.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
Result[DataFrame]
- try_unindexed_reference_cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Replicate
unindexed_reference_cashflow()with lazy exception handling.
- try_unindexed_reference_cashflow_analytic_delta(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank)#
Calculate the cashflow analytic delta for the Static Period before settlement currency adjustment and indexation, with lazy error raising.
\[\frac{\partial \mathbb{E^Q}[\bar{C}_t]}{\partial \xi}\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
- Return type:
- try_unindexed_reference_cashflow_analytic_rate_fixings(*, rate_curve=NoInput.blank, index_curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Return a DataFrame of financial sensitivity to published interest rate fixings, expressed in reference currency of the Period, unadjusted by timing of the cashflow and by indexation.
If the Period has no sensitivity to rates fixings this DataFrame is empty.
- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
Result[DataFrame]
- unindexed_cashflow(*, rate_curve=NoInput.blank, disc_curve=NoInput.blank, index_curve=NoInput.blank, fx=NoInput.blank, fx_vol=NoInput.blank)#
Calculate the cashflow for the Static Period with settlement currency adjustment but without indexation.
\[f(m_d)\mathbb{E^Q}[\bar{C}_t]\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows, if necessary.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type:
- unindexed_reference_cashflow(*, rate_curve=NoInput.blank, **kwargs)#
Calculate the cashflow for the Static Period before settlement currency and indexation adjustments.
\[\mathbb{E^Q}[\bar{C}_t]\]- Parameters:
rate_curve (_BaseCurve or dict of such indexed by string tenor, optional) – Used to forecast floating period rates, if necessary.
index_curve (_BaseCurve, optional) – Used to forecast index values for indexation, if necessary.
disc_curve (_BaseCurve, optional) – Used to discount cashflows, if necessary.
fx (FXForwards, optional) – The
FXForwardsobject used for forecasting thefx_fixingfor deliverable cashflows, if necessary. Or, anFXRatesobject purely for immediate currency conversion.fx_vol (FXDeltaVolSmile, FXSabrSmile, FXDeltaVolSurface, FXSabrSurface, optional) – The FX volatility Smile or Surface object used for determining Black calendar day implied volatility values.
- Return type: