help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom jacobian (dfdp) in nonlin_curvefit - calling parameters?


From: Pavel Hofman
Subject: Re: Custom jacobian (dfdp) in nonlin_curvefit - calling parameters?
Date: Tue, 19 Nov 2019 00:00:25 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0


Dne 18. 11. 19 v 18:39 Olaf Till napsal(a):

'dfdp'
      Function computing the Jacobian of the residuals with respect to
      the parameters, assuming residuals are reshaped to a column vector.

So for calculating the Jacobian, assume that the array returned by 'f'
is reshaped to a column vector (as with array(:)). So the Jacobian is
2D.

(The differences between nonlin_curvefit and nonlin_residmin do not
affect this.)


Now my f returns one vector column (first half output of the first function, the second half output of the second function).

The default dfdp of minimum differences works perfect. The sum of errors is 1e-17 in about 7 iterations.

sum((y - model_values).^2) with 2000 values.


My dfdp is IMO correct now, I checked several times. Yet I never get more than 3 iterations, with the sum of errors about 1e-10 which is too inprecise for my case.

I configured:

settings = optimset ('dfdp', fDfdp, 'TolFun', 1e-17, 'TolX', 1e-17, 'Display', "iter");


No change, always only 2 - 3 iteration. I am listing dfdp output before leaving the function and values in the four columns of dfdp output make sense.

Please could the real-finite differences DFDP do someting significantly different than a custom dfdp in terms of settings and tolerances? I did not see anything in __nonlin_residmin__ nor in __lm_svd__ when stepping through the code in debugger.

My custom dfdp worked great for values of <0, 1>. But when I am fitting to values < 1e-7 (incl. p values), the custom dfdp is significantly worse than the finite differences. All calculations performed in double.

I can stay with the finite differences, but wanted to try if a custom dfdp would further improve the precision since even tiny imprecisions are important in my project.

I very much appreciate any recommendation for further troubleshooting.

Regards,

Pavel.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]