Download paper

Forecasting electricity consumption demand with weather

Categories: ElectricityWeather

Forecasting electricity consumption demand with weather:

A comparison of regression analyses


The major element of electricity resource planning is forecasting the upcoming electricity consumption. Precise forecast of electricity consumption is of primary importance in developing countries’ energy planning. In the last decade, several new techniques have been used for energy consumption planning to accurately forecast future electricity consumption requirements. Consumers’ living standards may vary depending on their weather sensitivity. Therefore, electricity demand is influenced by weather changes. This paper reviews the study on weather impacts on electricity demand in Sri Lanka.

The study involves developing several regression model designs and selecting the best model which is capable of achieving the most accurate results. After the most reliable model is used to forecast electricity consumption and to make personalized consumer profiles. The model developed produces very satisfying outcomes and the electricity consumption range can be reached effectively. In this study, we are proposing a web application with two separate user views, admin and consumer.

The web application provides electricity providers and electricity traders to visualize the variation of electricity demand and electricity consumers to personalized consumer profiles.

Keywords electricity consumption; forecasting; regression; random forest regression; decision tree regression, gradient boosting regression


Electricity a major need that is produced and consumed simultaneously. For the past century, the need and significance of forecasting consumer consumption trends on the market have become a much-debated subject. The demand for electricity has continuously increased in Sri Lanka. According to a survey done by the Public Utilities Commission of Sri Lanka in 2018, the total electricity consumption was 13.

Top Experts
Marrie pro writer
Verified expert
5 (204)
Professor Harris
Verified expert
4.9 (457)
Sweet V
Verified expert
4.9 (984)
hire verified expert

2 billion units in 2017 [1]. Most of the countries like Sri Lanka, relying on various weather factors, are altering their living standards and other weather-dependent electricity consumption. Because energy demand is heavily influenced by fluctuations in weather demand patterns are probable to be influenced. Forecasting electricity consumption along with weather factors is, therefore, a significant element in the strategic planning of electricity suppliers. Not only does the forecast provide the expected amount of electricity consumption needed, but it also helps manage reserved electricity for emergency use.

Consumers play an active part by dynamically altering their consumption and altering consumer behavior by planning their home appliances under weather conditions. Therefore, it is important to improve consumer awareness of efficient electric power consumption. Consumption conduct will, therefore, become outdated and the electricity provider will need fresh sophisticated techniques for forecasting consumption and calculating dynamic load profiles.

Various methods and strategies have been developed for the prevision of electricity consumption [2]- [6]. Most of the built models are based on an artificial neural network and analysis of regression. Most analyzes are considered as more of mere omnipresent variables.

Regression analyses are a set of statistical methods used to assess the relationship between variables. Multiple techniques are involved in modeling and analyzing various variables when concentrating on the association between a dependent variable and one or more independent variables.

The research focuses on forecasting Sri Lankan power consumption through the use of multiple regression models based on information on consumption and weather. Each model performance was evaluated by using several measurements such as Root Mean Square Error and R Squared Value and the best model was selected.

Background study


The demand for electricity is very high. Therefore, the supply and demand must be managed appropriately by electricity providers. Forecasting the coming demand and supply will be important to maintain supply and demand accordingly. Hence, the incorrect estimation of electricity demand may cause many problems, the value of accurate forecasting is increasing. The study focuses on to provide a more accurate predictive model to forecast the upcoming electricity demand.

Existing Studies and Products

Prior to the research, a literary survey was conducted on current platforms with about the same capacity and features. Many authorities have recently discovered energy efficiency programs and policies.

The paper, Artificial neural networks for daily electricity demand prediction of Sri Lanka [2] discusses the study on predicting the next day electricity demand of Sri Lanka. The analyses implemented based on Artificial Neural Network (ANN) and Multiple regression.

Evaluation and Forecasting of Long Term Electricity Consumption Demand for Malaysia by Statistical Analysis [3], the study discussed an approach to understanding the factors affecting electricity demand and forecast electricity consumption for Malaysia.

The paper, Forecasting electricity consumption: A comparison of regression analysis, neural networks, and least squares support vector machines [6] focuses on comparing several predictive models and selecting the optimal model for forecasting electricity consumption in Turkey.

Ceylon Electricity Board (CEB) annual publications [4] presents the annual statistical analyses results for both electricity consumption and generation data.

Most of the existing studies are based on historical consumption data only. Therefore, the proposing study is based on forecasting electricity demand with weather factors to provide a more accurate solution. There is no proper mechanism to increase the consumer awareness towards efficient electricity consumption.

Recommended Features

Based on the literature review there are several requirements have been identified. They are forecast electricity demand with weather factors, introduce personalized consumer profiles and provide attractive visualization for analyses results.


The process of the study divided into several main stages named data collection, data preprocessing, model training, model evaluation and visualization.

Data Collection

Data for the monthly electricity consumption were obtained from the Ceylon Electricity Board from year 2015.01.01 to 2019.01.01. The consumption data consists of Time, Bill Cycle, Area, Account Number, Days, Average Consumption, Charge, Outstanding and SIN Number as independent variables and Consumption (units) as the dependent variable. Precipitation amount (millimeter), air temperature (0C), pressure (millimeter of mercury) and relative humidity (%) used as the weather factors for the consumption analyses.

