# Energy Management in Residential Dwellings: Forecasting Hot Water Demand with Hybrid Machine Learning Models

Ibrahim Ali Kachalla, Christian Ghiaus, Adeniran Ademuwagun

► To cite this version:

Ibrahim Ali Kachalla, Christian Ghiaus, Adeniran Ademuwagun. Energy Management in Residential Dwellings: Forecasting Hot Water Demand with Hybrid Machine Learning Models. 2024 9th IEEE Workshop on the Electronic Grid (eGRID), Nov 2024, Santa Fe, United States. pp.1-6, 10.1109/eGRID62045.2024.10842758 . hal-04913375

HAL Id: hal-04913375

https://hal.science/hal-04913375v1

Submitted on 27 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Energy Management in Residential Dwellings:
## Forecasting Hot Water Demand with Hybrid
## Machine Learning Models

1st Ibrahim Ali Kachalla

Centre for Energy and Thermal Engineering (CETHIL)
UMR5008, INSA Lyon, University of Lyon
F-69621 Villeurbanne, France.

Email: ibrahim-ali.kachalla@insa-lyon.fr

2nd Christian Ghiaus

Centre for Energy and Thermal Engineering (CETHIL)
UMR5008, INSA Lyon, University of Lyon
F-69621 Villeurbanne, France.

Email: christian.ghiaus@insa-lyon.fr

3rd Adeniran Ademuwagun

Electrical and Electronics Engineering Department
Air Force Institute of Technology Kaduna
Air Force Base, Kaduna, Nigeria.

Email: kademuwagun@gmail.com

**Abstract**—Optimal and accurate forecasting of hot water consumption is essential for optimizing grid energy usage and supporting sustainable energy management in the fight against global warming and fluctuating demand in a changing climate. This study hybridises and compares supervised learning algorithms, Support Vector Regression (SVR), and the statistical regression technique ARIMA, both integrated with Multi-Layer Perceptron (MLP). The analysis utilises one year and five months of domestic hot water consumption data from a residential building, categorized into daily seasonal consumption for winter and summer scenarios as endogenous inputs. SVR-MLP demonstrates superior accuracy in winter at 94%, effectively modeling irregularities and non-linearity dependencies in hot water demand, despite higher computational costs of 3 minutes and 35 seconds. In contrast, ARIMA-MLP performs optimally in summer, offering computationally efficient and precise forecasts under stable variable seasonal conditions with 98% accuracy. This study highlights the strengths and limitations of each model, offering valuable insights for optimizing domestic hot water and energy consumption forecasting based on seasonal variability.

**Index Terms**—Domestic Hot Water Consumption, Energy Management, Hybrid Model, Machine Learning, Residential Buildings

## I. INTRODUCTION

By accurately predicting hot water demand, energy management systems can optimise the operation of water heaters and other related systems. This optimization can lead to reduced energy consumption during peak periods and more effective use of off-peak energy, which typically costs less, thereby lowering utility bills [1], [2]. As global warming increases, energy consumption is projected to rise by over 50%, with the residential sector contributing around 20% of this increase. domestic hot water boiler (DHW) account for

45.8% of energy consumption in dwellings due to consistent hot water usage year-round from DHW activities [1]. This usage includes activities such as showering, kitchen use, and bathtub filling [3], [4]. Accurate models are essential for implementing Model Predictive Control (MPC) strategies for demand-side response management [5], [6]. However, developing these models is challenging due to the complexities of time series data and the non-linear nature of user behavior with seasonal variation. Time series models, like ARIMA, effectively capture seasonal trends and temporal dynamics in domestic hot water consumption data. In 2015, Aurore Lomet et al. [7] developed an ARIMA model for daily domestic hot water (DHW) consumption, accounting for weekly periodicity and random fluctuations.

