Next Article in Journal
Sustainable Management of Healthcare Settings’ Personnel Based on Intelligent Project-Oriented Approach for Post-War Development
Previous Article in Journal
Sliding-Mode Current Control with Exponential Reaching Law for a Three-Phase Induction Machine Fed by a Direct Matrix Converter
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Adaptive Strategy for Medium-Term Electricity Consumption Forecasting for Highly Unpredictable Scenarios: Case Study Quito, Ecuador during the Two First Years of COVID-19

1
Master’s Program in Mathematical Methods and Numerical Simulation in Engineering, Salesian Polytechnic University, Quito EC170702, Ecuador
2
Smart Grid Research Group—GIREI (Spanish Acronym), Salesian Polytechnic University, Quito EC170702, Ecuador
*
Author to whom correspondence should be addressed.
Energies 2022, 15(22), 8380; https://doi.org/10.3390/en15228380
Submission received: 14 October 2022 / Revised: 1 November 2022 / Accepted: 7 November 2022 / Published: 9 November 2022

Abstract

:
This research focuses its efforts on the prediction of medium-term electricity consumption for scenarios of highly variable electricity demand. Numerous approaches are used to predict electricity demand, among which the use of time series (ARMA, ARIMA) and the use of machine learning techniques, such as artificial neural networks, are the most covered in the literature review. All these approaches evaluate the prediction error when comparing the generated models with the data that fed the model, but they do not compare these values with the actual data of electricity demand once these are obtained, in addition, these techniques present high error values when there are unexpected changes in the trend of electricity consumption. This work proposes a methodology to generate an adaptive model for unexpected changes in electricity demand through the use of optimization in conjunction with S A R I M A time series. The proposed case study is the electricity consumption in Quito, Ecuador to predict the electricity demand in the years 2019 and 2020, which are particularly challenging due to atypical electricity consumption attributed to COVID-19. The results show that the proposed model is capable of following the trend of electricity demand, adapting itself to sudden changes and obtaining an average error of 2.5% which is lower than the average error of 5.43% when using a non-adaptive approach (more than 50% or error improvement).

1. Introduction

Operation and planing of the Electrical Power System (EPS) is key for the economic development and progress of a country. Correct planning of the expansion of the EPS allows electricity generating companies and the state, through energy policies, to supply the energy that the population will need at certain moments. A fundamental tool in this planning is electricity forecasting demand for the short, medium, and long term, this forecasting allows new users of the electrical network to meet their energy needs [1], and this is reflected in the social and economic development of the sector, allowing large consumers of electricity, such as industries to generate new jobs for the sector. Among the different types of electricity demand forecasting, the most important and used for planning is medium-term forecasting, which provides tools for the expansion of the transmission system and strategies for intelligent electricity consumption policies for the user (rate plans and incentive policies for energy savings) [2].
Among the different techniques used to predict electricity demand, the use of time series stands among other methodologies. Time series proposes the use of various mathematical models that are capable of describing a set of data with certain precision and subsequently generating predictions about them [3]. Among these mathematical models based on time series, the most common and used are auto-regressive (AR) models, moving average (MA) models, auto-regressive and moving average (ARMA) models, auto-regressive and moving average integral models (ARIMA), and the ARIMA models that consider a component of repetition in time or seasonal component [4].
In the research cited in [5], an ARIMA model is used for long-term energy consumption forecasting (electricity, natural gas, oil, coal, and LPG) in Pakistan, for this study energy consumption data from 1992 to 2014 were considered and, as a result, prediction data were generated up to the year 2035. The work determined that the greatest increase for the year 2035 will be in oil with a growth of 38.16% followed by natural gas with a growth of 36.57% and electricity with 16.22%.
Authors in [6] show a comparison between an ARIMA and Holt-Winter model for electricity consumption in Pakistan between 1980 and 2011, thus, generating predictions and an error comparison between both models. This work determined that although both models provided acceptable results, the Holt–Winter model is the one that best suits Pakistani electricity consumption.
In the research cited in [7], a Seasonal ARIMA or SARIMA model is used in which the models are modified to minimize the values of residuals. The case study of this work took monthly electricity consumption data from February 2006 to March 2010 in the Northwest electricity grid in China. Using this modified SARIMA model, it was possible to verify that the accuracy of data prediction increases when using a seasonal model with residual reduction.
In the last couple of years, machine learning techniques, such as neural networks and deep neural networks, have been used to analyse and solve problems related to electrical power systems, among which data prediction and systems behaviour modelling can be mentioned [8]. With the rise of machine learning and artificial intelligence techniques, new techniques applicable to the prediction of time series have been applied for electricity demand forecasting [4].
Research cited in [9] shows an ARMA model which is used in combination with Neural Networks and Neuro-Fuzzy systems. The study scenario used was the electricity demand in South Africa from 1985 to 2011. The results of this work generated error values of up to 13.5%.
Research in [10] showed that there are other time series techniques, such as Gray and Grey–Markov, for the prediction of electricity demand. In this work, the case study was the energy consumption in India between the years 2005 and 2015. This work generated results for the prediction of electricity demand with an error of 3.4%.
Authors of [11], propose an artificial neural network (ANN) and regression models which are applied for the prediction of long-term electricity demand in Thailand. As a result, it is determined that ANN provides more accurate results compared to the regression models. The study proposed as a validation metric of the model, the real results of the years 2010, 2015, and 2020. For this, the neural network was trained with data from 1989 to 2008. As a result, the annual prediction presented an error of 1.82%.
In the research cited in [12], a hybrid self-adaptive Particle Swarm Optimization–Genetic Algorithm function model is used to predict electricity demand in Wuhan, China. This study takes as known data the electricity consumption in the said region between the years 1990 and 2013, after which the electricity demand for the years 2014–2020 is predicted. Error is not estimated in this study.
In the work developed by Authors in [13], the annual prediction of electricity consumption in Turkey is made based on historical data between 1975 and 2013, obtaining electricity demand forecasting values for the years 2014–2028. This work uses linear regression models in conjunction with artificial neural networks. In this work, the error of the model before the prediction (error less than 5%) is evaluated; however, it does not evaluate an error of the predicted values in comparison with real results.
In the research cited in [14], a seasonal ANN is proposed for the monthly forecast of electricity demand between the years 2015 and 2018 in Turkey. The results of this work are contrasted with the implementation of an ARIMA model and it is determined that the seasonal ANN has a lower prediction error of 3% (error based on known data).
As detailed in the review of previous works, most of the research articles use two approaches for electricity demand forecasting, time series, and machine learning techniques (such as ANN artificial neural networks), also in some cases a combination of both techniques are used. In the case of investigations with time series, the work consists of determining the coefficients and degree of these that make up the temporal series (AR, MA, ARMA, ARIMA, or SARIMA), after this step, it is possible to generate the forecasting data on the established model (forecasted data are generated either for short, medium, or long term). A disadvantage of this approach is that once the coefficients of the model are selected, they are not modified regardless of the number of periods in the future that the model will forecast, thus at some point the model that has been previously defined can become irrelevant and the prediction error might to be too high.
On the other hand, the use of machine learning techniques, such as artificial neural networks, genetic algorithms, and optimization techniques, are limited to executing a prediction of electricity demand, ignoring the mathematical behaviour of these data, which, by definition, are time series. Although this approach indeed allows predictions to be made, it ignores important parameters of the data that must necessarily be considered in real scenarios [15,16] (temporary periodicity, auto-regression, variance, mean, etc.).
To solve the previously detailed problems, this research proposes a methodology in which monthly electricity demand prediction will be performed for a medium-term through ARMA, ARIMA, and SARIMA time series. To determine the coefficients of the model, a PSO optimization technique will be used and the model will be periodically updated month by month so that each month a new mathematical model is obtained that represents the electricity demand and its current behaviour. With this methodology, unexpected changes in electricity demand will be considered and the proposed model will offer adaptability to these, thus providing the ability to make electricity demand predictions with a minimum margin of error with a self-adaptive model over time.

