## nonlinear minimization with fminunc

### Daniel (view profile)

on 24 Jul 2014
Latest activity Commented on by Shashank Prasanna

### Shashank Prasanna (view profile)

on 24 Jul 2014
Hi All:
I am doing parameterization by minimizing a nonlinear target function. However, after the iteration runs, it returns the following message. And returns with the initial values for the parameters that I set.
*Iteration Func-count f(x) Step-size optimality
0 9 1.46536 7.77e+06
1 144 1.39431 1.57417e-14 5.47e+06
Local minimum possible.
fminunc stopped because the size of the current step is less than the default value of the step size tolerance.*
There is no error in the code. What do you suggest to solve this issue?
Thank you!

### Matt J (view profile)

on 24 Jul 2014

Evaluate the gradient at the initial point and see if it is close to zero. Also, call fminunc with all of its output arguments,
to get more diagnostic information.

Daniel

### Daniel (view profile)

on 24 Jul 2014
Gradient: 1.1230 -0.5735 -0.7339 -2.8473 -0.4665 -0.7594 -1.5631 -2.0650
Hessian: -0.3929 -0.0146 1.6484 1.8609 1.4881 2.0857 -0.6735 2.4585 -0.0146 1.9118 4.0316 3.6329 2.6916 2.6806 -0.9732 6.1937 1.6484 4.0316 0.3282 0.9016 1.4807 4.5981 -1.3104 3.2933 1.8609 3.6329 0.9016 3.0804 3.2111 2.4965 1.9743 0.3590 1.4881 2.6916 1.4807 3.2111 0.5078 1.3144 0.0943 1.4038 2.0857 2.6806 4.5981 2.4965 1.3144 2.8224 0.0054 1.7383 -0.6735 -0.9732 -1.3104 1.9743 0.0943 0.0054 1.2775 3.2253 2.4585 6.1937 3.2933 0.3590 1.4038 1.7383 3.2253 2.3437
How do you think?
Thanks!
Matt J

### Matt J (view profile)

on 24 Jul 2014
I'm guessing your function may not be differentiable. A local minimum of a twice continuously differentiable function should have a positive semi-definite Hessian and gradient near zero. It appears you are far from either.

### Shashank Prasanna (view profile)

on 24 Jul 2014
Edited by Shashank Prasanna

### Shashank Prasanna (view profile)

on 24 Jul 2014

The optimization stopped because size of the current step is less than the default value. However you can change the defaults.
• When the Solver Fails
• When the Solver Might Have Succeeded
• When the Solver Succeeds
There are guidelines on what you can try in each of the situations.

Daniel

### Daniel (view profile)

on 24 Jul 2014
Thanks Shashank. I actually noticed that and fixed it with changing the default step size. But now, got another message:
fminunc stopped because it cannot decrease the objective function along the current search direction.
... looked online support, feels like there is really no solution for this...