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

Home » Public Forums » archive » Re: Piecewise curve fitting in idl
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: Piecewise curve fitting in idl [message #61788 is a reply to message #61785] Thu, 31 July 2008 05:39 Go to previous messageGo to previous message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
d.poreh@gmail.com wrote:
> On Jul 31, 1:21 pm, Wox <nom...@hotmail.com> wrote:
>> On Thu, 31 Jul 2008 03:30:22 -0700 (PDT), d.po...@gmail.com wrote:
>>> Folks
>>> How we can do the piecewise curve fitting in idl. Say we have an array
>>> that this array has got 2 or 3 trends in data and we want to fit a
>>> liner curve for each trends. In MATLAB curve fitting tool, we can
>>> easily exclude or include a part of data and then fit a curve. How we
>>> can do this in IDL
>>> Cheers
>>> Dave
>> Euhm, just do the fitting on the different parts? Or do you mean
>> fitting with a piecewise polynomial (i.e. spline: see e.g. IMSL_BSLSQ
>> or IMSL_CONLSQ)
>
> just doing the fitting on the difrent part. how we can select this
> parts and how we can fit a curve to these parts separatly?
> Cheers

Identifying the different parts is up to you. How do you know that there
are 2-3 different trends? Whatever method you use to reach that
conclusion will have to be adequate to identify where the different
trends start and end. However, once you have identified the different
parts you want fit separately, fitting each one separately is trivial:
pass x[trend_start[i]:trend_end[i]] and y[trend_start[i]:trend_end[i]]
to the curve-fitting routine.

If you want a curve fitting routine that automatically figures out where
each trend starts and ends, then it gets a LOT more complicated. You
could do that by using a non-linear curve fitting routine, and make the
transition point between the two trends be one of the parameters of your
fitting curve. However, I would strongly recommend trying to understand
why you see 2 or 3 different trends, and then try to come up with a
single mathematical model for the entire curve that reflects that
reason. Then fit that model to your data.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Surface fitting image with missing data
Next Topic: Re: Edge detection and convert edges into polygons

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

Current Time: Sat Oct 11 01:51:33 PDT 2025

Total time taken to generate the page: 1.04081 seconds