Hi Olaf,
The interface of your functions and the way you call nonlin_curvefit
seem ok. The code inside f_dfdp() doesn't seem ok. I don't think the
documentation of the optim package contains an example for explicitly
computing a Jacobian with m-code (because this is not specific to the
optim package). But in the code of 'optim_problems.m' there is an
example:
ret.curve.schittkowski_327.dfdp = ...
@ (x, p) [1 + exp(-p(2) * (x - 8)), ...
(p(1) + .49) * (8 - x) .* exp(-p(2) * (x - 8))];
Note that 'x' (or 't', in your code) is a column vector.
Thanks a lot for your help.
Function APIs of that example are:
ret.curve.schittkowski_327.f = @(x, p) ......
ret.curve.schittkowski_327.dfdp = @(x, p) ......
while nonlin_curvefit has @(p, x). Should the partial derivative dfdp
function for nonlin_curvefit be @(x, p), or @(p, x)?