optimization: have function return NaN but not at initial point
15 ビュー (過去 30 日間)
古いコメントを表示
I use fmincon interior-point algoritm to solve my optimization problem.
Based on Matlab's recommendation, I let my function return NaN if the objective function can not be evaluated for given parameters to indicate fmincon to try a different set of parameters. This works very well at intermediat iterations...
I got the following error:
"Errror using barrier. Objective function is undefined at initial point. Fmincon can not continue."
However, if I do not return NaN, fmincon, for whatever reasons, can solve the optimization problem even if the initial point is not correctly evaluated. Indeed, I observe this for many start vectors.
Anyway, is there a way to return NaN in my function always, except at the evaluation of the initial point? That is, figuring out (somehow) when my function is called with the initial point?
0 件のコメント
採用された回答
Matt J
2023 年 3 月 4 日
編集済み: Matt J
2023 年 3 月 4 日
Setting the objective to NaN should not be seen as a substitute for constraints. If there is a region where your objective function cannot be evaluated, you still have to specify appropriate constraints so that the algorithm knows to avoid that region.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Nonlinear Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!