Previous Article in Journal
Short-Term Urban Water Demand Forecasting Using an Improved NeuralProphet Model
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

An Approach Based on the Use of Commercial Codes and Engineering Judgement for the Battle of Water Demand Forecasting †

by
Alfredo Iglesias-Rey
1,
Carlos A. López-Rojas
2,
F. Javier Martínez-Solano
2 and
Pedro L. Iglesias-Rey
2,*
1
SAS Institute BV, Flevolaan 69, 1272 PC Huizen, The Netherlands
2
Department of Hydraulic Engineering and Environment, Universitat Politècnica de València, 46022 Valencia, Spain
*
Author to whom correspondence should be addressed.
Presented at the 3rd International Joint Conference on Water Distribution Systems Analysis & Computing and Control for the Water Industry (WDSA/CCWI 2024), Ferrara, Italy, 1–4 July 2024.
Eng. Proc. 2024, 69(1), 176; https://doi.org/10.3390/engproc2024069176 (registering DOI)
Published: 27 September 2024

Abstract

:
This paper demonstrates the synergistic use of engineering judgment and statistical/deep learning models, implemented through a four-step process using the software SAS Viya 4. Initial data filtering, input variable determination, and simultaneous application of RNN, LSTM, and GRU forecasting algorithms are conducted. Results are evaluated based on Battle of Water Demand Forecasting criteria, refining parameters iteratively for enhanced prediction accuracy. The methodology iteratively incorporates new data, streamlining neural network resolution.

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.

Author Contributions

Conceptualization, A.I.-R., C.A.L.-R., F.J.M.-S., and P.L.I.-R.; software, A.I.-R.; methodology, validation, formal analysis, and writing, A.I.-R., F.J.M.-S., and P.L.I.-R. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

No new data were created.

Acknowledgments

Acknowledgements to SAS Institute for providing and supporting the use of SAS Viya software.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Antunes, A.; Andrade-Campos, A.; Sardinha-Lourenço, A.; Oliveira, M.S. Short-term water demand forecasting using machine learning techniques. J. Hydroinformatics 2018, 20, 1343–1366. [Google Scholar] [CrossRef]
  2. Kühnert, C.; Gonuguntla, N.M.; Krieg, H.; Nowak, D.; Thomas, J.A. Application of LSTM networks for water demand prediction in optimal pump control. Water 2021, 13, 644. [Google Scholar] [CrossRef]
  3. Wei, X.; Zhang, L.; Yang, H.Q.; Zhang, L.; Yao, Y.P. Machine learning for pore-water pressure time-series prediction: Application of recurrent neural networks. Geosci. Front. 2021, 12, 453–467. [Google Scholar] [CrossRef]
  4. Hajirahimi, Z.; Khashei, M. Hybridization of hybrid structures for time series forecasting: A review. Artif. Intell. Rev. 2023, 56, 1201–1261. [Google Scholar] [CrossRef]
  5. Hutton, C.J.; Kapelan, Z.; Vamvakeridou-Lyroudia, L.; Savić, D.A. Dealing with uncertainty in water distribution system models: A framework for real-time modeling and data assimilation. J. Water Resour. Plan. Manag. 2014, 140, 169–183. [Google Scholar] [CrossRef]
  6. Sherstinsky, A. Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Physica D 2020, 404, 132306. [Google Scholar] [CrossRef]
  7. Niknam, A.; Zare, H.K.; Hosseininasab, H.; Mostafaeipour, A.; Herrera, M. A critical review of short-term water demand forecasting tools—what method should I use? Sustainability 2022, 14, 5412. [Google Scholar] [CrossRef]
  8. Salloom, T.; Kaynak, O.; He, W. A novel deep neural network architecture for real-time water demand forecasting. J. Hydrol. 2021, 599, 126353. [Google Scholar] [CrossRef]
Table 1. Methods used in each network for daily and weekly predictions.
Table 1. Methods used in each network for daily and weekly predictions.
NetDaily PredictionsWeekly Predictions
MWLNPI1PI2(1 + 2)MWLNPI1PI2PI3
ALSTM804150.1360.1900.325LSTM806150.2300.3140.020
BLSTM806150.0960.0640.159LSTM804100.1250.1390.125
CLSTM704150.1180.1490.267LSTM806150.1070.1910.068
DGRU606150.1030.1030.205LSTM806100.0950.1470.023
ERNN306100.0450.0540.100LSTM804100.0410.0640.013
FGRU806100.1100.0620.173LSTM804150.0970.2960.245
GLSTM806100.0380.1100.147LSTM804100.0840.1630.098
HLSTM704100.0470.0610.108GRU604150.0390.0800.045
ILSTM804150.0310.0590.090GRU806150.0220.0170.021
JGRU804100.0300.0080.038GRU806100.0750.1220.011
M: method; W: number of weeks studied; L: total number of layers (including input and output); N: number of neurons in hidden layers; PI1: mean-absolute error in relation to the 24 h; PI2: maximum-absolute error in relation to the 24 h; (1 + 2): sum of terms PI1 and PI2; PI3: mean-absolute error in relation to the period between the second and the final day.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Iglesias-Rey, A.; López-Rojas, C.A.; Martínez-Solano, F.J.; Iglesias-Rey, P.L. An Approach Based on the Use of Commercial Codes and Engineering Judgement for the Battle of Water Demand Forecasting. Eng. Proc. 2024, 69, 176. https://doi.org/10.3390/engproc2024069176

AMA Style

Iglesias-Rey A, López-Rojas CA, Martínez-Solano FJ, Iglesias-Rey PL. An Approach Based on the Use of Commercial Codes and Engineering Judgement for the Battle of Water Demand Forecasting. Engineering Proceedings. 2024; 69(1):176. https://doi.org/10.3390/engproc2024069176

Chicago/Turabian Style

Iglesias-Rey, Alfredo, Carlos A. López-Rojas, F. Javier Martínez-Solano, and Pedro L. Iglesias-Rey. 2024. "An Approach Based on the Use of Commercial Codes and Engineering Judgement for the Battle of Water Demand Forecasting" Engineering Proceedings 69, no. 1: 176. https://doi.org/10.3390/engproc2024069176

Article Metrics

Back to TopTop