java.lang.Object
net.finmath.time.daycount.DayCountConvention_ACT
net.finmath.time.daycount.DayCountConvention_ACT_ACT_YEARFRAC
- All Implemented Interfaces:
Serializable
,DayCountConvention
public class DayCountConvention_ACT_ACT_YEARFRAC
extends DayCountConvention_ACT
implements Serializable
Implementation 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 DayCountConvention_ACT_ACT_ISDA
.
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).
- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an ACT/ACT YEARFRAC daycount convention. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDaycountFraction(LocalDate startDate, LocalDate endDate)
Return the daycount fraction (year fraction) corresponding to the period from startDate to endDate given the specific daycount convention.toString()
Methods inherited from class net.finmath.time.daycount.DayCountConvention_ACT
daysBetween, getDaycount
-
Constructor Details
-
DayCountConvention_ACT_ACT_YEARFRAC
public DayCountConvention_ACT_ACT_YEARFRAC()Create an ACT/ACT YEARFRAC daycount convention.
-
-
Method Details
-
getDaycountFraction
Description copied from interface:DayCountConvention
Return the daycount fraction (year fraction) corresponding to the period from startDate to endDate given the specific daycount convention.- Specified by:
getDaycountFraction
in interfaceDayCountConvention
- Parameters:
startDate
- The start date given as aLocalDate
.endDate
- The end date given as aLocalDate
.- Returns:
- The daycount year fraction corresponding to the given period.
-
toString
-