R/date-counters.R
actual_actual_isda.Rd
This calculates the years between two dates using the Actual/Actual ISDA day basis convention. This convention counts the number of calendars between the start and end dates. The definition of a year is contingent on whether the year is a leap year or not. The year fraction is calculated as: d1dy1+d2dy2+y2−y1−1
actual_actual_isda(date1, date2)
date1 | A date-time object |
---|---|
date2 | A date-time object |
a numeric value representing the number of years between
date1
and date2
.
where:
d1 is the remaining days in the first date's year including both the start and end date
d2 is the number of days to the second date from the start of that year
dy1 is 366 if the first date is in a leap year. Otherwise it is 365
dy2 is 366 if the second date is in a leap year. Otherwise it is 365
The order of date1
and date2
is not important. If date1
is less than date2
then the result will be non-negative. Otherwise,
the result will be negative.
Other counter methods: actual_360
,
actual_365
,
is_valid_day_basis
,
thirty_360_eu_isda
,
thirty_360_eu_plus
,
thirty_360_eu
, thirty_360_us
,
thirty_360
, year_frac