Organization

The organization of the paper is as follows: Section 1 discusses an introduction of methodologies applied for electricity demand forecasting, also this section shows the previous research completed in the area involving time series analysis and machine learning techniques, how they evaluated their results and the different errors those techniques were able to obtain.
Section 2 shows the statistical analyses for seasonal, regressive and moving average behaviour of the electricity demand for Quito, Ecuador. This section also fully explains the implementation of particle swarm optimization used to find the optimal S A R I M A models for the data and how the iterative adaptive model is implemented.
Section 3 shows the resulting models for the adaptive methodology implemented in this research, this section also analyses model errors and compared them with errors of a traditional technique employed for forecasting. Finally, this section provides a detailed discussion and analysis of the results.
Finally, Section 4 summarizes the conclusions from the research performed in this work.

2. Methodology

2.1. Case Study

The hybrid methodology proposed in this work for medium-term electricity demand forecasting consists of Seasonal A R I M A and Particle Swarm Optimization, and is applied to a specific case study for the city of Quito in Ecuador.
For this purpose, historical information has been collected on the monthly electricity consumption of Quito starting in January 1999 until December 2020. In this way, 264 data corresponding to historical records of electricity demand for 22 years have been collected. This information is freely accessible and is made known to the public by the Ministry of Energy of Ecuador on its web-page, subsection Ecuadorian electric sector statistics [17].
It is also proposed to carry out the study with a database that contains information up to the year 2020 because the years 2019 and 2020 present a particularly high challenge in terms of data prediction, and that is that they are the years in which there were worldwide Unexpected fluctuations in electricity consumption due to the COVID-19 pandemic.
Figure 1 shows the behaviour of electricity demand in the city of Quito until 2018, being visually evident that the trend of this demand until December 2018 is upward.
On the other hand, Figure 2 shows the electricity demand from 2013 to 2020, considering the atypical years 2019 and 2020, in this figure, it can be seen that the trend in electricity demand until 2018 is upward (black dotted line), however this is not true for data from 2018 onwards (red dotted line).
Therefore, this work will start with the analysis of the monthly electricity demand in the city of Quito until December 2018. Once the behaviour of this time series has been studied, this will serve as a starting point for the proposed methodology to make predictions about the years 2019 and 2020 that represent a challenge of adaptability.

2.2. Time Series Analysis

2.2.1. Auto-Regressive Moving Average Time Series (ARMA)

In time series analysis one of the most fundamental models for real case scenarios is the ARMA model. The ARMA model combines the auto-regressive AR and moving average MA models and can only be applied to stationary data. This type of model expresses the current value of the series in terms of a linear combination of its previous values until reaching a maximum value of p previous values X ( t 1 ) , X ( t 2 ) , X ( t 3 ) , X ( t p ) . On the other hand, the moving average ( m a ) component is expressed as a function of a linear combination of q previous white noise values Z ( t 1 ) , Z ( t 2 ) , Z ( t 3 ) , Z ( t q ) [18,19,20].
By combining the regression and moving average components, an ARMA series is described by the Equation (1), where ϕ and β are constants that are applied to each of the time terms for each previous component of the series itself and the white noise.
X t = ϕ 1 X t 1 + ϕ 2 X t 2 + + ϕ p X t p + Z t + β 1 Z t 1 + β 2 Z t 2 + + β q Z t q
In addition, operator B (Backward shift operator) can be considered as B X t = X t 1 , and this, in turn, allows Equation (1) to be summarized in Equation (2), also it should be considered that ϕ ( B ) and β ( B ) are described in Equations (3) and (4), respectively.
ϕ ( B ) X t = β ( B ) Z t
ϕ ( B ) = 1 ϕ 1 B ϕ 2 B 2 . ϕ p B p
β ( B ) = 1 β 1 B β 2 B 2 . β p B q

