discount.time {QuantBondCurves}R Documentation

Quantil's discount time convention

Description

Function to count the number of years between dates according to Quantil's discount convention. A year is defined as the difference in one year, between two dates with the exact month and day. Meanwhile, partial years are defined as the quotient between the number of elapsed days within a year and the total number of days that make up that year. Total number of years between the two dates is then the sum between complete full years and the partial portion.

Usage

discount.time(tinitial, tfinal)

Arguments

tinitial

Initial date of analysis.

tfinal

Final date of analysis.

Details

There is an exception. For example, for initial date 29-February, a year is defined as the 28 of February of the next year. Meanwhile four years, is defined as 29 of February four years after.

Value

Number of years between the specified dates.

Examples

discount.time(tinitial = "2024-07-13", tfinal = "2025-03-01")
discount.time(tinitial = "2024-02-29", tfinal = "2025-02-28")
discount.time(tinitial = "2024-02-29", tfinal = "2028-02-29")


[Package QuantBondCurves version 0.3.0 Index]