Failure in initial objective function evaluation. FMINCON cannot continue.

7 visualizaciones (últimos 30 días)
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:-)

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Mayo de 2017
Editada: Walter Roberson el 11 de Mayo de 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.

Más respuestas (0)

Categorías

Más información sobre Elementary Math en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by