2.2.2. Integrated Auto-Regressive Moving Average Time Series (ARIMA)

In some cases, the analysed data increase their mean over time. As it can be seen in Figure 1, the electricity demand for Quito, Ecuador until 2018 shows a tendency to increase year after year, for this reason, it is not possible to apply an ARMA model because said model requires the data to be stationary (constant average).
If the data in Figure 1 are differentiated one after the other, that is, subtraction of data n is performed concerning its previous data and so on until reaching the first value, the electricity demand data can be transformed into a new set of data that represent a stationary series as can be seen in Figure 3.
Mathematically this data differentiation is represented as D i f f ( X t ) = ( 1 B ) d X t , where d is the number of times the differentiation is performed [21]. Finally, by applying this concept in Equation (2), the ARMA model becomes the ARIMA model which is detailed in Equation (5).
ϕ ( B ) ( 1 B ) d X t = β ( B ) Z t

2.2.3. Seasonal Auto-Regressive Integrated Moving Average Time Series (SARIMA)

Electricity demand is a time series with time characteristics that are repeated annually, that is, every 12 months. This characteristic means that ARIMA models cannot describe the behaviour of electricity demand with absolute certainty, which is why the seasonality of the analysed data must be considered [4,22]. These additional components are applied to both the auto-regressive part ( 1 Φ 1 B 12 Φ 2 B 24 ) X t and the moving average part ( 1 Θ 1 B 12 Θ 2 B 24 ) Z t . Thus, a SARIMA model is defined as described by Equation (6).
Φ ( B S ) ϕ ( B ) ( 1 B S ) D ( 1 B ) d X t = Θ ( B S ) β ( B ) Z t
With the aforementioned, a SARIMA model has a total of 6 coefficients of interest, three for the non-periodic part ( p , d , q ) and three for the periodic part ( P , D , Q ) . A SARIMA model can be written with the following notation S A R I M A ( p , d , q , P , D , Q ) S , which details the degree of each component and this, in turn, can be also represented in Equation (7).
Φ P ( B S ) ϕ p ( B ) ( 1 B S ) D ( 1 B ) d X t = Θ Q ( B S ) β q ( B ) Z t

2.2.4. Based Model Analysis for SARIMA Coefficients

Based on the analysis described in Figure 1 and Figure 3, it can be determined that the electricity demand in Quito, Ecuador has a differentiation order of 1, d = 1 . Additionally, it is determined that the model presents periodicity every 12 months, which establishes a hierarchy of seasonality S = 12 .
The following analysis is based on establishing an approximate order for the auto-regression and moving average coefficients. As for the moving average coefficients, once the data have been differentiated, as shown in Figure 3, the next step is to analyse the auto-correlation of this dataset. Figure 4 shows the behaviour of the auto-correlation of the differentiated data in a total of 35 lags. Auto-correlation analyses the correlation between time series that are k lags intervals apart from each other. Because the time series is compared with itself this function has a maximum value of one (strongest auto-correlation) and any lag that is above some limits called confidence bounds (typically ± 0.12 which is 12% of the maximum value) are degrees that should be considered for the moving average degree coefficients.
As it can be seen in Figure 4, there are significant lags that exceed the confidence bounds around lags 1, 6, and 12 and lags that are very close to the confidence bounds around lags 4 and 9. For this reason, the order of the moving average component MA can reach a value of 5. Additionally, Figure 4 shows that this trend repeats periodically every 12 lags, so the order of the seasonal moving average SMA component also takes a maximum value of 5.
The next analysis consists of studying the partial auto-correlation PACF of the differentiated electricity demand dataset. Figure 5 shows the behaviour of the PACF of the differentiated data in a total of 35 lags. Partial auto-correlation analyses the correlation between time series that are k lags intervals apart from each other by considering the intervals in between. This function also has a maximum value of one (strongest partial auto-correlation) and any lag that is above some limits called confidence bounds (typically ± 0.12 which is 12% of the maximum value) are degrees that should be considered for the auto-regressive degree coefficients.
As it can be seen in Figure 5, there are significant lags that exceed the confidence bounds around lags 1, 3, 4, 5, 8, 9, 11, and 12. However, after lag 12 there are not significant points outside the confidence bounds, for this reason, the order of the auto-regressive component AR can reach a value of 5. Additionally, Figure 5 shows that this trend repeats periodically every 12 lags, so the order of the seasonal auto-regressive component AR also takes a maximum value of 5.
Finally, the analysis of the electricity demand for Quito, Ecuador between 1999 and 2018 yields the following results that will serve as the basis for the methodology proposed in this work, S A R I M A ( p , d , q , P , D , Q ) S = S A R I M A ( p , 1 , q , P , 1 , Q ) 12 .
  • Seasonal coefficient, S = 12 .
  • Differentiated coefficient, d = 1 .
  • Seasonal differentiated coefficient, D = 1 .
  • Auto-regressive coefficients, 0 p 5 .
  • Moving average coefficient, 0 q 5 .
  • Seasonal auto-regressive coefficients, 0 P 5 .
  • Seasonal moving average coefficient, 0 Q 5 .
Thus, the range of variation for p , q , P , Q is from 0 to 5, each one having six possible values, therefore, the total number of possible models (TNM) can be calculated following Equation (8), having, as a result, TNM = 1296 ( T N M = 6 6 6 6 ) . Later it will be detailed that the process of finding the best coefficients is iterative and due to the high number of possible combinations (1296) the processing time of a computer will be very high. Every time a S A R I M A model is generated, the forecasted values needed to be calculated and errors should be evaluated as well, for this paper a core i7 computer with 16 GB RAM running Matlab 2021b Software took around 80 s for this process, therefore, the analysis of all the scenarios would need around 103,680 s which is not at all an optimal procedure. For this reason, optimization will be used to find the best model in a relatively short time.
T N M = R a n g e p R a n g e q R a n g e P R a n g e Q

