LMFIT [message #18206] |
Sat, 11 December 1999 00:00 |
Alberto Verga
Messages: 3 Registered: April 1999
|
Junior Member |
|
|
I tried the following example on the use of LMFIT given in the IDL 5.2
help:
FUNCTION myfunct, X, A
bx = A[0]*EXP(A[1]*X)
RETURN,[ [bx+A[2]+A[3]*SIN(X)], [EXP(A[1]*X)], [bx*X], $
[1.0] ,[SIN(X)] ]
END
X = FINDGEN(40)/20.0
Y = 8.8 * EXP(-9.9 * X) + 11.11 + 4.9 * SIN(X)
sig = 0.05 * Y
A = [10.0, -0.1, 2.0, 4.0] fita = [1,1,1,1]
PLOTERR, X, Y, sig
coefs = LMFIT(X, Y, A, WEIGHTS = (1/sig^2.0), FITA = fita, $
FUNCTION_NAME = 'myfunct')
OPLOT, X, coefs
I obtained
% LMFIT: Warning: Failed to Converge.
and in consequence a bad fit!
Does anyone known if this LMFIT is correctly implemented?
--
Alberto Verga - verga@marius.univ-mrs.fr
Institut de Recherche sur les Ph�nom�nes Hors Equilibre.
12, av. G�n�ral Leclerc, 13003 Marseille, France.
Tel: 33 (0) 4 91 64 44 76 - Fax 33 (0) 4 91 08 16 37
|
|
|