How to use fmincon for multivariable optimisation of a cost function with different levels of sensitivity to different variables?
13 ビュー (過去 30 日間)
古いコメントを表示
Dear all,
In short I would like to know if it is possible to define the DiffMinChange option in fmincon so that in a multivariable optimisation different DiffMinChange options are used for the different variables? And if so how this should be implemented.
A more complete explanation:
I am simulating a 6 degree of freedom system, where each degree of freedom is characterised by a single variable. These variables determine the motion in each degree of freedom. I am trying to optimise the variables so that a predicted motion in each direction matches the measure motion in the corrisponding direction. To do this I have been using fmincon to optimise the variables by minimising the cost function, which I have defines as the sum of the squared error (measured-predicted motion).
Until now I have been optimising a single variable at a time and changing the DiffMinChange option to help guide the step size fmincon used to find the optimal solution. Doing this I was able to drastically reduce the number of iterations. I am now trying to optimise all 6 variables simultaneously, however the cost function is highly sensitive to certain variables while much less sensitive to others. Therefore I am trying to implement different DiffMinChange values for different variables so that I can encourage fmincon to take larger steps for the variables which do not affect the cost function rapidly and small steps for the variables which have a large effect on the cost function. Is it possible to specify different DiffMinChange values for the different variables or would I need to consider a different optimisation function?
I have tried to assign a 1x6 matrix to DiffMinChange (in the same way you assign a matrix of variables to be optimised) but this does not work as DiffMinChange requires a real non-negative scalar.
Thanks,
Samuele
0 件のコメント
採用された回答
Alan Weiss
2021 年 7 月 13 日
Usually you should not use DiffMinChange. The more recent version of the option is FiniteDifferenceStepSize. That option accepts a vector value. You might also consider changing the FiniteDifferenceType option to 'central' to obtain more accurate estimates.
You probably know that these options only affect the solver in terms of estimating the gradient by finite differences. They do not directly control the step sizes that fmincon takes.
Finally, I hope that you are using optimoptions to set your options. If not, please change your code.
Alan Weiss
MATLAB mathematical toolbox documentation
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Problem-Based Optimization Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!