2.3. Optimization Process: Particle Swarm Optimization

PSO is a global optimization meta-heuristic technique with great popularity in various research fields due to its easy adaptability to the process to be analysed. It is of special importance when solving multi-variable and multidimensional problems in which the use of traditional deterministic algorithms is not possible [23]. Traditionally, deterministic optimization methods are designed to find a local solution, in other words for these algorithms it is only important to find a solution which is better than the closest neighbours, for this reason, these algorithms are fast when there is no need to find a global optimum value or the problem has multiple variables. As an example, conjugate gradient methods can be listed as a deterministic algorithms [24].
PSO uses probabilistic transition rules in its internal search processes, which allow parallel searches to be carried out in the hyperspace of solutions without having any type of assumption or prior knowledge of either local or global optimal solutions. This optimization technique bases its selection criteria on the physical process by which groups of fish and birds search for food [25,26].
This optimization algorithm uses search agents called particles, each particle is denoted with the subscript i, each particle having, in turn, two fundamental characteristics, position ( x i ) and speed ( v i ) , these two characteristics are what determine how the operations will be carried out for subsequent iterations of searches as the algorithm progresses [23,25].
In each iteration, each particle finds two “best” values and stores them for subsequent iterations, these values are the best of each particle ( P b e s t ) and the best of the entire swarm ( G b e s t ) . The solution to the whole problem is the position stored in Gbest [27,28].
Equations (9) and (10) describe how to calculate velocity and position, where c 1 is known as the personal acceleration coefficient and c 2 as the social acceleration coefficient, additionally w is a coefficient of inertia.
Additionally, PSO considers for each iteration the generation of a random value for local and global positions which, in turn, will be the new values for the algorithm’s new iterations, this process is repeated subsequently until the optimal global is found. Functions r a n d 1 and r a n d 2 are in charge of the generation of random values for the position which will depend on the variables to optimize and typically can take decimal values.
v i ( t + 1 ) = w v i + c 1 r a n d 1 p i b e s t ( t ) x i ( t ) + c 2 r a n d 2 g b e s t ( t ) x i ( t )
x i ( t + 1 ) = x i ( t ) + v i ( t + 1 )
PSO generates initial random values for position and velocity and, in turn, in each iteration velocity is updated with random data as shown in Equation (9), however, this approach defines the variables of interest as decimal values within a set range. This research proposes the use of PSO to determine the values of the variables ( p , d , P , Q ) which are integer values, reason why it is necessary to modify the speed update expression to Equation (11) where the random values generated are restricted as integers.
Equation (11), indicates the formulation that will be used for the optimization of variables ( p , d , P , Q ) which in Section 2.2.4 were established to have a range between 0 and 5. For this reason in Equation (11), the functions r a n d I n t 1 and r a n d I n t 2 generate randomized positions (coefficient values for ( p , d , P , Q ) ) that area integers and vary from 0 to 5 each one. In addition, variables of c 1 and c 2 take the value of 2 and w the value of 1 (most common values for fast convergence [27]).
v i ( t + 1 ) = v i + 2 r a n d I n t 1 p i b e s t ( t ) x i ( t ) + 2 r a n d I n t 2 g b e s t ( t ) x i ( t )

2.3.1. Cost Function

Every optimization technique needs a cost function to be minimized or maximized in order to find the best possible value of the set of solutions.
In this work, when using PSO, a cost function must be defined that indicates when the global minimum has been reached [29], that is, when the coefficients p , q , P , Q that best fit the data have been found.
When modelling a dataset using a S A R I M A time series, the better the fit provided by the model, the smaller the difference between the actual values of the measured data when compared to values generated by the model. As an example, a S A R I M A ( 1 , 1 , 0 , 1 , 1 , 0 ) 12 model has been created for the electricity demand data between 1999 and 2018, and it can be seen in Figure 6 how the model data differs from the real data, in Figure 6b this can be seen in greater detail.
The final objective of this work is to perform electricity consumption forecasting for which it must be guaranteed that the best model that represents the real data with a minimum deviation is always obtained. For this reason, the decision parameter for the cost function was chosen to be the residual sum of squares RSS, which is shown in Equation (12). In this equation, E D i is the original electricity demand data and S A R I M A i is the data generated with de S A R I M A model. The smaller the RSS the smaller the forecasting error, therefore this paper proposes a minimization problem for the RSS.
R S S = i = 1 n E D i S A R I M A i 2

2.3.2. Number of Particles and Iterations for the Optimization Algorithm

The optimization problem needs to define two variables, the number of agents or particles with which the agents will be in charge of finding the optimal solution and the number of iterations necessary for these agents to find the global optimum.
According to the electricity demand data and the characteristics established for the S A R I M A model in the previous sections, several tests were carried out on the optimization function to find the best model that adapts to the electricity demand data in Quito, Ecuador from 1999 to 2018. This process was performed with a particle range of 1 to 18, and a maximum number of iterations of 30.
This process can be visualized in Figure 7 and a summary of the results is shown in Table 1. By analysing both Figure 7 and Table 1, it is possible to conclude that for the lowest RSS the population should be greater than 5 and to avoid excessive processing time it should be lower than 12. Therefore, a population of 6 particles is selected which will guarantee an optimal result in no more than five iterations with a processing time iteration of 23.07 s and a RSS of 17715.129.

2.4. Methodology for Adaptive Forecasting of Electricity Consumption

