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

Home » Public Forums » archive » Yet another user with poly_fit problems
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: Yet another user with poly_fit problems [message #86096 is a reply to message #86094] Thu, 03 October 2013 04:00 Go to previous messageGo to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Thursday, 3 October 2013 00:14:56 UTC+2, Gus wrote:

> To contextualize the discussion, I just wanted to say that the actual mathemathical equation used in the fitting is not so important for the engineering application for which I use it for. What is important is that, whichever method I use, it should be consistently applied for future datasets.
>
> Moreover, I expect to always have evenly spaced Y values, but increasingly spaced X values. Perhaps I need to look into the different fitting methods and determine whether one of them is acceptable for all future datasets.

How about fitting Y versus log(X+X0) then?

X = [0.000000d, 11.6667d, 822.914d, 3458.85d, 27703.4d, 133928d]
Y = [15.9000d, 16.0000d, 17.0000d, 18.0000d, 19.0000d, 20.0000d]
X0 = - min(X) + 1d0 ; "Randomly" chosen to make min(X+X0)>0 for the ALOG operation.

C = poly_fit(alog(X+X0), Y, 3, /double, yfit=D)

plot, X+X0, Y, /xlog
oplot, X+X0, D, col='ff'x

I don't know what X and Y values you expect, but this seems to work reasonably well for the ones you specify in your original post.

--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgContour and NaN values
Next Topic: reversing axes ranges with IDL 8 graphics

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

Current Time: Sat Oct 11 00:06:03 PDT 2025

Total time taken to generate the page: 1.68159 seconds