Last updated: 2023-03-16.
tf_quant_finance.datetime.PeriodicSchedule#
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. Ifbackward=Truemust be broadcastable toend_date, otherwise has arbitrary shape.end_date:DateTensor. Defines the upper boundary of the schedule. Ifbackward=Falsemust be broadcastable tostart_date, otherwise has arbitrary shape.tenor:PeriodTensor. Defines the frequency of the schedule. Must be broadcastable tostart_dateifbackward=False, and toend_dateifbackward=True.holiday_calendar:dates.HolidayCalendar. IfNone, 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 ifholiday_calendar = None. Default value: BusinessDayConvention.NONE (i.e. no rolling).backward: Pythonbool. Whether to build the schedule from thestart_datemoving forwards or from theend_dateand moving backwards.end_of_month: Pythonbool. IfTrue, shifts all dates in schedule to the ends of corresponding months, ifstart_dateorend_date( depending onbackward) is at the end of a month. The shift is applied before applyingroll_convention. In the batched case, only those schedules in a batch, whose correspondingstart_date(orend_date) are at ends of months, will be shifted.
Attributes:#
end_dateend_of_monthgenerate_backwards: Returns whether the schedule is generated from the end date.holiday_calendarroll_conventionstart_datetenor
Methods#
dates
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.