This research proposes to find the best S A R I M A ( p , d , q , P , D , Q ) S model, through optimization for the coefficients p, d, P, and Q, once the optimal model (the one with the lowest RSS) is found, the electricity forecast is performed for the power consumption in the following 6 months. Subsequent to this, each month new information is reloaded to the general data and a new S A R I M A model is generated, thus repeating the optimization process and guaranteeing that the model is adaptable to any variation that occurs monthly. This process can be observed in Figure 8.
Most of the models and investigations found in the state of the art do not measure the error that they generate and if they do, they only make measurements of the model against itself (RSS), in this work the data that are predicted are compared with the known values that were given during 2019 and 2020 (particularly atypical years due to the pandemic) and in this way a prediction error can be calculated, something that other research works have not done.

3. Analysis of Results

3.1. Traditional Approach for Forecasting

In this section, the traditional approach used for the prediction of electricity demand and its disadvantages before unexpected changes in the behaviour of the data will be analysed. For this purpose, a S A R I M A model is used that is within the limits and conditions established in Section 2.2.4.
When applying a S A R I M A ( 1 , 1 , 0 , 1 , 1 , 0 ) 12 model to the electricity demand data of Quito, Ecuador from 1999 to 2018, an RSS of 25701.92 is obtained, which represents an acceptable value but could be reduced as will be seen later. Once this model is generated, it is proposed to generate power consumption forecast for the years 2019 and 2020, that is, 24 months.
The 24-month forecast is performed because it is the period of time in which the electricity demand underwent unpredictable changes that did not obey previous trends and today, by having these values, a prediction error can be evaluated. The forecasting results are displayed in Figure 9.
The forecasting data results shown in Figure 9 (red dotted line) present a significant difference from the actual values of electricity demand for the years 2019 and 2020 (solid blue line). By analysing these 24 values of electricity demand and compared with the real ones, it was determined that the technique presented an average error of 5.42%, a maximum error of 21.45%, a minimum error of 0.8%, and the model itself presented an RSS of 25,701.92.

3.2. Adaptive Forecasting Approach for Power Consumption

3.2.1. Results Achieved for Every Forecast Session

The adaptive forecast of electricity demand starts from the same scenario, considering as base data for the model the electricity demand in Quito, Ecuador from 1999 to 2018.
The methodology that this work proposes and that was explained in Section 2.4, Figure 8, offers to generate a S A R I M A model whose coefficients are obtained using PSO optimization, thus guaranteeing that the model that is found presents the lowest possible value of RSS, later a forecast for electrical demand will be performed for 6 months.
The optimization process and how it can minimize the value of RSS in each iteration with each particle is shown in Figure 10, where the larger the size of the particle, the closer its value is to the optimal RSS. As it can be seen in this figure, all the particles find the optimal value of RSS equal to 17715.13, which is equivalent to a S A R I M A ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 model.
Subsequently, each month the new known electricity demand data is fed back to the database and a new S A R I M A model is generated, which adapts to the new conditions imposed by the last month. Once this is done, a prediction is made again for the next six months. This process has been repeated a total of 19 times, which makes it possible to predict the 24 months corresponding to 2019 and 2020. This process can be seen in Figure 11.
The results with the different RSS values for each prediction session, the different types of models and the mean error in each case are shown in Table 2. For this analysis, in each session, the six forecasted values have been compared with the real electricity demand (values known from historical data) and errors have been calculated value by value (the error shown in Table 2 is the mean from these six values), this approach is different from other works in the literature review because, the error of the model itself is not evaluated but the error of the forecasted data against real data.
In these results, it is also important to indicate that as it was analysed in Table 1 the best RSS that the methodology was able to achieve is 17,715.129 which was achieved three times and the other scenarios had values close to it.
A more detailed analysis of the different errors that were reached in each electricity demand prediction session can be seen in Figure 12. In this figure, for each forecasting session, six values of error are generated and the box plot analysis for each case is represented, by doing these is possible to observe the minimum, maximum and median of the errors.

3.2.2. Global Results Achieved for 24 Months

Once the different electricity demand prediction sessions have been carried out, it is possible to evaluate the global performance of the data obtained in comparison with the prediction made with a traditional approach, as indicated in Section 3.1 in Figure 9.
Figure 13 shows the global results of the adaptive approach of this work in comparison with the traditional technique and the real electricity demand data that occurred during the years 2019 and 2020. As can be seen in the green-coloured line, the forecast data generated in this work follow much more accurately the actual electricity demand data, thus demonstrating the adaptability of the model to unexpected changes in electricity demand.
In addition, Figure 14 presents the percentage error results for each electricity demand data that were generated with the adaptive model and the traditional approach. By analysing this graph, it can be determined that the error is lower in the adaptive model and also in April 2020, which is the most critical month for the prediction (because there was a considerable drop in electricity consumption due to the beginning of country home-office in Ecuador) the error of the adaptive model is less than the traditional model, proving once again the adaptability of the model that this work proposes.
Finally, a statistical analysis of the global error values of the adaptive and traditional models was carried out, as can be seen in Figure 15. From this figure, it can be determined that the mean error in the adaptive model is significantly lower than in the traditional model, approaching a value of 2%. Additionally, the maximum value of error in the traditional model is greater than 20% while in comparison in the adaptive model this value is 15%. These results prove once again the validity of the implemented methodology.

4. Conclusions

The prediction of electricity demand is an area of study and research that has been widely covered, however, most of the works related to this topic validate their results only by comparing the errors of the model or models that are generated with respect to the data that were the root of the model itself, which does not guarantee that the prediction data generated from the model is reliable and close to reality. In contrast, in addition to validating the model error (RSS in the optimization function) in this work, an error calculation of the prediction values is also performed.
Through the methodology proposed in this work, it was shown that by performing constant feedback of electricity demand data and generating new S A R I M A models for electricity demand, the time series models change and do not remain constant over time. This phenomenon shows that when there are unexpected changes in the electricity demand, a model will depend more or less on previous data for the subsequent prediction and this changes the order of the auto-regression and moving average coefficients.
When comparing the results of this work with a traditional approach to electricity demand prediction, it is determined that the mean prediction error is reduced from 5.42% (traditional model) to 2.5% (adaptive model), in addition, the maximum error is reduced from 21% to 15.5%. Finally, it can also be mentioned that the minimum error was reduced from 0.77% to 0.21%. All these results show that the adaptive model is perfectly capable of maintaining a minimum value of error in the prediction even with unexpected changes in the behaviour of electricity demand.

