# Time-Series Prediction of Failures in an Industrial Assembly Line Using Artificial Learning
## 3 Materials and Methods
### Statistical Tools for Evaluating the Model Performances  
Two commonly used methods for performance evaluation are regression analysis and error analysis. Error histograms provide insight into the distribution of errors, as well. Additionally, variance analysis is another method employed in performance evaluation. Through regression analysis, the correlation coefficient, denoted by \(R\), is calculated. For regression analysis, a first-order regression is applied to fit a curve. The correlation in this curve is computed using the formula \(R=\frac{N^{\sum_{i=1}^{N}}(p_{i}-\alpha_{i})-\left(\sum_{i=1}^{N}p_{i}\right) \left(\sum_{i=1}^{N}\alpha_{i}\right)}{\left(\sqrt{N^{\sum_{i=1}^{N}p_{i}^{2} -\left(\sum_{i=1}^{N}p_{i}\right)^{2}}}\sqrt{N^{\sum_{i=1}^{N}\alpha_{i}^{2}- \left(\sum_{i=1}^{N}\alpha_{i}\right)^{2}}}\right)}\). In regression plots, the \"fit line\" represents the first-order regression applied to the entire set of (target, output) points. This line takes the form of \(output=a\times target+c\), where \(a\) is the slope of the linear regression line. \(c\) is the intercept on the \"output\" axis. The correlation between this line and the data is shown by \(R\) in the plot. While \(R\) is the correlation coefficient, \(R^{2}\) is the coefficient of determination. Both are dimensionless. While \(R\) is good at evaluating the strength and direction of a linear relationship between two variables, \(R^{2}\) is good at evaluating the proportion of variance. The \(R^{2}\) value can be [0, 1]. It means that the model explains 100 \(\times\)\(R^{2}\)% of the variance in the dependent variable. When it comes to the \(R\) value, [0.01, 0.29], [0.30, 0.70], or [0.71, 0.99] indicate a weak, moderate, or strong relationship, respectively. A value of 0 implies no relationship, while negative values indicate an inverse linear relationship. The absolute increase in \(R\) signifies a stronger relationship. The \"target\" axis includes original data, while the \"output\" axis includes data predicted by the network. Ideally, these values should be equal, in which case \(R=1\) and all points lie on the 45\({}^{\circ}\) line. Although regression analysis shows the linear relationship, it is not solely sufficient to evaluate a model's performance [23]. Therefore, these findings  
Figure 3: Correlogram of the series: (**a**) ACF and (**b**) PACF. must be supported by other statistical control methods and error metrics to ensure more reliable results. The error, denoted as \(E_{t}\), is the difference between the estimated and original values, calculated as \(E_{t}=p_{t}-\;o_{t}\) where \(o_{t}\) and \(p_{t}\) are original and estimated values, respectively. The mean error (ME) is given by Equation (1):  
\[ME=\frac{1}{N}{\sum_{t=1}^{N}E_{t}} \tag{1}\]  
Mean squared error (MSE) is given by Equation (2). \[MSE=\;\frac{1}{N}{\sum_{t=1}^{N}(E_{t})}^{2} \tag{2}\]  
The square root of MSE is called RMSE. Another error metric is the mean of the absolute relative error (MAE) given in Equation (3):  
\[MAE=\frac{1}{N}{\sum_{t=1}^{N}}|E_{t}| \tag{3}\]  
The average of the absolute percentage error is called MAPE. It can be calculated via Equation (4):  
\[MAPE=\frac{100}{N}\left[{\sum_{t=1}^{N}\left|\frac{E_{t}}{o_{t}}\right|}\right] \tag{4}\]  
The mean bias error can be calculated using \(MBE=100\frac{\sum_{t=1}^{N}|E_{t}|}{\sum_{t=1}^{N}o_{t}}\). Another metric is \(t\)-statistics. It can be calculated using \(t=\sqrt{\frac{(N-1)MBE^{2}}{RMSE^{2}-MBE}}\). While MAE and RMSE have the same units as the data, the MSE has the square of this unit. MBE and MAPE are expressed as a percentage. If the error approaches zero, the model's outputs closely approximate the original data. This is expected in all error metrics. Additionally, the mean square deviation (\(\chi^{2}\)) can be computed utilising \(\chi^{2}=\sum_{t=1}^{N}\frac{E_{t}^{2}}{o(t)}\). The error histogram visualises the distribution of \(E_{t}\) using bars with specific intervals [24]. The widths of the bars on the horizontal axis show the error ranges.