## 3 Methodology
### The Goal, Data Inputs, and Data Processing Involved in the Development of the ANN-PSO Model
Six (6) distinct swarm population sizes were also considered. According to past research work [60], it was discovered that the best possible optimum value of the acceleration factor of the particle \(C_{1}\) and \(C_{2}\) is situated in-between 1-2.5 and 2-3. Five (5) various variables of accelerating factors \(C_{1}\) and \(C_{2}\) were considered. Table 4 shows the overall number of neurons in the hidden layer used to train the datasets. The table also presents the particle size and the acceleration factor considered when training the traffic datasets. The variables of the PSO-ANN hybrid model developed for the traffic data were established by performing frequent training of the traffic data. An overall 1000 training runs were done on the MATLAB environment to acquire the near-perfect integration of the ANN-PSO framework. Training of the traffic data during the ANN-PSO training of the traffic data. The training will only be stopped or terminated when the objective function iteration has been fulfilled. The following benchmark was adhered to. The benchmark is:  
* A maximum iteration of 1000. * The training run will be terminated if the objective function is not up to a specific fixed parameter. The ANN-PSO training was carried out in the MATLAB environment by following these steps:  
* Step One: Traffic data collection. * Step Two: Creation of the hybrid network. * Step Three: Configuration of the ANN-PSO network. * Step Four: Initialization of the weight and biases. * Step Five: Training the Neural network by applying particle swarm optimization. * Step Six: Validation and testing of the ANN-PSO network. * Step Seven: Using the Neural Network. The inputs and outputs variables used for the development of the ANN-PSO network are shown in \[x_{ij}^{t} =x_{ij}^{t-1}+v_{ij}^{t}\]0 These input and output variables were categorized based on the method used by [61; 62]. Preparation of the dataset is followed by structuring the architecture of the algorithms. MATLAB user interface tools and command-line functionality are used to oversee the ANN-PSO model's development, training, and testing. The traffic datasets used in this traffic prediction study were obtained from seven major road intersections connecting to the N1 Allandale Road, the busiest interchange in southern Africa. The breakdown of how the traffic datasets were divided and used for the ANN-PSO training and testing is shown in Table 5 below. We used 434 traffic datasets, 364 for training, and 70 for testing the ANN-PSO model performance. The division of the traffic datasets for training and testing is shown in Table 5 below. The MATLAB codes used to develop the ANN-PSO model have been deposited in a GitHub repository. This is the link to the \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Acceleration Factor** & **Swarm Population Size** & **Number of Neurons** \\ \hline
**Value of the parameters** & \(\mathbf{C_{1}}\) & \(\mathbf{C_{2}}\) & \\ \hline
1 & 2.0 & 10 & 5 \\
1.5 & 2.25 & 20 & 6 \\
2 & 2.5 & 50 & 7 \\
2.25 & 2.75 & 100 & 8 \\
2.5 & 3.0 & 200 & 9 \\  & & 400 & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Values of parameters of the ANN-PSO model used for the traffic study. MATLAB codes [[https://github.com/Olayode1989/ANN-PSO-codes.git](https://github.com/Olayode1989/ANN-PSO-codes.git)]([https://github.com/Olayode1989/ANN-PSO-codes.git](https://github.com/Olayode1989/ANN-PSO-codes.git)) (accessed on 20 August 2021). Allendale road SB on, Allendale Road IC (SB only), new road SB off, Olifantsfnrt road SB off, Samrand Ave SB off, Old Johannesburg Road SB off and Brakfontein IC N1 SB. Equations (10) and (11) show the regression value's statistical formulae and the mean square error.