How to determine Simplex using Nelder-Mead Algorithm in all direction?

Dear All, how can I determine all the possibles simplexes while working with Nelder-Mead Algorithm? Please have a look into the illustrated picture along with codes.
function [xMin] = NMS2(objfunc,x0,alpha,beta,gamma,varargin)
N = length(x0);
% Initializing the simplex
smp = repmat(x0,1,N+1);
smp(:,2:end) = smp(:,2:end) + eye(N);
% Identify the vertices
fval = feval(objfunc,smp,varargin{:});
iter = 0;TOL = 1e-8; maxIter = 500*N;
while iter <= maxIter
% sort function values in ascending order
[fval,I2] = sort(fval);
smp = smp(:,I2);
v0 = smp(:,1);
f0 = fval(1);
fStd = std(fval);
distv0 = max(max(abs(repmat(v0,1,N)-smp(:,2:end))));
if fStd < TOL && distv0 < TOL
break;
end
vn = smp(:,N+1);
fn = fval(N+1);
%calculate the centroid over all vertices vi ~= vn
vert = mean(smp(:,1:N),2);
This is the partial code along with stopping condition.

2 件のコメント

James Tursa
James Tursa 2020 年 2 月 10 日
I don't understand the question. What do you mean by "determine all the possible simplexes"?
Julkar_Mustakim
Julkar_Mustakim 2020 年 2 月 12 日
Dear James Tursa, If you have a look into the picture you will understand what I meant. Usually we find the simplex based on three points (V0,V1 & V2). But in this case the intial simplex could be any three points in any direction where "V0" is fixed but "V1 and V2" could be anywhere around "V0" like the way it is mentioned in the picture. I hope, I clarified the method. Thank you.

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

回答 (1 件)

James Tursa
James Tursa 2020 年 2 月 12 日
編集済み: James Tursa 2020 年 2 月 12 日

0 投票

The Nelder-Mead Simplex Method is an adaptive method that adjusts the lengths and directions dynamically. The vertices could be anywhere on your plot above (and outside of it), not just at the square corner points and mid-points. So your desire to determine all possible simplexes simply doesn't make sense for this algorithm. There are an infinite number of them and an infinite variety of shapes and sizes.

1 件のコメント

Julkar_Mustakim
Julkar_Mustakim 2020 年 2 月 14 日
Dear James, thanks for your answer. So it is possible to assign the points statically instead of dynamically around the point "V0"? Thank you.

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

カテゴリ

ヘルプ センター および File ExchangeOptimization Toolbox についてさらに検索

製品

リリース

R2018a

質問済み:

2020 年 2 月 7 日

コメント済み:

2020 年 2 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by