Effect of river flow on the quality of estuarine and coastal waters using machine learning models

This study explores the river-flow-induced impacts on the performance of machine learning models applied for forecasting of water quality parameters in the coastal waters in Hilo Bay, Pacific Ocean. For this purpose, hourly recorded water quality parameters of salinity, temperature and turbidity as well as the flow data of the Wailuku River were used. Several machine learning models including artificial neural network, extreme learning machine and support vector regression have been employed to investigate the river-flow-induced impact on the water quality parameters from the current time up to 2 h ahead. Following the input structure of the machine learning models, two separate models based on including and excluding the river flow were developed for each variable to quantify the importance of the flow discharge on the accuracy of the forecasting models. The performance of different machine learning models was found to be close to each other and showing similar pattern considering accuracy and uncertainty of the forecasts. The results revealed that flow discharge influenced the water salinity and turbidity of the bay in which the models including the river flow as input variables had better performance compared with those excluding the flow time series. Among the water quality parameters investigated in this research, river flow made the most and least improvement on the efficiency of the models applied for forecasting of turbidity and water temperature, respectively. Overall, it was observed that water quality parameters can be properly forecasted up to several hours ahead providing a potentially valuable tool for environmental management and monitoring in coastal areas.


Introduction
Water quality parameters are important components to assess the health of the coastal environment and to guarantee suitable conditions for aquatic life. Estuarine and coastal waters are particularly susceptible to non-point/point source pollution conveyed by rivers and streams (Clark, 1995). These coastal areas are among the most important regions considering food supply and natural resources. Recently, anthropogenic pollution released in water bodies has been recognized as an important point of pollutants which necessitates serious attention to prevent drastic environmental problems. There are many estuaries that have been closed to commercial fishing due to pollution problems (Weiner and Matthews, 2003). Concerning an increasing demand on the use of estuarine waters, development of comprehensive water quality management programs is needed to CONTACT Shahabbodin Shamshirband shahaboddin.shamshirband@tdt.edu.vn evaluate conflicting uses of the estuary such as the discharge of wastewater, alterations of physiographic features, and alterations in the distribution and amount of freshwater inflow (Espey & Ward, 1972). Development of forecasting models of water quality parameters several hours ahead based on river flow can provide an early-stage alarm to prevent severe disaster in the coastal ecosystem by taking necessary actions in advance. Moreover, they can be employed as helpful tools for coastal monitoring purposes. Water quality includes a wide variety of parameters that may be classified into three groups -biological, chemical and physical factors. In this study, three wellknown physical properties of water quality including water temperature, salinity and turbidity are investigated. Sharp increase or decrease in these physical parameters can adversely affect water quality and microorganisms as well (e.g. high turbidity has side effects on flora and fauna). Water quality models can be constructed as physically based models or data-driven models. In the physical models, good knowledge of physics of the phenomena, relationships among different parameters (using mathematical descriptions) is mandatory. Chau and Jiang (2002) developed a three-dimensional numerical model of pollutant transport for the Pearl River Estuary. This model was applied for chemical oxygen demand (COD) distribution in the estuary and the results indicated the impact of pollutants especially during the wet season. Corbari, Lassini, and Mancini (2016) investigated intense short rainfall events on the water quality variables in the coastal waters. This study was carried out by means of remote sensing data including MODIS. The results showed that spatial and temporal water quality variation is dependent on the rainfall intensity and also on the distance from the shoreline. Data-driven models are becoming more popular due to their simplicity, ease of implementation and suitable performance. Dealing with water quality models, key elements of the water bodies can be designated as water quality indicators, or a combination of several water quality parameters can be formulated as water quality indices (WQIs). Several WQIs have been presented which consider different variables in the formulation. Gazzaz, Yusoff, Aris, Juahir, and Ramli (2012) used the WQI as a function of dissolved oxygen (DO), the concentration of suspended solids (SS), biochemical oxygen demand, COD, pH and ammonia nitrogen (NH 3 -N). Sotomayor, Hampel, & Vázquez (2017) applied k-means classifying technique and a combined model of a KKNgenetic algorithm for water quality assessment in a river basin in southern Ecuador. In this study, a large number of water quality parameters have been taken under consideration. The results indicated that the efficiency of the employed techniques for water quality management in the river, especially when dealing with a complex dataset is required. Such models may require a large number of variables to estimate the WQIs. However, in some cases, these datasets are not available. Moreover, sometimes the models need to concentrate on some specific parameters. Therefore, development of water quality models based on individual important parameters rather than composite WQIs is a good alternative. Furthermore, some of the water quality parameters are mutually interrelated (e.g. water temperature with DO). Therefore, investigation of some particular parameters will suffice.
To date, no research study has been reported to explore river-flow-induced impacts on the water quality parameters in coastal and estuarine waters. Lack of enough data records of the river flow and water quality elements in coastal waters is a drawback for such studies. An interesting point related to the river flow impacts on the water quality in coastal waters is to consider the travel time of flow (or pollutant) from the river flow gauge to coastal waters and also its lability in the natural environment. In this regard, multi-timestep-ahead forecasting models can be of great importance. However, uncertainty about future events can reduce the efficiency of the long-term forecasting models. Therefore, development of forecasting models with reliable outputs necessitates examining different data mining techniques.
The main objective of this study is to explore the effect of river flow on the performance of machine learning models for forecasting of water quality parameters in coastal and estuarine waters in Hilo Bay, Pacific Ocean. In this regard, surface water temperature, salinity and turbidity as water quality indicators are forecasted up to 2 h ahead. ANN, ELM, and SVR are employed to explore impacts of the river flow on the water quality parameters. The width of uncertainty band with 95% confidence level as well as root mean square error (RMSE) and coefficient of determination (R 2 ) and mean error is used to evaluate the performance of the models. The performance of different models is compared in terms of river flow impacts, time horizon, the forecasting technique and its time and space complexity procedure. A brief description of the methodology, datasets and study area and model development procedures are given in the next section. The results of the models are discussed in Section 3. Conclusions are presented in Section 4.

