Re: Yet another user with poly_fit problems [message #86096 is a reply to message #86094] |
Thu, 03 October 2013 04:00   |
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
|
|
|