[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] What I am doing wrong / gsl_interp_polynomial

From: Patrick Alken
Subject: Re: [Bug-gsl] What I am doing wrong / gsl_interp_polynomial
Date: Mon, 30 Nov 2015 16:43:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


I confirmed that your program is failing for the polynomial interpolation, but polynomial interpolation is known to be difficult for large datasets. From the manual:

Interpolation Type: gsl_interp_polynomial

Polynomial interpolation. This method should only be used for interpolating small numbers of points because polynomial interpolation introduces large oscillations, even for well-behaved datasets. The number of terms in the interpolating polynomial is equal to the number of points.

So basically you are trying to fit a degree 1000 polynomial to your dataset, which will not be numerically stable - even though your dataset is well behaved.

Cubic splines are probably the way to go here, but if you insist on a degree 1000 polynomial (even though you shouldn't) I might be able to give you some further ideas.

You mentioned that previous versions of GSL worked for you. Can you verify if you used exactly this same dataset successfully with a previous version of GSL? If so please tell me the version number.


On 11/30/2015 10:25 AM, Petrus, Adam (UK) wrote:
I am attempting to use the polynomial interpolation method with GSL. However I 
am getting very strange results.

If I run the attached program I get the below result. If I change the method to 
linear or cspline the interpolation works fine.

Not in previous gsl versions the polynomial interpolation has worked!


Is there something I am missing?

Yours aye


This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]