Home »
Public Forums »
archive »
Notes on CURVEFIT.PRO
Notes on CURVEFIT.PRO [message #570] |
Mon, 05 October 1992 20:16 |
landsman
Messages: 93 Registered: August 1991
|
Member |
|
|
The version of CURVEFIT.PRO in the IDL User's library in V2.3.2 (and
presumably in earlier versions) contains a typo in line 133
FLAMBDA = FLAMBDA/100. ;DECREASE FLAMBDA BY FACTOR OF 10
According to the versions of this procedure in both Bevington and "Numerical
Recipes" the comment (and not the code) is correct, i.e. the denominator should
be 10. and not 100. The effect of this typo is to slow down convergence
when the initial parameters are far from the best-fit parameters. (The
version with the typo actually converges *faster* when the initial guesses
are close to the best-fit parameters.) I suspect that this typo is
responsible for some convergence problems I have had with CURVEFIT although
I am not sure of this.
CURVEFIT also gives the following definition of the weight vector:
; W: A row vector of weights, the same length as x and y.
; For no weighting,
; w(i) = 1.0.
; For instrumental weighting,
; w(i) = 1.0/y(i), etc.
This is not correct. For Poisson statistics the weight is given by
w(i) = 1.0/y(i) but for instrumental errors sigmay(i) the weighting is given
by w(i) = 1.0/ (sigmay(i)^2).
Finally, I would like to suggest some additional options to CURVEFIT.
(They are simple enough to add by individual users but I think it would
be better if RSI would standardize them.)
(1) Add a keyword determining the maximum number of iterations to
be attempted.
(2) Add a keyword giving the chi square of the final fit.
(3) Add a /DEBUG or /VERBOSE keyword giving the results of each
iteration (these are now commented lines in the code)
(4) Add a parameter to choose which parameters to hold constant and
which parameters to vary
(5) Maybe use the STATUS parameter of the INVERT function to signal
a small pivot element
|
|
|
Current Time: Wed Oct 08 15:11:04 PDT 2025
Total time taken to generate the page: 0.00557 seconds