tf_quant_finance.datetime.daycount_actual_365_actual

Contents

Last updated: 2023-03-16.

tf_quant_finance.datetime.daycount_actual_365_actual#

View source

Computes the year fraction between the specified dates.

tf_quant_finance.datetime.daycount_actual_365_actual(
    *, start_date, end_date, schedule_info=None, dtype=None, name=None
)

The actual/365 actual convention specifies the year fraction between the start and end date as the actual number of days between the two dates divided 365 if no leap day is contained in the date range and 366 otherwise.

When determining whether a leap day is contained in the date range, start_date is excluded and end_date is included.

Note that the schedule info is not needed for this convention and is ignored if supplied.

Args:#

  • start_date: A DateTensor object of any shape.

  • end_date: A DateTensor object of compatible shape with start_date.

  • schedule_info: The schedule info. Ignored for this convention.

  • dtype: The dtype of the result. Either tf.float32 or tf.float64. If not supplied, tf.float32 is returned.

  • name: Python str name prefixed to ops created by this function. If not supplied, actual_365_actual is used.

Returns:#

A real Tensor of supplied dtype and shape of start_date. The year fraction between the start and end date as computed by Actual/365 Actual convention.