Author Contributions

M.J.: Conceptualisation, Methodology, Validation, Writing—Review and Editing, Data curation, Formal analysis D.C.: Writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Universidad Politécnica Salesiana and GIREI—Smart Grid Research Group under the project Forecast of electricity demand in the short and medium term using time series techniques and optimization heuristics.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
A R Auto-regressive time series model
M A Moving average time series model
A R M A Auto-regressive moving average time series model
A R I M A Auto-regressive integrated moving average time series model
S A R I M A Seasonal Auto-regressive integrated moving average time series model
A N N Artificial neural network
P S O Particle swarm optimization algorithm
D i f f Differentiated time series
A C F Auto-correlation function
P A C F Partial auto-correlation function
T N M Total number of models
P A C F Partial auto-correlation function
X t Time series component at time t
Z t White noise component at time t
ϕ p Coefficients for auto-regressive components
β q Coefficients for moving average components
Φ P Coefficients for seasonal auto-regressive components
Θ Q Coefficients for seasonal moving average components
BBack shift operator for time series
v i ( t ) PSO algorithm speed at time t
x i ( t ) PSO algorithm position at time t
wPSO algorithm inertia coefficient
c 1 PSO algorithm personal acceleration coefficient
c 2 PSO algorithm social acceleration coefficient
p i b e s t ( t ) Particle i best position at time t in PSO
g b e s t ( t ) Global best position at time t in PSO
r a n d 1 Decimal random value for updated local position in PSO algorithm
r a n d 2 Decimal random value for updated global position in PSO algorithm
r a n d I n t 1 Integer random value for updated local position in PSO algorithm
r a n d I n t 2 Integer random value for updated global position in PSO algorithm
R S S Residual sum of squares
E D i Original electricity demand at position i

