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

Home » Public Forums » archive » mpfit: meaning of status flag
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
mpfit: meaning of status flag [message #53683] Thu, 26 April 2007 02:32 Go to next message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
Hi,

I'm using mpfit (actually mpfitfun) to do some fitting. Even though
the fit seems to converge properly, for all fits I get the message:
improper input perameters. Is this a problem? I must admit that I
thoughly abuse the X variable, to pass some extra information around,
but as far as I know, mpfit does not touch this variable. On the other
hand, looking at the list of possible status values, I wouldn't know
exactly what's good, and what isn't.

Maarten
Re: mpfit: meaning of status flag [message #53769 is a reply to message #53683] Tue, 01 May 2007 07:33 Go to previous messageGo to next message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
On May 1, 1:27 pm, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
> Quoth Maarten:
>
>> 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.

Thanks, I'd been looking at the mpfitfun docs, which is somewhat less
explicit. I should have thought to look at the primary source.

> 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.

I already assumed that that was the case.

Maarten
Re: mpfit: meaning of status flag [message #53771 is a reply to message #53683] Tue, 01 May 2007 06:27 Go to previous messageGo to next message
Christopher Thom is currently offline  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
Re: mpfit: meaning of status flag [message #53844 is a reply to message #53683] Mon, 07 May 2007 00:06 Go to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
Craig Markwardt wrote:
> Maarten <maarten.sneep@knmi.nl> writes:
>
>> On May 1, 1:27 pm, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
>>> Quoth Maarten:
>>>
>>>> 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.
>>
>> Thanks, I'd been looking at the mpfitfun docs, which is somewhat less
>> explicit. I should have thought to look at the primary source.
>>
>>> 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.
>>
>> I already assumed that that was the case.
>
>
> Wait, you are saying you got a return status value of 1 (success) and
> an empty ERRMSG, and yet somehow a message was printed to the screen
> that said "improper input parameters"?

No, PEBKAC. Off by one error on my part, after creating a human
readable version of the documentation header in LaTeX, the status
messages were off by one (insert bright red face here). All is fine
now (although the mismatch between the headers of mpfit and mpfitfun
is real; the mpfit header seems more readable).

Maarten
Re: mpfit: meaning of status flag [message #53846 is a reply to message #53769] Sat, 05 May 2007 22:13 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Maarten <maarten.sneep@knmi.nl> writes:

> On May 1, 1:27 pm, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
>> Quoth Maarten:
>>
>>> 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.
>
> Thanks, I'd been looking at the mpfitfun docs, which is somewhat less
> explicit. I should have thought to look at the primary source.
>
>> 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.
>
> I already assumed that that was the case.


Wait, you are saying you got a return status value of 1 (success) and
an empty ERRMSG, and yet somehow a message was printed to the screen
that said "improper input parameters"?

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Where do all those heap variables come from?
Next Topic: Add diagonal 1:1 line in a plot?

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

Current Time: Wed Oct 08 19:39:21 PDT 2025

Total time taken to generate the page: 0.00612 seconds