|
From: Giuseppe T. <tr...@gm...> - 2022-06-02 10:41:25
|
Hello Victoria, Relinkable handles are useful when you are instantiating objects that requires a Handle to something (a yield curve, a volatility structure...). You can relink the handle to another object without reinstantiating the object that requires it. For example say you want to observe the effect of different interpolations of the yield curve on the NPV of a swap. You can create two yield curves with the two interpolations and pass the Relinkable Handle to your pricing engine. This way you can just call NPV on your swap, relink the Handle to the second curve and call NPV again and check the difference. With a regular Handle you would have to reinstantiate your pricing engine with the Handle to the second curve, reset the new pricing engine to the swap and then recompute the NPV. Of course it's doable but think about the hassle if you have different instruments, different curves, volatility surfaces... Il Gio 2 Giu 2022, 12:17 Victoria Titon <vic...@we...> ha scritto: > Hello, > > I read some blog articles about the function > yts1=ql.RelinkableYieldTermStructureHandle and the method > yts1.linkTo(YieldTermStructureHandle2). > > I understand that it allows the yts1 to be updated according to another > yts2 (please correct me if I'm wrong). > > But I don't see the purpose of doing this: using yts1 and link it to yts2, > instead of using directly yts2? > > Thanks in advance for your answer. > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > |