mpfit debugging [message #90140] |
Fri, 30 January 2015 16:34  |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
I'm debugging a program that does a sequence of mpfit calls, where I fix different parameters in different calls. This is mpfit.pro directly, not mpfitfun etc., so the MYFUNCT function returns the difference between measured samples and model data. I also limit some of the parameters.
By making various errors, so far I've noticed that
* if I forget to make the model data real (there are FFTs involved) the report after each iteration has two lines that begin with "Iter", one with the current iteration number followed by "chi-square" and "dof" and one with some other number that does not change from iteration to iteration and is not followed by chi-square" and "dof". (Something like that, it's been a couple of weeks since I fixed this bug.)
* if my initial parameter array has values that are outside the specified limits, mpfit just returns the initial parameters without writing an "Iter" report and without even calling MYFUNCT once.
But what could cause the following behavior?
It writes the initial "Iter 1" report, calls MYFUNCT a bunch of times to calculate the derivatives, then writes an identical "Iter 1" report, and returns the initial parameters as the answer.
I should add that these initial parameters do not happen to be the optimum. I tried again with slightly different values for some of the non-fixed initial parameters, a different chi-square was printed in the "iter 1" report but the behavior was the same.
Does this ring a bell with anyone? What kind of bug should I look for?
/Mats
|
|
|