Skip to content
All library documents

Actual/Actual AFB Day Count for a Leap-Day Boundary

Article Quant Q&A · Author: TT.

Summary

The document examines an Actual/Actual AFB year fraction when the date range spans several complete years and leaves a stub around a leap day. It outlines the convention’s approach: count complete years backward from the period end, apply the February 28 adjustment rule, then calculate the remaining stub using a denominator determined by whether February 29 falls within the relevant interval.

For the dates in the example, counting back yields a stub ending on February 29. The accepted answer inspects QuantLib’s denominator logic and concludes that its implementation keeps the stub denominator at 365, producing a factor of four plus one three-hundred-sixty-fifth. This conflicts with the cited reference example, which gives a leap-year denominator. The response therefore suggests the reference example may be wrong, based on the implementation examined; it does not establish a broader resolution across all interpretations or implementations of the convention.

Key ideas

  • Actual/Actual AFB counts complete years backward from the period end before calculating any remaining stub.
  • The February 28 adjustment can shift the rebased endpoint to February 29 in a leap year.
  • The cited QuantLib logic leaves the stub denominator at 365 for the dates examined.
  • The answer concludes that the reference example’s denominator may be incorrect, based on this implementation.

Tags

Full text
# Day count convention Actual/Actual AFB; Factor for Date1 = 2004-02-28 and Date2 = 2008-02-28


# Day count convention Actual/Actual AFB; Factor for Date1 = 2004-02-28 and Date2 = 2008-02-28












The Actual/Actual AFB day count convention is explained on Wikipedia here. I'll condense the rules here the way I understood them.

> Factor = Days(Date1,Date2)/DiY If 29th february is in date range from Date1 (inclusive) to Date2 (exclusive), DiY=366 else DiY=365 If date range from Date1 to Date2 spans multiple years, calculation is split in two parts: Number of complete years counted back from the last day in the period The remaining initial stub, calculated using the basic rule ISDA additional rule: If counting backwards for multiple years, if the last day of the relevant period is 28 February the full year should be counted back to 28 February unless 29 February exists in which case 29 February should be used.

Now consider the case `Date1 = 2004-02-28` and `Date2 = 2008-02-28`. Applying the rules gives:

- 4 full years

- Date2' = 2004-02-29 [rebased Date2 by counting back + ISDA additional rule]

- DiY = 365, because: Date1 = 2004-02-28, Date2' = 2004-02-29; 29 February is not in date range from Date1 (inclusive) and Date2' (exclusive) i.e. the remaining initial stub

- Factor = 4 + 1/365

However, in the example on the Wikipedia page I linked to at the top it shows for those same two dates that `Factor = 4 + 1/366`. Which factor is correct? And if the result of the Wikipedia page is correct, where did I go wrong with my reasoning?

## Answer by TT. (score 1, accepted)

https://quant.stackexchange.com/a/36462

Looking at the link to QuantLib's implementation of Act/Act AFB posted by Helin Gai in comments, this would be the part that the determines DiY (variable `den`):

```
Real den = 365.0; // the DiY

if (Date::isLeap(newD2.year())) {
    temp = Date(29, February, newD2.year());
    if (newD2>temp && d1<=temp)
        den += 1.0;
} else if (Date::isLeap(d1.year())) {
    temp = Date(29, February, d1.year());
    if (newD2>temp && d1<=temp)
        den += 1.0;
}
```

`d1` will be 2004-02-28 and `newD2` will be 2004-02-29 after counting back complete years and applying the ISDA additional rule. Applying this bit of code:

- `if (Date::isLeap(newD2.year()))` > True

- `temp = Date(29, February, newD2.year());` > temp = '2004-02-29'

- `if (newD2>temp && d1<=temp)` > False, since `newD2>temp` doesn't hold

- `den` is not incremented and remains 365;

So according to QuantLib's implementation, Factor will be 4 + 1/365. It seems my suspicion is true that the example on Wikipedia is incorrect.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.