tf_quant_finance.datetime.PeriodicSchedule

Last updated: 2023-03-16.

tf_quant_finance.datetime.PeriodicSchedule#

View source

Defines an array of dates specified by a regular schedule.

tf_quant_finance.datetime.PeriodicSchedule(
    *, start_date, end_date, tenor, holiday_calendar=None,
    roll_convention=tf_quant_finance.datetime.BusinessDayConvention.NONE,
    backward=False, end_of_month=False
)

Args:#

  • start_date: DateTensor. Defines the lower boundary of schedule. If backward=True must be broadcastable to end_date, otherwise has arbitrary shape.

  • end_date: DateTensor. Defines the upper boundary of the schedule. If backward=False must be broadcastable to start_date, otherwise has arbitrary shape.

  • tenor: PeriodTensor. Defines the frequency of the schedule. Must be broadcastable to start_date if backward=False, and to end_date if backward=True.

  • holiday_calendar: dates.HolidayCalendar. If None, the dates in the schedule will not be rolled to business days.

  • roll_convention: BusinessDayConvention. Defines how dates in the schedule should be rolled to business days if they fall on holidays. Ignored if holiday_calendar = None. Default value: BusinessDayConvention.NONE (i.e. no rolling).

  • backward: Python bool. Whether to build the schedule from the start_date moving forwards or from the end_date and moving backwards.

  • end_of_month: Python bool. If True, shifts all dates in schedule to the ends of corresponding months, if start_date or end_date ( depending on backward) is at the end of a month. The shift is applied before applying roll_convention. In the batched case, only those schedules in a batch, whose corresponding start_date (or end_date) are at ends of months, will be shifted.

Attributes:#

  • end_date

  • end_of_month

  • generate_backwards: Returns whether the schedule is generated from the end date.

  • holiday_calendar

  • roll_convention

  • start_date

  • tenor

Methods#

dates

View source

dates()

Returns the dates as computed from the schedule as a DateTensor.

Constructs the date schedule from the supplied data. For more details see the initializer docstring.

Returns:#

DateTensor of rank one more than start_date or end_date (depending on backwards), representing schedules for each element of the input.