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

Home » Public Forums » archive » Re: sigma in curvefit function!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: sigma in curvefit function! [message #39347] Thu, 13 May 2004 11:20
marcuirl is currently offline  marcuirl
Messages: 14
Registered: December 2003
Junior Member
<Raquel.Niclos@uv.es> writes:

> Hello,
>
> I was trying to use IDL curvefit function in order to obtain the
> fitting parameters for a non-linear equation. This equation needs a
> fixed parameter to be read from an external file, so I wrote a
> program that read x,y and this parameter from a file, then it call
> the curvefit function (I modified it in order to read this extra
> parameter) with the corresponding function_name (where is my
> equation, which uses this fixed parameter).
> The problem is that I�m using the no-weighting form (because I�m
> fitting one model results to another theoretical equation) and I
> obtained nonsense values for the standard deviations on the fitted
> coefficients (sigma). I read something about this, and I tried with
> the mpcurvefit function too, but I didn't know how to read the
> external fixed parameter from the mpcurvefit function (I didn�t know
> modify it in this case)
>
> Has anybody a solution? Has anybody an alternative program?


To quote David Fanning 03-May 14:26 in this very group, right here yes
(i.e. http://tinyurl.com/23ro5)

<quote David Fanning>

Yes, abandon CURVEFIT and get on over to Craig's site and pick
up MPFIT, the fitting software the professionals use. :-)

http://cow.physics.wisc.edu/~craigm/idl/fitting.html
</quote David Fanning>

TWH, marcu
--
Unless otherwise noted, the statements herein reflect my
personal opinions and not those of any organisation with
which I may be affiliated.
Re: sigma in curvefit function! [message #39348 is a reply to message #39347] Thu, 13 May 2004 09:31 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
<Raquel.Niclos@uv.es> writes:

> Hello,
>
> I was trying to use IDL curvefit function in order to obtain the=20
> fitting parameters for a non-linear equation. This equation needs a=20
> fixed parameter to be read from an external file, so I wrote a=20
> program that read x,y and this parameter from a file, then it call=20
> the curvefit function (I modified it in order to read this extra=20
> parameter) with the corresponding function_name (where is my=20
> equation, which uses this fixed parameter).=20
> The problem is that I=92m using the no-weighting form (because I=92m=20
> fitting one model results to another theoretical equation) and I=20
> obtained nonsense values for the standard deviations on the fitted=20
> coefficients (sigma). I read something about this, and I tried with=20
> the mpcurvefit function too, but I didn't know how to read the=20
> external fixed parameter from the mpcurvefit function (I didn=92t know=20
> modify it in this case) =20
>
> Has anybody a solution? Has anybody an alternative program?

The only solution is for you to supply appropriate weights or error
bars to the observational error bars.

*If* you can assume that the fit is good, then you can adjust the
parameter errors according to the documentation of SIGMA in the
MPCURVEFIT routine. This is equivalent to supplying error bars
estimated from the dat themselves.

On a separate note, generally speaking you should not read external
parameters within your fitting function. Instead, read them aheaad of
time, and then pass the info to your function via any number of means,
such as the FUNCTARGS keyword, or the "X" value, or a COMMON block.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: sigma in curvefit function!
Next Topic: Flow3 procedure

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

Current Time: Wed Oct 08 20:01:39 PDT 2025

Total time taken to generate the page: 0.03251 seconds