## 2 Methodology
### IPSO-LSSVM Model
#### 2.2.3 IPSO Algorithm Principle  
The particle searches iteratively with a quick convergence velocity for the global optimum at the beginning of the PSO algorithm. However, the velocity of convergence will decrease gradually with the iterative process. If the particle meets a local optimum, all particles' velocities will eventually reach zero, and the swarm's evolution will come to an end. To address the issue of the local optimum of the PSO algorithm being easily trapped, an improved particle swarm optimization (IPSO) algorithm is proposed to avoid falling into the local optimum. Improvements were achieved in the following three aspects:  
1. Generation of the initial swarm  
The generation of the initial swarm is random. The likelihood of obtaining the global optimum is usually small since the particles are always not evenly dispersed in space. If too many particles are used, the optimization time and cost will be increased. Therefore, the swarm will almost certainly enter the local optimum if the limited number of particles cannot be dispersed over space. The average particle distance is defined as follows:  
\[D(t)=\frac{1}{mH}\sum_{i=1}^{m}\sqrt{\sum_{d=1}^{n}\left(P_{id}-\overline{P}_{ d}\right)^{2}} \tag{13}\]  
where \(H\) is the length of the search space's longest diagonal; \(n\) is the search space's dimensionality; \(\overline{P}_{d}\) is the average of all particle locations' coordinates in the \(d\)-th dimension; and \(m\) is the number of particles in the swarm. The average particle distance reflects the aggregation degree of distribution among particles. The smaller the \(D\) (\(t\)), the denser the swarm. 2. Determination of premature convergence  
The overall fitness change in all particles can be used to identify the state of the swarm because a particle's position affects its fitness. If \(\overline{f}\) is the current average fitness of the swarm and \(f_{i}\) is the present fitness of particle \(i\), then the following definition can be used to describe the fitness variance of the swarm:  
\[\psi^{2}=\sum_{i=1}^{m}\left(\frac{f_{i}-\overline{f}}{f}\right)^{2} \tag{14}\]  
where \(f\) is a normalized scaling factor. The value formula is:  
\[f=\left\{ \begin{array}{ll}\max\left|f_{i}-\overline{f}\right|,\max\left|f_{ i}-\overline{f}\right|>1\\ 1,&\text{other}\end{array} \right. \tag{15}\]Fitness variance reflects the degree of particle aggregation. The smaller the \(\psi^{2}\), the denser the swarm. The fitness of all particles tends to be consistent with the iterative process, so the \(\psi^{2}\) becomes smaller and smaller. If \(\psi^{2}\) is lower than a certain threshold, we can consider that the PSO algorithm enters the post-search phase. The swarm will easily become stuck in local optimum solutions at this time, leading to premature convergence. Improvement of inertia weight coefficient and learning constants  
\(\tau\) reflects the degree to retain the last iteration velocity. During the early search period, a large value is beneficial to the global searching ability. During the later search period, the low value is beneficial to the local searching ability. To balance the global searching ability and local searching ability, an inertia weight coefficient decreasing in parabolic form was proposed:  
\[\tau=(\tau_{\max}-\tau_{\min})\bigg{(}\frac{k}{k_{\max}}\bigg{)}^{2}+(\tau_{ \min}-\tau_{\max})\bigg{(}2\frac{k}{k_{\max}}\bigg{)}+\tau_{\max} \tag{16}\]  
where \(\tau_{\max}\) and \(\tau_{\min}\) represent the maximum value and the min value of inertia weight coefficient, respectively. The \(\tau_{\max}\) and \(\tau_{\min}\) are generally accepted as: \(\tau_{\max}=0.9\) and \(\tau_{\min}=0.4\)[29]; \(k\) is the number of iterations; and \(k_{\max}\) is the maximum number of iterations. \(C_{1}\) represents the particle's judgment of the best moving direction and represents the particle's judgment affected by other particles. During the early search period, the value of \(C_{1}\) should be large and the value of \(C_{2}\) should be small to enhance the particle's global search ability.