The basic idea of the particle swarm iteration-based cuckoo hybrid search optimization algorithm is in the iterative process of n particle swarms, the PSO algorithm is used to update the velocity and position of the particles in each generation to obtain the optimal position of a group of particles, and then the optimal particle position is entered into the CS algorithm to continue to iteratively update. Based on the number of iterations of the original algorithm, each particle swarm adds 1 update and calculation of the CS algorithm, and there is little change in the running time.
Given \(m\) individual forecasting models, each assigned a corresponding weight denoted as \({w}_{i}(\text{1,2},\dots ,m)\), the combined forecast can be expressed as
$$\begin{array}{c}{\widehat{y}}_{\text{combined }}={\widehat{y}}_{1}*{w}_{1}+{\widehat{y}}_{2}*{w}_{2}+\cdots +{\widehat{y}}_{m}*{w}_{m} \left(1\right)\end{array}$$
For optimal weight assignment of combined models, determining the weights of each individual prediction model is critical. In this study, the corresponding weights for each individual model are estimated by constructing an optimisation problem that minimises the error between the combined predicted and observed values.
Thus, an optimization problem estimating the reasonable weight of each individual model is construed as below:
$$\begin{array}{c}Min G\left(y-{\widehat{y}}_{\text{combined }}\right) s.t.\sum _{i=1}^{m}{w}_{i}=1 \left(2\right)\end{array}$$
where \(G\) is a predetermined function such as sum squared (SSE),mean squared (MSE), sum absolute (SAE), mean absolute (MAE),etc., \(y\) is observed value.
The proposed PSO-CS weight assignment method is based on an improved CS algorithm, namely the PSO-CS algorithm. The CS algorithm, inspired by cuckoo’s brood parasitic behavior, is a new population-based search paradigm. Cuckoos seek out nests of other hosts and then lay their eggs, which may be found and discarded by the hosts. To enhance the survival rate of their eggs, cuckoos can imitate the host’s eggs, or even take them out. The CS algorithm is efficient, robust, and relatively simple in comparison with other evolutionary computing algorithms due to its few control parameters. Furthermore, the levy flight instead of standard random walk is applied in CS, this helps to explore the huge solution space compared to the linear relationship, due to its infinite mean and variance, as well as nonlinear relationship. However, the huge exploration space of the CS algorithm may lead to poor convergence and accuracy of solutions, so the PSO algorithm is introduced to optimize the CS algorithm. The proposed PSO-CS weight assignment method can be expressed as follows:
Define the objective function \(F\left(w\right)={\sum }_{i=1}^{n} y-\left|{\stackrel{\prime }{y}}_{n}\text{*}{x}_{n}\right|\), where \({x}_{n}\) is the value of the weight coefficient, \({\stackrel{\prime }{y}}_{n}\) is the \(n\) th individual forecasting model, and \({\sum }_{i=1}^{n} {x}_{i}=1\).
Parameters such as population size \(N\) Maximum number of iterations \(T\), minimum weighing value \({w}_{\text{m}\text{i}\text{n}}\) Maximum weight \({w}_{\text{m}\text{a}\text{x}}\), acceleration coefficients \({c}_{1}\) and \({c}_{2}\), maximum discovery, and probability \({p}_{a}\in \left[\text{0,1}\right]\). A set of randomly generated host nests \({X}_{i}=\left\{{x}_{i1},{x}_{i2},\dots ,{x}_{iD}\right\}\) and the corresponding velocities \({V}_{i}=\left\{{v}_{i1},{v}_{i2},\dots ,{v}_{iD}\right\}\) and host nests \({X}_{i}(i=\text{1,2},\dots ,N)\) to its location in the \(D\)-dimensional space is a potential solution to the problem. In the\(t\) iteration, the update speed of the first \(i\) The first nest is built by optimizing the location of the first \(i\) The first nest.
$$\begin{array}{c}{pbes\text{t}}_{i}^{\left(t\right)}=\left\{{pbest}_{i1}^{\left(t\right)},\dots ,{pbest}_{i,D}^{\left(t\right)}\right\} \left(3\right)\end{array}$$
and the optimal position for the entire population \(gbes{t}^{\left(t\right)}\), and then update the nested positions.
$${v}_{ij}^{\left(t+1\right)}=w\times {v}_{ij}^{\left(t\right)}+{c}_{1}\times {rand}\left(\text{0,1}\right)\times \left[pbes{t}_{ij}^{\left(t\right)}-{x}_{ij}^{\left(t\right)}\right]$$
$$\begin{array}{c}+{c}_{2}\times {rand}\left(\text{0,1}\right)\times \left[gbes{t}_{j}^{\left(t\right)}-{x}_{ij}^{\left(t\right)}\right] \left(4\right)\end{array}$$
$$\begin{array}{c}{x}_{ij}^{\left(t+1\right)}={x}_{ij}^{\left(t\right)}+{v}_{ij}^{\left(t+1\right)} \left(5\right)\end{array}$$
These are \({v}_{i,j}^{(t+1)}\) and \({x}_{ij}^{(t+1)}\) are \((t+1)\) of \(w={w}_{\text{m}\text{a}\text{x}}-\frac{{w}_{\text{m}\text{a}\text{x}}-{w}_{\text{m}\text{i}\text{n}}}{T}\times t\) are the inertia weights. Let \({x}_{ij}^{\left(t\right)}=pbes{t}_{ij}^{\left(t\right)}\) update the \({x}_{ij}^{(t+1)}\), \(L\left(\lambda \right)\sim u={t}^{-\lambda }(1<\lambda \le 3)\) is \({x}_{ij}^{(t+1)}={x}_{ij}^{\left(t\right)}+\alpha ⊛L\left(\lambda \right)\) where \(\alpha\) is the step size that should be proportional to the size of the optimization problem. This \({x}_{ij}^{(t+1)}\) will change randomly, with probability \({p}_{a}\).
replacements \({x}_{ij}^{(t+1)}\) is defined by the \({x}_{ij}^{\left(t\right)}\) If the fitness value \(F\left({x}_{ij}^{(t+1)}\right)>F\left({x}_{ij}^{\left(t\right)}\right)\). Then, it finds the list of nests by sorting the list of \(t\) generations of the best nests.
The PSO-CS hybrid optimization algorithm combines the search capability of PSO and the global search capability of CS to improve the optimization capability of the algorithm in general. Experimentally, it is proved that the accuracy of the PSO-CS hybrid optimization algorithm is significantly better than that of the PSO algorithm, and it is more stable [22].