|
From: Guillaume H. <gui...@gm...> - 2018-02-19 19:05:56
|
I haven't done any work on it lately. It's on my todo list, I'll try to get to it eventually. If I find something wrong with the existing code, I'll send a PR. Guillaume On Thu, Feb 15, 2018 at 5:18 AM, Luigi Ballabio <lui...@gm...> wrote: > Hello, > just thought I'd check. Did either of you manage to make progress on > this? > > Luigi > > > On Mon, Jan 22, 2018 at 10:22 PM yuzhao88 <yuz...@gm...> wrote: > >> Thanks for checking horel. You are right, in this case, the dollar amount >> matches. To give you an idea why I am looking into survive probabilities, >> on Bloomberg, try using curve date as 12/29/2017 and use 12/19/2018 as the >> valuation date and leaving all other fields unchanged, the cash amount >> obtained from Bloomberg is 886319. Quantlib is giving 890,543. >> >> >> >> >> >> On Jan 12, 2018 4:51 PM, "Guillaume Horel" <gui...@gm...> >> wrote: >> >>> Where do you get the survival probabilities in bloomberg? I'm not sure >>> why they don't match exactly. I can try to investigate more, but what >>> matters is the dollar amount, survival probabilities are not tradeable. >>> >>> On Fri, Jan 12, 2018 at 4:40 PM, yuzhao88 <yuz...@gm...> wrote: >>> >>>> Thanks for coming up with the example. I just tried your code. The >>>> survival probability to 3/20/2018 is 0.990768 whereas Bbg is showing >>>> 0.9909. I actually got something very similar to what you got in survival >>>> probability and it is off by 0.0001 across the board. Any idea why this is >>>> off by about 0.0001? >>>> >>>> On Jan 12, 2018 12:51 PM, "Guillaume Horel" <gui...@gm...> >>>> wrote: >>>> >>>>> Hello, >>>>> >>>>> see the code that I used here: https://gist.github.com/ >>>>> 2123c9e524e2b8c50f0f75ebfffa3ae2 >>>>> I get an upfront payment of 638,870 which matches bloomberg for me. >>>>> One thing to remember is that the upfront is payed T+3 so it's slightly >>>>> bigger than the NPV of the cds. >>>>> >>>>> Cheers, >>>>> Guillaume >>>>> >>>>> On Tue, Jan 9, 2018 at 8:59 AM, yuzhao88 <yuz...@gm...> wrote: >>>>> >>>>>> As an example, the survival probability I got for 3/20/2018 is around >>>>>> 0.99076538 whereas Bloomberg is showing 0.9909. In general default >>>>>> probabilities I got are slightly lower than Bloomberg across the board. >>>>>> >>>>>> (I am using Spread 248, evaluation date 12/29/2017) >>>>>> >>>>>> >>>>>> On Tue, Jan 9, 2018, 8:29 AM yuzhao88 <yuz...@gm...> wrote: >>>>>> >>>>>>> Sorry forgot to click Reply all. Thanks for your reply. >>>>>>> >>>>>>> Yes. There discount factors match exactly with Bloomberg, but the >>>>>>> default probability does not match. >>>>>>> >>>>>>> I am using the following code to construct the credit curve. The >>>>>>> spread I am plugging in is 248. / 10000.. The evaluation date is 12/29/2017 >>>>>>> and the default probability I got on 3/20 2018, 6/20/2018 etc is lower than >>>>>>> bbg. >>>>>>> >>>>>>> >>>>>>> Calendar weekendsOnly = WeekendsOnly(); >>>>>>> >>>>>>> CreditDefaultSwap::PricingModel model = CreditDefaultSwap::ISDA; >>>>>>> Real recovery_rate = 0.4; >>>>>>> >>>>>>> std::vector<boost::shared_ptr<DefaultProbabilityHelper>> >>>>>>> instruments{ >>>>>>> boost::shared_ptr<DefaultProbabilityHelper>( >>>>>>> new SpreadCdsHelper(cds_spread, 6 * Months, 1, WeekendsOnly(), >>>>>>> Quarterly, Following, >>>>>>> DateGeneration::CDS2015, Actual360(), 0.4, tsCurve, true, true, >>>>>>> Date(), >>>>>>> Actual360(true), true, model)), >>>>>>> >>>>>>> boost::shared_ptr<DefaultProbabilityHelper>( >>>>>>> new SpreadCdsHelper(cds_spread, 5 * Years, 1, WeekendsOnly(), >>>>>>> Quarterly, Following, >>>>>>> DateGeneration::CDS2015, Actual360(), 0.4, tsCurve, true, true, >>>>>>> Date(), >>>>>>> Actual360(true), true, model)), >>>>>>> }; >>>>>>> >>>>>>> // build credit curve >>>>>>> Handle<DefaultProbabilityTermStructure> probability = >>>>>>> Handle<DefaultProbabilityTermStructure>( >>>>>>> boost::make_shared<PiecewiseDefaultCurve<SurvivalProbability, >>>>>>> LogLinear> > >>>>>>> (0, WeekendsOnly(), instruments, Actual365Fixed())); >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, Jan 9, 2018, 4:22 AM Luigi Ballabio < >>>>>>> lui...@gm...> wrote: >>>>>>> >>>>>>>> Do you have any intermediate results you can compare? (Schedules, >>>>>>>> annuities, coupons, probabilities...) >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Jan 8, 2018 at 2:27 PM yuzhao88 <yuz...@gm...> wrote: >>>>>>>> >>>>>>>>> I did try that, but did not resolve the discrepancy. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Jan 8, 2018 5:18 AM, "Luigi Ballabio" <lui...@gm...> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>> Just to rule it out, may you try increasing the accuracy of the >>>>>>>>> bootstrap? (It can be passed to the constructor of PiecewiseDefaultCurve; >>>>>>>>> the default is 1e-12, but you might try requesting a smaller error.) >>>>>>>>> >>>>>>>>> Luigi >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sun, Jan 7, 2018 at 2:38 AM zcg6433 <yuz...@gm...> wrote: >>>>>>>>> >>>>>>>>>> I am wondering if anyone can match ISDA calculation with this >>>>>>>>>> change. I could >>>>>>>>>> match the pv of the coupon/premium leg exactly, but the >>>>>>>>>> protection leg is >>>>>>>>>> off by about $200 for the $10mm notional cds I tested. Anyone >>>>>>>>>> else had any >>>>>>>>>> luck or has idea what is going on? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Sent from: http://quantlib.10058.n7.nabble.com/quantlib-users-f3. >>>>>>>>>> html >>>>>>>>>> >>>>>>>>>> ------------------------------------------------------------ >>>>>>>>>> ------------------ >>>>>>>>>> Check out the vibrant tech community on one of the world's most >>>>>>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>>>>>>>>> _______________________________________________ >>>>>>>>>> QuantLib-users mailing list >>>>>>>>>> Qua...@li... >>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>> ------------------------------------------------------------ >>>>>> ------------------ >>>>>> Check out the vibrant tech community on one of the world's most >>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>>>>> _______________________________________________ >>>>>> QuantLib-users mailing list >>>>>> Qua...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>> >>>>>> >>>>> >>> |