Hi Luigi, all,
a swap being a LazyObject will notify its observers of changes only if it is calculated. Now if I have a model and an engine (for a swaption on that swap) which only know directly of one curve (the model curve), but apply adjustments for coupons with associated curves different from the model curve (attached via the coupons' ibor or swap indexes), the pricing won't be updated if these curves change, because the change isn't propagated from the swap to the swaption. Except, the swap is calculated each time the swaption is priced. This would also suggest the workaround, namely to calculate the swap in the pricing engine, with two drawbacks though: 1 the calculation might not be needed, so wasted time and 2 the swap needs a suitable pricing engine attached, again without direct use. A concrete example would be a FloatFloatSwap which exchanges Euribor3M (with an attached 3m - curve) and CMS5Y (with an attached 6m - forward curve and Eonia - discount curve), a FloatFloatSwaption built on top of that (say european exercise), a MarkovFunctional model (with the 6m - curve as the (unique and only) model curve) and a Gaussian1dFloatFloatSwaptionEngine (with Eonia again for discounting). Now if I shift the 3m curve to compute deltas, the change won't be noticed by the pricing engine, because this curve is only observed by the underlying swap. Do you think there is any easy solution for this ? Thanks Peter ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Similar to your suggested workaround, you could always manually call
notifyObservers() on the swap, which will not re-calculate (and it
stays marked with calculated_ = false).
> Date: Thu, 11 Dec 2014 21:02:28 +0100 > From: [hidden email] > To: [hidden email] > Subject: [Quantlib-users] Broken Notification Chain > > Hi Luigi, all, > > a swap being a LazyObject will notify its observers of changes only if > it is calculated. Now if I have a model and an engine (for a swaption > on that swap) which only know directly of one curve (the model curve), > but apply adjustments for coupons with associated curves different > from the model curve (attached via the coupons' ibor or swap indexes), > the pricing won't be updated if these curves change, because the > change isn't propagated from the swap to the swaption. > > Except, the swap is calculated each time the swaption is priced. This > would also suggest the workaround, namely to calculate the swap in the > pricing engine, with two drawbacks though: 1 the calculation might not > be needed, so wasted time and 2 the swap needs a suitable pricing > engine attached, again without direct use. > > A concrete example would be a FloatFloatSwap which exchanges Euribor3M > (with an attached 3m - curve) and CMS5Y (with an attached 6m - forward > curve and Eonia - discount curve), a FloatFloatSwaption built on top > of that (say european exercise), a MarkovFunctional model (with the 6m > - curve as the (unique and only) model curve) and a > Gaussian1dFloatFloatSwaptionEngine (with Eonia again for discounting). > Now if I shift the 3m curve to compute deltas, the change won't be > noticed by the pricing engine, because this curve is only observed by > the underlying swap. > > Do you think there is any easy solution for this ? > > Thanks > Peter > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Jan,
yes, this is true. Actually I am using model->update() which is the same kind of manual kick to get the recalculation running. What seems a bit special about the situation is that the swap is not the primary instrument of interest, but only the underlying of the swaption. As long as the pricing of the swaption uses results from the swap (like in the black engine, where the fair rate of the swap is computed for example) everything is fine, but if this is not the case and the swap in merely a data container and not an instrument in its own right, we have a broken line. Maybe it would be consequent if a swaption would register directly will all observables of the underlying swap. Not sure. Thanks Peter On 22 December 2014 at 01:05, Jan Ladislav Dussek <[hidden email]> wrote: > Similar to your suggested workaround, you could always manually call > notifyObservers() on the swap, which will not re-calculate (and it stays > marked with calculated_ = false). > > >> Date: Thu, 11 Dec 2014 21:02:28 +0100 >> From: [hidden email] >> To: [hidden email] >> Subject: [Quantlib-users] Broken Notification Chain > >> >> Hi Luigi, all, >> >> a swap being a LazyObject will notify its observers of changes only if >> it is calculated. Now if I have a model and an engine (for a swaption >> on that swap) which only know directly of one curve (the model curve), >> but apply adjustments for coupons with associated curves different >> from the model curve (attached via the coupons' ibor or swap indexes), >> the pricing won't be updated if these curves change, because the >> change isn't propagated from the swap to the swaption. >> >> Except, the swap is calculated each time the swaption is priced. This >> would also suggest the workaround, namely to calculate the swap in the >> pricing engine, with two drawbacks though: 1 the calculation might not >> be needed, so wasted time and 2 the swap needs a suitable pricing >> engine attached, again without direct use. >> >> A concrete example would be a FloatFloatSwap which exchanges Euribor3M >> (with an attached 3m - curve) and CMS5Y (with an attached 6m - forward >> curve and Eonia - discount curve), a FloatFloatSwaption built on top >> of that (say european exercise), a MarkovFunctional model (with the 6m >> - curve as the (unique and only) model curve) and a >> Gaussian1dFloatFloatSwaptionEngine (with Eonia again for discounting). >> Now if I shift the 3m curve to compute deltas, the change won't be >> noticed by the pricing engine, because this curve is only observed by >> the underlying swap. >> >> Do you think there is any easy solution for this ? >> >> Thanks >> Peter >> >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> >> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >> _______________________________________________ >> QuantLib-users mailing list >> [hidden email] >> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Yes, the clean solution might be to have some method in Observer that says: "register me with all the observables this other thing is registered to". I don't think I have any other ideas... Luigi On Mon, Dec 22, 2014 at 2:26 PM, Peter Caspers <[hidden email]> wrote: Hi Jan, ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |