## 3 Model Construction
### Optimized Prediction Model Construction
, \tag{2}\]  
where \(x_{\mathit{worst}}^{t}\) represents the global worst position in the \(tth\) iteration, \(x_{p}^{t+1}\) represents the best position achieved by the discoverer during the \((t+1)th\) iteration, and \(A\) denotes a matrix of \(1\times d\), where each element is randomly assigned a value of \(1\) or \(-1\). \(A^{+}=A^{T}(AA^{T})^{-1}\), where \(A^{T}\) is the transpose of matrix \(A\). Lastly, \(n\) denotes the size of the sparrow population. The adjustment of the follower's position is outlined as follows: When \(i>\frac{n}{2}\), it indicates that a follower with a lower fitness value is unable to obtain food and is in a state of severe hunger, necessitating a move to other locations to search for more energy. When \(i\leq\frac{n}{2}\), the follower will forage in the vicinity of the optimal individual \(x_{p}^{t}\). (6) Alerter location updating. Sparrows on the flock's periphery move toward the safe zone, while those in the center randomly disperse to approach other individuals. Equation (3) is used to update the positions of the sparrows that have detected the danger. Assuming that the scout sparrows, which issue early warnings, make up about 10% to 20% of the total sparrow population and that their initial positions are assigned randomly, the position of a sparrow that has detected a threat (i.e., an alerter) is updated using the following formula:  
\[x_{i,j}^{t+1}= \begin{cases}x_{\mathit{best}}^{t}+\beta\cdot\left|x_{i,j}^{t}- x_{\mathit{best}}^{t}\right|,&f_{i}>f_{g}\\ x_{\mathit{best}}^{t}+k\cdot\left(\frac{x_{i,j}^{t}-x_{\mathit{best}}^{t}}{|f_ {i}-f_{g}|+k}\right),&f_{i}=f_{g}\end{cases} , \tag{3}\]  
where \(x_{\mathit{best}}^{t}\) denotes the position of the best solution in the \(tth\) iteration, \(\beta\) is the control step parameter, typically following a normal distribution with a mean of \(0\) and a standard deviation of \(1\), \(k\) is a uniformly distributed random number within the specified range \([-1,1]\), representing the direction in which the sparrow is moving and also serving as a control step parameter, \(\varepsilon\) is a very small constant added to prevent the denominator from becoming zero, \(f_{i}\) represents the fitness value of the individual in question, \(f_{g}\) is the fitness value of the best-performing individual found globally so far, and \(f_{w}\) is the fitness value of the worst-performing individual in the current population. The position of the alerter is updated as follows: When \(f_{i}>f_{g}\), the individual is at the edge of the population and is therefore more vulnerable to predation. When \(f_{i}=f_{g}\), the individual is situated in the central area of the population and adjusts its search strategy by moving closer to other sparrows promptly to avoid predators. (7) Sparrow position update determination. Each sparrow's fitness value is assessed and compared to the population's average fitness to identify the optimal individual and its corresponding position. (8) Determination of whether the maximum number of iterations and the minimum error are reached. The process verifies whether the maximum number of iterations has been reached and if the minimum error threshold has been satisfied. If both conditions are met, the process terminates, providing the optimal input weights and hidden layer biases for the ELM, or the penalty factors and kernel function parameters for the SVR. If not, the process returns to step (3). (9) Optimal parameter determination. The determined weights and hidden layer biases are incorporated into the ELM to form the SSA-ELM model, or the determined penalty factors and kernel function parameters are integrated into the SVR to create the SSA-SVR model. (10) Model effect evaluation. The testing samples are fed into the optimized SSA-ELM or SSA-SVR predictive model to generate forecast outcomes, and the effectiveness of the model's predictions is assessed based on predefined evaluation metrics.