Re: mpfit: meaning of status flag [message #53771 is a reply to message #53683] |
Tue, 01 May 2007 06:27   |
Christopher Thom
Messages: 66 Registered: October 2006
|
Member |
|
|
Quoth Maarten:
> On Apr 27, 6:32 pm, Craig Markwardt wrote:
>
>> As you suspect, neither MPFIT nor MPFITFUN touches the "X" values. As
>> I note on my FAQ, check the ERRMSG keyword for a text description of
>> the problem. Usually you have specified a model parameter outside of
>> its limits or something like that.
>
> the errmsg string is empty, at least on the output that I've managed
> to generate. All I have is the status variable equal to 1, and the
> model parameters are within the limits, I checked that first.
>
> A plot of the fit looks OK, and the residuals seem to be fine, so I
> suspect it is OK, but the documentation is a bit vague: "STATUS: an
> integer status code is returned. All values other than zero can
> represent success." So I might be successful, but I'm certainly a bit
> uncertain right now ;)
The documentation in mpfit.pro is pretty explicit.
==============
; STATUS - an integer status code is returned. All values greater
; than zero can represent success (however STATUS EQ 5 may
; indicate failure to converge). It can have one of the
; following values:
;
; -16 a parameter or function value has become infinite or an
; undefined number. This is usually a consequence of
; numerical overflow in the user's model function, which
; must be avoided.
;
; -15 to -1
; these are error codes that either MYFUNCT or ITERPROC
; may return to terminate the fitting process (see
; description of MPFIT_ERROR common below). If either
; MYFUNCT or ITERPROC set ERROR_CODE to a negative number,
; then that number is returned in STATUS. Values from -15
; to -1 are reserved for the user functions and will not
; clash with MPFIT.
;
; 0 improper input parameters.
;
; 1 both actual and predicted relative reductions
; in the sum of squares are at most FTOL.
===============
A return status of 1 means that everything is working ok, and that the
routine seems to have found the minimum. If your fit looks ok, and the
errors seem reasonable, then your work here is done.
cheers
chris
|
|
|