## 3 Results
### Recurrent Neural Networks
We use these data to develop models capable of forecasting horizontal displacement, or zigzag length, because this value must be within certain limits, and making a prediction will be extremely valuable in preventing situations where the parameter zigzag length is not within these acceptable limits. We must develop a multi-step prediction because it is essential to understand the trend of the zigzag variation in order to take preventive action. Figure 23 depicts the multiple-step forecast. In order to find the best model, we developed various configurations of the RNN and tested the main metrics that usually characterize the accuracy of a model. The parameters that we used to find the best models were learning rate, previous values, the ratio between the training and testing data, and the number of epochs. We evaluated the model using the main metrics used in time-series predictions. These are _RMSE_ (Root Mean Square Error), _MAE_ (Mean Absolute Error), _sMAP_ (Simmetric Mean Absolute Percentage Error), and R-squared (the coefficient of correlation). These metrics are well known and have been used in many research studies [22; 23; 24; 25]. The mathematical relations for these metrics are presented in Equations (4)-(8). Figure 23: The method of prediction. Figure 22: The full sequence of data used for training the RNN. In all equations, the significance of the variable is the following: n is the number of predicted values, \(Zig_{i}\) is the measured value of zigzag length at step \(i\), and \(Z_{i}^{n}g_{i}\) is the estimated value at step \(i\). 1. Mean Absolute Percentage Error (MAPE)  
This metric is used for determining the forecasting model accuracy presented in Equation (4). \[MAPE=\frac{1}{n}\underset{i=1}{\overset{n}{\underset{i=1}{\sum}}}\left|\frac{Zig _{i}-Z_{i}^{n}g_{i}}{Zig_{i}}\right| \tag{4}\]
2. Symmetric Mean Absolute Percentage Error (sMAPE). The simple mean absolute percentage error (sMAPE) is a helpful indicator for forecasting models, particularly if the data are distributed across multiple scales. Equation (5), which contains the sMAPE formula, is shown below:  
\[sMAPE=\frac{1}{n}\underset{i=1}{\overset{n}{\underset{i=1}{\sum}}}\frac{2 \left|Zig_{i}-Z_{i}^{n}g_{i}\right|}{\left|Zig_{i}\right|+\left|Zig_{i}\right|} \tag{5}\]
3. Root Mean Square Error (RMSE)  
The root mean square error (RMSE) is a measurement of accuracy that is frequently used in prediction models. \[RMSE\big{(}AP_{i},\hat{AP_{i}}\big{)}=\sqrt{\frac{1}{n}\big{(}Zig_{i}-Z_{i}^{n }g_{i}\big{)}^{2}} \tag{6}\]
4. Mean Absolute Error (MAE)  
A measure of the mean absolute error (MAE) is the average of the absolute differences between the values that were predicted and the ones that were measured. \[MAE\big{(}AP_{i},\hat{AP_{i}}\big{)}=\frac{1}{n}\underset{i=1}{\overset{n}{ \underset{i=1}{\sum}}}\left|Zig_{i}-Z_{i}^{n}g_{i}\right| \tag{7}\]
5. \(R^{2}\) coefficient  
In time-series forecasting, the \(R^{2}\) coefficient (coefficient of determination) measures the model's effectiveness by comparing the predicted outcomes to actual values in time. Figure 20:0  
Figure 24 shows a comparison between the measured and the predicted values for zigzag lengths ranging from \(-\)300 to 400 mm. The measured data trend is clearly followed by the forecasted data, and the prediction results are good. Figure 25 illustrates the correlation between the measured and predicted values, which is around 0.94. This strong correlation value suggests that the predictions correspond with the measured data. The predicted value graph includes 1500 samples. The predicted results closely match the regular oscillating pattern of the measured data. Figure 18a illustrates two curves. Alignment suggests that the prediction model accurately captures both the oscillation pattern and the amplitude. The equation 0.94 * Target + 4.7 represents the linear regression fit, which is symbolized by the blue line. For a slope of 0.94, the forecasts are close to the target value. There are still some minor errors in some circumstances.