# A Short-Term Water Demand Forecasting Model Using a Moving Window on Previously Observed Data

^{*}

## Abstract

**:**

## 1. Introduction

## 2. The Proposed Model

#### 2.1. Estimation of the Coefficients ${\mathsf{\alpha}}_{t}$ and ${\mathsf{\beta}}_{t,k}$

_{1}, s

_{2},…, s

_{n}would not be obtained by going back 7 × 24 h, 7 × 24 × 2 h,… 7 × 24 × n h, that is, by considering the Tuesdays of the previous weeks, but rather by selecting the corresponding hours of the previous Sundays (or other holidays, considered equivalent to Sundays). In the example considered, where the forecasting time t corresponds to an hour of a holiday falling on a Tuesday, s

_{1}would be equal to t − 2 × 24, therefore, going back 2 days, from Tuesday to Sunday, s

_{2}would be equal to t − (2 + 7) × 24, whilst considering the same hour occurring two Sundays ago, s

_{3}would be equal to t − (2 + 7 × 2) × 24, …, and s

_{n}would be equal to t − (2 + 7 × (n − 1)) × 24. Incidentally, in this case, the series of observed data would be slightly shorter than n weeks (since s

_{n}= t − (2 + 7 × (n − 1)) × 24, and not s

_{n}= t − (7 × n) × 24 as in the case of an “ordinary” condition (see Equation (4)).

_{j}(with j = 1, 2, …, n) while, with reference to Equation (4) and under “ordinary” conditions, s

_{1}= t − 7 × 24, s

_{2}= t − 7 × 24 × 2,…, s

_{n}= t − 7 × 24 × n, and ${\overline{D}}_{{s}_{j}-24}^{obs}$ is the observed average water demand in the 24 h preceding the hour s

_{j}(i.e., from s

_{j}− 24 to s

_{j}) (see Figure 1).

_{j}(with j = 1, 2, …, n). It should be noted that at every forecasting time step t, 24 values of the coefficient ${\mathsf{\beta}}_{t,k}$ are calculated, one for each forecast lead time k (with $k=1,2,...,K=24$). The earlier considerations regarding the definition of the set S where the forecasted hour corresponds to an hour of a holiday falling on a weekday clearly apply for the estimation of ${\mathsf{\beta}}_{t,k}$ as well.

#### 2.2. Considerations on the Length n of the Moving Window

#### 2.3. Model with Holidays and Special Occasions

_{y}denotes the hour of the same holiday corresponding to the current time t but occurring y years earlier and hence ${Q}_{{s}_{y}+k}^{obs}$ is the hourly water demand corresponding to the observed forecasted hour (which falls within a holiday) y = 1, 2, …, m years earlier and ${\overline{D}}_{{s}_{y}}^{obs}$ is the corresponding average water demand observed in the 24 h following the hour s

_{y}in the y = 1, 2,…, m previous years.

_{h}_WDF (αβ holiday Water Demand Forecasting) model.

## 3. Case Study

_{h}_WDF model is presented; the coefficients ${\mathsf{\beta}}_{t,k}$ assumed when applying the latter were estimated on the basis of observed data for the years 1997 and 1999 as well (since data related to the holidays considered were also available for these years).

## 4. Analysis and Discussion of the Results

_{h}_WDF model can provide a benefit. Indeed, as can be observed in Figure 9, which also shows the 1-h-ahead forecast provided by the αβ

_{h}_WDF model, the estimate of the coefficients ${\mathsf{\beta}}_{t,k}$ made for the same holiday in the m = 3 previous years (1997, 1998, and 1999) (see Equation (7)) enables a more accurate forecast of the trend in water demand. This is further confirmed by the RMSE and MAE% values computed considering all and solely the public holidays in the year 2000, as they fall slightly from 8.5 and 10 L/s, respectively, for the 1- and 24-h-ahead forecasts of the αβ_WDF model—corresponding to MAE% values in the range of 10% to 13%—to 7.5 L/s and 8 L/s, respectively, for the 1- and 24-h-ahead forecasts of the αβ

_{h}_WDF model, corresponding to MAE% values in the range of 9.5% to 10%.

## 5. Conclusions

_{h}_WDF, enables a certain improvement in forecasting accuracy. In conclusion, its good forecasting capability over different time horizons and different periods/years, combined with the need for a small set of observed data for its implementation, make the proposed model a robust and effective water demand forecasting tool to be used in the context of real-time network management, potentially for any network size. This is due to its nature which is based on the use of data observed just prior to the time of the forecast. However, this latter aspect is currently under investigation considering case studies different from the one here examined, which regards a middle size pipe network, in order to characterize its efficacy as the number of served users changes. Results will be published in due time.

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## Appendix A. Example of Numerical Estimation of the Coefficients ${\mathsf{\alpha}}_{t}$ and ${\mathsf{\beta}}_{t,k}$

_{j}(with j = 1,2,3) is thus $\left\{{s}_{1};\text{\hspace{0.17em}}{s}_{2};\text{\hspace{0.17em}}{s}_{3}\right\}=\left\{t-7\times 24;\text{\hspace{0.17em}}t-7\times 24\times 2;\text{\hspace{0.17em}}t-7\times 24\times 3\right\}$ (see Figure A1).

_{j}(with j = 1, 2, 3) and ${\overline{D}}_{{s}_{j}-24}^{obs}$ is the observed average water demand in the 24 h preceding the hour s

_{j}(i.e., from s

_{j}− 24 to s

_{j}) (see also Figure 1). Thus, considering the water consumptions provided in Figure A1, the values of ${\overline{D}}_{{s}_{j}}^{obs}$ and ${\overline{D}}_{{s}_{j}-24}^{obs}$ for j = 1, 2, 3 are $\{49.05;48.45;48.51\}$ and $\{46.09;46.08;46.15\}$ respectively.

_{j}(with j = 1, 2, 3), and thus, considering the water consumptions provided in Figure A1, the values of ${Q}_{{s}_{j}+k}^{obs}$ for k = 3 are $\{24.72;24.71;24.77\}$.

**Figure A1.**Hourly water consumption of the days {i, i − 1,…, i − 6, i − 7, i − 8,…, i − 13, i − 14, i − 15,…, i − 20, i − 21, i − 22}. The values used to compute ${\mathsf{\alpha}}_{t}$ and ${\mathsf{\beta}}_{t,k}$ at the forecasting time t considering a lead time k = 3 are highlighted using the halftone screens provided in the legend.

## References

- Donkor, E.; Mazzuchi, T.; Soyer, R.; Alan Roberson, J. Urban Water Demand Forecasting: Review of Methods and Models. J. Water Resour. Plan. Manag.
**2014**, 140, 146–159. [Google Scholar] [CrossRef] - Billings, B.; Jones, C. Forecasting Urban Water Demand, 2nd ed.; American Waterworks Association: Denver, CO, USA, 2008. [Google Scholar]
- Alhumoud, J.M. Freshwater consumption in Kuwait: Analysis and forecasting. J. Water Supply Res. Technol. AQUA
**2008**, 57, 279–288. [Google Scholar] [CrossRef] - Mohamed, M.; Al-Mualla, A. Water demand forecasting in Umm Al-Quwain using the constant rate model. Desalination
**2010**, 259, 161–168. [Google Scholar] [CrossRef] - Feng, S.; Li, L.; Duan, Z.; Zhang, J. Assessing the impacts of South-to-North Water Transfer Project with decision support systems. Decis. Support Syst.
**2007**, 42, 1989–2003. [Google Scholar] [CrossRef] - Lee, S.; Wentz, E.; Gober, P. Space-time forecasting using soft geostatistics: A case study in forecasting municipal water demand for Phoenix, Arizona. Stoch. Environ. Res. Risk Assess.
**2010**, 24, 283–295. [Google Scholar] [CrossRef] - Polebitski, A.; Palmer, R.; Waddell, P. Evaluating water demands under climate change and transitions in the urban environment. J. Water Resour. Plan. Manag. ASCE
**2011**, 137, 249–257. [Google Scholar] [CrossRef] - Wu, L.; Zhou, H. Urban water demand forecasting based on HP filter and fuzzy neural network. J. Hydroinf.
**2010**, 12, 172–184. [Google Scholar] - Zhou, S.; McMahon, T.; Walton, A.; Lewis, J. Forecasting operational demand for an urban water supply zone. J. Hydrol.
**2002**, 259, 189–202. [Google Scholar] [CrossRef] - Alvisi, S.; Franchini, M.; Marinelli, A. A short-term, pattern-based model for water-demand forecasting. J. Hydroinf.
**2007**, 9, 39–50. [Google Scholar] [CrossRef] - Gato, S.; Jayasuriya, N.; Roberts, P. Forecasting residential water demand: Case study. J. Water Resour. Plan. Manag. ASCE
**2007**, 133, 309–319. [Google Scholar] [CrossRef] - Herrera, M.; Torgo, L.; Izquierdo, J.; Perez-Garcia, R. Predictive models for forecasting hourly urban water demand. J. Hydrol.
**2010**, 387, 141–150. [Google Scholar] [CrossRef] - Bakker, M.; Vreeburg, J.H.G.; Schagen, K.M.V.; Rietveld, L.C. A fully adaptive forecasting model for short-term drinking water demand. Environ. Model. Softw.
**2013**, 48, 141–151. [Google Scholar] [CrossRef] - Alvisi, S.; Franchini, M. Assessment of predictive uncertainty within the framework of water demand forecasting using the Model Conditional Processor (MCP). Urban Water J.
**2017**, 14, 1–10. [Google Scholar] [CrossRef] - Adamowski, J.; Chan, H.F.; Prasher, S.O.; Ozga-Zielinski, B.; Sliusarieva, A. Comparison of multiple linear and nonlinear regression, autoregressive integrated moving average, artificial neural network, and wavelet artificial neural network methods for urban water demand forecasting in Montreal, Canada. Water Resour. Res.
**2012**, 48. [Google Scholar] [CrossRef] - Puleo, V.; Fontanazza, C.M.; Notaro, V.; de Marchis, M.; Freni, G.; La Loggia, G. Pumps as turbines (PATs) in water distribution networks affected by intermittent service. J. Hydroinf.
**2014**, 16, 259–271. [Google Scholar] [CrossRef] - De Marchis, M.; Freni, G. Pump as turbine implementation in a dynamic numerical model: Cost analysis for energy recovery in water distribution network. J. Hidroinf.
**2015**, 17, 347–360. [Google Scholar] [CrossRef] - Al-Zahrani, M.A.; Abo-Monasar, A. Urban Residential Water Demand Prediction Based on Artificial Neural Networks and Time Series Models. Water Resour. Manag.
**2015**, 29, 3651–3662. [Google Scholar] [CrossRef] - Dos Santos, C.C.; Pereira Filho, A.J. Water Demand Forecasting Model for the Metropolitan Area of Sao Paulo, Brazil. Water Resour. Manag.
**2014**, 28, 4401–4414. [Google Scholar] [CrossRef] - Aly, A.; Wanakule, N. Short-term forecasting for urban water consumption. J. Water Resour. Plan. Manag. ASCE
**2004**, 130, 405–410. [Google Scholar] [CrossRef] - Tiwari, M.K.; Adamowski, J.F. Medium-term urban water demand forecasting with limited data using an ensemble wavelet-bootstrap machine-learning approach. J. Water Resour. Plan. Manag.
**2015**, 141. [Google Scholar] [CrossRef] - Liu, J.; Savenije, H.; Xu, J. Forecast of water demand in Weinan City in China using WDF-ANN model. Phys. Chem. Earth
**2003**, 28, 219–224. [Google Scholar] [CrossRef] - Ghiassi, M.; Zimbra, D.; Saidane, H. Urban water demand forecasting with a dynamic artificial neural network model. J. Water Resour. Plan. Manag.
**2008**, 134, 138–146. [Google Scholar] [CrossRef] - Babel, M.S.; Shinde, V.R. Identifying Prominent Explanatory Variables for Water Demand Prediction Using Artificial Neural Networks: A Case Study of Bangkok. Water Resour. Manag.
**2011**, 25, 1653–1676. [Google Scholar] [CrossRef] - Romano, M.; Kapelan, Z. Adaptive water demand forecasting for near real-time management of smart water distribution systems. Environ. Model. Softw.
**2014**, 60, 265–276. [Google Scholar] [CrossRef] [Green Version] - Msiza, I.S.; Nelwamondo, F.V.; Marwala, T. Water demand prediction using artificial neural networks and support vector regression. J. Comput.
**2008**, 3, 1–8. [Google Scholar] [CrossRef] - Shabani, S.; Yousefi, P.; Adamowski, J. Intelligent Soft Computing Models in Water Demand Forecasting. In Water Stress in Plants; Rahman, I.M.M., Begum, Z.A., Hasegawa, H., Eds.; InTech: Rijeka, Croatia, 2016; pp. 99–117. [Google Scholar]
- Lertpalangsunti, N.; Chan, C.W.; Mason, R.; Tontiwachwuthikul, P. Toolset for construction of hybrid intelligent forecasting systems: Application for water demand prediction. Artif. Intell. Eng.
**1999**, 13, 21–42. [Google Scholar] [CrossRef] - Rafiq, M.; Bugmann, G.; Easterbrook, D. Neural Network Design for Engineering Applications. Comput. Struct.
**2001**, 79, 1541–1552. [Google Scholar] [CrossRef] - Alvisi, S.; Franchini, M. A Procedure for the Design of District Metered Areas in Water Distribution Systems. Procedia Eng.
**2014**, 70, 41–50. [Google Scholar] [CrossRef] - Alfares, H.K.; Nazeeruddin, M. Electric load forecasting: Literature survey and classification of methods. Int. J. Syst. Sci.
**2002**, 33, 23–34. [Google Scholar] [CrossRef] - Monedero, I.; Biscarri, F.; Guerrero, J.I.; Peña, M.; Roldán, M.; Leòn, C. Detection of Water Meter Under-Registration Using Statistical Algorithms. J. Water Resour. Plan. Manag.
**2016**, 142, 1–10. [Google Scholar] [CrossRef] - Monedero, I.; Biscarri, F.; Guerrero, J.I.; Roldán, M.; Leòn, C. An Approach to Detection of Tampering in Water Meters. Procedia Comput. Sci.
**2015**, 60, 413–421. [Google Scholar] [CrossRef]

**Figure 2.**Root Mean Square Error (RMSE) of the αβ_WDF and Patt_WDF models for the years 1998 and 2000 for different forecasting time horizons.

**Figure 3.**Mean Absolute Error (MAE%) of the αβ_WDF and Patt_WDF models for the years 1998 and 2000 for different forecasting time horizons.

**Figure 4.**Comparison of the forecasting error frequency histograms of the αβ_WDF and Patt_WDF models for the year 1998 and the time horizons of (

**a**) 1 h; (

**b**) 6 h; (

**c**) 12 h; and (

**d**) 24 h.

**Figure 5.**Comparison of the forecasting error frequency histograms of the αβ_WDF and Patt_WDF models for the year 2000 and the time horizons of (

**a**) 1 h; (

**b**) 6 h; (

**c**) 12 h; and (

**d**) 24 h.

**Figure 6.**Scatter plot of the (

**a**) 1-h-ahead; (

**b**) 6-h-ahead; (

**c**) 12-h-ahead; and (

**d**) 24-h-ahead forecasts provided by the αβ_WDF model for the year 1998.

**Figure 7.**Scatter plot of the (

**a**) 1-h-ahead; (

**b**) 6-h-ahead; (

**c**) 12-h-ahead; and (

**d**) 24-h-ahead forecasts provided by the αβ_WDF model for the year 2000.

**Figure 8.**Comparison between the observed water demand pattern for a generic day in the year 2000 (23 January) and the 1- and 24-h-ahead forecasts provided by the αβ_WDF model. Q is the discharge flowing in the main pipe that connects the tank to the water distribution system, thus representing the total water demand of the network.

**Figure 9.**Comparison between the observed water demand pattern for a holiday in the year 2000 (1 May, international workers’ day) and the 1-h-ahead forecasts provided by the αβ_WDF and αβ holiday Water Demand Forecasting (αβ

_{h}_WDF) models. Q is the discharge flowing in the main pipe that connects the tank to the water distribution system, thus representing the total water demand of the network.

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license ( http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Pacchin, E.; Alvisi, S.; Franchini, M.
A Short-Term Water Demand Forecasting Model Using a Moving Window on Previously Observed Data. *Water* **2017**, *9*, 172.
https://doi.org/10.3390/w9030172

**AMA Style**

Pacchin E, Alvisi S, Franchini M.
A Short-Term Water Demand Forecasting Model Using a Moving Window on Previously Observed Data. *Water*. 2017; 9(3):172.
https://doi.org/10.3390/w9030172

**Chicago/Turabian Style**

Pacchin, Elena, Stefano Alvisi, and Marco Franchini.
2017. "A Short-Term Water Demand Forecasting Model Using a Moving Window on Previously Observed Data" *Water* 9, no. 3: 172.
https://doi.org/10.3390/w9030172