Fminsearch doesn't converge but MLE value doesn't change
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm maximizing a MLE in order to find the optimal parameters to approximate an unknown function. Unfortunately the function is not converging even after 60.000 iterations. These are my options:
options = optimset('Display','iter','MaxIter', 60000,'MaxfunEvals',60000,'TolFun',1e-10);
However the value of the MLE doesn't change across iterations. What does it mean? Are the parameters that the program spits out correct?
I tried with different values for TolFun e per esempio con 1e-4 la funzione converge (e sia parametri che il valore del MLE sono uguali a quelli con 1e-10).
Thank you.
采纳的回答
Ghada Saleh
2015-8-10
Hi Mic,
I understand that 'fminsearch' does not converge to a solution even though the objective function does not change value. One possibility is that the command window output display format default is short, fixed-decimal format for floating-point notation. Hence, the objective function value might be changing but you cannot see that change in the command window.
A possible workaround is to change the precision of the data displayed for the optimal objective function value. You can use 'Output Functions' to customize the output data from the optimization problem at each iteration.
To do this, follow the following steps:
1. Change the command window format display to 'long', so that you can see the maximum number of digits of your variable. You can do this by adding the following command to your script before calling the optimization function.
>> format long;
2. Set the 'Output Function' up. You specify the output function in options, such as
>> options = optimset(options,'OutputFcn',@outfun);
3. Write your own 'outfun' function. For an example on how to do this, please refer to the following link: http://www.mathworks.com/help/optim/ug/output-functions.html
4. Use the 'disp' command to display the objective function's value.
I hope this helps,
Ghada
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!