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 #84208 is a reply to message #84202] Mon, 06 May 2013 06:48 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On 5/5/13 6:03 PM, 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?
>
> Cheers,
>
> David
>

Roundoff error in the typical fitting routines. Look at the OP's
original x values:

x = [3932.9321,3933.0452,3933.1162,3933.2514,3933.3517,3933.4271 ]

By switching to x-mean(x):

IDL> print, x-Mean(x)
-0.255371 -0.142334 -0.0712891 0.0639648 0.164307
0.239502

The effective precision of the values is 4 extra digits. Within the
polynomial fitting code, they're going to be squared, so roundoff error
in the original data is going to get bad, but the extra 4 digits keep it
under control.

-Jeremy.
[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 18:03:33 PDT 2025

Total time taken to generate the page: 0.00370 seconds