MPFIT parameter errors -0.00000 [message #75989] |
Mon, 09 May 2011 13:35  |
Eoj
Messages: 7 Registered: June 2010
|
Junior Member |
|
|
Hello,
I was wondering about something strange that seems to be going on
with MPFIT in IDL. MPFIT seems to be working and producing a fine
looking fit, but the errors on some of the parameters are identically
-0.00000. These parameters are not limited or tied to anything at the
moment, so they should be producing some parameter error. Output is
attached below, MPFIT is ending with a "2" status. Any idea what is
going on here? This only seems to happen for a specific data file, for
other fits it seems to be working fine.
Cheers,
Joe
IDL>
% MPFIT: WARNING: data is DOUBLE but parameters are FLOAT
% MPFIT: (converting parameters to DOUBLE)
Iter 1 CHI-SQUARE = 148.65044 DOF = 99
P(0) = 2.70126E+16
P(1) = 2.02481E+16
P(2) = 32.2569
P(3) = 37.7481
P(4) = 0.000100000
P(5) = 71.0903
P(6) = 0.273900
P(7) = 0.273900
P(8) = 930.748
P(9) = 930.748
Iter 1 CHI-SQUARE = 148.65044 DOF = 99
P(0) = 2.70126E+16
P(1) = 2.02481E+16
P(2) = 32.2569
P(3) = 37.7481
P(4) = 0.000100000
P(5) = 71.0903
P(6) = 0.273900
P(7) = 0.273900
P(8) = 930.748
P(9) = 930.748
STATUS
2
PERROR
-0.00000 -0.00000 0.492911 1.38439 0.00000
0.930223 0.00000
0.00000 0.00000 0.00000
|
|
|
Re: MPFIT parameter errors -0.00000 [message #76037 is a reply to message #75989] |
Thu, 12 May 2011 20:45  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On May 12, 1:32 pm, JoeM <josephmeir...@gmail.com> wrote:
> Yup, you were right, it was a range issue. By passing through log
> values of those huge parameters the errors are now non-zero. Thanks!
OK, good.
But the second part of advice still holds true, that the *variations*
of each parameter should be comparable as well.
Craig
|
|
|
|
Re: MPFIT parameter errors -0.00000 [message #76049 is a reply to message #75989] |
Thu, 12 May 2011 10:14  |
Eoj
Messages: 7 Registered: June 2010
|
Junior Member |
|
|
On May 12, 10:31 am, Craig Markwardt <craig.markwa...@gmail.com>
wrote:
> On May 9, 4:35 pm, JoeM <josephmeir...@gmail.com> wrote:
>
>
>
>
>
>> Hello,
>
>> I was wondering about something strange that seems to be going on
>> with MPFIT in IDL. MPFIT seems to be working and producing a fine
>> looking fit, but the errors on some of the parameters are identically
>> -0.00000. These parameters are not limited or tied to anything at the
>> moment, so they should be producing some parameter error. Output is
>> attached below, MPFIT is ending with a "2" status. Any idea what is
>> going on here? This only seems to happen for a specific data file, for
>> other fits it seems to be working fine.
>
>> Cheers,
>> Joe
>
>> IDL>
>> % MPFIT: WARNING: data is DOUBLE but parameters are FLOAT
>> % MPFIT: (converting parameters to DOUBLE)
>> Iter 1 CHI-SQUARE = 148.65044 DOF = 99
>> P(0) = 2.70126E+16
>> P(1) = 2.02481E+16
>> P(2) = 32.2569
>> P(3) = 37.7481
>> P(4) = 0.000100000
>> P(5) = 71.0903
>> P(6) = 0.273900
>> P(7) = 0.273900
>> P(8) = 930.748
>> P(9) = 930.748
>> Iter 1 CHI-SQUARE = 148.65044 DOF = 99
>> P(0) = 2.70126E+16
>> P(1) = 2.02481E+16
>> P(2) = 32.2569
>> P(3) = 37.7481
>> P(4) = 0.000100000
>> P(5) = 71.0903
>> P(6) = 0.273900
>> P(7) = 0.273900
>> P(8) = 930.748
>> P(9) = 930.748
>
>> STATUS
>> 2
>
>> PERROR
>> -0.00000 -0.00000 0.492911 1.38439 0.00000
>> 0.930223 0.00000
>> 0.00000 0.00000 0.00000
>
> You might find helpful information in the FAQ, in particular...
> http://www.physics.wisc.edu/~craigm/idl/fitqa.html#parstep
>
> It looks like you have a dynamic range problem, given that they cover
> a range of 1e20!!! Consider re-writing your user function so that the
> parameter values are roughly the same magnitude, and also vary by
> about the same magnitude. (Which may mean in your case to fit an
> offset to a large value instead of the large value itself.)
>
> Also, this error message,> % MPFIT: WARNING: data is DOUBLE but parameters are FLOAT
>> % MPFIT: (converting parameters to DOUBLE)
>
> is ominous. You should strive to maintain consistent numerical
> system, either all single precision or all double precision.
>
> These suggestions will be true, no matter which fitting software you
> use.
>
> Happy fitting,
> Craig Markwardt
Thanks Mark, I'm just puzzled by the fact that the same code seems to
work beautifully on another data set, and just not this one in
particular. MPFIT does converge on the solution, which I can check in
various ways, so it is running correctly.
Will change my floats to doubles though, and convert those huge
numbers to logs to decrease the dynamic range and see if that does
something.
Joe
|
|
|
Re: MPFIT parameter errors -0.00000 [message #76058 is a reply to message #75989] |
Thu, 12 May 2011 07:31  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On May 9, 4:35 pm, JoeM <josephmeir...@gmail.com> wrote:
> Hello,
>
> I was wondering about something strange that seems to be going on
> with MPFIT in IDL. MPFIT seems to be working and producing a fine
> looking fit, but the errors on some of the parameters are identically
> -0.00000. These parameters are not limited or tied to anything at the
> moment, so they should be producing some parameter error. Output is
> attached below, MPFIT is ending with a "2" status. Any idea what is
> going on here? This only seems to happen for a specific data file, for
> other fits it seems to be working fine.
>
> Cheers,
> Joe
>
> IDL>
> % MPFIT: WARNING: data is DOUBLE but parameters are FLOAT
> % MPFIT: (converting parameters to DOUBLE)
> Iter 1 CHI-SQUARE = 148.65044 DOF = 99
> P(0) = 2.70126E+16
> P(1) = 2.02481E+16
> P(2) = 32.2569
> P(3) = 37.7481
> P(4) = 0.000100000
> P(5) = 71.0903
> P(6) = 0.273900
> P(7) = 0.273900
> P(8) = 930.748
> P(9) = 930.748
> Iter 1 CHI-SQUARE = 148.65044 DOF = 99
> P(0) = 2.70126E+16
> P(1) = 2.02481E+16
> P(2) = 32.2569
> P(3) = 37.7481
> P(4) = 0.000100000
> P(5) = 71.0903
> P(6) = 0.273900
> P(7) = 0.273900
> P(8) = 930.748
> P(9) = 930.748
>
> STATUS
> 2
>
> PERROR
> -0.00000 -0.00000 0.492911 1.38439 0.00000
> 0.930223 0.00000
> 0.00000 0.00000 0.00000
You might find helpful information in the FAQ, in particular...
http://www.physics.wisc.edu/~craigm/idl/fitqa.html#parstep
It looks like you have a dynamic range problem, given that they cover
a range of 1e20!!! Consider re-writing your user function so that the
parameter values are roughly the same magnitude, and also vary by
about the same magnitude. (Which may mean in your case to fit an
offset to a large value instead of the large value itself.)
Also, this error message,
> % MPFIT: WARNING: data is DOUBLE but parameters are FLOAT
> % MPFIT: (converting parameters to DOUBLE)
is ominous. You should strive to maintain consistent numerical
system, either all single precision or all double precision.
These suggestions will be true, no matter which fitting software you
use.
Happy fitting,
Craig Markwardt
|
|
|