Failure in initial objective function evaluation. FMINCON cannot continue.

7 Ansichten (letzte 30 Tage)
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:-)

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Mai 2017
Bearbeitet: Walter Roberson am 11 Mai 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.

Weitere Antworten (0)

Kategorien

Mehr zu Elementary Math finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by