## 4 Principle of Particle Swarm Optimization (PSO)  
The Particle Swarm Optimization (PSO) algorithm is a parameter optimization algorithm based on swarm intelligence. Compared to traditional parameter optimization methods, the PSO algorithm is simple to implement and has high optimization efficiency. It greatly reduces the optimization time and improves the convergence speed through information sharing and transmission. It was first proposed by [PERSON] and [PERSON] [42] in 1995, inspired by the study of bird flocking behavior. In the PSO algorithm, each solution in the objective space is represented by a bird (particle), and the optimal solution of the problem is analogous to the food source that the bird flock seeks. During the process of finding the optimal solution, each particle exhibits individual behavior as well as collective behavior. Each particle learns from the flying experiences of its companions and incorporates its own flying experiences to locate the optimal solution. Two values are learned by each particle: the individual's historical best value and the group's historical best value. The particle adjusts its velocity and position based on these two values, and the quality of each position is determined by the fitness value. The flowchart of the PSO algorithm is depicted in Figure 8.  
Figure 8: Flowchart of the PSO algorithm. The detailed parameter optimization steps are as follows:  
* **Step 1:** Initialize the parameters of the particle swarm, such as the swarm size, particle dimension, number of iterations, inertia weight, etc. * **Step 2:** Initialize the position and velocity of each particle. In a \(D\)-dimensional target search space, a particle swarm consists of \(N\) particles, where each particle is a \(D\)-dimensional vector, and its spatial position represents a solution in the target optimization problem, denoted as \[x_{i}=(x_{i1},x_{i2},\ldots,x_{iD}),i=1,2,\ldots,N.\] (7) The flying velocity of the \(i\)-th particle is also a D-dimensional vector, denoted as \[v_{i}=(v_{i1},v_{i2},\ldots,v_{iD}),i=1,2,\ldots,N.\] (8) The positions and velocities of particles are randomly generated within a given range. * **Step 3:** Calculate the fitness value based on the fitness function. The fitness function represents the objective function of the optimization problem, which can be the mean square error, variance, standard deviation, etc. * **Step 4:** Update the historical best fitness value and position for each individual and the entire swarm. For each particle, compare its fitness value with its historical best fitness value. If the current fitness value is better, update it as the individual's historical best value. Then, compare its fitness value with the fitness value of the best position experienced by the entire swarm. If the current fitness value is better, update it as the swarm's historical best value. * **Step 5:** Determine if the termination condition is met (reaching the maximum number of iterations or the minimum difference in fitness value between two consecutive iterations). If the termination condition is met, output the optimal position. Otherwise, update the position and velocity of each particle and repeat steps 3-4. The velocity update formula is as follows: \[v_{ij}(t+1)=v_{ij}(t)+c_{1}r_{1}\Big{(}p_{bestij}(t)-x_{ij}(t)\Big{)}+c_{2}r_{2 }\Big{(}g_{bestj}-x_{ij}(t)\Big{)},\] (9) where \(v_{ij}(t)\) is the velocity of particle \(i\) in the \(j\)-th dimension at time \(t\). The subscript \(i\) represents the \(i\)-th particle, the subscript \(j\) represents the \(j\)-th dimension of the particle, which corresponds to the \(j\)-th parameter optimized by the algorithm, and \(t\) represents the current iteration count. \(c1\) and \(c2\) are acceleration constants, usually taken in the range of 0 to 2. \(r1\) and \(r2\) are two independent random numbers that vary between 0 and 1. \(p_{bestij}(t)\) is the historical best solution of particle \(i\) in the \(j\)-th parameter at time \(t\), and \(g_{bestj}\) is the historical best solution of all particles in the \(j\)-th parameter.