cmss Using the first and second differentials

When the function is twice differentiable and one knows how to compute its first and second differentials, still more efficient algorithms can be used (in our case, a variant of Levenberg-Marquardt). The option "d2f" allows to specify a function that returns the value of the function, the first and second differentials of the minimized function. Entering the commands :

function [c, dc, d2c] = d2foo (x)

    c = foo(x);

    dc = diffoo(x);

    d2c = diag (cos (x(:)-1) + 2/9);

end

[x,v,n] = minimize ("foo", x0, "d2f", "d2foo") 

produces the output :

x =

  1.0000 1.0000 1.0000

v = -3

n =

  34 5

This time, 34 function evaluations, and 5 evaluations of d2foo() were needed.



Søren Hauberg 2008-04-29