|
From: Amine I. <ami...@gm...> - 2019-09-03 18:41:05
|
Hi team,
Please see the below and respond at your convenience. If someone can help me that would be great!
Thanks
amine
> Begin forwarded message:
>
> From: Amine Ifri <ami...@gm...>
> Subject: PiecewiseYieldCurve<C,I,B>::maxDate() vs InterpolatedDiscountCurve<T>::maxDate(): impact of lazyobject::calculate() function
> Date: 3 September 2019 at 19:37:46 BST
> To: qua...@li...
> Cc: Luigi Ballabio <lui...@gm...>
>
> Hi team/Luigi,
>
> I am building a small framework for forward calculations in a XVA like manner, where I simulate a set of market yield curves forward using some model and pass those simulations as a map<int, boost::shared_ptr<YieldTermStructure>>, but first, I build a PiecewiseYieldCurve<C,I,B> that is bootstrapped on a set of dummy market instrument quotes and at the moment I use the same forwarding and discounting curve for cash flows to keep things simple. So far so good…
>
> The problem arises for me as I get to call the pricers many many times in the future, thereby making extensive use of the discount() method which itself calls a maxDate() method to check whether the time to maturity T is still within bounds. Even though PiecewiseYieldCurve<I> is a typedef of InterpolatedDiscountCurve<> in the case of yield term structures, I don’t understand why one performs a lazy calculation first:
>
> template <class T>
> inline Date InterpolatedDiscountCurve<T>::maxDate() const {
> if (this->maxDate_ != Date())
> return this->maxDate_;
> return dates_.back();
> }
>
> template <class C, class I, template <class> class B>
> inline Date PiecewiseYieldCurve<C,I,B>::maxDate() const {
> calculate();
> return base_curve::maxDate(); <==== here I suspect it is same as above?
> }
>
> More importantly, I m trying to price both VanilllaSwaps and OvernightIndexedSwaps in the future using my scenarios. VanillaSwaps price just fine, whereas I get a bootstrapper issue when pricing OvernightIndexedSwaps. I suspect this has something to do with the way the Overnightindexedcouponpricer is coded?
>
> I would appreciate very much your help on this as this is a major bottleneck in my code and can’t seem to be moving forward.
>
> Thanks!
>
> Amine
>
|