Multistart parameter space and fval return
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
In the link below, please see section under Multistart -> Create GlobalOptimSolution Object.
It says that after Multistart reaches a stopping condition, it "creates a vector of GlobalOptimSolution". I am using multistart using the below syntax to solve a lsqnonlin problem to fit 6 parameters.
[x fval] = run(ms,problem,k)
But after multistart finishes going through all of the 'k' points, it returns just one value , the minimum value of fval that that found from 'k' different initial points and does not return a vector called 'GlobalOptimSolution' where all the values of fval are stored.
My questions are:
a)How can I get multistart to return a vector of all fvals as described in the section in the link above.
b) Is there a way I can see the kind of initial values matlab uses for the 'k' points ? I know that there are ways to give random OR custom start points but is there a way to know the initial values being used if I just specify 'k', i.e. number of initial points within given bounds to be sampled. Does MATLAB use some special code to generate 'k' values so that I can know that it is sampling the entire parameter space.
Thank you
0 件のコメント
採用された回答
Walter Roberson
2015 年 9 月 6 日
The solution vector you are looking for is the 5th output returned by run(), but you are only saving the first 2 outputs.
1 件のコメント
Alan Weiss
2015 年 9 月 8 日
[x,fval,exitflag,output,solutions] = run(...) returns a vector of solutions containing the distinct local minima found during the run.
Alan Weiss
MATLAB mathematical toolbox documentation
その他の回答 (1 件)
Abdelmoumen Bacetti
2015 年 11 月 29 日
Actually I didn't know that Matlab allows automatically running optim problems with different start points. This is why I wrote my own multistart by generating random vectors and applying the upper and lower bounds.
I save everything (random start points, their respective solutions and performance indicators) in matrices.
lb = [ 50, 1e-4, 1e-4, 1e-4, 1e-4, 1e-4];
ub = [ 10000, 1, 1, 1, 1, 1];
nvars = 6;
nr = 100;
r = rand(nvars,nr);
x0 = zeros(nvars,nr);
xlsq = zeros(nvars,nr);
resnorm = zeros(nr);
for i=1:nr
x0(:,i) = (ub - lb) .* r(:,i)' + lb;
[xlsq(:,i),resnorm(i)] = lsqnonlin(@(x)ObjFcn(x, Additional_param), x0(:,i),lb,ub,lsqoptions);
end
best = find(resnorm==min(resnorm));
best_xlsq = xlsq(:,best);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Global or Multiple Starting Point Search についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!