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 #20041 is a reply to message #19941] Thu, 11 May 2000 00:00 Go to previous messageGo to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
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
[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: Wed Oct 08 19:17:45 PDT 2025

Total time taken to generate the page: 0.00465 seconds