Support vector regression (SVR), an extension of SVM, handles non-linearities that classical methods like ARIMA cannot. Machine learning technologies like Artificial Neural Networks (ANNs) have become popular for managing complex, non-linear user behaviours in hot water consumption. Sheng Cao et al. used SVM to predict showering behaviours, achieving a 33% reduction in hot water demand [8]. Similarly, SVR and Machine learning methods manage high-dimensional and non-linear dependencies in data effectively. Christopher Bennett et al. developed an ANN-based model for residential water demand forecasting [9]. Combining classical regression methods with machine learning has led to more accurate hybrid load demand models [10]. Accurate predictions and forecasts enable precise energy consumption planning, reducing energy waste caused by overestimating hot water demand, while accounting for seasonal variability and its influence on domestic hot water consumption in
residential buildings.

This study hybridizes statistical regression (ARIMA) with machine learning regression techniques (SVR and Multi-layer Perceptron) to form ARIMA-MLP and SVR-MLP models. The primary focus is to forecast hot water consumption in residential buildings and compare the accuracy of these models. Performance metrics are employed to evaluate the models' accuracy, seasonal variability, and computational efficiency. Table I provides a summary of related literature on domestic hot water consumption in residential buildings, highlighting research methodologies, forecast time steps, data configurations, and research gaps, particularly in the comparison of hybrid models.

## II. METHODOLOGY

The primary objective is to examine the seasonal influence of endogenous inputs by comparing the forecast accuracy of hybridized ARIMA-MLP and SVR-MLP models for domestic hot water consumption across two scenarios: winter and summer daily time-steps. The performance is evaluated using MAE, RMSE, and R-squared. This section outlines the model development and research methodology framework, as illustrated in Figure 1.

<figure><img src="image_2.png" /><figcaption>Fig. 1. methodology framework of research</figcaption></figure>

### A. Case study

Hot water consumption data were collected from 67 apartments between the duration from 2020-02-14, 08:00:00 to 2021-08-02, 12:00:00 which is 1 year, 5 months, 19 days, and 4 hours. The data were categorised into two scenarios

for evaluation, the different scenarios used for evaluating the forecasting models are summer and winter with daily time-step, 120 days training period, and 30 days forecast length for each scenario. Furthermore, Models were trained on 80% of the data, with the remaining 20% used as the test set.

Figure 2 and Figure 3 represent the statistical description of the case study hot water consumption dataset. Apartment 4 in summer and apartment 5 in winter show significant variability in hot water usage, with some extreme consumption values, while apartments 1,2,3,6, and 7 maintain stable, low hot water consumption in both summer and winter, exhibiting consistent usage patterns.

<figure><img src="image_3.png" /><figcaption>Fig. 2. Apartments summer hot water consumption</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig. 3. Apartments winter hot water consumption</figcaption></figure>

### B. Hybrid model development

This study combines ARIMA with machine learning techniques (MLP and SVR) using a two-stage prediction approach. First, the ARIMA and SVR models capture the linear components of the time series. The residuals, representing non-linear relationships, are then used as exogenous input features for the MLP to address variation complexities that ARIMA and SVR cannot capture from the endogenous
<table><caption>TABLE I
COMPARATIVE ANALYSIS OF RESEARCH METHODOLOGIES</caption><thead><tr><th rowspan="2">Research</th><th colspan="3">Methodology</th><th rowspan="2">Forecast Time-Step</th><th rowspan="2">Data Configurations</th><th rowspan="2">Research Gap</th></tr><tr><th>Regression</th><th>Machine Learning</th><th>Hybrid</th></tr></thead><tbody><tr><td>Fargallo et al. [11]</td><td>✓<sup>a</sup></td><td></td><td></td><td>–<sup>b</sup></td><td>98 apartments, 2015 to 2021</td><td>Did not include hybrid methods</td></tr><tr><td>Louis-Gabriel et al. [12]</td><td></td><td>✓</td><td></td><td>–</td><td>40-unit residential building, Quebec City (Canada)</td><td>Did not incorporate hybrid models</td></tr><tr><td>Xin Zhou et al. [10]</td><td></td><td>✓</td><td>✓</td><td>–</td><td>Female hostel university in Xi’an, China, 1 March to 30 Nov. 2022</td><td>Lacked analysis over multiple scenarios</td></tr><tr><td>Gelazan et al. [13]</td><td>✓</td><td></td><td></td><td>Hourly</td><td>1 hour, 2 hours, 3 hours for 2006 EWB</td><td>Did not compare hybrid approaches</td></tr><tr><td>Bennett et al. [9]</td><td>✓</td><td></td><td></td><td>Liter/person</td><td>Southeast Queensland residential end-user study (SEWREUS)</td><td>Did not assess hybrid model performance</td></tr></tbody></table>

