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

Home » Public Forums » archive » Problems in non-linear fitting
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: Problems in non-linear fitting [message #53081 is a reply to message #52990] Thu, 15 March 2007 08:30 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"duxiyu@gmail.com" <duxiyu@gmail.com> writes:
> I am using the MPFITFUN for curve-fittin.
> It is easy and effectual.
> But I have some confused points in using it.
>
> Could it give a value which can measure the quality of fiting?
> For example, if you do a linear fiting, you can caculate the R^2 to
> measure the quality of fiting.
> This R maybe is the correlate cofficient between Y and Yfit. (I am not
> sure for this. if you know how the R is caculated, please tell me.)
> I do not know whether the R^2 can describe the quality of non-linear
> fiting.

R does not necessarily measure the quality of fit, but rather the
degree of *linear* correlation between two variables. Thus, it is
only appropriate for linear fitting.

The chi^2 statistic is more commonly used for non-linear fitting; see
the BESTNORM parameter of MPFIT & MPFITFUN.


> Becasuse when I select the different starting values of the parameters
> to fit, I get the different results, I need a parameter to determine
> which result is best.
> If it not, I want to find a new parameter which can meet my request.

You may be getting different solutions for two different reasons that
I can think of. One possibility is that there are multiple local
minima. In that case, MPFIT is not the best method; perhaps monte
carlo or simulated annealing would be more appropriate.

Another possibility is that you are using the automatic derivatives,
but MPFIT is varying the parameters by too little to calculate an
accurate derivative. In that case you should use the PARINFO
parameter with the STEP or RELSTEP fields, to declare a step size to
use for derivatives.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: The spectra of fluctuations in variable
Next Topic: change colors of IDL shell on OS X?

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

Current Time: Sun Oct 12 01:13:41 PDT 2025

Total time taken to generate the page: 0.32021 seconds