|
From: Peter C. <pca...@gm...> - 2022-11-25 18:01:02
|
Hi Marek not sure what PCHIP exactly refers to (MatLab ?), but if that is a Hermite Spline you probably want to use CubicInterpolation with a FirstDerivative boundary condition. Plus probably monotonic = true if I read the docs correctly. https://www.mathworks.com/help/matlab/ref/pchip.html Thanks Peter On Mon, 21 Nov 2022 at 19:14, Marek Grasshoff <mar...@gm...> wrote: > > Anyone knows please? > > Mar...@gm... > 0 (044) 778 778 0850 > > On 13 Nov 2022, at 20:06, Marek Grasshoff <mar...@gm...> wrote: > > > > Hi, > > > > I was wondering which interpolation method in QuantLib corresponds to PCHIP? > > > > I tried MonotonicCubicNaturalSpline, but a.) the results don’t match pchip and b.) it actually does overshoot > > > > Example: y = 1/(1+x^2) > > Set samples for x = -5, -4.3, -3.6, -2.9, -2.2, -1.5, -0.8, -0.1, 0.6, 1.3, 2, 2.7, 3.4, 4.1, 4.8 > > And you will see for x_target = 0.0 an overshoot (the interpolation for x = 0.0 is bigger than any of the sample y) > > > > > > > > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |