MPFIT [message #63341] |
Wed, 05 November 2008 08:17  |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
Hi all
Hi Craig ;-)
Every once in a while, when using mpfit with box constraints on some
of the parameters, I run into the same problem: I get X+F convergence
while the model clearly doesn't fit well to the data.
Today it happened again. I noticed that the last alpha (fraction of
the LM-step) equals to 1.4e-017 which makes the actual and predicted
reduction of the Chi-Square very small, causing the X and F
convergence criteria to be fulfilled.
If alpha is so small, this means that a parameter got close to the
boarder in a previous iteration (in my case 1.1e-016, while the lower
boarder = 0). When it gets that close, it should have been picked up
by this piece:
---begin snip mpfit.pro---
;; Adjust the final output values. If the step put us exactly
;; on a boundary, make sure it is exact.
sgnu = (ulim GE 0)*2d - 1d
sgnl = (llim GE 0)*2d - 1d
wh = where(qulim AND wa2 GE ulim*(1-sgnu*MACHEP0), ct)
if ct GT 0 then wa2[wh] = ulim[wh]
wh = where(qllim AND wa2 LE llim*(1+sgnl*MACHEP0), ct)
if ct GT 0 then wa2[wh] = llim[wh]
---end snip mpfit.pro---
But it didn't because llim is zero in my case. Am I right in saying
that this needs fixing (llim + or - something instead of
multiplication)?
Additionally, how small can alpha be before causing actred and prered
to be less than FTOL and causing false convergence? When determining
alpha, one could then limit it to this smallest value and all steps
that cause parameters to go outside their box would be put on the
boarder in the code-snip above.
Wout
|
|
|