|
From: Francis D. <fdf...@gm...> - 2021-05-06 19:23:52
|
Hi Luigi, I thought that I cc'ed the group on this but I replied directly by mistake. I answered this as follows with the updated attachment: I have attached a v2 of your file with some changes showing how you get back the input fair spread and an NPV of 0: - I would use "settlementDays" = 0 i.e. protection start is equal to trade date with protection effective immediately. I believe that this is the standard for CDS post the 2009 Big Bang. I know that the ISDA model has T + 1 for riskless days but that is handled in the engine. - Evaluation date is 13 Jun 2011, so I would use "DateGeneration::CDS". For more recent evaluation dates after 2015, I would use "DateGeneration::CDS2015". - To get the "terminationDate" that you use in your schedule, I would use the "cdsMaturity(...)" function. It handles the various CDS conventions to generate the correct maturity. - When creating the instrument, I would use the extra ctor parameters to provide the "protectionStart" explicitly as the trade date (if this is not provided, protection start is assumed to be the first date in the CDS schedule) and the last period day counter of "Actual360(true)". These changes give an output of: -- Repricing the first instrument used for calibration: -- par spread: 0.792700 % NPV: -2.65118e-10 default leg: -4165.83 coupon leg: 6037.46 Thanks, Francis. On Thu, May 6, 2021 at 5:08 PM Luigi Ballabio <lui...@gm...> wrote: > Thanks for the heads up. There's definitely something weird going on. > I'll try investigating some more... > > Luigi > > > On Wed, Apr 21, 2021 at 4:19 AM HB <kar...@gm...> wrote: > >> Hi all, >> >> I would really appreciate any insights on how to properly re-price >> the CDS used to bootstrap a survival probability curve. >> >> After building a survival probability curve from CDS instruments, I >> re-price the calibration instruments as a sanity check, however the NPV of >> the re-priced CDS is not zero. >> >> The attached file is a minimal working example. >> >> Using the first CDS as an example, if in each `SpreadCdsHelper` I use >> `model == CreditDefaultSwap::ISDA` and as pricing engine the >> `MidPointCdsEngine`, then I get an NPV of ~17 cents. If the pricing engine >> is changed to `IsdaCdsEngine` (so that, on the surface, appears consistent >> with the model), then the NPV becomes a whooping ~ $22: >> >> -- Repricing the first instrument used for calibration: >> -- par spread: 0.792734 % >> NPV: -0.176124 >> default leg: -4143.93 >> coupon leg: 4143.75 >> >> -- Repricing the first instrument used for calibration: >> -- par spread: 0.796878 % >> NPV: -21.8426 >> default leg: -4165.85 >> coupon leg: 4144.01 >> >> >> Thanks in advance and best regards, >> HB >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |