2d fit problem

From: Jeffrey Reid (jgreid@u.washington.edu)
Date: Thu Jan 27 2000 - 21:47:43 MET


I am trying to fit a 2d histogram using the following user-defined
function:

Double_t fitf(Double_t *x ,Double_t *par) {
   Double_t k = x[0]+x[1];
   Double_t q = x[0]-x[1];

   Double_t kPower = 2.5;
   Double_t qPower = 2.5;

   Double_t fitval = par[0]+par[1]*pow(k,kPower)+par[2]*pow(q,qPower);

   return fitval;
}

I have no problems at all as long as kPower and qPower are integers.

However, when (as above) the powers I specify for k and q are non-integers 
the fit fails:

 FCN=NaN FROM MIGRAD    STATUS=CALL LIMIT    522 CALLS         523 TOTAL
                     EDM=NaN    STRATEGY= 1      NO ERROR MATRIX       
  EXT PARAMETER               CURRENT GUESS       STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Offset               NaN   3.00000e-01           NaN           NaN
   2  kCoeff               NaN   4.00000e-02           NaN           NaN
   3  qCoeff               NaN   4.00000e-02           NaN           NaN

I suspect it is a problem in calculating the derivative, but it seems that
it ought to be able to sucessfully calculate such a simple derivative.

Does anyone know what the problem might be?  

---------------------------------------------------------------------
Jeffrey G Reid  |  jgreid@u.washington.edu  |  UW Nuclear Physics Lab
=====================================================================



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:17 MET