inputs. The final prediction is a weighted combination of both models' outputs as presented Figure 4. The hybrid models, ARIMA-MLP and SVR-MLP, aim to improve accuracy by leveraging the strengths of both regression and machine learning techniques.

### C. ARIMA-MLP model development

The ARIMA (3,1,0) model was selected through empirical simulations using the Akaike Information Criterion (AIC) and the Autocorrelation Function (ACF) to ensure the best fit. Parameters were estimated by maximizing the likelihood function, fitting the model with autoregression AR(p=3), integrating difference I(d=1), and moving average MA(q=0) components. The model uses the entire dataset to predict future hot water consumption levels:

$$ \hat{x}_{t+1} = \zeta + \phi_1 \Delta x_t + \phi_2 \Delta x_{t-1} + \phi_3 \Delta x_{t-2} + \theta_1 \epsilon_t \quad (1) $$

where $\hat{x}_{t+1}$ is the forecast at time $t+1$, $\zeta$ is a constant, and $\theta_1 \epsilon_t$ models the error as a linear combination of past errors up to the q-th lag. The residual error from the ARIMA forecast is used as input for the machine learning models to capture non-linear components that ARIMA missed. Forecast errors are calculated as the difference between the actual observed values and the ARIMA model's forecasted values:

$$ f_t = y_t - \hat{y}_t \quad (2) $$

where $y_t$ is the actual value at time $t$ and $\hat{y}_t$ is the forecasted value. The forecast error $f_t$ reflects the discrepancies between actual outcomes and model forecasts. Both $y_t$ and $f_t$ (residuals) are used as inputs to the MLP, which learns from these errors to correct future predictions and capture non-linear patterns missed by ARIMA as presented Figure 4. The hybrid forecasts combine the ARIMA forecasts $\hat{y}_{f,t}$ with

the MLP forecasted $\hat{z}_{\text{fore},t}$ using a weighted sum, yielding the final forecasts:

$$ \hat{y}_{f,\text{adj},t} = w_1 \cdot \hat{y}_{f,t} + w_2 \cdot \hat{z}_{\text{fore},t} \quad (3) $$

where $\hat{y}_{f,\text{adj},t}$ is the final hybrid forecast at time $t$.

<figure><img src="image_5.png" /><figcaption>Fig. 4. Hybrid model research frame work</figcaption></figure>

### D. SVR-MLP model development

The support vectors and coefficients in the SVR model are determined during the training process. Based on preliminary

<footnote>a Method considered by author</footnote>

<footnote>b Demand not considered by author</footnote>
empirical simulations, the optimal parameters are: Sigma (σ) for the kernel function is set to 0.005, Error Tolerance (ε) at 0.2, Epsilon at 0.1, and Maximum Iterations capped at 1000. The Gaussian kernel (RBF) is used to map the input data into a higher-dimensional space. The kernel function is presented as:

$$K(x, y) = e^{-\frac{\|x-y\|^2}{2\sigma^2}} \quad (4)$$

where σ is the bandwidth parameter, and x and y are data points. The Lagrange multipliers (αᵢ) are initialized to zero and iteratively updated, solving the SVR optimization problem:

$$\alpha_i = \alpha_i + y_i - \epsilon \cdot \text{sign}(\alpha_i) - \sum_{j=1}^{n} \alpha_j K(x, x_i) \quad (5)$$