Study area and data analysis
To explore the river flow impacts on the water quality parameters, the hourly flow data related to the Wailuku River entering Hilo Bay, Pacific Ocean were considered for the procedure. Moreover, the datasets of hourly water quality parameters including water temperature, salinity and turbidity in Hilo Bay were employed. These data were recorded by the Hilo Bay water quality buoy (HBB) moored within 1 m of the surface in one location within a small tropical estuary. The hourly data used in this study are average data of 15-minute records of the buoy. Quality of all data has been controlled and their accuracy has been validated. They have been provided by PacIOOS (Pacific Islands Ocean Observing System). The water quality measured by HBB is expected to be affected by freshwater inputs from the Wailuku River into Hilo Bay. The river is 45.1 km long and is the longest river in Hawaii. The coordinates for the buoy station (HBB) are 19.7430 N 155.0814 W, and the river station is USGS 16704000 Wailuku River at Piihonua, HI at 19.71214 N and 155.15080 W. The data cover hourly records from 2014 to 2016. Figure 1 illustrates the study area and Figure 2 shows the HBB components.
The datasets used in this study were recorded from January 2012 to December 2016 with 15-minute interval. Each hourly data are the average of four values. All the data have been normalized in a range of [0,1], as follows.
where X i represents the normalized data and X i , X max , X min denote the observed data, maximum and minimum of the measured data, respectively. The statistical analysis including minimum 'Min', maximum 'Max', average 'Mean', standard deviation 'Sd' and skewness 'Skew' are given in Table 1 to give more details about the applied data. The statistics show that the data have a wide range of variation. Especially, the flow data have high values of standard deviation that implies a high deviation of data from the average value.

