필터 지우기
필터 지우기

Multistart parameter space and fval return

조회 수: 1 (최근 30일)
Soham
Soham 2015년 9월 5일
답변: Abdelmoumen Bacetti 2015년 11월 29일
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

채택된 답변

Walter Roberson
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
Alan Weiss 2015년 9월 8일
To expand on what Walter said, take a look at the last listed syntax for MultiStart run:
[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
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);

카테고리

Help CenterFile 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!

Translated by