Re: R: Question about qlinterpolate and linear extrapolation
Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Question-about-qlinterpolate-and-linear-extrapolation-tp4030p4033.html
Chiara,
apologies for the delay.
On 09/21/2005 08:06:25 PM, FORNAROLA,CHIARA wrote:
> thanks for your answer this gives to me some more assurance, but it
> also generates some more questions.
> 1) is the same algorithm used for x<X{0} where X{0} is the first
> known point of the series you use to build the line?
Yes.
> 2) I'm comparing the results of extrapolation on same input data I
> can obtain by using: QuantLibXL-0.3.7's qlinterpolate function,
> linear_interpolate function of Perl library and a VBA user defined
> function I create following the same algorithm you described, but I
> can't obtain the same output number.
Unless my algebra got rusty, the formula should be
y = y_{N} + (x - x_{N})*(y_{N}-y_{N-1})/(x_{N}-x_{N-1}).
Which of the three functions is closer?
Luigi
----------------------------------------
This gubblick contains many nonsklarkish English flutzpahs, but the
overall pluggandisp can be glorked from context.
-- David Moser