Artificial neural networks
Feed forward neural networks (here called ANN) are a common type of artificial neural networks which applied in this study. An ordinary ANN model consists of input, hidden and output layers in which each layer has its nodes/neurons. Each layer is connected to the following layer via nodes. The nodes in the input layer which representing the input variables are transformed to hidden layer with weighted connections. The computations and processes are carried out in the hidden layer and then the nodes of the hidden layer are connecting to the output layer. Based on the relative importance of each input variable, appropriate weights between the connections of the nodes in the layer with those of the following layer are assigned.
Usually, the appropriate weights are determined through an iterative backpropagation algorithm in the training stage. Given N distinct samples (x i , y i ), a single hidden layer ANN model with a linear activation function of output nodes in the general form can be expressed as (Huang, Zhu, & Siew, 2006): where x j is the input value to node j, o j is the output at node j, g is the hidden layer activation function (in this study means log-sigmoid) for the hidden layer, b i is the hidden layer bias, and n is the number of nodes in the hidden layer. w i and β i are the weight between the input nodes and the ith hidden node, and the weight between the ith hidden node and the output nodes, respectively.

ELM
ELM proposed by Huang, Zhu, and Siew (2004) has become popular due to its faster implementation and better generalization compared to traditional ANNs. Unlike the gradient-based learning algorithm, ELM does not suffer from the stacking in local minima and overfitting problems. Dealing with ELM, the input weights and hidden layer biases are chosen randomly while in ANN models, it is a time-dependent procedure due to determination through an iterative process. Also, in ELM the method, unlike the ANN, there is no need to tune all the parameters but determining the output weights analytically while choosing the input weights and hidden layer biases randomly. Assuming that there . Therefore Equation (3) can be rewritten in a compact form as: where where H is the hidden layer output matrix. Working with ELM, the matrix H can remain fixed once arbitrary values have been assigned to these parameters at the beginning of learning. Therefore, the model can be trained by finding a least-squares solutionβ for Equation (6).
If n = N, the H will be a square and invertible matrix and the training samples can be easily approximated with zero error. However, in real applications, it is usual to consider n N, therefore, having a non-square matrix H, the exact solution may not exist. Therefore, a least square technique is used to obtain the solution.
where H † is the Moore-Penrose generalized inverse of matrix H. A complementary introduction into ELM algorithm can be found in Huang et al. (2004) and Taormina and Chau (2015).

SVR
Generally, support vector machines (SVMs) are a common type of data mining technique for classifying and regression purposes. They employ a hyperplane to separate data points of two categories. SVR is a type of support vector machine dealing with regression problems. Given a training dataset of where n is the sample size and x and y represent input and output data, the method is applied to map the input space into an n-dimensional feature space using a non-linear function (ϕ(x)). Basically, the SVR function can be expressed as (Liu, Zhou, Chen, & Guo, 2014): where w denotes the weight vector w = {w 1 , . . . , w n }, and b represents the bias. In SVR, the coefficients including the weight vector and the bias are estimated by defining a cost function. In the conventional regression models, the coefficients were obtained by minimizing square error while in SVR, they are determined using a new loss function known as the -insensitive loss function (Liu et al., 2014).
where L ε is the loss function, y is the target value, and ε is the region of ε insensitivity (defined by the user).
In SVR, the weight vector is derived using the regularized risk function as follows: where 1 2 w 2 and C are called regularization term and constant, respectively. The constant can be introduced by the user. Equation (10) can be rewritten as an optimization problem with the following cost function and constraints (Vapnik, 2013): where ξ i and ξ * i are the positive slack variables to measure the training samples' deviation outside the ε-insensitivity zone. Finally, the general form of the SVR regression function is formulated as (Vapnik, 2013): where a i , a * i ≥ 0 are the Lagrangian multipliers that satisfy the equality a i a * i = 0; and K(x, x i ) is the kernel function (Liu et al., 2014). Different types of kernel function such as linear, Gaussian, polynomial, etc., can be employed in which selection of an appropriate type of the function is a mandatory step toward achieving suitable performance of SVR. Further details of SVM and SVR can be found in Vapnik (2013).

