comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: poly_fit for less number of points
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: poly_fit for less number of points [message #84198] Mon, 06 May 2013 13:26 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Sunday, May 5, 2013 6:03:25 PM UTC-4, David Fanning wrote:
> Craig Markwardt writes:
>
>> This fit,
>> res = poly_fit(x-mean(x), y, 2)
>> gives a smooth fit.
>
>
>
> What is the principle here that made you think of this solution and
> caused it to work?

Well, not much. He asked for a smooth function and I gave it to him. Jeremy is right, there is a round-off problem that makes the original POLY_FIT(X,Y,2) not work. Subtracting the mean of X (and/or Y) is a classic solution to the problem of round-off.

As HeinzS intimates, there's really a lot more to the question, like, how smooth should the function be? what degree of polynomial is permissible? how close of an approximation should the function be? what is the tolerance for outliers? why are there no error bars on the data? what is the definition of a "good fit?"

Without any of that information, I felt it worth to just provide *an* answer, even if it wasn't *the* answer to the original implicit question.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: idlwave online help error
Next Topic: the problem for GPULIB+IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:51:46 PDT 2025

Total time taken to generate the page: 0.00520 seconds