References

  1. Bai, W.; Zhu, J.; Zhao, J.; Cai, W.; Li, K. An Unsupervised Multi-Dimensional Representation Learning Model for Short-Term Electrical Load Forecasting. Symmetry 2022, 14, 1999. [Google Scholar] [CrossRef]
  2. Gao, T.; Niu, D.; Ji, Z.; Sun, L. Mid-term electricity demand forecasting using improved variational mode decomposition and extreme learning machine optimized by sparrow search algorithm. Energy 2022, 261, 5328. [Google Scholar] [CrossRef]
  3. Zhuang, Z.; Zheng, X.; Chen, Z.; Jin, T.; Li, Z. Load Forecast of Electric Vehicle Charging Station Considering Multi-Source Information and User Decision Modification. Energies 2022, 15, 7021. [Google Scholar] [CrossRef]
  4. Mir, A.A.; Alghassab, M.; Ullah, K.; Khan, Z.A.; Lu, Y.; Imran, M. A review of electricity demand forecasting in low and middle income countries: The demand determinants and horizons. Sustainability 2020, 12, 5931. [Google Scholar] [CrossRef]
  5. Ur Rehman, S.A.; Cai, Y.; Fazal, R.; Walasai, G.D.; Mirjat, N.H. An integrated modeling approach for forecasting long-term energy demand in Pakistan. Energies 2017, 10, 1868. [Google Scholar] [CrossRef] [Green Version]
  6. Hussain, A.; Rahman, M.; Memon, J.A. Forecasting electricity consumption in Pakistan: The way forward. Energy Policy 2016, 90, 73–80. [Google Scholar] [CrossRef]
  7. Wang, Y.; Wang, J.; Zhao, G.; Dong, Y. Application of residual modification approach in seasonal ARIMA for electricity demand forecasting: A case study of China. Energy Policy 2012, 48, 284–294. [Google Scholar] [CrossRef]
  8. Jaramillo, M.; Tipán, L.; Muñoz, J. A novel methodology for optimal location of reactive compensation through deep neural networks. Heliyon 2022, 8, e11097. [Google Scholar] [CrossRef]
  9. Marwala, L.; Twala, B. Forecasting electricity demand in South Africa. In Proceedings of the 2014 International Joint Conference on Neural Networks (IJCNN), Beijing, China, 6–11 July 2014; pp. 3049–3055. [Google Scholar]
  10. Kumar, U.; Jain, V.K. Time series models (Grey-Markov, Grey Model with rolling mechanism and singular spectrum analysis) to forecast energy consumption in India. Energy 2010, 35, 1709–1716. [Google Scholar] [CrossRef]
  11. Panklib, K.; Prakasvudhisarn, C.; Khummongkol, D. Electricity Consumption Forecasting in Thailand Using an Artificial Neural Network and Multiple Linear Regression. Energy Sources Part B Econ. Plan. Policy 2015, 10, 427–434. [Google Scholar] [CrossRef]
  12. Yu, S.; Wang, K.; Wei, Y.M. A hybrid self-adaptive Particle Swarm Optimization-Genetic Algorithm-Radial Basis Function model for annual electricity demand prediction. Energy Convers. Manag. 2015, 91, 176–185. [Google Scholar] [CrossRef]
  13. Günay, M.E. Forecasting annual gross electricity demand by artificial neural networks using predicted values of socio-economic indicators and climatic conditions: Case of Turkey. Energy Policy 2016, 90, 92–101. [Google Scholar] [CrossRef]
  14. Hamzaçebi, C.; Es, H.A.; Çakmak, R. Forecasting of Turkey’s monthly electricity demand by seasonal artificial neural network. Neural Comput. Appl. 2019, 31, 2217–2231. [Google Scholar] [CrossRef]
  15. Kumar, A.; Yan, B.; Bilton, A. Machine Learning-Based Load Forecasting for Nanogrid Peak Load Cost Reduction. Energies 2022, 15, 6721. [Google Scholar] [CrossRef]
  16. Alsharekh, M.F.; Habib, S.; Dewi, D.A.; Albattah, W.; Islam, M.; Albahli, S. Improving the Efficiency of Multistep Short-Term Electricity Load Forecasting via R-CNN with ML-LSTM. Sensors 2022, 22, 6913. [Google Scholar] [CrossRef]
  17. Gobierno del Encuentro. Estadísticas del Sector Eléctrico Ecuatoriano Buscar. Available online: https://www.controlrecursosyenergia.gob.ec/estadisticas-del-sector-electrico-ecuatoriano-buscar (accessed on 31 October 2022).
  18. Gupta, A.; Kumar, A. Mid Term Daily Load Forecasting using ARIMA, Wavelet-ARIMA and Machine Learning. In Proceedings of the 2020 IEEE International Conference on Environment and Electrical Engineering and 2020 IEEE Industrial and Commercial Power Systems Europe (EEEIC/I&CPS Europe), Madrid, Spain, 9–12 June 2020. [Google Scholar]
  19. Sun, Y.; Liu, J. AQI Prediction Based on CEEMDAN-ARMA-LSTM. Sustainability 2022, 14, 2182. [Google Scholar] [CrossRef]
  20. Fu, C.; Jiang, S.F. A Hybrid Method for Structural Modal Parameter Identification Based on IEMD/ARMA: A Numerical Study and Experimental Model Validation. Appl. Sci. 2022, 12, 8573. [Google Scholar] [CrossRef]
  21. Zrieq, R.; Kamel, S.; Boubaker, S.; Algahtani, F.D.; Alzain, M.A.; Alshammari, F.; Alshammari, F.S.; Aldhmadi, B.K.; Atique, S.; Al-Najjar, M.A.A.; et al. Time-Series Analysis and Healthcare Implications of COVID-19 Pandemic in Saudi Arabia. Healthcare 2022, 10, 1874. [Google Scholar] [CrossRef] [PubMed]
  22. Tang, C.; Tao, X.; Wei, Y.; Tong, Z.; Zhu, F.; Lin, H. Analysis and Prediction of Wind Speed Effects in East Asia and the Western Pacific Based on Multi-Source Data. Sustainability 2022, 14, 2089. [Google Scholar] [CrossRef]
  23. Li, C.; Coster, D.C. Article Improved Particle Swarm Optimization Algorithms for Optimal Designs with Various Decision Criteria. Mathematics 2022, 10, 2310. [Google Scholar] [CrossRef]
  24. Alshamrani, A.M.; Alrasheedi, A.F.; Alnowibet, K.A.; Mahdi, S.; Mohamed, A.W. A Hybrid Stochastic Deterministic Algorithm for Solving Unconstrained Optimization Problems. Mathematics 2022, 10, 3032. [Google Scholar] [CrossRef]
  25. Sengupta, S.; Basak, S.; Peters, R. Particle Swarm Optimization: A Survey of Historical and Recent Developments with Hybridization Perspectives. Mach. Learn. Knowl. Extr. 2018, 1, 157–191. [Google Scholar] [CrossRef] [Green Version]
  26. Salameh, T.; Sayed, E.T.; Olabi, A.G.; Hdaib, I.I.; Allan, Y.; Alkasrawi, M.; Abdelkareem, M.A. Adaptive Network Fuzzy Inference System and Particle Swarm Optimization of Biohydrogen Production Process. Fermentation 2022, 8, 483. [Google Scholar] [CrossRef]
  27. Rokbani, N.; Abraham, A.; Alimi, A.M. Fuzzy Ant supervised by PSO and simplified ant supervised PSO applied to TSP. In Proceedings of the 13th International Conference on Hybrid Intelligent Systems (HIS 2013), Gammarth, Tunisia, 4–6 December 2013; pp. 251–255. [Google Scholar]
  28. Severino, A.G.V.; de Lima, J.M.M.; de Araújo, F.M.U. Industrial Soft Sensor Optimized by Improved PSO: A Deep Representation-Learning Approach. Sensors 2022, 22, 6887. [Google Scholar] [CrossRef]
  29. Zou, K.; Liu, Y.; Wang, S.; Li, N.; Wu, Y. A Multiobjective Particle Swarm Optimization Algorithm Based on Grid Technique and Multistrategy. J. Math. 2021, 2021, 1626457. [Google Scholar] [CrossRef]
