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 #84202 is a reply to message #84198] Mon, 06 May 2013 11:02 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Sat, 4 May 2013 07:02:57 -0700 (PDT), sid wrote:

> ... But can you please suggest me is there any other fit available to fit this kind of dataset. Because I want to get a smoothed fit.

I'm not sure, what you mean with "smoothed fit". I fully agree with
Craig, that a polynomial fit of degree 2 is very smooth.

Putting a more detailed look onto your data, I see that the function
has to be vary asymmetric to match the data. I guess you tried degree
4 or higher and don't like that wiggles, which are typical for
polynomal fits of higher degree.

It would be very helpful to know, if you are looking for a least
square fit (which compensates uncertainties within the y values) or a
function which interpolates the given points (and goes exactly through
the given points).

In any case I think, that it is very risky to draw an arbitrary curve
through the points on the right side of the diagram. It would be very
helpful, to have a model explaining y vs. x. Can you tell something
about the origin of the data?

A "quick and dirty" solution may be a hyperbolic function like
y(t) = (p0 + p1*t + p2*t^2) / (t - q0)
where p0, p1, p2 and q0 are the (fit-)constants and t=x-mean(x).

Such a non-linear function can be fitted by IDL's curvefit() or Craig
Markwardt's mpfit(). If you want to see the result for your example
before doing the fitting stuff, here are my results:
q0=0.311793, p0=-0.0241749, p1=0.0906013, p2=-0.0602339

But again, this is very speculative. This is one function, that fits
your data. And there may be other functions with other results!
Furthermore I would expect, that you have other data examples, where
the function above does not work!

Heinz
[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: Fri Oct 10 01:47:09 PDT 2025

Total time taken to generate the page: 0.40031 seconds