R: R: Question about qlinterpolate and linear extrapolation

Posted by chiara.fornarola on
URL: http://quantlib.414.s1.nabble.com/Question-about-qlinterpolate-and-linear-extrapolation-tp4030p4032.html

 

Thx Luigi!
it seems qlinterpolate eand my linear interpolate function in VB are
closer.
The Perl's linear_interpolate is more distant but I believe it has
something to do with rounding off.
Chiara

-----Messaggio originale-----
Da: Luigi Ballabio [mailto:[hidden email]]
Inviato: 30 September 2005 12:15
A: FORNAROLA,CHIARA
Cc: [hidden email]
Oggetto: Re: R: [Quantlib-users] Question about qlinterpolate and linear
extrapolation


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

-----------------------------------------------------------------------------
Chi riceve il presente  messaggio e` tenuto a verificare se lo stesso non gli
sia pervenuto per  errore.  In tal caso e` pregato di avvisare immediatamente
il mittente  e,  tenuto  conto  delle  responsabilita` connesse  all'indebito
utilizzo e/o  divulgazione  del  messaggio  e/o  delle  informazioni  in esso
contenute,  voglia  cancellare  l'originale  e distruggere  le varie copie  o
stampe.

The receiver  of this message is required to check if  he/she has received it
erroneously.  If  so,  the  receiver  is  requested to immediately inform the
sender and - in consideration of the responsibilities  arising from undue use
and/or disclosure of the message  and/or  the information contained therein -
destroy the original message and any copy or printout thereof.
-----------------------------------------------------------------------------