Figure 1. Monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Figure 1. Monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Energies 15 08380 g001
Figure 2. Monthly power consumption in Quito, Ecuador between January 2013 and December 2020.
Figure 2. Monthly power consumption in Quito, Ecuador between January 2013 and December 2020.
Energies 15 08380 g002
Figure 3. Diff Data for Monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Figure 3. Diff Data for Monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Energies 15 08380 g003
Figure 4. Auto-correlation for Diff Data for Monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Figure 4. Auto-correlation for Diff Data for Monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Energies 15 08380 g004
Figure 5. Partial auto-correlation PACF for Diff Data for monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Figure 5. Partial auto-correlation PACF for Diff Data for monthly power consumption in Quito, Ecuador between January 1999 and December 2018.
Energies 15 08380 g005
Figure 6. Power consumption for Quito, Ecuador vs. S A R I M A ( 1 , 1 , 0 , 1 , 1 , 0 ) 12 model, years 1999–2018. (a) Power consumption vs. SARIMA modelled data, Period 1999–2018. (b) Power consumption vs. SARIMA modelled data, Period 2014–2018.
Figure 6. Power consumption for Quito, Ecuador vs. S A R I M A ( 1 , 1 , 0 , 1 , 1 , 0 ) 12 model, years 1999–2018. (a) Power consumption vs. SARIMA modelled data, Period 1999–2018. (b) Power consumption vs. SARIMA modelled data, Period 2014–2018.
Energies 15 08380 g006
Figure 7. Analysis of iterations and populations of particles for minimization of RSS. (a) Population number vs. RSS and iteration time. (b) Number of iterations vs. RSS.
Figure 7. Analysis of iterations and populations of particles for minimization of RSS. (a) Population number vs. RSS and iteration time. (b) Number of iterations vs. RSS.
Energies 15 08380 g007
Figure 8. Methodology for adaptative forecasting of power consumption: Quito, Ecuador.
Figure 8. Methodology for adaptative forecasting of power consumption: Quito, Ecuador.
Energies 15 08380 g008
Figure 9. Traditional forecasting for electrical with S A R I M A ( 1 , 1 , 0 , 1 , 1 , 0 ) 12 model. (a) Traditional forecasting for years 2019–2020. (b) Forecasting for years 2019–2020 (zoomed since 2016).
Figure 9. Traditional forecasting for electrical with S A R I M A ( 1 , 1 , 0 , 1 , 1 , 0 ) 12 model. (a) Traditional forecasting for years 2019–2020. (b) Forecasting for years 2019–2020 (zoomed since 2016).
Energies 15 08380 g009
Figure 10. Process of optimization performed for each particle.
Figure 10. Process of optimization performed for each particle.
Energies 15 08380 g010
Figure 11. Adaptive forecast process generated for 24 months.
Figure 11. Adaptive forecast process generated for 24 months.
Energies 15 08380 g011
Figure 12. Error analysis for each forecasting session.
Figure 12. Error analysis for each forecasting session.
Energies 15 08380 g012
Figure 13. Adaptive and traditional models against actual power consumption.
Figure 13. Adaptive and traditional models against actual power consumption.
Energies 15 08380 g013
Figure 14. Monthly forecast error for adaptive and traditional models.
Figure 14. Monthly forecast error for adaptive and traditional models.
Energies 15 08380 g014
Figure 15. Box plot analysis for errors of adaptive and traditional forecast models.
Figure 15. Box plot analysis for errors of adaptive and traditional forecast models.
Energies 15 08380 g015
Table 1. Convergence times of optimization algorithm based on number of particles and iterations.
Table 1. Convergence times of optimization algorithm based on number of particles and iterations.
Number of ParticlesBest RSS (Lowest)Iteration Time [s]Number of Iterations for Best RSSTotal Time until Best RSS [s]
121,7101.3633040.9
221,939.9082.475512.375
417,981.31218.94475.76
617,715.12923.0715115.356
817,745.31825.8075129.035
1017,715.12931.365156.8
1217,715.12941.583124.74
1417,745.31852.89152.89
1617,715.12954.752109.5
1817,721.44358.685293.4
Table 2. Results achieved for each forecasting session.
Table 2. Results achieved for each forecasting session.
Forecast SessionBest RSS AchievedSARIMA ModelAverage Error [%]
117,715.129 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 0.4676
218,017.779 ( 3 , 1 , 4 , 3 , 1 , 4 ) 12 1.8975
318,027.888 ( 3 , 1 , 3 , 2 , 1 , 4 ) 12 2.0242
419,271.434 ( 0 , 1 , 4 , 4 , 1 , 4 ) 12 1.7797
518,228.642 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 2.3764
618,248.905 ( 4 , 1 , 3 , 3 , 1 , 4 ) 12 2.0697
718,286.459 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 1.0980
818,372.007 ( 2 , 1 , 4 , 2 , 1 , 4 ) 12 0.9826
918,529.698 ( 4 , 1 , 3 , 4 , 1 , 3 ) 12 1.5770
1018,893.479 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 0.9214
1118,929.334 ( 3 , 1 , 4 , 3 , 1 , 4 ) 12 2.2272
1218,957.999 ( 3 , 1 , 4 , 4 , 1 , 4 ) 12 1.9012
1317,715.129 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 3.6585
1419,253.160 ( 4 , 1 , 3 , 3 , 1 , 4 ) 12 4.7415
1517,745.318 ( 4 , 1 , 3 , 3 , 1 , 4 ) 12 4.0424
1617,981.312 ( 4 , 1 , 3 , 4 , 1 , 4 ) 12 3.3610
1726,061.050 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 9.3543
1817,745.318 ( 4 , 1 , 3 , 3 , 1 , 4 ) 12 9.8121
1917,715.129 ( 2 , 1 , 4 , 4 , 1 , 4 ) 12 7.1956
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Jaramillo, M.; Carrión, D. An Adaptive Strategy for Medium-Term Electricity Consumption Forecasting for Highly Unpredictable Scenarios: Case Study Quito, Ecuador during the Two First Years of COVID-19. Energies 2022, 15, 8380. https://doi.org/10.3390/en15228380

AMA Style

Jaramillo M, Carrión D. An Adaptive Strategy for Medium-Term Electricity Consumption Forecasting for Highly Unpredictable Scenarios: Case Study Quito, Ecuador during the Two First Years of COVID-19. Energies. 2022; 15(22):8380. https://doi.org/10.3390/en15228380

Chicago/Turabian Style

Jaramillo, Manuel, and Diego Carrión. 2022. "An Adaptive Strategy for Medium-Term Electricity Consumption Forecasting for Highly Unpredictable Scenarios: Case Study Quito, Ecuador during the Two First Years of COVID-19" Energies 15, no. 22: 8380. https://doi.org/10.3390/en15228380

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop