Re: sigma in curvefit function! [message #39348 is a reply to message #39347] |
Thu, 13 May 2004 09:31  |
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
|
|
|