Code covered by the BSD License

# Stochastic Radial Basis Function Algorithm for Global Optimization

by

### Julie (view profile)

Solves computationally expensive black-box global optimization problems with box constraints

ComputeRBF(CandPoint,Data)
```function [RBFVALUE, NORMVALUE] = ComputeRBF(CandPoint,Data)

%--------------------------------------------------------------------------
% ComputeRBF predicts the objective function values of the candidate points
% and also returns the distance of each candidate point to all already
% sampled points
%
% Input:
% CandPoint: (Ncand x dimension) matrix with candidate points for next
%            expensive function evaluation
% Data: struct-variable with all problem information
%
% Output:
% RBFVALUE: objective function value predicted by RBF model
% NORMVALUE: matrix with distances of all candidate points to already
%            sampled points
%--------------------------------------------------------------------------

numpoints = size(CandPoint,1);%determine number of candidate points

%compute pairwise distances between candidates and already sampled points
NORMVALUE=pdist2(CandPoint,Data.S(1:Data.m,:))';

%compute radial basis function value for distances
U_Y = phi(NORMVALUE,Data.phifunction);

%determine the polynomial tail (depending on rbf model)
switch Data.polynomial
case 'none'
PolyPart = zeros(numpoints,1);
case 'constant'
PolyPart = ctail*ones(numpoints,1);
case 'linear'
PolyPart = [ones(numpoints,1),CandPoint]*Data.ctail;
temp = [ones(numpoints,1),CandPoint,zeros(numpoints,(Data.dim*(Data.dim+1))/2)];
columnpos = Data.dim+1;
for i = 1:Data.dim
for j = i:Data.dim
columnpos = columnpos + 1;
temp(:,columnpos) = CandPoint(:,i).*CandPoint(:,j);
end
end
PolyPart = temp*Data.ctail;
otherwise
disp('Error: Invalid polynomial tail.');
return;
end

%predict objective function values at candidate points
RBFVALUE = (U_Y')*Data.lambda + PolyPart;

end %function```