I've recently been trying to work on and understand the concepts around CDS. By making simplifications (flat hazard rate, flat forward rate), I wanted to compare the values I could obtain by manual calculations for the NPV of the couponsLeg and the protectionLeg with the one I could obtain by using QuantLib.

I got exactly the same value for the protectionNPV but a different one for the couponLeg. Of course, the couponLeg is the sum: defaultAccrualNpv + premiumNPV

I have the right values for the premiumNPV value but not for the defaultAccrualNpv. Looking at the code, I discovered the existence of a default halfDayBias. Could someone explain to me what is the logic behind this bias? In my opinion, this bias just creates a half-day overlap between the different periods.

Thanks you in advance for your help

  • $\begingroup$ so what is your question? Are you trying to understand the purpose of AccrualBias? Have you looked at the comments in rkapl123.github.io/QLAnnotatedSource/d3/dfb/… ? Have you tried looking at cdsmodel.com/documentation.html , in particular cdsmodel.com/assets/cds-model/docs/… ? $\endgroup$ Commented Sep 25, 2023 at 14:42
  • $\begingroup$ Yes, I'm trying to understand the purpose of the Accrual Bias. I was not able to see something talking about this bias in the cdsmodel documentation and I don't understand the comment following the HalfDayBias definition in quantlib ("as in [1] formula (50), second error term is included") $\endgroup$
    – Sakhr
    Commented Sep 25, 2023 at 14:50
  • $\begingroup$ Ok, it seems there is a mistake in the comment, i think it should be "as in [1] formula (49), second error term is included" but i still don't understand the purpose of this bias $\endgroup$
    – Sakhr
    Commented Sep 25, 2023 at 15:35


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.