Procedures
To select and develop any data mining techniques for forecasting purposes, input selection, accuracy of the models, physical meaning of the relationship, size of the data in training stage and its homogeneity with the testing dataset and complexity of the models' structure have to be taken under consideration to guarantee efficiency and reliability of the models (Alizadeh, 2017). Different machine learning techniques have their own advantages and disadvantage because of employing different formulations. Therefore, they are different in terms of structure, training procedures, learning time, etc. For instance, the dataset in traditional ANN models is usually divided into three subsets of training, validation and testing in which validation set is applied to control the model overfitting. On the other hand, the SVR and ELM need two datasets (no overfitting problem). In terms of learning time, the ELM and ANN are faster than the SVR technique. Moreover, they have different input structure but in this study, all the three techniques have been fed by the same input variables. In this study, an attempt made to the model and forecast water temperature, salinity and turbidity up to several hours ahead in Hilo Bay. To select the right input variables for each model, the correlation between each predictor with different lags and the target variable has been determined ( Table 2).
As seen in Table 2, each water quality parameter is correlated mainly to its previous values. Moreover, an acceptable correlation between the river flow and water quality parameters especially salinity and turbidity are observed. A negative correlation between salinity and the river flow indicates freshwater intrusion to coastal and estuarine saline waters. The high correlation between the river flow and water turbidity in the estuary shows that the flow increases water turbidity due to making turbulence and spreading it. The river flow with 1 lag has the highest correlation with the water quality parameters in which implies the travel time (1 h) of flow from gauging station in the river to the Buoy in the Bay. Figure 3 illustrates a variation of water quality parameters and the flow time series for 18-day period in August 2014 in which the peak flow has happened in this time period. It is observed from the figure that turbidity and salinity fluctuations are in accordance with the flow discharge. Moreover, the peak flow has affected the water temperature. However, for the other flow values, the temperature is only slightly influenced by the river discharge.
This study investigates the efficiency of machine learning methods of ANN, ELM, and SVR to simulate and forecast the water temperature, salinity and turbidity in Hilo Bay for the current time (t) up to 2 h in advance (t + 2). In each model, the same variable as the output variable with different lags (up to 3) is used as input variables. Moreover, the river flow data are included in the input structure of the developed models to forecast the target variable up to 2 h in advance. To provide more comparisons, separate models excluding the river flow data as an input variable are considered. In the model development, there are some parameters which need to   be tuned accordingly to reach the desired performance.
In the ANN, the number of neurons in the hidden layer was 10, with the Levenberg-Marquardt algorithm. The activation function of ELM was set as 'sigmoid'. The linear kernel function for SVR is used. Other important characteristics of the models were set as default. The main steps of the study can be schematically illustrated as Figure 4. The performance of the models is measured using three indices of the coefficient of determination (R 2 ), RMSE and width of uncertainty band (±1.96S e ). In where n is the number of data. Table 2 shows that river flow has the highest correlation with turbidity compared to salinity and temperature. As observed, the turbidity in the current hour has the highest correlation with the river discharge in the previous hour which can be due to travel time between hydrometric station recording the flow data and the water quality buoy. Moreover, there is a remarkable dependency of turbidity with those of flow data in other time horizons including t, and t-1. Therefore, the machine learning models including the flow data were constructed using the flow data in t, t-1, and t-2. These models were employed to predict turbidity up to 2 h ahead. The results are presented in Table 3. The models excluding and including the river flow as input variables are denoted with '-Q' and '+Q' respectively.

