IBORStubFixing#

class rateslib.data.fixings.IBORStubFixing(*, rate_series, accrual_start, accrual_end, value=NoInput.blank, identifier=NoInput.blank, date=NoInput.blank)#

Bases: _BaseFixing

A rate fixing value referencing an interpolated tenor-IBOR type calculation.

Parameters:
  • rate_series (FloatRateSeries) – The parameters associated with the floating rate index.

  • accrual_start (datetime) – The start accrual date for the period.

  • accrual_end (datetime) – The end accrual date for the period..

  • date (datetime, optional) – The date of relevance for the fixing, which is its publication date. This can be determined by a lag parameter of the rate_series measured from the accrual_start.

  • value (float, Dual, Dual2, Variable, optional) – The initial value for the fixing to adopt. Most commonly this is not given and it is determined from a timeseries of published FX rates.

  • identifier (str, optional) – The string name of the timeseries to be loaded by the Fixings object. This is a series identifier, e.g. “Euribor”, which will be extended to derive the full version, e.g. “Euribor_3m” based on available and necessary tenors.

Notes

An interpolated tenor-IBOR type calculation depends upon two tenors being available from the Fixings object. Appropriate tenors will be automatically selected based on the accrual_end date. If only one tenor is available, this will be used as the single fixing1 value.

Examples

This fixing automatically identifies it must be interpolated between the available 3M and 6M tenors.

In [1]: fixings.add("EURIBOR_1M", Series(index=[dt(2000, 1, 3), dt(2000, 2, 4)], data=[1.651, 1.665]))

In [2]: fixings.add("EURIBOR_2M", Series(index=[dt(2000, 1, 3), dt(2000, 2, 4)], data=[2.651, 2.665]))

In [3]: fixings.add("EURIBOR_3M", Series(index=[dt(2000, 1, 3), dt(2000, 2, 4)], data=[3.651, 3.665]))

In [4]: fixings.add("EURIBOR_6M", Series(index=[dt(2000, 1, 3), dt(2000, 2, 4)], data=[4.651, 4.665]))

In [5]: ibor_fix = IBORStubFixing(
   ...:     accrual_start=dt(2000, 1, 5),
   ...:     accrual_end=dt(2000, 5, 17),
   ...:     identifier="Euribor",
   ...:     rate_series=FloatRateSeries(
   ...:         lag=2,
   ...:         modifier="MF",
   ...:         calendar="tgt",
   ...:         convention="act360",
   ...:         eom=False,
   ...:     )
   ...: )
   ...: 

In [6]: ibor_fix.date
Out[6]: datetime.datetime(2000, 1, 3, 0, 0)

In [7]: ibor_fix.value
Out[7]: np.float64(4.1125384615384615)

This fixing can only be determined from a single tenor, which is quite distinct from the stub tenor in this case.

In [8]: fixings.add("NIBOR_6M", Series(index=[dt(2000, 1, 3), dt(2000, 2, 4)], data=[4.651, 4.665]))

In [9]: ibor_fix = IBORStubFixing(
   ...:     accrual_start=dt(2000, 1, 5),
   ...:     accrual_end=dt(2000, 1, 17),
   ...:     identifier="Nibor",
   ...:     rate_series=FloatRateSeries(
   ...:         lag=2,
   ...:         modifier="MF",
   ...:         calendar="osl",
   ...:         convention="act360",
   ...:         eom=True,
   ...:     )
   ...: )
   ...: 

In [10]: ibor_fix.date
Out[10]: datetime.datetime(2000, 1, 3, 0, 0)

In [11]: ibor_fix.value
Out[11]: np.float64(4.651)

In [12]: ibor_fix.fixing2
Out[12]: <NoInput.blank: 0>

The following fixing cannot identify any tenor indices in the Fixings object, and will log a UserWarning before proceeding to yield NoInput for all values.

In [13]: ibor_fix = IBORStubFixing(
   ....:     accrual_start=dt(2000, 1, 5),
   ....:     accrual_end=dt(2000, 1, 17),
   ....:     identifier="Unavailable_Identifier",
   ....:     rate_series=FloatRateSeries(
   ....:         lag=2,
   ....:         modifier="MF",
   ....:         calendar="nyc",
   ....:         convention="act360",
   ....:         eom=True,
   ....:     )
   ....: )
   ....: 

In [14]: ibor_fix.date
Out[14]: datetime.datetime(2000, 1, 3, 0, 0)

In [15]: ibor_fix.value
Out[15]: <NoInput.blank: 0>

In [16]: ibor_fix.fixing1
Out[16]: <NoInput.blank: 0>

In [17]: ibor_fix.fixing2
Out[17]: <NoInput.blank: 0>

Attributes Summary

accrual_end

The end accrual date for the defined accrual period.

accrual_start

The start accrual date for the defined accrual period.

date

The date of relevance for the fixing, which is its publication date.

fixing1

The shorter tenor IBORFixing making up part of the calculation.

fixing2

The longer tenor IBORFixing making up part of the calculation.

identifier

The string name of the timeseries to be loaded by the Fixings object.

series

The FloatRateSeries for defining the fixing.

value

The fixing value.

weights

Scalar multiplier to apply to each tenor fixing for the interpolation.

Methods Summary

reset([state])

Sets the value attribute to NoInput, which allows it to be redetermined from a timeseries.

Attributes Documentation

accrual_end#

The end accrual date for the defined accrual period.

accrual_start#

The start accrual date for the defined accrual period.

date#

The date of relevance for the fixing, which is its publication date.

fixing1#

The shorter tenor IBORFixing making up part of the calculation.

fixing2#

The longer tenor IBORFixing making up part of the calculation.

identifier#

The string name of the timeseries to be loaded by the Fixings object.

series#

The FloatRateSeries for defining the fixing.

value#
weights#

Scalar multiplier to apply to each tenor fixing for the interpolation.

Methods Documentation

reset(state=NoInput.blank)#

Sets the value attribute to NoInput, which allows it to be redetermined from a timeseries.

Examples

In [1]: fx_fixing1 = FXFixing(publication=dt(2021, 1, 1), fx_index="eurusd", identifier="A")

In [2]: fx_fixing2 = FXFixing(publication=dt(2021, 1, 1), fx_index="gbpusd", identifier="B")

In [3]: fixings.add("A_eurusd", Series(index=[dt(2021, 1, 1)], data=[1.1]), state=100)

In [4]: fixings.add("B_gbpusd", Series(index=[dt(2021, 1, 1)], data=[1.4]), state=200)

# data is populated from the available Series
In [5]: fx_fixing1.value
Out[5]: np.float64(1.1)

In [6]: fx_fixing2.value
Out[6]: np.float64(1.4)

# fixings are reset according to the data state
In [7]: fx_fixing1.reset(state=100)

In [8]: fx_fixing2.reset(state=100)

# only the private data for fixing1 is removed because of its link to the data state
In [9]: fx_fixing1._value
Out[9]: <NoInput.blank: 0>

In [10]: fx_fixing2._value
Out[10]: np.float64(1.4)
Parameters:

state (int, optional) – If given only fixings whose state matches this value will be reset. If no state is given then the value will be reset.

Return type:

None