The model halts updating when changes in α values fall below the tolerance threshold, preventing over-fitting and ensuring computational efficiency. The final prediction (ŷ) is calculated as:

$$\hat{y} = \sum_{i=1}^{n} \alpha_i K(\tilde{x}_i, x_i) + b \quad (6)$$

The robustness of the model was evaluated using an epsilon-insensitive loss function, and the Mean Squared Error (MSE) metric was adopted for performance evaluation. For forecasting, x includes lagged observations of the time series, and the forecasted value is given by:

$$\hat{y}_{t+1} = \sum_{i=1}^{n} \alpha_i K(x_t, x_i) + b \quad (7)$$

where ŷₜ₁ represents the forecasted value at time t + 1, t + 2, ..., and xₜ includes features observed up to time t. In predicting energy consumption, the SVR model uses input features x directly related to the prediction target:

$$\hat{y} = \sum_{i=1}^{n} \alpha_i K(x, x_i) + b \quad (8)$$

The residual equation is defined as:

$$r_t = y_t - \hat{y}_t \quad (9)$$

where yₜ is the actual observed value, and ŷₜ is the predicted or forecasted value at time t. The residual for future forecasting is computed as:

$$r_{t+1} = y_{t+1} - \hat{y}_{t+1} \quad (10)$$

where yₜ₁ is the actual value at time t + 1 after updating, and ŷₜ₁ is the forecasted value for the same period from the SVR model. In the SVR-MLP hybrid implementation, similar to Figure 4, the ARIMA model is replaced with the

SVR model. The SVR model calculates residuals (rₜ) at time t. The forecast ŷₜ₁ₖ for a future time t + k is given as:

$$\hat{y}_{t+k} = \text{SVR}(X_t) \quad (11)$$

where ŷₜ₁ₖ is the forecasted value k periods ahead of the last observed time t. Additionally, fSVRt+k is the SVR forecast, and fMLPt+k is the MLP forecast for the same future time. The hybrid forecasts fhyb t+k are computed as:

$$f_{t+k}^{\text{hyb}} = w_1 \cdot f_{t+k}^{\text{SVR}} + w_2 \cdot f_{t+k}^{\text{MLP}} \quad (12)$$

where w₁ and w₂ are the weights for the SVR and MLP predictions respectively.

### III. RESULTS AND DISCUSSION

The model was developed in Python and tested on a system with an 8th Gen Intel Core i5-8265U CPU @ 1.60 GHz and 16 GB RAM. Computational time was computed during the simulations, and the forecasting results were compared. Additionally, the models were evaluated under different seasonal conditions, as hot water and energy demand vary by season, as presented in Table II.

In winter, SVR-MLP incurred a computational cost of 3 minutes and 35 seconds (215 s), while ARIMA-MLP took 48 seconds, showcasing its efficiency. In summer, both models demonstrated low computational costs, with ARIMA-MLP being more efficient due to lower variability in hot water demand.

<table><caption>TABLE II
COMPUTATION TIME COMPARISON OF HYBRID MODELS</caption><thead><tr><td>Scenario (Timestep)</td><td>Algorithms Model</td><td>Computation Time</td></tr></thead><tbody><tr><td rowspan="2">Winter (daily)</td><td>SVR-MLP</td><td>215 s</td></tr><tr><td>ARIMA-MLP</td><td>48 s</td></tr><tr><td rowspan="2">Summer (daily)</td><td>SVR-MLP</td><td>43 s</td></tr><tr><td>ARIMA-MLP</td><td>38 s</td></tr></tbody></table>

In winter, ARIMA-MLP performs poorly, with a negative variability of R² (-0.712), unable to handle the nonlinearity in the hot water consumption pattern. SVR-MLP shows moderate results with an R² of 0.056 as presented in Table III. Both models perform better in summer, with ARIMA-MLP and SVR-MLP values of R² 0.988 and 0.748, respectively. ARIMA-MLP has a high RMSE (0.382) in winter, while SVR-MLP shows better performance with RMSE (0.061). In summer, ARIMA-MLP achieves high accuracy with an RMSE of 0.020. Similarly, ARIMA-MLP shows high winter error with MAE 0.367, while SVR-MLP performs better with an MAE of 0.043.

