Documentation of 'net.finmath.time.daycount.DayCountConvention_ACT_ACT_YEARFRAC' Java class
DayCountConvention_ACT_ACT_YEARFRAC
net.finmath.time.daycount

Class DayCountConvention_ACT_ACT_YEARFRAC

  • All Implemented Interfaces:
    DayCountConventionInterface


    public class DayCountConvention_ACT_ACT_YEARFRAC
    extends DayCountConvention_ACT
    Implementation of ACT/ACT as in Excel (2013). Calculates the day count by calculating the actual number of days between startDate and endDate. The method is only exact, if the two calendar dates are (approximately) on the same time. A fractional day is rounded to the approximately nearest day (since daylight saving is not considered, the notion of nearest may be off by one hour). 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).

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double getDaycountFraction(java.util.Calendar startDate, java.util.Calendar endDate)
      Return the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DayCountConvention_ACT_ACT_YEARFRAC

        public DayCountConvention_ACT_ACT_YEARFRAC()
        Create an ACT/ACT YEARFRAC daycount convention.
    • Method Detail

      • getDaycountFraction

        public double getDaycountFraction(java.util.Calendar startDate,
                                          java.util.Calendar endDate)
        Description copied from interface: DayCountConventionInterface
        Return the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.
        Parameters:
        startDate - The start date given as a Calendar.
        endDate - The end date given as a Calendar.
        Returns:
        The daycount fraction corresponding to the given period.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.