# Data-Based Modelling of Chemical Oxygen Demand for Industrial Wastewater Treatment
## 3 Results and Discussion
Figure 6: Measured effluent COD (black) and model estimates (blue) as a function of time with a prediction horizon of 20 h (1 data point = 2 h): (**a**) training data (correlation 0.74, MAPE 15.7%); (**b**) model testing with independent test data (correlation 0.77, MAPE 7.6%). Grey area is the estimated 95% prediction interval. Figure 7: Zoomed view of Figure 6b at time period 400–550 when hardware sensor is malfunctioning (approximately 440–520). Lastly, some properties of the residual were calculated (Table 4) to numerically verify the observations. The range indicates the span of residual values, while the standard deviation represents the spread or variability around the model predictions. Skewness and kurtosis reveal the shape and potential outliers in the residual distribution. Monitoring these properties can help identify model deficiencies and guide further improvements. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Residual** & **Range** & **Std. Deviation** & **Skewness** & **Kurtosis** \\ \hline Influuent model training data & \([-1.4,2]\) & 0.54 & 0.19 & 2.91 \\ Influent model test data & \([-0.8,1.3]\) & 0.43 & 0.74 & 3.3 \\ Effluent model training data & \([-2.4,2.9]\) & 0.67 & 0.63 & 4.3 \\ Effluent model test data & \([-1.2,2.87]\) & 0.55 & 0.34 & 3.84 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Residual properties. Figure 8: Influent soft sensor model residual for training and test data: (**a**) training data residual histogram; (**b**) training data residual normal probability plot; (**c**) test data residual histogram; (**d**) test data residual normal probability plot. The effluent training data exhibit residual values ranging from \(-1.4\) to \(2\), with a standard deviation of \(0.54\). The distribution of residuals is moderately peaked (kurtosis = 2.91) and is slightly skewed (skewness = 0.19) with a longer tail on the right side. This suggests the presence of some outliers or heavy-tailed behaviour. These values are good for a model made with industrial data. The test data for the influent model show residual values ranging from \(-0.8\) to \(1.3\). The standard deviation decreases slightly to \(0.43\), indicating a relatively smaller spread of residuals compared to the training data. The distribution remains slightly skewed (skewness = 0.74) and exhibits a higher peak (kurtosis = 3.3), suggesting a higher probability of outliers. The effluent model's training data exhibit residual values ranging from \(-2.4\) to \(2.9\). The standard deviation of \(0.67\) indicates a larger spread of residuals compared to both the influent model's training and test data. The distribution is similarly slightly skewed (skewness = 0.63) with a higher peak and heavier tails (kurtosis = 4.3), also suggesting the presence of extreme values or outliers. The test data for the effluent model show residual values ranging from \(-1.2\) to \(2.87\). The standard deviation is \(0.55\), indicating a moderate spread of residuals. The distribution remains slightly skewed (skewness = 0.34) with a  
Figure 9: Effluent predictive model residual for training and test data: (**a**) training data residual histogram; (**b**) training data residual normal probability plot; (**c**) test data residual histogram; (**d**) test data residual normal probability plot. lower peak and lighter tails (kurtosis = 3.84) compared to the model's training data. Overall, it seems that both models are a decent fit for their intended purposes, even if the models sometimes exhibit outliers. Considering that the models are a representation of a real wastewater treatment process, modelled with real data where situations and circumstances can vary significantly. In general, the models perform well, especially when considering the complexity of the wastewater treatment process. Our study yielded results that are similar to previous industrial wastewater studies employing linear model structures. For example, [PERSON] et al. [11] reported correlations between 0.68 and 0.835 for various linear models on test data.