These results highlight the volatility of winter demand, making forecasting more challenging, while ARIMA-MLP performs better in the stable summer season, as shown in Figure 5 and Figure 6. However, SVR-MLP demonstrated proficiency in fitting time series data with a lag. These
<table><caption>TABLE III
PERFORMANCE METRICS</caption><thead><tr><th>Scenario (Timestep)</th><th>Algorithms Model</th><th>MAE</th><th>RMSE</th><th>R<sup>2</sup></th></tr></thead><tbody><tr><td rowspan="2">Winter (daily)</td><td>SVR-MLP</td><td>0.043</td><td>0.061</td><td>0.056</td></tr><tr><td>ARIMA-MLP</td><td>0.367</td><td>0.382</td><td>-0.712</td></tr><tr><td rowspan="2">Summer (daily)</td><td>SVR-MLP</td><td>0.061</td><td>0.091</td><td>0.748</td></tr><tr><td>ARIMA-MLP</td><td>0.009</td><td>0.020</td><td>0.988</td></tr></tbody></table>

results highlight the SVR-MLP model's superior forecasting capabilities for both winter and summer forecasting.

Further evaluation of advanced machine learning approaches to capture complex behaviors beyond traditional time series trends is recommended. Enhancing the SVR model by addressing the step lag and integrating additional time series features or experimenting with different kernels could improve its ability to capture hot water consumption variability. Finally, applying the ARIMA-MLP model for Model Predictive Control (MPC) in demand-side response and grid management of hot water consumption is recommended for real-time modeling, while SVR-MLP is ideal for handling highly seasonal variations and complex user behavior.

<figure><img src="image_6.png" /><figcaption>Fig. 5. Winter hot water consumption forecast</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Fig. 6. Summer hot water consumption forecast</figcaption></figure>

## IV. CONCLUSION

The hybrid ARIMA-MLP model demonstrates superior performance and computational efficiency, making it highly

effective for forecasting hot water usage. Its accurate forecasts enable precise energy allocation, reducing the risk of overproduction or underproduction, thereby minimizing energy waste and lowering overall costs. This study compared the forecasting accuracy of two novel hybridised models (SVR-MLP & ARIMA-MLP), highlighting their strengths and limitations, and provided recommendations for improvement.

The study has shown that ARIMA-MLP is proficient in forecasting domestic hot water consumption during periods of minimal seasonal variability. In contrast, SVR-MLP shows moderate performance across all seasons and fits well with time series data but is limited by higher computational costs and a time lag. However, SVR-MLP performs better in winter, demonstrating greater accuracy in modeling irregular and non-linearity of hot water consumption, despite its complexity. While ARIMA-MLP struggles in winter, is proficient in summer, making it ideal for energy-efficient forecasting during stable variable seasonal conditions.

These models can be applied not only to domestic hot water consumption but also to other time series data for prediction and forecasting. Future work can explore exogenous variables impacting domestic hot water consumption to improve predictions beyond seasonal variations, considering resident behaviours, household sizes, and seasonal heating needs. This could lead to targeted energy-saving measures and, better resource planning and grid management.

## ACKNOWLEDGMENT

The authors would like to thank the Institut National des Sciences Appliquées de Lyon and the Centre d'Energétique et de Thermique de Lyon for providing the necessary resources and facilities to conduct this research. We are grateful to the Petroleum Technology Development Fund (PTDF), Nigeria, the Air Force Institute of Technology Kaduna, Nigeria, and Immobilier Rhône Alpes-Groupe 3F for their financial support and for providing data, which made this study possible. Lastly, we extend our gratitude to our families and friends for their continuous encouragement and understanding.

## REFERENCES

[1] E. Fuentes, L. Arce, and J. Salom, "A review of domestic hot water consumption profiles for application in systems and buildings energy performance analysis," *Renew. Sustain. Energy Rev.*, vol. 81, pp. 1530-1547, Jan. 2018, doi: 10.1016/j.rser.2017.05.229.

