_infer_stub_date#

rateslib.scheduling._infer_stub_date(effective, termination, frequency, stub, front_stub, back_stub, modifier, eom, roll, calendar)#

Attempts to infer either a front or back stub in an unspecified schedule.

Parameters:
  • effective (datetime) – The adjusted or unadjusted effective date.

  • termination (datetime) – The adjusted or unadjusted termination date.

  • frequency (str in {}, optional) – The frequency of the schedule.

  • stub (str combining {"SHORT", "LONG"} with {"FRONT", "BACK"}) – The stub type to enact on the swap. Can provide two types, for example “SHORTFRONTLONGBACK”.

  • front_stub (datetime, optional) – An adjusted or unadjusted date for the first stub period.

  • back_stub (datetime, optional) – An adjusted or unadjusted date for the back stub period. See notes for combining stub, front_stub and back_stub and any automatic stub inference.

  • modifier (str) – The date modification rule in {‘NONE’, ‘F’, ‘MF’, ‘P’, ‘MP’}.

  • eom (bool) – Use an end of month preference for rolls instead of 28, 29, or 30.

  • roll (str, int, optional, set by Default) – The roll day for the schedule in [0, 31] or {“eom”, “som”, “imm”}.

  • calendar (Calendar, optional, set by Default) – The holiday calendar used for adjusting dates.

Returns:

tuple

Return type:

bool, and either kwargs or error message.

Notes

Only the following inferences are possible:

  • front_stub: when stub is front sided only and back_stub is NoInput.

  • front_stub: when stub is dual sided and back_stub is specified.

  • back_stub: when stub is back sided only and front_stub is NoInput.

  • back_stub: when stub is dual sided and front_stub is specified.