1. Introduction
Energy demand forecasting plays a key role in ensuring the efficient allocation and management of resources within the energy sector. It also helps achieve sustainable development goals, particularly Sustainable Development Goal 7 (SDG 7) and its targets [
1].
The SDG7 incorporates a number of targets, including the following: ensuring universal access to affordable, reliable, and modern energy services (SDG 7.1), increasing the share of renewable energy in the global energy mix (SDG 7.2), doubling the global rate of improvement in energy efficiency (SDG 7.3), encouraging international cooperation for clean energy research and technology (SDG 7.4), and improving the infrastructure for sustainable energy services in developing countries (SDG 7.5). To this extent,
Table 1 demonstrates the actions taken by Brazil to reach these targets.
Accurate predictions about the international energy outlook are essential to enable utilities, policymakers, and stakeholders to make informed decisions that support these targets. Long-term trends, such as socioeconomic factors and technological advances, influence energy consumption patterns over extended periods and are aligned with SDG7’s goal of increasing access to modern energy services (SDG 7.1) and enhancing energy efficiency (SDG 7.3). Short-term seasonal factors, including variations in weather conditions and industrial production cycles, also affect energy demand fluctuations. These are fundamental considerations when seeking to achieve the targets of SDG7, particularly with regard to the integration of renewable energy sources (SDG 7.2) and infrastructural development (SDG 7.5).
Furthermore, unexpected events such as economic fluctuations and policy changes highlight the importance of robust forecasting methods to support international cooperation in clean energy research and technology (SDG 7.4). By selecting appropriate forecasting techniques, utility companies and researchers can contribute to global efforts to enhance access to clean energy and create a sustainable infrastructure for renewable energy (SDG 7.A, 7.B).
Accurate knowledge of energy consumption enables cities to formulate effective strategies for energy management, advancing the development of smart cities [
2]. By analyzing consumption patterns, authorities can identify peak demand periods, allocate resources efficiently, implement demand response programs to alleviate strain on the energy grid, and develop sustainable urban planning initiatives. This approach may also be used in data centers and cloud environments, leading to improved energy efficiency and reduced operational costs [
3].
As the global population grows, urbanizes, and industrializes, the demand for electricity rises, introducing uncertainty regarding future consumption patterns [
4]. Remarkably, this has been a global concern with the recent growth in the use of electric vehicles [
5]. This brings challenges to energy planners and utility providers to accurately predict and provide future energy needs. This is especially true for developing countries [
6], such as Brazil.
Due to the relevance of this field, researchers have focused on time series models for forecasting electricity consumption in Brazil [
7,
8,
9,
10,
11,
12]. None of them, however, forecast the general energy consumption in Brazil to the time frame proposed in this work, for up to 2033. They are either sector-specific, such as industrial or residential demand, or their forecasting does not cover the temporal scope of this work. Hence, this study addresses these limitations by long-term forecasting Brazil’s energy consumption, thereby contributing to Brazilian policymakers and global energy research.
The primary objective of this research is to compare the performance of various forecasting models in predicting energy demand in Brazil while seeking to achieve the targets of SDG7 by finding innovative ways of improving energy demand forecasting methods and forecasting energy consumption in Brazil for up to 2033. More specifically, this study seeks to evaluate the effectiveness of the following forecasting models: Seasonal Autoregressive Integrated Moving Average (SARIMA) and Exogenous SARIMA (SARIMAX) [
13], Facebook Prophet (FB Prophet) [
14], Holt–Winters [
15], Trigonometric Seasonality Box–Cox transformation, ARMA errors, Trends, and Seasonal components (TBATS) [
16]. However, this study does not evaluate the Autoregressive Integrated Moving Average (ARIMA) due to the presence of seasonality in the studied time series, which the model cannot handle.
These models are selected based on a literature assessment. Facebook Prophet is a time series model that has been demonstrated to have good accuracy for predicting energy demand [
17,
18]. Nonetheless, as seen in
Section 2, it has not been as extensively explored as other models. Conversely, ARIMA-based models are broadly applied in the energy sector [
19]. Holt–Winters and TBATS have achieved better accuracy than ARIMA models in specific energy scenarios [
20,
21]. As seen in
Section 2, this is the first study to evaluate and compare these models concurrently.
For the optimal use of these models, however, specific characteristics of the energy consumption time series must be evaluated. These features, such as periodicity of seasonality and stationarity of the time series, are assessed with statistical tests and passed as parameters for the models.
1.1. Contributions and Limitations of the Work
By conducting a comparative analysis of SARIMA, FB Prophet, Holt–Winters, and TBATS, this research seeks to determine their respective strengths and weaknesses by investigating the complex dynamics of energy demand in Brazil, along with an estimation of energy demand in the country in 2033. It also contributes by updating the energy consumption forecasting in Brazil, with better-assessed accuracy than previous recent studies, as seen in
Section 2.3.
This study aims to offer practical recommendations for enhancing energy demand forecasting since this will lead to more efficient resource management within the energy sector and, thus, assist in achieving sustainable development goals.
Additionally, this research contributes to the understanding of time series model biases, such as overestimation or underestimation, providing a nuanced perspective on model selection. This work, thus, serves as a robust framework for researchers aiming to improve forecasting accuracy in diverse fields. We also make available the forecasted energy consumption values for Brazil up to 10 years ahead using the four time series models, providing an important benchmark for future validation as actual data become available.
This work also proposes a statistically robust methodology that rigorously evaluates time series, patterns, and anomalies. This methodology is not limited to energy consumption forecasting but is versatile and can be applied to any time series application, enhancing its utility across various domains.
As limitations, this study uses solely economic, industrial, and climatic indexes as exogenous variables. Other categories of variables could also be useful in describing energy patterns, such as demographic data. Such a study could explore the relationship between energy consumption and population growth rate, age distribution of the population, and urbanization rate.
Another limitation refers to the restricted scope of the data and of the time series models evaluated. This work forecasts exclusively the energy consumption, not production. It also assesses only the models SARIMA/X, FB Prophet, Holt–Winters, and TBATS, not encompassing promising models such as Temporal Fusion Transformers (TFTs), N-BEATS, DeepAR, and Gated Recurrent Units.
1.2. Organization of the Work
The remainder of this paper is structured as follows.
Section 2 reviews the literature on time series forecasting and its applicability in the energy sector, reinforcing the novelty of this work through bibliometric analysis.
Section 3 presents the material and the methodology used.
Section 4 examines patterns and the results of statistical tests on the time series of energy consumption in Brazil.
Section 5 compares the different models’ accuracy and time performance, presenting forecast values for up to ten years.
Section 6 concludes the paper.
2. Literature Review
The significance of devising a sustainable energy plan and the emphasis on forecasting energy demand highlights the importance of managing energy demand—the necessity to align with the long-term objectives of ecological, societal, economic, and industrial sustainability goals [
22]. By combining energy demand forecasting with sustainable energy planning, societies can progress toward a future that is both sustainable and equitable.
Therefore, energy demand forecasting is critical to energy planning and management, enabling stakeholders to make informed decisions regarding resource allocation, infrastructure development, and policy formulation. Energy demand forecasting methods can be broadly categorized into qualitative and quantitative approaches. As documented by [
23], within quantitative methods, time-series models are widely used for energy demand forecasting because they capture the temporal patterns and trends inherent in energy consumption data.
Although this study focuses on energy demand, forecasting models have also been used for energy production, such as from wind power [
24], including the use of state-of-the-art approaches, such as TFT [
25,
26].
Several studies have compared the performance of time-series models in different contexts and for various applications. Ref. [
27] conducted a comprehensive review of forecasting methods, including classical and modern approaches. Similarly, ref. [
28] used a Nonlinear Autoregressive (NAR) neural network to forecast the next decade of energy demand based on a publicly available data set for global energy consumption. Apart from energy, SARIMA, for example, has also been used for predicting traffic flow [
29], and network traffic generated from an agricultural environment [
30].
Energy demand forecasting has been a significant research area, with various methods proposed for accurate predictions. Neural networks, such as Nonlinear Autoregressive neural networks, can effectively handle statistical, empirical, and theoretical problems, as presented by [
31].
Convolution Neural Networks (CNNs) and Conditional Random Fields (CRFs) have been used to forecast power consumption, achieving high accuracy, according to [
32]. Electricity price forecasting is also relevant in this context [
33].
Developing countries face challenges in achieving low-carbon and sustainable economic growth. Still, for [
23], artificial neural networks (ANNs) hybridized with meta-heuristic techniques are superior in load forecasting. Probabilistic forecasting models, such as DeepAR and Deep State Space (DeepState), perform better for longer prediction horizons, as conducted by [
27]. Machine learning (ML) techniques are widely used, particularly for short-term electricity forecasting, while engineering-based models cover long temporal horizons and appliance consumption, according to [
34]. In energy generation, forecasting models have also been used for predicting parameters of electrical energy production, such as wind speed [
35,
36].
Existing studies on energy demand forecasting methods in Brazil have explored various models and approaches. The Holt–Winters method, Seasonal ARIMA model, dynamic linear model, and autoregressive neural network model have been compared for forecasting electric energy consumption in the Brazilian industrial sector [
37]. Regression models and recurrent neural networks have been evaluated for predicting electricity consumption in the northern region of Brazil, with the linear regression model using moving average and the recurrent neural network model performing well [
38].
Time-series forecasting models such as Holt–Winters, SARIMA, dynamic linear model, TBATS, neural network autoregression, and multilayer perceptron have been applied to forecast industrial electricity consumption in Brazil, with the multilayer perceptron model showing the best performance [
10]. Gray-type models, including the optimized nonlinear gray Bernoulli model and the nonlinear gray Bernoulli model with particle swarm optimization, have also been compared with classic time series models like ARIMA, with the models showing equal predictive performance [
39].
Considering the relevance of the energy sector, which is deemed as critical infrastructure, for a country’s sustainable development, industrial productivity, and economic growth, the cybersecurity aspects of this sector should also be assessed and improved. A cyber threat can disrupt energy operations, compromise data integrity, and even pose risks to public safety. In that regard, common attack vectors in the energy sector have been studied [
40], along with possible regulatory outcomes [
41].
2.1. Bibliometric Review
A bibliometric analysis is conducted to examine the publication domain surrounding electric energy demand forecasting. To support this analysis, the Scopus database is used. The search terms presented in Listing 1 result in 3549 documents that are used in the analysis of this section.
Listing 1. Search terms used in Scopus for publication count per target country. |
(time-series OR “time series”) AND (forecast OR forecasting OR predicting OR predict) AND energy AND (electric OR electrical OR electricity) |
For a greater similarity with this work, for the following investigations, the documents are filtered to include exclusively those in at least one of the areas of Engineering, Energy, Computer Science, Mathematics, or Decision Sciences. This results in 2882 documents.
As the electric energy consumption and production patterns vary among different economies and geographical regions, the forecasting studies usually target a specific country, such as this work, which is focused on Brazilian electric patterns. To assess the frequency at which the BRICS countries are the objects of similar studies, these filtered documents are filtered successively to the presence of each BRICS country in the document title, and the number of publications targeting each of them is depicted in
Figure 1a. China leads the publication count, followed by India and Brazil, with similar values to each other.
Despite Brazil being a large country with significant energetic resources, there is little publication targeting it, when compared to China.
As this work is based on the SARIMA/X, FB Prophet, Holt–Winters, and TBATS forecasting models, the frequency at which these models are used is also evaluated for both general and energy purposes. To achieve this, Listing 2 shows the search terms used in Scopus, including the filter for energy application and the terms for searching documents that use all models simultaneously.
Listing 2. Search terms used in Scopus for publication count per time series model. |
(fb OR facebook) AND prophet / AND energy AND (electric OR electrical OR electricity) |
(sarima OR sarimax) / AND energy AND (electric OR electrical OR electricity) |
holt AND winters / AND energy AND (electric OR electrical OR electricity) |
tbats / AND energy AND (electric OR electrical OR electricity) |
tbats AND holt AND winters AND (sarima OR sarimax) AND prophet AND (fb OR facebook) |
The results, shown in
Figure 1b, suggest that there is no study in the Scopus base that conducted a comparative assessment between these models simultaneously with any applicability, indicating the novelty of this work.
2.2. Discussion on the Strengths and Limitations of SARIMA, FB Prophet, Holt–Winters, and TBATS Models
The SARIMA model is a powerful tool for energy demand forecasting. It has been used in various studies to forecast electricity consumption, generation, peak load, and installed capacity [
42]. It incorporates seasonal factors, whilst Exogenous SARIMA (SARIMAX) also supports additional regression with exogenous variables, which helps improve forecasting accuracy and reduce error values [
43]. It outperforms simpler autoregressive integrated moving average-based techniques regarding forecasting accuracy [
44].
The SARIMA model is particularly effective in capturing vital seasonality components in demand-related time series [
45]. However, SARIMA may face challenges when dealing with irregular seasonal components in electricity demand. Despite this limitation, SARIMA has been shown to significantly improve the accuracy of predictions, leading to better management of electrical distribution.
Facebook Prophet is a time-series model used for energy demand forecasting. It has been applied in various studies to predict energy consumption in different sectors, such as manufacturing companies in the food sector [
28]. The model has shown promising results in predicting energy consumption of electricity, water, and diesel fuel.
However, it is essential to note that the model’s performance may vary depending on the specific dataset and context. In the context of forecasting Italian electricity spot prices, combining seasonal and trend decomposition with Facebook Prophet has been found to improve forecast accuracy and reduce error rates [
46]. The model considers factors like seasonality, climatic parameters, and special events to enhance projections.
The Holt–Winters model is a time-series forecasting model used in energy demand forecasting. It has several strengths and weaknesses. One of its strengths is that it can capture seasonal patterns in the data, making it suitable for forecasting energy demand with seasonal variations, according to [
31].
Additionally, the model can handle nonlinear characteristics in the data, which is significant for accurately predicting energy consumption, as conducted by [
47]. However, the Holt–Winters model may have limitations when the data patterns change over time or when there are sudden shifts in the energy demand, expressed by [
48]. For ref. [
49], it may also struggle to accurately forecast energy demand during significant disruptions, such as the COVID-19 pandemic. Despite these weaknesses, the Holt–Winters model has been shown to outperform other models, such as ARIMA, in terms of accuracy for energy demand forecasting [
50].
Furthermore, the TBATS model is characterized by its flexibility in handling various seasonalities and non-linear trends, making it suitable for capturing intricate patterns in energy consumption [
32]. Additionally, the incorporation of Box–Cox transformations in TBATS enables it to effectively deal with non-normality in the data, leading to more precise predictions [
43]. Moreover, TBATS can handle missing values and outliers commonly encountered in energy demand data without compromising the accuracy of the forecasts [
42].
However, certain limitations exist when using TBATS for energy demand prediction. One such restriction is that an adequate amount of historical data is required to accurately capture the seasonal and trend patterns [
34]. Furthermore, TBATS might encounter obstacles in generating long-term projections, as it relies on the assumption that future patterns will resemble those observed in the past [
42]. Lastly, TBATS is unlikely to perform optimally despite sudden changes or disruptions in the energy system, as it assumes a relatively stable and predictable environment.
Table 2 provides a comparative overview of four prominent time series forecasting models: SARIMAX, Facebook Prophet, Holt–Winters, and TBATS. Each model entry details its strengths and limitations, highlighting its capabilities alongside potential drawbacks. Additionally, the table identifies gaps in the current literature for each model.
These gaps point toward potential areas for future research, such as improving SARIMAX’s handling of irregular seasonality or optimizing Prophet for specific energy demand datasets. Therefore, the table summarizes the key characteristics of these forecasting models and pinpointing crucial areas for further development and where further research is necessary to optimize their performance in energy demand forecasting.
2.3. Comparison with Other Works
To establish an accuracy comparison base, the literature was searched for studies that used time series forecasting applied to energy. The common accuracy metric used is the Mean Absolute Percentage Error (MAPE), which is better defined in
Section 3.
Reference [
51] states that a MAPE value of less than 10% is considered a Highly Accurate Prediction (HAP), while values between 10% (inclusive) and 20% (exclusive) fall into the category of Good Prediction (GPR). Additionally, predictions with MAPE values between 20% (inclusive) and 50% (exclusive) are deemed Reasonable Predictions (RP), while those equal to or greater than 50% are labeled as Inaccurate Predictions (IPRs). All values presented in
Table 3, which detail the accuracy of these studies, are classified as HAP.
Some of the models presented in
Table 3, and their acronyms, are Regression–SARIMA–generalized autoregressive conditional heteroskedastic (Reg–SARIMA–GARCH), methods based on Box–Cox Transformation Quantile Regression via Normal Distribution (N-BCQR), the Error-Correction State Space Model (ECSTSP), and a hybrid model based on seasonal adjustment (SEEMDGESN).
To the best of our knowledge, the study by [
38] is the most recent to employ MAPE as an evaluation metric for forecasting energy in Brazil. However, despite its recent publication, other older studies have achieved superior performance in terms of MAPE values [
58,
59]. This presents an opportunity for our work to enhance the accuracy of energy forecasting in Brazil compared to recent studies.
Also, this study makes several contributions that distinguish our research in relation to these previous works. We propose a time series analysis methodology, which is conducted prior to the actual forecasting. This methodology enables pattern recognition within the data and assists in model selection and model parameters specification, making it applicable beyond energy consumption to any time series domain.
Furthermore, the assessment of these forecasting models does not rely solely on accuracy, but also on a rigorous statistical assessment of model fit through the Ljung–Box test on residuals, ensuring robust validation. We also publish predicted data extending up to 10 years into the future, providing an essential benchmark for future validation as actual data becomes available. Moreover, we incorporate a wide range of exogenous factors, such as climatic, industrial, and economic variables, to capture the complex dynamics influencing energy demand in Brazil.
3. Materials and Methods
This section describes the historical data used and the statistical analysis performed on the resulting dataset, as depicted in
Figure 2.
3.1. The Dataset
The dataset used in this study is composed of data from different sources, in the time range between January 2004 and November 2023. The energy consumption data are obtained from the Energy Research Company (EPE). The economic and industrial variables are extracted from the Institute of Applied Economic Research (IPEA), except for the number of registered electric vehicles, which is obtained from the Brazilian Association of Electric Vehicles (ABVE). The source of the climatic variables is the National Institute of Meteorology (INMET).
The target variable, which is the focus of this study, is the energy consumption within the territory of Brazil, measured in megawatt-hour (MWh). The independent variables may be categorized into industrial factors, which are the production of assembled automobiles (units), oil production (average daily quantity–barrel), capital goods production (quantum index, taking 2012 as the base year), consumer goods production (quantum index, taking 2012 as the base year), intermediate goods production (quantum index, taking 2012 as the base year), fertilizer production (tons), industrial wage bill (percentage, taking 2006 as the base year), sales of motor vehicles in the domestic market (units), and registration of electric cars (units).
The climatic variables are measured hourly in 473 municipalities across all 26 states and the Federal District of Brazil. In the consolidated dataset, the hourly values are grouped by month and averaged, encompassing all municipalities. The variables are total precipitation (mm), atmospheric pressure at station level (mb), maximum atmospheric pressure in the previous hour (aut) (mb), minimum atmospheric pressure in the previous hour (aut) (mb), solar global radiation (kJ/m2), air temperature-dry bulb (°C), dew point temperature (°C), maximum temperature in the previous hour (aut) (°C), minimum temperature in the previous hour (aut) (°C), maximum dew point temperature in the previous hour (aut) (°C), minimum dew point temperature in the previous hour (aut) (°C), maximum relative humidity in the previous hour (aut) (%), minimum relative humidity in the previous hour (aut) (%), relative humidity (%), wind direction (gr) (° (gr)), maximum wind gust (m/s), and wind speed (m/s).
The economic variables are the Gross Domestic Product (GDP), measured in millions in Brazilian currency, R$), changes in prices of exports (%, taking 2018 as the base year), changes in prices of imports (%, taking 2018 as the base year), General Price Index-Domestic Availability (GPI-DA, or IGP-DI in Portuguese, taking 1994 as the base year), General Market Price Index (GMPI, or IGP-M, taking 1994 as the base year), National Consumer Price Index (NCPI, or INPC, taking 1993 as the base year), and Extended National Consumer Price Index (ENCPI, or IPCA, taking 1993 as the base year).
The GPDI tracks price variations in various products, including commodities, durable consumer goods, and services. Prices are collected between the 1st and the 30th of the reference month for this index. In contrast, the GMPI collects price data between the 21st of the previous month and the 20th of the reference month. While both indices measure price fluctuations in similar products and services, they assign different weights to various categories. The GMPI is commonly utilized for rent adjustments and public tariffs.
The NCPI and ENCPI track price changes for a basket of goods and services Brazilian households consume. The NCPI focuses explicitly on families with incomes ranging from 1 to 5 minimum wages, while the ENCPI covers all income levels. Both indices are inflation indicators in Brazil and are widely used by policymakers and economists to monitor changes in the cost of living.
3.2. Data Analysis Methods
All these variables are combined and then analyzed, as represented in Algorithm 1. Firstly, it is necessary to select the parameters for defining the time series models. These models require the specification of autoregression and moving average parameters, which are obtained with statistical tools like autocorrelation and partial autocorrelation functions. Additionally, the time series must be evaluated in relation to the presence of a unit root, which is achieved with the Augmented Dickey–Fuller test. Ultimately, the seasonality of the energy consumption is also assessed, both with the autocorrelation function and with a Kruskal–Wallis test.
Algorithm 1 Data analysis |
Require: |
Require: |
1: procedure is_seasonal() |
2: ← detrend() |
3: if (autocorrelation_confirms() AND kruskall-wallis_confirms()) then |
4: return True |
5: else |
6: return False |
7: end if |
8: end procedure |
9: procedure granger_variables() |
10: |
11: for each in do |
12: if granger_causality() then |
13: |
14: end if |
15: return |
16: end for |
17: end procedure |
18: if is_seasonal() then |
19: components ← STL_decomposition(time_series) |
20: end if |
21: ← |
22: ← |
23: ← |
24:
|
|
25: |
Then, the persistence or long-term memory of the time energy consumption time series is examined. This analysis informs how the time series behaves in relation to previous values and whether it presents random walk patterns or not.
Finally, statistical analyses such as Granger causality tests and correlation studies were executed further to examine the relationship between external factors and energy consumption. These statistical methods aid in pinpointing significant variables and quantifying their effect on energy demand fluctuations, thereby boosting the forecasting accuracy of the models.
3.3. Models Evaluation and Forecasting
The forecasting models have undergone training and testing phases to evaluate the methodology. These models were trained on some historical data, with a specific time frame set aside for testing purposes, as depicted in Algorithm 2. The training process involves fine-tuning model parameters and assessing performance metrics through techniques like cross-validation. Performance metrics like Mean Absolute Percentage Error (MAPE), Mean Percentage Error (MPE), Mean Squared Error (MSE), and the Normalized Root Mean Square Error by the range between the minimum and the maximum values (NRMSE_minmax) are utilized to assess the precision and efficiency of the forecasting models.
Algorithm 2 Forecasting |
- Require:
- Require:
- 1:
- 2:
- 3:
- 4:
procedure optimal_case() - 5:
- 6:
- 7:
- 8:
for to 6 do - 9:
for each model in models do - 10:
- 11:
- 12:
- 13:
- 14:
if then - 15:
- 16:
end if - 17:
end for - 18:
end for - 19:
return - 20:
end procedure - 21:
- 22:
- 23:
- 24:
- 25:
for each model in models do - 26:
- 27:
- 28:
- 29:
- 30:
end for
|
The MAPE offers a measure of the average percentage difference between the predicted and actual values, offering perspective into the relative magnitude of errors while inherently accounting for the scale of the data. As a complement, MPE provides an indication of directional bias by measuring the average percentage difference between the predicted and actual values without absolute value transformation, thereby discerning whether predictions consistently overestimate or underestimate actual values.
Furthermore, RMSE offers a measure of the typical magnitude of errors, while penalizing larger errors. Finally, NRMSE_minmax normalizes the RMSE by the range of actual values, allowing for a comparison of predictive accuracy relative to the variability of the data. These metrics are calculated by Equations (
1)–(
4), in which
y represents the actual data and
represents the predicted value.
These metrics elucidate each model’s capability to predict energy demand. In addition to assessing the individual performance of the forecasting models, this study inquires about the influence of external factors on energy consumption trends. External variables, selected according to the Granger tests, are examined alongside the forecasting models to assess their impact on energy demand patterns.
For the section of the work in which we evaluate the impacts of exogenous variables, SARIMAX is used instead of SARIMA. The multivariate models are run on SARIMAX and FB Prophet exclusively, as Holt–Winters and TBATS do not support this type of forecasting.
In addition to the accuracy metrics, the models’ fit is also evaluated, with the Ljung–Box test. This test evaluates whether the model has successfully captured the time series structure by checking for remaining autocorrelations in the residuals. If the residuals show no significant autocorrelation, the model is considered a good fit.
The accuracy and fitness of the models are evaluated for different training window sizes, and the optimal scenario is selected for forecasting the energy consumption in Brazil up to 2033. Ultimately, we also measure the time for training and predicting with each model.
A comparative analysis evaluates each forecasting model’s strengths and weaknesses in predicting Brazil’s energy demand trends. This assessment considers factors such as prediction precision, computational speed, and the ability to manage external factors, offering perspectives into the algorithms’ practical applicability in real-world situations.
4. Data Analysis
Understanding its statistical characteristics is essential for more precise time series forecasting. This enables the selection of forecasting models that best align with these characteristics.
For the SARIMA model, for example, some parameters must be passed; these are the Autoregression (AR), Integrated (I), and Moving Average (MA) parameters, represented by the letters
, respectively. The
d parameter is determined in
Section 4.1, while
in
Section 4.2.
Additionally, seasonality in the time series eliminates the suitability of linear regression models, as they assume a linear relationship between the independent and dependent variables. However, a straight line cannot accurately capture the cyclical patterns exhibited by seasonal time series.
Section 4.3 presents statistical tests to evaluate whether the energy consumption in Brazil follows a seasonal pattern, along with the decomposition into its seasonal, trend, and residual components.
Moreover, the findings from an analysis of long-term memory in a time series may indicate whether the past observations in a time series are informative for future forecasting or not. This analysis is provided in
Section 4.4.
Furthermore, the patterns and components of the time series may manifest as a consequence of other underlying factors, which may not directly correlate with the values in the time series or depend on them. These factors are termed exogenous variables, and considering them may also enhance the accuracy of the forecasting model. This evaluation is presented in
Section 4.5.
This section presents these evaluations before comparing the results between the different models.
4.1. Unit Root Test and Differencing Order
Ensuring stationarity is a crucial step before applying many statistical methods. It implies that statistical properties of the data, such as mean, variance, and autocorrelation, remain constant over time. This characteristic impacts forecasting accuracy and model selection, as it is a fundamental assumption in many time series models, ARIMA.
Non-stationary data, often characterized by the presence of a unit root, can lead to unreliable parameter estimates and erroneous forecast results. It is manifested as a trend that increases or decreases. As seen in
Section 4.3.1, the energy consumption time series in Brazil is not stationary, as it has an increasing trend component.
To address this unit root problem, stationarity is achieved by removing non-stationary features from the time series. The number of differences required to achieve stationarity is estimated using unit root tests, such as the Augmented Dickey–Fuller (ADF) test.
Hypothesis 1. The times series has a unit root, it is non-stationary.
Hypothesis 2. The series does not have a unit root, it is stationary.
For the original time series, the ADF test results a p-value of 0.84, which is greater than 0.05, suggesting acceptance of the null hypothesis. After one difference, however, the p-value is 0.0003 and indicates acceptance of the alternative hypothesis. This means that the time series is stationary after one difference. This determines that the d parameter of the SARIMA model must be equal to 1.
4.2. Autoregressive and Moving Average Orders
To ascertain the remaining parameters for SARIMA, namely the Autoregressive (AR) and Moving Average (MA) parameters, denoted as p and q respectively, the Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) can be employed.
To determine the AR parameter,
p, and the MA parameter,
q, the plots from
Figure 3 are used. In this Figure, the blue shades represent the confidence interval, at a 95% confidence level.
The ACF displays the correlations between the time series and its lagged values, which are past observations of a variable at specific time points relative to the current observation. In contrast, the PACF plot reveals the autocorrelation of a time series with itself at different lags, while controlling for the influence of intermediate lags, thus isolating the direct correlation between each observation and its specific lagged value.
For the
p parameter, the PACF plot, in
Figure 3b, is examined. A significant peak at lag 1 in the PACF plot, indicated by a spike beyond the confidence interval, represented by the blue shade, suggests a strong correlation between the current observation and its immediate lagged value. This is indicative of an autoregressive relationship. Consequently,
p is determined to be 1.
A similar approach is used in the ACF plot, in
Figure 3a, for the moving average parameter
q extends to the ACF plot. A significant decay in correlation after the first lag in the ACF plot indicates the presence of a moving average process, where subsequent observations are influenced by past forecast errors. Thus, the observation of a significant correlation at lag 1 in the ACF plot, coupled with a rapid decay in subsequent lags, signifies the influence of one lagged forecast error on the current observation, leading to the determination of
q as 1.
In addition to that, the ACF may also provide evidence of seasonality in a time series. A 12-month seasonality in energy consumption in Brazil is evidenced by
Figure 3a.
4.3. Seasonality Tests
Identifying cyclical patterns in the time series empowers forecasting models to deliver more precise predictions. Hence, the seasonality and the temporal periodicity at which the time series presents this behavior must be detected.
For evaluating the seasonality of the energy consumption, the stationary time series, after one difference, is used, according to
Section 4.1. The intention is to eliminate its underlying trend, intending to evidence short-term fluctuations and the seasonal component.
The Kruskal–Wallis test is a non-parametric statistical method utilized to evaluate whether the medians of two or more groups are different. Its hypotheses are as follows:
Hypothesis 3. The medians of all the groups are equal; that is, , where represents the median of the ith group.
Hypothesis 4. At least one of the group medians is different from the others.
To apply this test, the trend-subtracted time series is divided into 20 groups of 12 months each, each representing a year of energy consumption between 2004 and 2023. The length of 12 months is chosen based on the ACF results from
Section 4.2.
These groups are inputted into the Kruskal–Wallis test, which returned a p-value of 0.994, more significant than the significance level of 0.05. Therefore, the null hypothesis is accepted, which suggests that the time series presents the same median throughout all years, endorsing the existence of yearly seasonality in the time series.
4.3.1. Seasonal and Trend Decomposition Using LOESS
After formal proof of the seasonality of the energy consumption in Brazil, the time series may be decomposed into its components using Locally Estimated Scatterplot Smoothing (LOESS). This results in the seasonal, trend, and residual components, as depicted in
Figure 4. The decomposition is performed with additive seasonality, resulting in a consistent seasonal pattern, thus suggesting its additive nature.
The trend component represents the long-term direction of the time series. As seen in
Figure 4, energy consumption is consistently rising, despite drops in 2009 and 2020 and a change in the slope in 2015.
The seasonal component represents the repeating pattern in the data at fixed intervals. This section proved that this fixed interval is 12 months wide. This is also confirmed by the seasonal component, shown in
Figure 4.
In the seasonal component chart, all the dips to below
MWh occurred either in June or in July when it is winter in Brazil, and all peaks above
MWh are registered in March, during the transition from summer (until the 20th) to autumn. This suggests a correlation between the energy consumption pattern and the temperatures in Brazil. This causality is more deeply studied in
Section 4.5.
After removing the trend and seasonal patterns, the residual component represents the unexplained variation or noise in the time series data. A sharp drop between April and July 2020 is observed in the residual component, potentially linked to the COVID-19 pandemic, officially declared by the World Health Organization on 11 March. This period may have decreased energy consumption due to pandemic-related restrictions and changes in societal behavior, as found by [
60]. This also appears to be responsible for the drop in the trend component in 2020.
4.4. Long-Term Memory Test
The capacity of a time series to retain patterns over extended periods refers to its long-term memory. It reflects the degree to which past observations influence future observations in the series. It indicates how well the historical data of the time series are preserved or remembered over time. Comprehending the long-term memory of a time series is fundamental for revealing its underlying dynamics, analyzing trends, identifying patterns, and improving the reliability of forecasts based on historical data.
In this regard, a time series is said to have persistent behavior if it tends to replicate its patterns over time, manifested as momentum in the data, whether characterized by increasing or decreasing trends. This means that increases follow increases in values, and decreases in values are followed by decreases in values.
Conversely, an anti-persistent time series is more likely to experience an increase in value after a decrease and vice versa. This creates a mean reversion behavior rather than continuing in the same direction.
A time series may also present a Brownian motion behavior in which future values do not depend on past observations. This poses a challenge to time series forecasting.
The Hurst exponent (H) evaluates a time series regarding their long-term memory. This metric, , indicates whether a time series presents a persistent (), anti-persistent (), or random () behavior.
The variation of the Hurst Exponent over a 100-month wide window is calculated for the energy consumption time series and its residual and trend components. This analysis does not include the seasonal component due to its evident cyclical behavior. The results are presented in
Figure 5, demonstrating that energy consumption in Brazil has a consistent growth trend despite the inflection points, such as the one possibly caused by the COVID-19 pandemic.
In contrast, the energy consumption time series and its residual components follow an anti-persistent behavior. The persistent behavior of the trend component, along with the fact that no Brownian motion behavior (
) (red dashed lined in
Figure 5) is observed, implies that Brazil’s energy consumption is predictable by observing its past values.
4.5. Interaction with Exogenous Variables
Understanding the intricate relationship between energy usage and external factors is essential to gain a comprehensive perception of the dynamics of energy demand.
Economic fluctuations, for example, may impact energy consumption trends, reflecting shifts in production, consumption patterns, and overall economic activity. Similarly, climatic variables, such as temperature and precipitation, may influence energy demand, particularly in sectors like heating and cooling.
By leveraging exogenous variables in the analyses, not only is the understanding of the factors that shape energy consumption patterns enhanced, but forecasting models may also improve in accuracy. This possibly enables these variables to serve as valuable indicators of external influences that drive changes in energy demand, allowing us to anticipate and adapt to evolving dynamics in the energy landscape. By meticulously analyzing these interactions, we aim to improve comprehension that facilitates informed decision-making in energy planning, resource allocation, and policy formulation.
4.5.1. Granger Causality
Granger causality determines whether one time series can be used to predict another time series [
61]. It asserts that a given time series, denoted here as X, Granger-causes (or G-causes) another time series, designated as Y, under the condition that the historical data of X contribute to a superior forecasting accuracy of Y compared to relying solely on Y’s past data. The hypotheses of the test are as follows:
Hypothesis 5. The lagged X-values do not explain the variations in Y, i.e., X(t) does not G-cause Y(t).
Hypothesis 6. The lagged X-values may explain the variation in Y, i.e., X(t) G-causes Y(t).
For each pair of variables in our dataset, the Granger causality is tested for a maximum lag of three months, and the causality is only considered valid if the null hypothesis is rejected for all three lags.
Figure 6 displays the results, in which the rows represent the causes being tested and the columns are the targeted time series.
It is important to note, however, the Granger causality does not imply a symmetric relationship between two variables; that is, (X(t) → Y(t)) ⇏ (Y(t) → X(t)), in which the → represents the Granger causality. Because of that, the matrices in
Figure 6 are not symmetrical concerning their main diagonal. Also, one variable cannot G-cause itself; therefore, the matrices are also false in their main diagonal.
While oil production was the only industrial factor to Granger-cause energy consumption (
Figure 6a), the climatic factors were the main ones responsible for the seasonal component of the energy usage (
Figure 6b). The Granger causality testing, however, does not provide information about the direction of the causal effect between variables. That is, it cannot determine whether the energy consumption rises or falls after an increase in the temperature.
Section 4.5.2 assesses the relationship between these variables’ directions.
Figure 6c shows that the economic indexes do not G-cause the trend or seasonality. However, the GDP, NCPI, ENCPI, and uni-direction Granger causality influence Brazil’s energy consumption (EC) time series. This finding diverges from those found by [
62], which stated the causality in the reverse order between 1963 and 1993; that is, EC → GDP.
The Granger causality between economic growth and energy consumption has been studied in several countries, such as Italy, as conducted by [
63] and in G7 countries, as conducted by [
64]. It has been observed that, for example, between 1990 and 2014, EC ↔ GDP globally, while EU countries had EC → GDP, and, between 1960 and 2012, Belgium had GDP → EC, according to [
65], as our current findings for Brazil.
4.5.2. Correlation
The assessment of the correlation between variables enlightens the direction of the relationship between variables and causality relationship. For this analysis, we have selected exclusively the variables that demonstrated, in
Section 4.5.1, Granger causality to energy consumption or any of its components.
The correlation confirms the observations from
Section 4.3.1, which concluded that the energy consumption was higher in the Brazilian summer.
Figure 7 shows that the dry bulb temperature and the seasonal component of the energy consumption have a strong positive correlation, suggesting that the greater the temperature, the higher the energy demand.
A strong correlation between the trend component and the economic and industrial factors is noted despite no Granger causality being observed between them. This phenomenon may be attributed to several plausible explanations. Firstly, a common cause could form the basis of the observed correlation, whereby alterations in these factors occur concurrently without direct causal links among them. Alternatively, the potential presence of Granger causality, albeit with a lag greater than three months, was used in the experiment.
4.5.3. Cointegration
Cointegration describes the long-term equilibrium relationship between two-time series. Cointegrated series move together in the long run despite exhibiting short-term deviations from their equilibrium relationship.
For this analysis, we selected the variables that were found to be Granger causes of energy consumption in Brazil, according to
Section 4.5.1. The cointegration between them was assessed with the Engle-Granger test.
This test involves regressing one non-stationary variable on another and then testing the stationarity of the residuals obtained from the regression, using the Augmented Dickey–Fuller test. If the p-value from the unit root test is below 0.05, it indicates that the residuals are stationary, suggesting that the variables are cointegrated. However, if the p-value exceeds this significance level of 0.05, the null hypothesis of non-stationarity in the residuals cannot be rejected, implying that there is no cointegration between the variables.
Figure 8 shows the matrix of cointegration between the selected Granger variables and is presented as the True cointegration if the
p-value is less than 0.05 and as false otherwise.
All variables depicted in
Figure 8 exhibit Granger causality with energy consumption, but only dew point temperature and relative humidity of air demonstrate cointegration with the energy consumption time series or its components. This suggests a predictive relationship between the two variables, but it may not be a stable long-term relationship.
5. Time Series Models
Having conducted the data analysis in
Section 4, the patterns, trends, and correlations within the time series are now comprehended, providing meaningful observations of the historical behavior of energy consumption. This knowledge also enables a better configuration of the prediction models, resulting in more accurate values.
5.1. Training Settings
The forecast is conducted using the SARIMA, FB Prophet, Holt–Winters, and TBATS models, configured to consider energy consumption’s yearly seasonality. These models were selected due to their support for seasonal time series and their previous successful use, as seen in
Section 2.
The experiment is conducted using Python, version 3.10.12. The libraries used for each model and their training parameters are presented in
Table 4. These parameters were selected according to the data analysis discussed in
Section 4, with a corresponding reference in
Table 4, indicating where the determination of each parameter is elaborated. The parameters not mentioned in
Table 4 were set to their default values. It is noted that FB Prophet is easier to use, as it automatically identifies the adequate parameters. Conversely, SARIMA requires manual configuration of several variables.
The 24 most recent months (December 2021 up to November 2023) of the data are used to test the predicted values, leaving 215 months available for training. As the features of the time series, such as the Hurst exponent, vary with time, each model is trained using an expanding training window that incrementally encompasses 36 months of historical data up to the complete training dataset.
Moreover, to mitigate the influence of noise inherent in the residual component, the evaluation is conducted on both the original time series and on a smoothed version, with a smoothing parameter
.
Figure 9 summarizes these forecasting scenarios.
5.2. Univariate Models Accuracy Evaluation
The validity and performance of these time series forecasting models must be rigorously assessed to ensure their suitability for real-world applications. This section presents the test results of the time series univariate forecasting models SARIMA, FB Prophet, Holt–Winters, and TBATS for energy consumption, comparing them on their Mean Absolute Percentage Error (MAPE).
As presented in
Figure 10, FB Prophet’s model achieved the best accuracy, with 0.71% MAPE for the smoothed energy usage time series, with a 108-month training window. Furthermore, upon comparing
Figure 10a,b, it becomes evident that smoothing the time series enhanced the accuracy of the models. Additionally, in most scenarios, the utilization of a 36-month training window yielded the poorest MAPE values, suggesting an insufficient amount of data for robust model performance.
For the original time series, the optimal training window sizes for each model were 72 months for SARIMA (1.38% MAPE) and for FB Prophet (1.91%); 108 months for Holt–Winters (3.85%); and 215 months for TBATS (4.17%). For the smoothed version, the optimal sizes were 180 months for SARIMA (1.44%), 108 months for FB Prophet (0.71%, the lowest MAPE overall); 72 months for Holt–Winters (2.53%); and 215 months for TBATS (1.44%).
The predictions for the validation period for each optimal model are further compared with additional accuracy metrics in
Table 5, which presents additional accuracy metrics for these models. Both FB Prophet and SARIMA returned negative MPE values, meaning that their predicted values are greater than the actual values. In contrast, Holt–Winters and TBATS resulted in positive MPE values, as their estimated values are lower than the actual ones. The TBATS model also obtained a MAPE equal to MPE, meaning that the predicted values never cross over the actual values. These conclusions are supported by Equation (
2) and visually represented in
Figure 11, which compares these models, in these same scenarios, for both the original and the smoothed time series. It is noteworthy that all these models achieved Highly Accurate Prediction, according to [
51].
These models are also used to forecast the energy consumption in Brazil for up to November 2033, in
Section 5.5.
The MAPE assessment shows that FB Prophet achieved the best accuracy among the models assessed for energy forecasting in Brazil. Our findings are in accordance with [
17,
18].
5.3. Multivariate Models Accuracy Evaluation
Similar to the results presented in
Section 5.2, this section evaluates the accuracy metrics for the forecasting models. In this section, however, we incorporate exogenous variables that exhibit a Granger causality relationship with the energy consumption time series, as seen in
Section 4.5.
As the Holt–Winters and the TBATS models do not natively support exogenous variables, they are excluded from the analysis of this section. Also, SARIMAX is used, along with FB Prophet, instead of SARIMA.
As a consequence, these models are evaluated regarding their accuracy, measured by the MAPE, when adding the exogenous variables of oil production (industrial); GDP, NCPI, and ENCPI (economic) [
66]; total precipitation, air temperature, dew point temperature, relative humidity of air and wind speed (climatic). We also assess the accuracy when including all these factors concurrently in the models. The results are shown in
Figure 12 for SARIMAX and
Figure 13 for FB Prophet.
It is worth noting that SARIMAX demonstrated improved optimal accuracy, in comparison to SARIMA, when incorporating exogenous variables in both the original and smoothed time series. Specifically, the original time series, utilizing solely climatic variables, achieved a MAPE of 1.28% with a training window size of 215 months. Conversely, the smoothed time series, incorporating economic variables, returned an even lower MAPE of 1.18% with a training window size of 180 months. In contrast, when considering only endogenous time series data, the MAPE values were slightly higher, at 1.38% for a training window size of 72 months and 1.44% for a window size of 180 months, respectively.
In the case of the FB Prophet model, an interesting observation emerges. Contrary to expectations, including economic exogenous variables seems to have a detrimental effect on model accuracy. When considered in isolation, these variables resulted in a maximum Mean Absolute Percentage Error (MAPE) of 42.08%, and when combined with industrial and climatic factors, the MAPE increased to 52.79%. Interestingly, while incorporating exogenous variables did not significantly enhance the model’s accuracy in the smoothed time series, it marginally improved accuracy in the original version. Specifically, accuracy improved from 1.91% with endogenous variables alone to 1.62% with a training window of 144 months, considering industrial variables.
None of the models incorporating all factors simultaneously produced superior results. However, when each category of exogenous variables was considered independently, the best accuracy was achieved under specific scenarios. Industrial variables enhanced the accuracy of the smoothed time series in the Facebook Prophet model, while climatic variables benefited the original time series in SARIMAX. Economic variables, conversely, demonstrated a modest improvement in accuracy for the smoothed version in SARIMAX. The original time series in the Facebook Prophet model generated the best results when considering endogenous variables exclusively.
For the original time series, the SARIMAX achieved its best MAPE value for a training window of 215 months and considering climatic exogenous variables, while FB Prophet achieved it for 144 months and industrial variables. For the smoothed version, SARIMAX tested the best with 180 months and economic variables, while FB Prophet with 36 months and industrial variables. Both SARIMAX and FB Prophet are compared in these optimal scenarios with different metrics in
Table 6. These same scenarios are used to visually demonstrate the validation in
Figure 14.
SARIMAX achieved Highly Accurate Prediction in all combinations of exogenous variables, both for the original and the smoothed time series. FB Prophet, contrarily, appears to have reacted poorly to the economic exogenous variables, achieving an Inaccurate Prediction when incorporating all variables in the smoothed version. When using exclusively industrial or climatic variables, it consistently reached Highly Accurate Predictions.
5.4. Models Fit Test
To estimate the adequacy of these models in each scenario, the Ljung–Box test is performed. The test is performed with a maximum lag of four, considering the default parameter of . Its hypotheses are as follows:
Hypothesis 7. There is no autocorrelation in the data up to a specified lag.
Hypothesis 8. There is significant autocorrelation present in the data.
The Ljung–Box test is run on the residuals (i.e.,
) of each model, in their optimal window sizes, according to
Section 5.2.
Significant autocorrelation in the residuals suggests that the model fails to capture some foundational patterns in the data, indicating potential deficiencies in the estimation process. Its results help ensure the validity of the model’s assumptions, particularly regarding the independence and randomness of the residuals. This helps improve the forecasting model’s reliability.
The fourth lag demonstrated the highest
p-values for all models. From
Table 7, it is noted that only FB Prophet and SARIMA, when applied to the original time series, were able to reject
. This means that the forecasting models adequately capture the temporal dependencies present in the time series, and the residuals exhibit randomness and independence. The residuals for forecasting the smoothed version, however, present significant autocorrelation, implying a lack of fit. Holt–Winters and TBATS showed a lack of fit for both scenarios.
Upon restricting the accuracy evaluation for SARIMA and FB Prophet applied to the original time series, as these are the only models that demonstrated to be fit, it is concluded that SARIMA is the most accurate fit model for the univariate forecasting.
Similarly, in the multivariate scenario, both SARIMAX and FB Prophet demonstrated adequate fit, with no autocorrelation within the residuals in the original time series, as demonstrated in
Table 8. In contrast, for the smoothed version, both models showed a lack of fit in the Ljung–Box test.
As again the smoothing of the time series made the models fail the Ljung–Box test, only the accuracy performance for the original time series is taken into consideration. With this restriction, SARIMAX returned the best MAPE values.
5.5. Energy Consumption Forecasting
This section considers the optimal training window sizes for each forecasting model, considering the univariate results presented in
Section 5.2.
Although SARIMAX achieved its best accuracy in the multivariate modeling, we here present the predictions provided by its univariate scenarios because forecasting the energy consumption up to 2033 in the multivariate scenario would also require predicting indexes like Brazilian’s GDP, inflation, and oil production, which is not a trivial task and beyond the scope of this work. Moreover, the accuracy of the univariate scenario is considered adequate for this purpose. The primary objective of the results from
Section 5.3 was to illustrate the impact of incorporating exogenous factors on model performance.
The predicted values are displayed in
Figure 15. The SARIMA predicts values close to 70,000 GWh in November 2033 when no smoothing is applied, with FB Prophet forecasting above 60,000 GWh. The value indicated by SARIMA is still near the upper limits of the predicted values by FB Prophet, represented by the gray shade in
Figure 15. It is noteworthy that Holt–Winters and TBATS predict a stationary trend in this scenario.
When smoothing is applied, SARIMAX and FB Prophet predict similar values at around 55,000 GWh consumption in November 2033. Although Holt–Winters still predicts a stationary trend in this scenario, TBATS forecasts an increase, predicting approximately 50,000 GWH for the same month. Smoothing the time series has also enlarged the lower and upper limits of the FB Prophet forecasts, possibly as a consequence of the increase of the autocorrelation in the residuals, as seen in
Section 5.4.
The forecasted values generated by all four models are accessible in the GitHub repository (
github.com/gabriel-arquelau/Brazilian-energy-consumption-prediction/ accessed on 21 June 2024). These predictions are based on scenarios that achieved the best MAPE assessments in their optimal univariate scenarios. They encompass data projections extending up to November 2033 for both the original and smoothed scenarios, and in the case of FB Prophet, accompanied by corresponding lower and upper limits. The publication of this data enables future validation of the forecasting with actual values.
5.6. Time Performance Assessment
While accuracy is a fundamental aspect of forecasting models, it is not the sole determinant of their effectiveness. Particularly in time-sensitive environments, time performance plays a vital role in ensuring the practicality and utility of these models.
In dynamic industries like energy management, decisions must be made rapidly in response to changing conditions. A forecasting model that provides accurate predictions but takes excessive time to train or generate forecasts may be impractical in such contexts. The decision-making process may require forecasting models that can deliver timely responses, enabling organizations to react adequately to emerging trends, seize opportunities, and mitigate risks effectively.
To extend the comparison between the models regarding their time performance, each was timed during training (with data of 215 months) and predicted (up to November 2033) 25 times, not considering exogenous variables. The resulting average execution time is shown in
Table 9, along with the measurement margin of error, using Equation (
5), and the consequent confidence level.
The time performance tests were conducted using a computer with 12.7 GB of RAM and an Intel(R) Xeon(R) CPU running at 2.20 GHz. No GPU was used.
6. Conclusions
Precise forecasting in the energy sector is crucial for the achievement of sustainable development objectives in three key areas: making available cost-effective, dependable, and up-to-date energy utilities, exploring alternative energy sources, and improving energy efficiency.
This study seeks to meet this objective by comparing the performance of different forecasting models in the Brazilian energy sector. The analysis assesses Seasonal Autoregressive Integrated Moving Average (SARIMA), Facebook Prophet (FB Prophet), Holt–Winters, and TBATS, in handling the intricate dynamics of energy demand in Brazil. The results reveal that each model displays distinct strengths and weaknesses.
As noted earlier, SARIMA excels in tracing seasonal patterns but may struggle to deal with irregular fluctuations. Facebook Prophet shows promising outcomes in different sectors. However, it requires careful examination of specific datasets and contextual factors when conducting an analysis. Holt–Winters is adept at handling seasonal variations but may encounter difficulties when faced with abrupt changes in demand. In contrast, TBATS shows flexibility when managing diverse seasonal patterns but requires a considerable amount of historical data and may face challenges in making long-term projections.
Furthermore, account was taken of the influence of external variables on energy consumption, such as economic indicators, industrial factors, and climatic conditions. This investigation seeks to elucidate the connecting links between these factors and energy consumption through Granger causality tests and correlation assessments. Additionally, the research investigates the persistence of energy consumption patterns, by highlighting enduring trends in trend components and non-persistent behavior in residual components.
The precision and effectiveness of the forecasting models are evaluated, in both univariate and multivariate scenarios. The performances of SARIMAX and FB Prophet are assessed in terms of their accuracy in integrating external variables and enabling practical applications. Thus, this study seeks to contribute to advances in energy demand prediction, by allowing well-informed decision-making in sustainable energy planning, resource allocation, and policymaking and, thus, assists in achieving SDG7 and its related objectives.
Our findings indicate that, although FB Prophet achieved the best general accuracy metrics, its residuals still present autocorrelation, which implies a lack of fit of the model. Upon restricting the accuracy evaluation to the models that do not present autocorrelation in the residuals, it is noted that SARIMA is found to return the best MAPE values for the univariate forecasting, with 1.38%, as opposed to the 1.91% from FB Prophet. In the forecasting with exogenous variables, SARIMAX achieved the best accuracy, achieving 1.28% MAPE compared to 1.62% from Facebook Prophet. The smoothed version of the time series resulted in autocorrelation within the residuals for all models.
These findings may support the Brazilian government in the elaboration of energy, economy, and sustainability policies. Additionally, the methodology proposed in this study may also be used as a framework for assessing and predicting energy consumption patterns worldwide.
As part of future work, we propose evaluating new categories of exogenous variables, such as demographic data, and their relationship to energy consumption patterns. We also propose expanding the statistical comparison to more recent time series models, such as TFT and N-BEATS, possibly to energy generation instead of demand.