Data Preprocessing

Consumption data and weather data are analyzed; hence data merging works are done on data. The collected data were cleaned and preprocessed by using several python libraries.

Model Building

Identify the variables affecting electricity consumption patterns through literature study and descriptive analysis (Identify factors linked to the conduct of electricity consumption patterns and check any connection between consumption and weather changes using sample information collection). Performed regression analyses with multiple variables on processed data to investigate the consumption of electricity.

Decision Tree Regression (DTR)

Decision Tree Regression discovers object features and builds regression models in tree structure to predict data.

Gradient Boosting Regression (GBR)

Gradient Boosting Regression is an ensemble regression model which converts weak learners into strong learners. GBR identify weak learners by using loss function gradient.

Multiple Linear Regression (MLR)

Multilinear Regression Model is used to measure relationship between two or more independent variables and a dependent variable.

The first order linear model is given below:

y = ?0 + ?1x + ?(1)


x – Independent variable

y – Dependent variables

?0 and ?1 – Model parameters

? – Error factor

Random Forest Regression (RFR)

An ensemble model which uses bagging and various deciding tree, to conduct regression and classification.

Model Evaluation

Model evaluation done by based on several measures named Root mean squared error (RMSE), Mean absolute error (MAE) and R2 value.

Root Mean Squared Error (RMSE)

The standard deviation of the residuals (prediction errors). RMSE measures how concentrated the data is around the best fitted line.

Mean Absolute Error (MAE)

Defines average of the absolute errors (absolute difference between true and predicted values).

R Squared Value (R2)

A statistical measure which defines how close the data to the fitted regression line.

Model Validation

Model validation works are performed on Multiple linear regression, which is identified as the optimal model for the data set. Check assumptions for built model [7];

Relationship between independent and dependent variables should always be linear.

The desired outcome is that points are symmetrically distributed around a diagonal line in the observed vs. predicted values plot or around a horizontal line in the residuals vs. predicted values plot.

Figure SEQ Figure * ARABIC 3: Observed vs. Predicted Values and Residuals vs. Predicted Values

Mean of residuals should be zero or close to zero as much as possible.

Mean of residuals = 1.7175e-12

Equal variance of residuals.

Breusch-Pagan test, the null hypothesis assumes homoscedasticity. Obtained results are shown below;


Web application implementation is done by using python based web framework named Django. The web application will provide descriptive and predictive analyses results in more attractive way. The web application contains a customer view which provides personalized consumer data and a admin view which provides consumption data.

Figure SEQ Figure * ARABIC 4: Customer View

Figure SEQ Figure * ARABIC 5: Admin View


The study mainly focuses on building an accurate predictive model for forecast electricity consumption with weather and implementing web application to visualize the descriptive and predictive model results. The optimal forecasting model has been selected by comparing measurements RMSE, MAE and R2 values. The selected model was satisfied all the model assumptions.

Further works can be done to improve the accuracy of the forecasting model with more historical data and more weather factors.


First and the foremost author would portray gratitude to Dr. Windhya Rankothge for the guidance, support and the direction. The author would like to convey her appreciation to the Ceylon Electricity Board for providing the data and to all the individuals who contributed to the effective completion of this research document, either directly or indirectly.


  1. “Public Utilities Commission of Sri Lanka”, Electricity consumption patterns of consumers in Sri Lanka-2017, 2018
  2. S. L. Karunathilake and H. R. K. Nagahamulla, “Artificial neural networks for daily electricity demand prediction of Sri Lanka,” 2017 Seventeenth International Conference on Advances in ICT for Emerging Regions (ICTer), Colombo, 2017, pp. 1-6.
  3. A. K. Imtiaz, N. B. Mariun, M. M. R. Amran, M. Saleem, N. I. A. Wahab and Mohibullah, “Evaluation and Forecasting of Long Term Electricity Consumption Demand for Malaysia by Statistical Analysis,” 2006 IEEE International Power and Energy Conference, Putra Jaya, 2006, pp. 257-261.
  4. Long term generation expansion plan 2018-2037, Transmission and Generation Planning Branch, Transmission Division, Ceylon Electricity Board Sri Lanka, April 2017.
  5. Parkpoom, S., Harrison, G. P., & Bialek, J. W. (2004, September). Climate change impacts on electricity demand. In 39th International Universities Power Engineering Conference, 2004. UPEC 2004. (Vol. 3, pp. 1342-1346). IEEE.
  6. Kaytez, F., Taplamacioglu, M. C., Cam, E., & Hardalac, F. (2015). Forecasting electricity consumption: A comparison of regression analysis, neural networks and least squares support vector machines. International Journal of Electrical Power & Energy Systems, 67, 431-438.

Cite this page

Forecasting electricity consumption demand with weather. (2019, Dec 20). Retrieved from

Are You on a Short Deadline? Let a Professional Expert Help You
Let’s chat?  We're online 24/7