Cash statistic fitting bug?

From: Moritz Boeck <moritz.boeck_at_email.domain.hidden>
Date: Tue, 30 Jul 2013 18:04:40 +0200
Dear isis users,

a warning for those of you who use the Cash statistic in isis:
It seems that this statistic in combination with a gradient minimization 
algorithm (at the moment we just verified it with the lmdif and mpfit 
fit method) leads to (slightly) wrong best fit parameter values.
We (Tobias Beuchert, Natalie Hell, and myself) found this problem with 
various data sets.
In the following I will describe the problem, and a minimal example 
reproducing the error is given at the end of the e-mail.

When data is modeled in isis using the Cash statistic and the mpfit (as 
well as the lmdif) algorithm, the statistic seems to be computed 
correctly for each parameter configuration. The calculation of, e.g., 
confidence limits seems correct. Using, however, the "fit_counts" 
command will yield a parameter configuration which is (slightly to 
significantly) off the best fit values, and thus has a worse statistic. 
This error is not a random uncertainty, but can be reproduced 
systematically. It even occurs when starting from the "true" best fit 
parameter configuration. Such a worsening of the fit can be easily seen 
in the minimal example at the end of the e-mail.

So far we did not look in detail for the source of the problem. The 
easiest way for us to avoid the problem was using the Cash statistic 
with another minimization algorithm, such as the "powell" method.

We appreciate any suggestions.

Best wishes,
Moritz

In the following the minimal example, which yields the following message 
for me:
"PROBLEM: fit_counts (using Cash statistic and mpfit) worsened the fit 
statistic from 1.93287 to 2.05232"
(In case you are interested in the used program version: ISIS version 
1.6.2-18; S-Lang version pre2.3.0-102)

EXAMPLE:

variable id = define_counts ([1:6],dup+1,[2,3,7,6,1,1],sqrt(dup+0.75)+1);

set_fit_statistic ("cash");

fit_fun("gauss(1)");
set_par("gauss(1).area",   20, 0,    0, 1e5);
set_par("gauss(1).center",  3, 0,    0,  10);
set_par("gauss(1).sigma",   1, 0, 1e-5,  10);

set_fit_method ("powell");
()=fit_counts ;

set_fit_method ("mpfit");
variable stat_best_fit,stat;
()=eval_counts (&stat_best_fit);
()=fit_counts (&stat);
vmessage("\nPROBLEM: fit_counts (using Cash statistic and mpfit) 
worsened the fit statistic from %.5f to 
%.5f\n",stat_best_fit.statistic,stat.statistic);
----
You received this message because you are
subscribed to the isis-users list.
To unsubscribe, send a message to
isis-users-request_at_email.domain.hiddenwith the first line of the message as:
unsubscribe
Received on Tue Jul 30 2013 - 12:05:08 EDT

This archive was generated by hypermail 2.3.0 : Fri May 02 2014 - 08:35:47 EDT