Re: Question about qlinterpolate and linear extrapolation

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Question-about-qlinterpolate-and-linear-extrapolation-tp4030p4034.html

On 09/14/2005 05:49:26 PM, FORNAROLA,CHIARA wrote:
> Hi
>
> I'm using QuantLibXL-0.3.7 and I'd like to know which is the  
> algorithm behind extrapolation used in qlinterpolate function.
> Sorry for this simple question, but I'm trying to replicate (into
> excel spreadsheet) the results this function gives and I'm also  
> asking if there is a "right" way to perform linear extrapolation.

Chiara,
        the extrapolation is performed by---hmm, what is the clearest  
way to put it?---by extending the last segment, i.e., by using the same  
formula which is used between x_{N-1} and x_{N} for x > x_{N}. In case  
of linear interpolation, the last segment is extended; in case of  
splines, the last cubic, and so on.

Later,
        Luigi

----------------------------------------

Better to remain silent and be thought a fool than to speak out and
remove all doubt.
-- Abraham Lincoln