public class DayCountConvention_ACT_ACT_YEARFRAC extends DayCountConvention_ACT implements SerializableImplementation of ACT/ACT as in Excel (2013). Calculates the day count by calculating the actual number of days between startDate and endDate. A fractional day is rounded to the approximately nearest day. The day count fraction is calculated using ACT_ACT_YEARFRAC convention, that is, it is calculates the daycount fraction corresponding to the Excel (2013) function YEARFRAC(startDate, endDate, 1). The day count fraction is calculated by dividing the actual number of days between start and end date by a denominator, where the denominator is determines as follows:
- If the interval from start to end spans more than one year fraction, denominator is the average number of days per year
- If the interval from start to end spans less or equal one year and if start and end fall in a leap year, denominator is 366.0
- If the interval from start to end spans less or equal one year and if either falls in a leap year and if February 29th of that leap year lies in between start and end (or is equal to start or end), denominator is 366.0
- If the interval from start to end spans less or equal one year and neither of the above applied denominator is 365.0
This method is not identical to ACT/ACT ISDA. For ACT/ACT ISDA use
In addition the method has the defect, that it is not additive (if you consider small intervals). For example YEARFRAC(30.12.2011, 04.01.2012, 1) is not equal to YEARFRAC(30.12.2011, 01.01.2012, 1) + YEARFRAC(01.01.2012, 04.01.2012, 1).
- Christian Fries
- See Also:
- Serialized Form
Constructors Constructor Description
DayCountConvention_ACT_ACT_YEARFRAC()Create an ACT/ACT YEARFRAC daycount convention.
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getDaycountFraction(LocalDate startDate, LocalDate endDate)Return the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.
Methods inherited from class net.finmath.time.daycount.DayCountConvention_ACT
getDaycountFractionDescription copied from interface:
DayCountConventionReturn the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.