[2] M. J. Ritchie, J. A. A. Engelbrecht, and M. J. Booysen, "Loadshedding-induced transients due to battery backup systems and electric water heaters," *Appl. Energy*, vol. 367, p. 123421, Aug. 2024, doi: 10.1016/j.apenergy.2024.123421.

[3] O. De Somer, A. Soares, K. Vanthournout, F. Spiessens, T. Kuijpers, and K. Vossen, "Using reinforcement learning for demand response of domestic hot water buffers: A real-life demonstration," in *2017 IEEE PES Innovative Smart Grid Technologies Conference Europe (ISGT-Europe)*, IEEE, 2017, pp. 1-7. Accessed: Jan. 13, 2024. [Online]. Available: https://ieeexplore.ieee.org/abstract/document/8260152/

[4] D. Leiria, H. Johra, A. Marszal-Pomianowska, and M. Z. Pomianowski, "A methodology to estimate space heating and domestic hot water energy demand profile in residential buildings from low-resolution heat meter data," *Energy*, vol. 263, p. 125705, Jan. 2023, doi: 10.1016/j.energy.2022.125705.
[5] H. Aki, T. Wakui, and R. Yokoyama, "Development of a domestic hot water demand prediction model based on a bottom-up approach for residential energy management systems," *Appl. Therm. Eng.*, vol. 108, pp. 697-708, Sep. 2016, doi: 10.1016/j.applthermaleng.2016.07.094.

[6] I. A. Kachalla and C. Ghiaus, "Electric Water Boiler Energy Prediction: State-of-the-Art Review of Influencing Factors, Techniques, and Future Directions," *Energies*, vol. 17, no. 2, p. 443, 2024, Accessed: Mar. 12, 2024. [Online]. Available: https://www.mdpi.com/1996-1073/17/2/443

[7] A. Lomet, F. Suard, and D. Chèze, "Statistical modeling for real domestic hot water consumption forecasting," *Energy Procedia*, vol. 70, pp. 379-387, 2015, Accessed: Feb. 13, 2024. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S187661021500260X

[8] S. Cao, S. Hou, L. Yu, and J. Lu, "Predictive control based on occupant behavior prediction for domestic hot water system using data mining algorithm," *Energy Sci. Eng.*, vol. 7, no. 4, pp. 1214-1232, 2019, doi: 10.1002/ese3.341.

[9] C. Bennett, R. A. Stewart, and C. D. Beal, "ANN-based residential water end-use demand forecasting model," *Expert Syst. Appl.*, vol. 40, no. 4, pp. 1014-1023, 2013, Accessed: Oct. 08, 2023. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0957417412009736

[10] X. Zhou, X. Meng, and Z. Li, "ANN-LSTM-A Water Consumption Prediction Based on Attention Mechanism Enhancement," *Energies*, vol. 17, no. 5, Art. no. 5, Jan. 2024, doi: 10.3390/en17051102.

[11] A. Pérez-Fargallo, D. Bienvenido-Huertas, S. Contreras-Espinoza, and L. Marín-Restrepo, "Domestic hot water consumption prediction models suited for dwellings in central-southern parts of Chile," *J. Build. Eng.*, vol. 49, p. 104024, May 2022, doi: 10.1016/j.jobe.2022.104024.

[12] L.-G. Maltais and L. Gosselin, "Energy management of domestic hot water systems with model predictive control and demand forecast based on machine learning," *Energy Convers. Manag. X*, vol. 15, p. 100254, Aug. 2022, doi: 10.1016/j.ecmx.2022.100254.

[13] L. Gelažanskas and K. A. A. Gamage, "Forecasting hot water consumption in dwellings using artificial neural networks," in *2015 IEEE 5th International Conference on Power Engineering, Energy and Electrical Drives (POWERENG)*, May 2015, pp. 410-415. doi: 10.1109/PowerEng.2015.7266352.