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

Home » Public Forums » archive » Re: What is the difference between 'curvefit', 'lmfit' and 'svdfit' procudure?
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: What is the difference between 'curvefit', 'lmfit' and 'svdfit' procudure? [message #52898 is a reply to message #52897] Wed, 07 March 2007 17:19 Go to previous messageGo to previous message
duxiyu@gmail.com is currently offline  duxiyu@gmail.com
Messages: 88
Registered: March 2007
Member
On Mar 7, 11:02 pm, "R.G. Stockwell" <n...@email.please> wrote:
> <dux...@gmail.com> wrote in message
>
> news:1173260085.952428.100150@q40g2000cwq.googlegroups.com.. .
>
>> I have a set of 'x' and 'y', and want to use a special function 'f(x)'
>> to fit it.
>
>> The function 'f(x)' contains three parameters.
>
>> But I'm confused by the three different procudure 'curvefit', 'lmfit'
>> and 'svdfit'.
>
> The difference is essentially between 1) linear least square error fits,
> and 2) non-linear least square error fit.
>
> In 1) you directly calculate the resulting fit.
> You start with the matrix equation
> Ax = b
>
> where x is the unknown. 'A 'is a matrix where your
> fitting function is evaluated at each point (and is usually
> not square).
>
> The LSF solution is:
>
> A^tAx = A^tb
> x = (A^tA)A^tb
>
> The svd routines solve this matrix equation.
>
> For 2) you make an error function
> error = data - nonlinear function(x)
>
> and you search around parameter space to try to
> find the minimum error. This may not converge, it probably
> depends on an initial guess, and can be very time consuming.
> This is what curvefit and the others do.
>
> If you can create a linear fit, then 1) is the way to go.
> If it is non-linear, google fpr mpfit, widely hailed as a superior
> non-linear fitting routine.
> (i'll google: http://cow.physics.wisc.edu/~craigm/idl/idl.html)
>
> Cheers,
> bob

Thanks for your explaination.
In your statement 1) means SVDFIT and 2) means LMFIT and CURVEFIT,
doesn't it?
When I want to create a linear fit, there are many choices like
LINFIT, LADFIT and SVDFIT.
But I'm confused which one I should select.

Best regards,
Du Jian
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: strange behaviour of ladfit - known?
Next Topic: using Container object for Strings?

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

Current Time: Fri Dec 05 02:20:31 PST 2025

Total time taken to generate the page: 0.01254 seconds