I am trying to help fmincon to converge faster by supplying gradient vector and Hessian matrix. I am using interior-point algorithm and I realize that in such case, I have to supply Hessian using a call to another function which is assigned to HessFcn of my OPTIOINS. I also realize that the Hessian for fmincon is the second derivatives of the Lagrangian as described here in equation 14-1. I am supposed to use the following function definition to have access to my fitting parameters and lambda while calculating the hessian
hessian = hessianfcn(x, lambda)
From this point on I have some difficulties figuring out the procedure. First of all how should I calculate the second and third terms in equation 14-1? Also, although my problem is constrained, lambda structure is empty i.e. whenever I try to access it from hessianfcn, it returns:
lambda = eqnonlin: [0x1 double] ineqnonlin: [0x1 double]
Any idea how to fix this problem and also how to calculate second and third terms in equation 14-1?
Best Answer