Skip to main content
. 2021 Nov 9;24(2):536–551. doi: 10.1177/14680874211055546
Algorithm 1: PSO based linear kernel SVM algorithm
Result: HCCI emission model: y(u)
training data set: {u,z};
splitting data set: training {utr,ztr} , cross-validation
{ucv,zcv} , and test {uts,zts};
Random hyperparameters: CLSVM,ϵLSVM;
Run Quadratic Programming of equation (11) to calculate α  and α+;
Calculate support vector sets based on equation (13)
Calculate model based on random hyperparameters using
Equation (14)
Set PSO options: MaxIterations1 ,
MaxStallIterations2 , FunctionTolerance3 ,
 and SwarmSize4 ;
whilei MaxIterations or d5 over
MaxStallIterations FunctionTolerance
do
  Calculate cost function:
   J(CLSVM,ϵLSVM)=(1ntri=1ntr(ztr,iytr,i)2+1ncvi=1ncv(zcv,iycv,i)2)
  Run PSO algorithm to minimize J(CLSVM,ϵLSVM) and
   find hyperparameters
  Update hyperparameters: CLSVM,ϵLSVM
  Run Quadratic Programming of equation (11) to calculate α
   and α+
  Calculate support vector sets based on equation (13)
  Calculate model based on Updated hyperparameters
   using equation (14)
   i=i+1
end
1. Maximum number of iterations for optimization ( =400 ), 2. Positive integer ( =20 ), 3. Non-negative scalar: Iterations end when the relative change in cost function value over the last MaxStallIterations iterations is less than FunctionTolerance =1e6 , 4. Number of particles in the swarm =200 , 5. Relative change