Fmincon makes an extremely big jump in parameter search

2 ビュー (過去 30 日間)
hey yo
hey yo 2022 年 6 月 19 日
コメント済み: hey yo 2022 年 6 月 20 日
Hello,
I run the attached code "mainfnc_up3_noL3.m". The code loads the (attached) data, simulates random variables, and uses the data and the simulated random variables to run an fmincon function with 8 parameters.
The fmincon function calls mainlf3.m, which evaluates the likelihood function llf_up13.m for each set of 20 simulated random variables. Then it finds the average likelihood function. Fmincon is supposed to minimize this likelihood function.
I find that fmincon makes a very strange jump. In the below image, you can see the values of the parameters after each iteration. In column J, the parameters suddenly explode, which makes the likelihood function NaN.
I would appreciate any help for understanding what I'm doing wrong with this code.
Thank you.
  2 件のコメント
Torsten
Torsten 2022 年 6 月 19 日
I think you included the wrong .xlsx file.
hey yo
hey yo 2022 年 6 月 20 日
Thank you for noticing. I fixed it.

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2022 年 6 月 19 日
編集済み: John D'Errico 2022 年 6 月 19 日
I think you do not understand how an optimization tool works.
Those first calls to your objective are there to differentiate it. As you can see, it makes a TINY change to the objective. It changes each variable by a small amount. Then using the resulting gradient information, it makes a step.
If that large step, based on what it sees in the gradient are a problem, then you should be setting constraints on the space where it is allowed to search. Surely if you created the objective function, then you can see where there will be problems in the evaluation threof. Bound the solver away from the bad places.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by