Re: MPFIT and initial Guesses [message #87993 is a reply to message #87986] |
Mon, 10 March 2014 22:11  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Monday, March 10, 2014 12:32:35 PM UTC-4, Steve Kaeppler wrote:
> However, I have found that the resulting parameter estimates change depending upon the initial guesses put in. I have tried to implement doing a small grid search on one of the parameters and then using the lowest chi square value from that grid search as the initial guess. I know that Levenberg-Marquardt routines do not converge to a global solution, but I am concerned that there are multiple local solutions that produce similar values of chi-squared.
The only way to guarantee the global minimum solution is an exhaustive grid search.
In a complicated chi-square space, choosing appropriate initial parameter values may be the most difficult part of the problem.
> I have tried to manually play with setting various step sizes in the parameters. Is there a location within the code or a parameter I could set which would allow me to see what the step size is? I am concerned I am either setting the step sizes too large or too small.
If you use .STEP or .RELSTEP, then you have manual control over the step size. If you don't set it, then it basically uses a step size of 1D-8 times the parameter value. I.e. the default is .RELSTEP=1D-8 for double precision parameters (1E-4 for single precision).
> A second question, which may be harder to answer, how close does the initial guess need to be to obtain a global minimum or something close? I suspect this has to do with how well defined the problem is.
As you say, L-M solutions are not guaranteed to find a global minimum. So basically, your initial conditions have to be within the "watershed" that includes the global minimum.
> Also, why is there this sudden abrupt shift in the last set of variables.
If you are computing numerical derivatives, MPFIT adjusts each parameter by .STEP / .RELSTEP to estimate the derivative. That is why you are seeing each vary in turn. This is not a search. It's just a mechanistic tallying of derivatives. After that is done, MPFIT computes a direction and then minimizes along that direction, which you could call a search. After minimizing along a line, then MPFIT goes back and recomputes new derivatives again! (and this repeats until convergence)
> All I am wondering is whether I can get some of these 'initial steps' in the > first iteration of the routine to be larger from the start. How do I do
> that? Does it involve setting the parameter information differently?
I think you already know now that you can choose this with .STEP and .RELSTEP, but these will only change how the derivatives are estimated.
Your example gives .RELSTEP=0.25. I think this is going to be way too big (but it is problem dependent). Your choice of .STEP and/or .RELSTEP should provide MPFIT a step size which is big enough to avoid round off error and small enough to capture the smallest variation of the function value.
Just one more comment: the fit will converge faster if you can remove .LIMITS constraints.
Craig
|
|
|