Skip to main content
. 2021 Nov 9;24(2):536–551. doi: 10.1177/14680874211055546
Algorithm 2: PSO based RBF 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
 Equations (15) and (16)
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 (23)
  Calculate model based on Updated hyperparameters
   using equations (25) and (26)
   i=i+1
 end
1. Maximum number of iterations for optimization ( =600 ), 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