I am new to Particle Swarm Optimization and trying to write a code in octave.
swarm_size=10; %number of the swarm particles
maxIter = 50; %maximum number of iterations
inertia = 1.0; %i dont know what it does
correction_factor = 2.0 ; % i dont know what it does too
X=csvread('batting_data.csv'); %load file into octave
x=X(:,2:columns(X));
D=reshape(x,[],2);
plotObjFcn=1; %make it 0 if you dont want to plot a grpah
for i =1: columns(x)
local_best=mean(x(:,i));
particle_init=x(randi(x(:,i),1,swarm_size),
initial_vel=0;
end
Now having reached here i need to have an objective function (I am hoping that i am correct till here) The data i have used here can be downloaded from
www.amstat.org/publications/jse/v21n3/scariano/batting_data.csv
Now i am not getting how to write an objective function to maximize value in each column. and at the end i want these five values in matrix form.
Help is deeply appreciated and if you find that my concepts are not correct kindly enlighten me