How can I set meshsize respectively for each parameter on patternsearch?

5 ビュー (過去 30 日間)
Kei Manabe
Kei Manabe 2020 年 6 月 4 日
コメント済み: Kei Manabe 2020 年 6 月 6 日
I am trying to optimize 4 parameters of the Page test using patternsearch. However, the estimated orders of the 4 parameters are different. See the initial parameters "param0" in the code below. In particular, I would like to set the meshsize to 10 for the first parameter, 10 for the second parameter, 0.1 for the third parameter, and 0.001 for the fourth parameter. My question is that is it possible to set the different meshsize for each parameter? Thank you so much in advance.
rand1 = rand(1)*1000; rand2 = rand(1)*1000; rand3 = rand(1); rand4 = rand(1)/100;
param0 = [round(max(rand1,rand2)), round(min(rand1,rand2)), round(rand3, 2), round(rand4, 5)];
options = optimoptions('patternsearch', 'PlotFcn', 'psplotbestx', 'MeshTolerance', 1, 'ScaleMesh', false, 'InitialMeshSize',10);
A = [];
b = [];
Aeq = [];
beq = [];
nlcon = [];
lb = [1 1 0.1 1/500000];
ub = [100000 100000 10 1/25000];
fun = @do;
[param, RSS, exitflag, ~] = patternsearch(fun, param0, A, b, Aeq, beq, lb, ub, nlcon, options);

採用された回答

Alan Weiss
Alan Weiss 2020 年 6 月 5 日
編集済み: Alan Weiss 2020 年 6 月 5 日
Usually it is better to set the scale within your objective function so that the optimization parameters are all of the same order of magnitude. For example,
function f = myfun(x)
x(1) = x(1)/1000;
x(2) = x(2)/1000;
x(3) = x(3) + 1000;
x(4) = (x(4) - 1000)*1000;
% Now put your code here
end
Alan Weiss
MATLAB mathematical toolbox documentation
  1 件のコメント
Kei Manabe
Kei Manabe 2020 年 6 月 6 日
Thank you so much. It is what I wanted to do.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDirect Search についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by