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

Home » Public Forums » archive » POLY_FIT gives wrong answer !
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 gives wrong answer ! [message #20025 is a reply to message #19941] Fri, 12 May 2000 00:00 Go to previous messageGo to previous message
Henk Schets is currently offline  Henk Schets
Messages: 4
Registered: May 2000
Junior Member
Stein Vidar Hagfors Haugan wrote:

> In article <MPG.13848f1b4d7167dd989b0f@news.frii.com>
> davidf@dfanning.com (David Fanning) writes:
>
>> [Actually, Bill Thompson wrote:
>>
>> ..about getting different results with a sorted vs unsorted data
>> set...]
>
> Excuse my brevity in quoting - this post is also smuggled out from
> Goddard, so I'm keeping it short to avoid detection :-)
>
> Although I think Bill's going in the right direction with regard to
> the POLY_FIT question (he's sitting in the cubicle next to me, so I
> should know where he's going :-), it doesn't actually explain the
> original problem as it was *stated* by Henk Schets:
>
>> The only way to do it right is by making other arrays like x2 and y2 and
>> doing a poly_fit on it.
>
> Taken at face value, this means he's doing this (referring to Bill's
> example code):
>
> xs = x(s)
> ys = y(s)
> param3 = poly_fit(xs,ys,2,yfit2)
>
> Doing so, I get *identical* results compared to using x(s) and y(s)
> (whereas the sorted/unsorted versions differ). So, the problem lies
> somewhere else.
>
> My guess is that Henk is converting either x(s) or y(s) (or both) to
> *double* precision, which will make the whole computation be performed
> with double precision..
>
> ..or Something Else (tm). Unless we get an actual example (including
> data) that will show the discrepancy, I'm leaning towards David's
> general hypothesis that the problem is not in POLY_FIT, but in the
> application of it..
>
> Stein Vidar

Yep, found the error. It was hard to find, so I'm sorry I questioned the
perfectness of poly_fit. At least I learned about the rounding error ;-)

Thanks,

Henk
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Arrays: strange feature ?!
Next Topic: Re: help on IDL

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

Current Time: Sat Oct 11 05:05:58 PDT 2025

Total time taken to generate the page: 0.79667 seconds