Turbidity
Regarding Table 3, it can be obtained that the models including the river flow (regardless of the machine learning type) provide more accurate forecasts of turbidity compared with those of excluding the river flow in the input structure. Therefore, it can be derived that the river flow can affect the turbidity of such large water bodies remarkably. Effects of the river flow on the turbidity in t + 1 and t + 2 indicate that it takes some hours to recover disturbance and turbidity caused by the river flow in the previous hours. Following the performance of the models at different times, it can be seen that the models' efficiency decreases as the time horizon increases. However,   the results for all three times investigated in this study are acceptable. Considering the performance of different machine learning models, it can be found that all three types of the models (ANN, ELM, and SVR) behave in a similar manner and the error measures for all of them are close to each other. Therefore, only forecasts of one model (the ANN) for different times are depicted against those of the observed data during the test period ( Figure 5). As the models including the river flow have a higher coefficient of determination, here only their scatterplots are illustrated. Generally, good agreement was obtained between observed and forecasted data. As the time horizon increases, the correlation between observed and forecasted data decreases. In Figure 5, for time t + 1 and t + 2, the data have more deviation from the linear trend line. In time t, the extreme values have been fairly forecasted while for times t + 1 and t + 2, the values have been generally underestimated. Comparison of the RMSE and 1.96S e for different times and the ANN models with and without the river flow inputs is shown in Figure 6. Figure 6 implies that the model for time t has the best accuracy and the uncertainty band for its output is narrower than the other times. As the time horizon increases, the uncertainty band is going to increase with a sharper rate. Therefore, the models applied for multi-hour-ahead forecasting may embed a high amount of uncertainty.

Water salinity
Among the variables considered in this study, it was found the water salinity in the Hilo Bay is mostly dependent on its values in the previous time steps and also on the river flow. Salinity is inversely correlated with those of the river flow with the highest correlation in t-2. Therefore, the water salinity in previous time steps, as well as the river flow (in the case), were applied to forecast the salinity in t, t + 1 and t + 2. Table 4 gives the results of the different models including and excluding the river flow up to 2 h ahead.
Results presented in Table 4 suggest that the models including the river flow slightly outperform the models without the flow inputs. Higher values of correlation, lower values of RMSE and also uncertainty band indicate the superiority of the models in which gain the flow data in their input structures. The forecasted time series of the ANN models during the test period are plotted versus the real values in Figure 7. According to Figure 5, the model provided a good forecast for all range of the salinity data. A high correlation can be found and all the points converge the trend line. For the other times, there are some points distracted from the line. However, the general performance of the models regardless of the time horizon is acceptable. Results related to the RMSE and uncertainty band of the forecasted target variable during the test period are presented in Figure 8. Figure 8 reveals that the models with the flow have lower values of RMSE and uncertainty. The models' performance deteriorates as the time horizon grows. However, the forecasts for times t + 1 and t + 2 are still reliable. Generally, it can be found that the machine learning models such as ANN, ELM, or SVR have a suitable capability to forecast water salinity in coastal and estuarine waters several hours ahead.

Surface water temperature
According to correlation analysis, the surface temperature in the current hour (t) is mostly correlated to the temperature in the preceding time steps. However, its relation with the river flow is not very high. The main reason for this inverse correlation can be lower, colder temperature of the river compared with warmer the estuarine water. The low correlation may be due to the fact that the amount of river flow entering in the estuary is not remarkable in comparison to the estuarine water volume. As this study is concentrated on the river-induced impacts, two sets of models including and excluding the flow as input parameter have been constructed. Therefore, the input structure of the forecasting models for temperature consists of its values in preceding hours (t-1, t-2, t-3) and flow time series from the current time (t) up to 2 h ago (t-2) (in case of including model) are considered. The results are given in Table 5.
Regarding Table 5, the surface water temperature can be efficiently forecasted for several hours ahead. The   show that for time t, the uncertainty in temperature forecasting is about 0.5C in which it indicates the reliability and efficiency of the models. Moreover, the models can predict the temperature for 2 h ahead with adequate accuracy and reliability. The uncertainty band for time t + 2 is less than unity which confirms high performance of the applied models for temperature forecasting. The results are promising for water temperature monitoring and environmental management in coastal and estuarine waters. Figure 9 illustrates the scatterplots of the ANN models for temperature for the test dataset. In Figure 9, there is a high similarity between forecasted and observed values of surface temperature for all three times under consideration. The forecasts are roughly close to 1:1 line which indicates the accuracy of the models. For more illustrations, Figure 10 presents the results for RMSE and width of uncertainty band of the forecasting models during the test period. In the figure, the RMSE and 1.96S e have relatively low values which imply the accuracy and reliability of the developed models for temperature forecasting. Moreover, the models including the river flow have a bit better performance than those of excluding the flow as an input variable. However, the difference is negligible. The point is that it takes more time for heat transfer among the water layers in the ocean and coastal waters. Moreover, the amount of the water released by the river flow in compare with such a huge water body is not remarkable.
In general, this study shows that the machine learning models can be successfully applied to forecast the water quality parameters in coastal and estuarine water up to a few hours ahead. Comparing the results of different variables demonstrate that temperature can be forecasted with higher accuracy than the salinity and turbidity. The Hilo Bay water quality buoy is moored within  1 m of the surface in one location within a small tropical estuary, and consequently the salinity measured by HBB is affected by freshwater inputs to Hilo Bay from the Wailuku River and submarine groundwater discharge (Mead & Wiegner, 2010;Paquay, Mackenzie, & Borges, 2007) as well as by tides (2-week Spring-Neap cycle). Storm events that result in elevated Wailuku River flow occur aperiodically and can depress salinity for several days (Mead & Wiegner, 2010); Paquay et al. (2007). However, the effect of Wailuku discharge and the Spring-Neap tide cycle on temperature is relatively smaller-while a strong storm can depress salinity 10-20 ppt, storm flows only affect temperature 2-4°C. On the other hand, turbidity is affected by the river flow with higher intensity, especially, in the case of storm flow, the sediments and other SSs increase the turbidity of the coastal waters. As the elevated temperature is an important factor in coral bleaching (Couch et al., 2017;Jokiel & Brown, 2004), accurate forecasts of local temperature in areas such as Hilo Bay where corals live is an important tool in understanding and managing coral bleaching. In general, the findings of this study are in a good accordance with the physics of the phenomena and characteristics of the water quality variables in the study area.
Wailuku River flow has a dominant influence on several biogeochemical processes and water quality parameters in Hilo Bay. Paquay et al. (2007) concluded that pCO 2 in Hilo Bay was largely driven by Wailuku R. flow conditions and its influence (along with the Wailuku R.) on the salinity gradient leading out of the bay. Mead and Wiegner (2010) showed that the surface water metabolic balance shifts from net autotrophy during low flow conditions to net heterotrophy during high flow conditions. Water quality parameters including nutrient concentrations and turbidity (Wiegner, Mead, & Molloy, 2013), Csource quality (Atwood, Wiegner, & MacKenzie, 2012), and microbial pollutants (Wiegner et al., 2017) have been shown to be related to storm vs. base flow river conditions in Hilo Bay. The models produced in the present study demonstrate the capability to model the influence of Wailuku river flow on these and other important parameters of Hilo Bay and perhaps other tropical estuarine systems.
Results of this study demonstrate that the river flow depleting in estuarine and coastal waters can affect water quality there. Moreover, it takes the coastal and estuaries some hours to recover themselves from the changes made by the flow. This study was carried out for depleting a freshwater and roughly clean water into the coastal waters. However, for rivers conveying industrial and domestic wastes, the problem is more serious, and the flow can degrade the water quality of that water body with frequently higher intensity. Especially, the problem would be worse when the river flow is released in smaller water bodies such as lakes and lagoons. Therefore, employing the proposed approach in this study can be helpful for the water quality monitoring and management. Moreover, a quantitative assessment of the river water quality and its impacts on the water quality it is depleted can be of great interest.

