1. Introduction
Water demand forecasting plays a pivotal role in the effective management of water resources, ensuring adequate supply and distribution to meet the needs of diverse stakeholders. Anticipating short-term water demand accurately is particularly crucial for water utilities, policymakers, and other stakeholders to optimize resource allocation, infrastructure planning, and operational decisions.
Short-term water demand prediction involves estimating water consumption over a relatively brief period, typically ranging from a few hours to a few days. Accurate forecasting enables stakeholders to optimize water distribution, minimize waste, and proactively address fluctuations in demand. However, achieving precise predictions in dynamic environments characterized by various influencing factors presents significant challenges.
Recent research in short-term water demand prediction has explored various methodologies and techniques to enhance forecasting accuracy. Data-driven models use historical water consumption data along with exogenous variables such as weather forecasts, demographics, and events to train predictive models [
1]. Artificial neural networks (ANNs), including RNNs such as LSTMs and GRUs, are used to capture temporal dependencies and nonlinear patterns in water demand data [
2,
3]. Hybrid models integrate multiple forecasting techniques, such as combining statistical methods with machine learning approaches, to leverage the strengths of different methodologies and improve prediction accuracy [
4]. Finally, it is also possible to incorporate uncertainty estimation techniques to provide probabilistic forecasts, enabling stakeholders to make informed decisions considering prediction confidence intervals [
5].
The evolution of computational techniques, particularly in the realm of artificial intelligence (AI) and machine learning, has revolutionized water demand forecasting. Traditional statistical methods, while useful, often struggle to capture the complex nonlinear relationships inherent in water demand data. In recent years, the application of advanced neural network architectures, including recurrent neural networks (RNNs), has shown promising results in short-term water demand prediction [
6]. Among RNN variants [
7], the long short-term memory (LSTM) network [
2] and the gated recurrent unit (GRU) network [
8] have garnered significant attention for their ability to effectively model temporal dependencies and capture long-range dependencies in sequential data. These architectures excel in capturing patterns and trends in time-series data, making them well-suited for short-term water demand forecasting tasks.
In addition to leveraging advanced neural network models, the integration of commercial software tools with domain expertise and engineering judgment is crucial for enhancing the accuracy and applicability of water demand predictions. Combining data-driven approaches with domain knowledge allows for the incorporation of contextual factors, such as weather patterns, holidays, and socioeconomic variables, which can profoundly influence water consumption dynamics.
In summary, the fusion of advanced neural network architectures like LSTM and GRU with commercial software tools and expert judgment holds tremendous potential for enhancing short-term water demand prediction accuracy, thereby facilitating more efficient and resilient water resource management practices. The aim of this work is to demonstrate how the use of commercial software (SAS Viya software) and engineering judgment can contribute to resolving the Battle of Water Demand Forecasting (BWDF).
2. Materials and Methods
The methodology for predicting water consumption involves a combination of engineering judgment and SAS Viya commercial software. The process starts with a thorough analysis of the dataset, including meteorological and consumption data, to identify and handle anomalies such as reading failures, network leaks, and irregular consumption patterns. Data gaps are filled using a fully conditional specification method [
2].
Input variables are categorized into four groups: i.prediction moment variables (hour, day of the week, and type of day such us workday, holiday or weekend); weather variables (thermal sensation and previous rain-free days), and temporal variation of water demand, thermal sensation, and wind speed (average daily value of the last day, and of various previous days; and weekly average of the last week, the last two weeks, the last 4 weeks, or the last year).
The next step involves defining three neural network models: RNN, LSTM, and GRU. Utilizing a Monte Carlo method, various parameters are tested for different sectors of the water distribution network. These parameters include the type of neural network model, analysis type (single-day consumption prediction or entire week consumption prediction), number of hidden layers, and number of neurons in each layer. Input variables are normalized with a mean of 0 and a standard deviation of 1. Each neural network model produces a single output, representing consumption prediction.
Lastly, the results from the Monte Carlo analysis are thoroughly examined to determine the most suitable strategy for each sector. Solutions are scrutinized using data from the most recent available week to validate initial findings.
3. Results and Discussion
The parameters analyzed for each neural network model (RNN, LSTM, GRU) included the number of previous weeks (ranging from 6 to 60), the number of hidden layers (ranging from 2 to 4), and the number of neurons per layer (ranging from 10 to 15). The daily predictions have been validated by comparing the results with estimations based on calculating the sum of the first two defined control parameters. Weekly predictions have been validated based on the sum of the three defined control parameters.
In this study, the performance of three neural network methods (RNN, LSTM, GRU) was thoroughly examined through a Monte Carlo analysis, focusing on three key criteria: the number of previous weeks analyzed, the number of hidden layers, and the number of neurons per layer. Two distinct analyses were conducted, one targeting daily predictions and the other focusing on weekly predictions.
Across the methods, GRU consistently yielded the lowest results, while RNN generally produced the highest outcomes, with LSTM exhibiting narrower ranges of variation. Particularly noteworthy was LSTM’s ability to approach GRU’s results and consistently outperform GRU in the worst-case scenarios.
Regarding the influence of the number of weeks considered, there was a clear trend indicating that results improved as the number of weeks analyzed increased. However, once the analysis extended beyond one year, the observed improvements were not as significant.
When evaluating the impact of the number of hidden layers, it was observed that models with two hidden layers generally outperformed those with four layers. However, it is worth noting that the disparity in results obtained with two layers was greater than that observed with four layers. Similarly, concerning the number of neurons per layer, the best results were achieved with fewer neurons, typically around 10. Nonetheless, models with a higher number of neurons exhibited more consistent performance.
Analyzing each method specifically, the analysis of the RNN method indicated that increasing the number of previous weeks analyzed did not necessarily lead to improved results. Optimal performance was observed with approximately 30 weeks of analysis. Additionally, models with four hidden layers consistently outperformed those with fewer layers. The number of neurons did not significantly affect the results. Regarding the LSTM method, the optimal configuration involved approximately 15 neurons per layer, with the number of weeks and hidden layers remaining relatively unchanged across the general analysis. Finally, the analysis of the GRU method highlighted that the best results for GRU models were achieved with approximately 80 weeks of analysis. While models with four hidden layers generally performed better, the optimal number of neurons was around 10.
In terms of weekly predictions, both LSTM and GRU tended to yield lower values compared to RNN, with LSTM demonstrating narrower ranges of variation. As observed in the daily predictions, increasing the number of weeks analyzed led to improved results, indicating a positive correlation between data depth and prediction accuracy.
Consistently, models with four hidden layers outperformed those with two layers in weekly predictions. Moreover, models with 15 neurons per layer tended to perform better than those with 10 neurons.
Analyzing each method specifically, similar to the daily predictions, the number of weeks, hidden layers, and neurons did not significantly impact the results for RNN models in the weekly predictions. The optimal configuration for LSTM models remained consistent across analyses, with no substantial variations observed in the number of weeks, hidden layers, or neurons. Optimal configurations for GRU models involved approximately 80 weeks of analysis, four hidden layers, and 15 neurons per layer, demonstrating a similar trend to the daily predictions.
4. Conclusions
Monte Carlo simulations have helped select the best method for each case. For daily simulations, PI1 and PI2 indicators (mean-absolute and maximum-absolute errors over 24 h) were used. Their sum determined the method selection. For weekly simulations, the control element was PI3 (mean-absolute error between the second and final day). Results are presented in
Table 1, which shows the method for each network and simulation.
Table 1 results indicate that the LSTM method was used in most situations with an analysis period of over a year. The number of hidden layers and neurons per layer did not significantly impact the results. However, the GRU method was advantageous in some cases, and the RNN method provided the best results in one case.