# Water Quality Evaluation and Prediction Based on a Combined Model
## 3 Materials and Methods
### Materials  
(1) ADF  
The ADF test determines whether the series is stationary by checking whether the sum of the autoregressive coefficients is 1 [25]. Compared with the DF test, which can only be used to determine whether the AR(1) model is stationary, the ADF test can be used to determine the stationarity of the AR(P) model. The hypothesis test is established as:  
\[H_{0}:\rho=0\]  
\[H_{1}:\rho<0\]  
The test statistic is:  
\[\tau=\frac{\hat{\rho}}{S(\hat{\rho})} \tag{15}\]  
where \(\rho=\varphi_{1}+\Lambda+\varphi_{p}-1\), and \(S(\hat{\rho})\) is the sample standard deviation of parameter \(\rho\).  
Figure 2: ARIMA—WNN structure.  
AF  
The autocorrelation function describes the correlation between the random sequence at time \(t\) and the value at time \(t-k\)[26].  
\[\rho_{k}=\frac{Cov(y_{t},y_{t-k})}{\sqrt{Var(y_{t})}\sqrt{Var(y_{t-k})}}=\frac{E[( y_{t}-k)(y_{t-k}-\mu)]}{\sqrt{Var(y_{t})}\sqrt{Var(y_{t-k})}}=\frac{\gamma_{k}}{ \sigma^{2}} \tag{16}\]  
where \(E(y_{t})=\mu,\sigma^{2}=E(y_{t}-\mu)^{2}\), and \(\gamma_{k}\) denotes the covariance of \(y_{t}\) and \(y_{t-k}\).  
(3) PAF  
The partial autocorrelation function shows that for sequence \(y_{t}\) in determining \(y_{t-1}\), \(y_{t-2},\ldots,\)\(y_{t-k+1}\), the correlation between \(y_{t}\) and \(y_{t-k}\) is denoted by \(\varphi_{kk}\)[26]:  
\[\varphi_{kk}=\left\{\begin{array}{cc}\gamma_{1}&k=1\\ \frac{\gamma_{k}-\sum_{j=1}^{k-1}\varphi_{k-1j}\gamma_{k-j}}{1-\sum_{j=1}^{k- 1}\varphi_{k-1j}\gamma_{j}}&k=2,\,3,\ldots\end{array}\right. \tag{17}\]  
(4) The AIC criterion  
The AIC criterion was proposed by Japanese statistician [PERSON] as a measure of model fit excellence [27].  
\[AIC=n\log\sigma^{2}+2(p+q) \tag{18}\]  
where \(n\) is the number of samples; \(\sigma^{2}\) is the sum of squares of the fitted residuals; and \(p\) and \(q\) are the orders of the AR and MA models, respectively. Models are established from low-order to high-order according to the ARIMA values, and the AIC value of each model is calculated. According to the criterion, the model with the lowest AIC value is the optimal model.  
(5) MAE  
Mean absolute error (MAE) is a measure of accuracy for regression [28]. It sums up absolute values of errors and divides them by the total number of values. It gives equal weight to each error value. The formula for calculating MAE is shown in Equation (19).  
\[MAE=\frac{\sum\left(\left\|\hat{y}_{i}-y_{i}\right\|\right)}{n} \tag{19}\]  
(6) MAPE  
The reason why mean absolute percentage error can describe accuracy is that it is often used as a statistical index to measure the accuracy of prediction [29].  
\[MAPE=\frac{1}{n}\sum\left(\left|\frac{\hat{y}_{i}-y_{i}}{y_{i}}\right|\right) \ast 100\% \tag{20}\]  
(7) RMSE  
Root mean squared error (RMSE) is the square root of MSE and scales the values of MSE to the ranges of observed values [28]. It is estimated according to Equation (21).  
\[RMSE=\sqrt{\frac{\sum\left(\left|\hat{y}_{i}-y_{i}\right|\right)^{2}}{n}} \tag{21}\]  
(8) AI  
In this paper, a new index (AI, accuracy improvement) is introduced to show the improvement of prediction ability of the combined model compared with the single model [30]. \(S_{i}\) and \(S_{c}\) are the MAPE of the single model and combined model, respectively.  
\[RI=\frac{\left|S_{i}-S_{c}\right|}{S_{i}}\times 100\% \tag{22}\]