Time and space complexity of the models
Dealing with big data and machine learning models, it is of great interest to know about time and space complexity of the models. In other words, runtime and required memory for implementation of the models can be considerable to select the suitable model. In this regard, this study provides a relative comparison for the three models. The results in terms of run time and memory space usage in percentile are given in Table 6. As the consuming time for models As observed, the ELM models require less computational time and memory space. On the other hand, SVR models have more complexity in terms of time and space. The models including and excluding the river flow as input variables roughly show the same characteristics in terms of time-consuming and space usage. However, it should be noticed that these values are strongly dependent on the specifications of the processors, data size, a number of input elements, programming language or the software capability, transfer functions, data format, etc. Providing more sophisticated analysis for time and space complexity of the machine learning models can be the direction of future studies.

Conclusions
The current research was aimed to investigate the effect of the Wailuku River flow on the water quality of the Hilo Bay. Moreover, an attempt was made to achieve models with acceptable performance for water quality parameter forecasting in the upcoming hours. The correlation analysis between the river flow and the water quality indicators showed that turbidity in time t is mostly depended on the flow in time t-1. However, temperature and salinity showed a higher correlation with the flow with more lags (t-2). This issue reflects the fact that turbidity is immediately affected when the river flow enters the Bay. However, it takes some hours for salinity and temperature to be affected by the flow probably because of stratification and time-consuming heat transfer between layers. It is noteworthy that the highest correlation and lowest correlation between the river flow with the water quality parameters were related to turbidity (R 2 = 0.67) and temperature (R 2 = -0.29), respectively. The inverse correlation (negative values) of flow with salinity and temperature denotes release of fresh and colder water of the river flow into saline and warmer coastal waters.
Results of this study revealed that including the river flow data in the input structure of the models improve the accuracy and reliability of the forecasts. Its influence on the water quality variables varies from the remarkable effect on turbidity to negligible effects on the surface water temperature. For example, the ANN models for turbidity improves the model performance in average about 11%, 5.5%, and 10% in terms of RMSE, R 2 , and width of the uncertainty band respectively. In a similar way, these results for temperature decreases to 1.6%, 0.3%, and 1.1%. The river flow and especially the storm flow can intensify turbidity by conveying sediments and making turbulence. Moreover, they can depress salinity depending on the flow discharge.
Comparing the performance of the ANN, ELM and SVR models demonstrated that all of them can provide reliable estimates of the water quality parameters. Moreover, their forecasts for different variables and times do not differ significantly, even though the SVR models require much longer execution time. The error measures (coefficient of determination, RMSE and width of the uncertainty band) for these models are roughly in the same range. The accuracy of the models deteriorate with an increase in forecasting time horizon. It happens with a higher rate of turbidity rather than salinity and temperature that implies turbidity may be prone to immediate change from different oceanic phenomena and storm flow compared with the other water quality variables. Evaluating performance of the models for different variables indicates that water temperature can be forecasted with higher accuracy than salinity and turbidity. The models provide forecasts of temperature in times t, t + 1, and t + 2 with R 2 > 0.85 and 0.286 < RMSE < 0.92 in which they confirm high accuracy for the forecast. Interestingly, the width of uncertainty band with 95% confidence level does not exceed the unity (1°C) for 2 h ahead forecasting. The uncertainty band is narrower for shorter times (t, t + 1). For salinity and turbidity, the uncertainty band is in a range of 2.5-4 (ppt or NTU).
Findings of this study are promising to develop models for water quality monitoring and beforehand forecasting.
Conducting similar studies for rivers depleting industrial and domestic wastes in inland waters or coastal seas is essential. According to the results of this study, acceptable forecasts of the water quality indicators in a few hours ahead can be achieved in which it can be used as an early-stage alarms to prevent more damages to aquatic hydro-environment. In this study, only the river flow data were included in model development while knowing more details about the river flow such as its physical and chemical components can be helpful to improve the models' efficiency. For regions which are prone to continuous inputs of sewage and effluent, the inclusion of details of the river flow (e.g. contaminant measurements) in the forecasting models is essential to achieve models with higher accuracy and reliable estimates. Moreover, applying sophisticated models to analyze the computational time and space complexity of the machine learning models can be the direction of future studies.