|
From: Luigi B. <lui...@gm...> - 2024-06-04 13:01:40
|
Hi, there's not a lot of documentation, I'm afraid. Things are more flexible in C++, where you can instantiate an InterpolatedDiscountCurve with the interpolation you want as a template argument. In Python, we can't export the template directly so it provides a number of possible interpolations but not all of them; as of QUantLib 1.34, you can see them at < https://github.com/lballabio/QuantLib-SWIG/blob/v1.34/SWIG/discountcurve.i#L57-L64>. So for instance, if you want monotonic log-cubic interpolation, you can use the second class listed there (MonotonicLogCubicDiscountCurve). Log-linear interpolation used to be the default and got the simpler name, DiscountCurve. All these curves take as input a set of dates and the corresponding discounts. If you want to interpolate between zero rates, you can use one of the classes listed at < https://github.com/lballabio/QuantLib-SWIG/blob/v1.34/SWIG/zerocurve.i#L59-L67> but they need a set of dates and zero rates as inputs. You can either convert your discount factors into zero rates manually, or you could instantiate one of the discount curves above and ask them for the zero rates at the input dates. Hope this helps, Luigi On Sat, Jun 1, 2024 at 5:10 AM Kiki zzz <kik...@gm...> wrote: > hi, >> >> I'm new to quant lib and I have some basic (or even stupid) questions. >> Let's say I have a list of dates and discount factors and I want to >> interpolate discount factors between 2 dates. >> >> - how can I choose different interpolation methods using QuantLib python >> interface? (e.g. in zero rate space, or forward rate space. linear or >> non-linear, etc) >> >> - what is the most common interpolation method (or maybe top 2 methods) >> used in practice? This question could be subjective or maybe there's a >> widely used standard in the fixed income world. >> >> It will be very helpful if someone can point me to any relevant documents >> or tutorial website. >> >> Really appreciate the help! >> Kiki >> > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |