I am trying to use a fitting function that consists of a sum of 20 cosine functions of the form [0]*exp(-x/[1])*( 1.0+[2]*cos([3]*x-[j]))
. The order of magnitude for the parameters are 10^5 for p0
, 10^1 for p1
, 10^-1 for p2
, 10^0 for p3
, and 10^-3 for p[i]
. The fit converges, but it strongly depends on the initial values for p[i]
parameters.
If my initial guess is 0 for all of the parameters p[i]
the result is:
FCN=4750.84 FROM MIGRAD STATUS=CONVERGED 2101 CALLS 2102 TOTAL
EDM=5.58924e-08 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 0.9 per cent
But if my initial guess is closer to the real values, the result is
FCN=4712.66 FROM MIGRAD STATUS=CONVERGED 1835 CALLS 1836 TOTAL
EDM=9.18336e-07 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 0.1 per cent
Is there a way to make MIGRAD get closer to the real values of p[i] without stopping the minimizer algorithm?