Failure in initial objective function evaluation. FMINCON cannot continue.
7 views (last 30 days)
Show older comments
Hey everybody. I try to implement 'Howard's policy improvement' in Matlab with erlang distribution for the transition probability law.
Every for loop has this content:
In a first step, an integral equation is solved (by Nystroem method - this part works very well and does not have any errors). In the next step, a function containing an integral has to be maximized with the function fmincon. If the maximum value is similar to the maximum value of the preceeding loop, the algorithm should stop. If this is not the case, the procedure starts again for r+1.
The weird thing about the algorithm is that it does not work for solve_equ(1, 0.99999, 2, 4, 0.5, 100) if I set maxnumber_it=100. Then it displays the error:
Error in solve_equ (line 121)
[u(r+1),maxval(r+1)] = fmincon(objfun,u0,[],[],[],[],0,x,[]);
Caused by:
Failure in initial objective function evaluation. FMINCON cannot continue.
But if I set maxnumber_it=99, it does not show any error.
Please find attached the code.
I hope someone can help me:-)
0 Comments
Accepted Answer
Walter Roberson
on 11 May 2017
Edited: Walter Roberson
on 11 May 2017
When the passed m minus maxnumber_it becomes 0, then m has been decremented all the way to 0, leaving the A_m = zero(m,m) an empty matrix; in that situation, A_m(1,:) has its leading index of 1 exceed the array size of 0.
More Answers (0)
See Also
Categories
Find more on Elementary Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!