HFITHN and HFITGA ..


The original question was:

I used both HFITHN and HFITGA routines to fit a Gaussian, for instance:

  CALL HFITHN(1017,'G',' ',3,PAR,STEP,PMIN,PMAX,SIGPAR,CHI2)

CALL HFITGA(1017,C,AV,SD,CHI2,IC,SIG)

I didn't obtain the same result. Why, I guess these two calls are equivalent, aren't they ?


The HI/FIT command with the option G uses HFITGA so it is not surprising that we get the same result in PAW and with HFITGA. The HFITHN routine is supposed to be able to handle simple formulae like G+P or E*G-P, like the H/FIT command. But in that case the code used is not the same. In particular in the case of HFITHN, a protection is made in case the 3rd parameter of a Gaussian is 0 (to avoid a division by zero) in this particular case the value of this parameter is set to 1.

To avoid the problem encountered here, the initial values of the parameters should not be equal to zero. For example, do something like:

       dimension par(3),step(3),pmin(3),pmax(3)
       par(1) = 1.
       par(2) = 1.
       par(3) = 1.
       CALL HFITHN(10,'G',' ',3,PAR,STEP,PMIN,PMAX,SIGPAR,CHI2)
 
and HFITHN will give the same result as HFITGA.


Release NotesKnown bugsFAQsContributionsTutorialReference manualDown loadMiscellaneous

Paw.Support@cern.ch