I think it's because the ActualActual daycounter needs a period to be able
to work correctly.
If you call the convention "Actual/Actual in period" it suddenly makes more
sense (for me at least)...
Basically the convention says that given a period, you are calculating the
*period* fraction and then scaling that to the whole year. That is useful in
case of coupon payments, where the period is for example 6 months.
To take your example, imagine that your real period was from 20 May 2004 to
20 November 2004, and you wanted to get the actual/actual year fraction
between 20 May 2004 and 26 July 2004.
If you look at the code, it first determines that your period is 6 months,
and the total actual days in the period are, let's say 183 (I didn't
actually count, forgive me).
Then you do actual/actual in period, which is 67/183 and you scale back by
the fact that there are two periods in a year and you get roughly 0.183
As you can see it doesn't make much sense to use Act/Act when you don't have
a period to reference. If you want something that is more "proportional" to
actual time elapsed, I would suggest Act/365 or the SimpleDayCounter.
Hope this helps
-Daniele
-----Original Message-----
From:
[hidden email] [mailto:
[hidden email]]
Sent: Wednesday, July 21, 2004 7:52 AM
To:
[hidden email];
[hidden email]
Cc:
[hidden email]
Subject: [Quantlib-users] ActualActual::yearFraction(d1,d2) VS Bloomberg
Hi,
when I test my program with Bloomber, I found that there is a problem with
yearFraction method. Check with
d1=Date(20,May,2004)
d2=Date(26,July,2004;
the ActualActual::dayCounter give the correct result of 67 days. So the
yearFraction from Bloomberg is simple 67/365=0.18356 whereas QuantLib give
ActualActual::ISMA_Impl::yearFraction(d1,d2)=0.166667 (2 months/12)
There is no Implementation in ActualActual which return this simple
yearFraction "à la Bloomberg" (so may be we should add one new simple
implementation). Can someone explain the reason that Bloomberg use this
convention to me (even It is shown that the bond's cashflow daycounter is
ACT/ACT ! XS