Electricity price forecasting on electricity spot market: a case study based on the Brazilian Difference Settlement Price

Developing predictive models is a complex task since it deals with the uncertainty and the stochastic behavior of variables. Specifically concerning commodities, accurately predicting their future prices allows us to minimize risks and establish more reliable decision support mechanisms. Although the discussion on this question is extensive, there is academic attention being paid to the construction of nonparametric models applied to energy markets, as they have presented promising predictive results, what justifies the present study. This paper applies classical statistical models and Dynamic Time Scan Forecasting (DTSF) to the short-term electricity market prices, in Brazil, from 2006 to 2019. DTSF consists of scanning a time series and then identifying past patterns (so-called “matches”), similar to the last available observations. We predict Brazilian electricity spot prices, according the most similar matches, using aggregation functions, such as median. Recent research on the electricity spot market is increasing, indicating research significance. Our predictive approach exhibited greater accuracy than seminal statistical models. Our approach was designed for a high frequency series. Its predictive performance remained robust when other models presented both high predictive errors (spring), as well as when those models are highly accurate (winter). For future research, we recommend a more finely-tune study on DTSF parameters.


Introduction
The construction of predictive models arouses interest in the literature [1][2][3][4], since economic agents deal with uncertainty in multiple spheres and aim to achieve the best level of results from the available resources [5]. Therefore, developing models with acceptable accuracy and adequate rigor presents a meaningful challenge to researchers. The Professor George Box synthesized this scheme: "All models are wrong, but some are useful" [6]. In other words, prediction is a technique that deals with risk, and there will always be a fundamental error associated with it. The best model is the one that adequately represents the phenomenon of interest.
In relation to the object of our study, electricity prices, there are several forecasting applications: (i) classical time series models like the autoregressive moving average, autoregressive integrated moving average, generalized autoregressive conditional heteroscedastic, among others [7][8]; (ii) pre-processing techniques, e.g., spectrum analysis, wavelets and Fourier analysis [9][10]; and, (iii) machine learning approaches such as neural networks, fuzzy systems and support vector machine [11]. Additionally, an alternative class known as hybrid models aims to combine machine learning representations with deferent methods. Instances of these methods are focused time-delay neural networks [12], neural networks with fuzzy inputs [13], finite-impulse response neural networks [14], local feedback dynamic fuzzy neural networks [15], type recurrent fuzzy networks [16], neurofuzzy inference systems [17], among others.
Although the literature on this question is extensive, there is academic interest in the construction of nonparametric models applied to energy markets, as they have presented promising predictive results. In general, these models are designed to deal with long-time series and are chiefly based on analog search [18] and scan-clustering methodologies [19][20].
According to this framework, understanding price behavior takes singular importance [21] since it allows the minimization of risk and uncertainty [22][23] and thereby to provide reliable production plans [24] and to establish a fine electricity market design [25]. In this scenario, it is noteworthy that in Brazil, for instance, the National System Operator defines the spot price of electricity weekly [26]. Predicting future values can help to establish enterprise decisions and behaviors. For example, if a firm expects that the energy price will scarcely increase, it could provisionally suspend part of its production and sell the surplus electricity in the spot market later at a higher price [27][28]. Also, the value of mapping the main conceptual theories used in the literature regarding the electricity spot market is noteworthy, as those theories evolve and become more robust over time [29][30].
The present paper contributes to the debate about the electricity spot market in two ways: (i) it illustrates how big data tools can produce relevant information about the electricity market; and, (ii) it illustrates, as a case study, a new forecasting approach, proposed by Costa et al. [20] to the analyzed market. Accordingly, we aim to review the literature on the electricity spot market, through the employment of big data tools, presenting the main research trends in the electricity spot market; also, to introduce a new, predictive instrument based on dynamic time scan, using the Brazilian difference settlement price as a case study.
The paper is organized as follows. Section 2 presents the methodology, the data retrieval, and the dynamic time scan forecasting procedure. Section 3 illustrates an application of our forecasting approach, applied to the Brazilian electricity market, as a case study. Finally, section 5 highlights some patterns observed in the literature review and the potential use of dynamic time scan forecasting for future studies focusing on the energy spot market.

Materials and Methods
This section first presents the data and the procedures used to carry out a review of literature. Second, it introduces a promising statistical model based on dynamic time scan forecasting. To illustrate the accuracy of the model, and to present its applicability, the Brazilian "difference settlement price" dataset was used as a case study.

A review of the literature on the Electricity Spot Market
We conducted an exhaustive survey of publications regarding papers on the electricity spot market. It is noteworthy that Web of Science (WoS), along with Scopus, are the most used academic citation databases for delineating fields of study. WoS, formerly known as the ISI, Web of Knowledge database, was used as the most complete and traditional bank of scientific publications in the world [31][32]. We limited our search to papers published in English. Moreover, we considered only the WoS database, since the WoS and Scopus databases may not differ significantly [30]. In addition, we chose to analyze only the core publication journals, which are usually indexed in both databases.
Data extraction from the WoS platform (2019-05-06) took into account publications that responded to the search expression "electricity spot market*", as shown in Figure 1. The use of the "*" character in the search expression helps to capture words in both the singular and in the plural, making search results more complete.
The research universe encompasses publications from the years 1992 to 2018 (n = 173). 1992 is the year of the first scientific publication on the subject indexed in WoS. 2018 is the last year for which complete information is available. The sample for this project (1992 to 2018, n = 97) is henceforth called "primary publications". To filter these primary publications, we scanned for any of the descriptors shown in Figure 1 in the titles, abstracts, author's keywords, or in the Plus keywords. Criteria for including a paper in the sample were based on these indicators: (i) CiteScore (measures average citations received per document published in the serial); (ii) SCImago Journal Rank (SJR) (measures weighted citations received by the serial. Citation weighting depends on subject field and prestige, SJR of the citing serial); and, (iii) Source Normalized Impact per Paper (SNIP) (measures actual citations received relative to citations expected for the serial's subject field), all of them for the year of 2018. The present study considered only the periodicals rated above the second quartile for each of the three criteria. After selecting journals, we conducted a descriptive analysis of our bibliographic data frame. To do this, we used the "Bibliometrix R-package" developed by Aria & Cuccurullo [33] to analyze the annual publication of electricity spot markets in the most relevant journals, as well as the most productive countries of corresponding authors and seminal works. Next, we developed a dictionary that aggregates similar words. For example, we considered "electricity prices" and "electricity pricing", or "electricity spot market" and "electricity trading", as equivalent expressions. Finally, we constructed a WordCloud using the VOSviewer software [34], that filters the hot and cold areas of interest for the theme according to the co-citation keywords, showing in detail how they interact with each other.

Data retrieval
The present study is based on the Brazilian difference settlement price (DSP). The DSP is determined weekly, considering three load levels for each sub-market. The submarkets are defined by the National Operator of the System, and consider the following geographical divisions: North, Northeast, Southeast/Center-West and South.
The DSP is determined ex-ante (considering expected availability and load information), based on weeks counted from Saturday to Friday. The prices must sell out all the energy, not just the contracted energy, among the agents [35]. The analyzed sample consists of weekly DSP data (R$/MWh) collected by the Chamber of Electric Energy Commercialization, from January 2006 to May 2019 (n = 701 weeks). We utilized the twelve available series, divided into the four Brazilian sub-markets: North, Northeast, Southeast/Midwest and South (called, respectively, N, NE, SE and S); and three load levels of energy: Heavy, Average, and Light (called, respectively, P, M and L) † .

Dynamic time scan forecasting methodology and benchmark comparison
Dynamic time scan forecasting (DTSF) is an R-package based on scan statistics [36]. It was originally formulated to deal with wind forecasting and power generation by industrial plants [20]. It consists of scanning a time series and then identifying past patterns (so called "matches") similar to the last available observations. Future values are predicted from the most similar matches using aggregation functions, such as median. Mathematical formulation and the results of original applications can be found in Costa et al. [20].
Here, we present an innovative use of DTSF based on the electricity spot market. To present the method, we utilize a predictive window equal to four weeks, the number of matches as the ten best-correlated ones and, finally, a polynomial function of order one ( Figure 2). In this way, it is possible to find patterns between last available data and the old information, without any statistical test (green highlights). This procedure is based only on † According to this, we have: high similarity statistics (R²). The most similar patterns, called "median value of matches," allow us to predict the DSP with the highest level of accuracy.

Fig. 2.
Time series of the DSP (P-SE) and ten best matches found using DTSF.
To illustrate the DTSF, we compare it to the classical statistical methods utilized in the "Makridakis Competitions" (also known as the M Competitions or M-Competitions). These competitions are a series of open disputes organized by the Professor Spyros Makridakis to evaluate and compare the accuracy of different forecasting methods [37][38]. Table 1 provides our benchmark comparison.

Initials Description
Naïve 1 A random walk model; future values will be the same as that of the last known observation. Naïve S Forecasts are equal to the last known observation of the same period.

Naïve 2
Like Naïve 1 but the data are seasonally adjusted, if needed, by applying a classical multiplicative decomposition. A 90% autocorrelation test is performed to decide whether the data are seasonal.

SES
Exponentially smoothing the data and extrapolating assuming no trend. Seasonal adjustments are considered as per Naïve 2.

Holt
Exponentially smoothing the data and extrapolating assuming a linear trend. Seasonal adjustments are considered as per Naïve 2.

Damped
Exponentially smoothing the data and extrapolating assuming a damped trend. Seasonal adjustments are considered as per Naïve 2.

Theta
As applied to the M3 Competition using two Theta lines, ϴ1 = 0 and ϴ2 = 2, with the first one being extrapolated using linear regression and the second one using SES. The forecasts are then combined using equal weights. Seasonal adjustments are considered as per Naïve 2.

Comb
The simple arithmetic average of SES, Holt and Damped exponential smoothing (used as the single benchmark for evaluating all other methods).

DTSF
Based on scan-clustering, parametrized with a predictive window equals to four week, assuming the number of matches as the ten best correlated ones and a polynomial function of order one.

Statistical benchmarks
Scan-clustering analysis

Academic research on electricity spot market
Research on electricity spot markets began with Green & Newbery [42], who analyzed the competition in the British market and demonstrated the Nash equilibrium in supply schedules, implying a high markup on marginal costs and substantial deadweight losses. However, there was a notable gap of seven years until the next three papers were published [43][44][45]. The first research [43] studied transmission efficiency in the western US. The second and the third studies [44][45] focused on measuring duopoly power in the British electricity spot market and the reform of electricity trading in England and Wales, respectively.
In  It is possible to create maps based on bibliographic information and then explore, for instance, the degree of appearance of a particular keyword and its temporal evolution. This type of analysis allows us to verify the hot and cold areas of interest in the scientific debate on the electricity spot market (Figure 3). Our purpose is to take out the frequency of papers with certain keywords. We set our "breakpoint" (n = 2) as the minimum number of occurrences considering all the keywords (n = 432). As it is possible to see, below, 37 keywords (nodes) meet that threshold. The diameter of the circle is proportional to the number of occurrences of, and the lines show the number of links between, these keywords. In recent research, some topics have gained prominence: (i) non-parametric models; (ii) impact analysis; (iii) merit order effect; (iv) virtual power plant; and, (v) electric vehicles. Figure 3 highlights a defined trajectory of research over time. The first published research (in purple) emphasized economic aspects such as the supply of energy, as well as technical elements (capacity and transmission, e.g.) concerning spot energy markets. Following this, there was a growing importance of studies on electricity generation and pricing (in blue), studies on contract theory, energy storage, and technologies (in green). Finally, the areas of the most current interest are those linked to non-parametric models, impact analysis, merit order effect, virtual power plant, and electric vehicles. Note: This WordCloud considers only articles with a maximum number of authors per document (n=25). The inclusion criterion for a single word is that it appear at least (n=2) times in different papers' keywords.
Let us look at the non-parametric node. This node has been used in papers after 2016, which indicates a possible trend for further research. Studies that have used the keyword "non-parametric models" have also used other keywords, namely: (i) behavior strategies, (ii) complementarity, (iii) electricity pricing, (iv) impact analysis, (v) market structure, (vi) penetration, (vii) power generation, (viii) renewable energy, (ix) spot market, and (x) transmission. Thus, our paper relates to current research trends on electricity and innovates by proposing the first application of the nonparametric model (DTSF) for forecasting energy prices in the spot market.
The main articles that addressed nonparametric models applied to energy focused on: (i) assessing the influence of high penetration of wind power on the market-splitting behavior between West and East Denmark, using logit and non-parametric models [49]; and, (ii) expressing the probability response for market-splitting of day-ahead spot electricity prices as a function of the explanatory variables representing the main technologies in the generation mix, including wind, hydro, thermal and nuclear power, together with the available transfer capacity and electricity demand [50].

Statistical analysis of difference settlement price time series (DSP)
In order to test the hypothesis of equality of DSP prices, among groups 1 to 12 (PSE,  Table 2). The initial objective is to identify the existence of at least one difference among the prices in the DSP groups. As the P-value for the F statistic is significant, there is evidence that at least one difference among the average prices would be significant.

Response: Prices
To check whether the results obtained in the ANOVA are satisfactory, it is recommended that the following conditions be tested: (i) are the standard deviations of groups constant over time? (ii) is the response distribution normal for each group? To test for homoscedasticity, we performed the Bartlett Test [51], and obtained a P-value equal to 0.448. To detect normality, we performed the Shapiro test [52], which gave a P-value of 0.501. The non-normality of these results corroborates findings previously reported in the literature [53]. Furthermore, since the DTSF is based on a non-parametric model, our goal was not to perform statistical inference analysis.
From this evidence, it is interesting to identify where the differences among the means of the analyzed groups lie. In particular, the process of comparing means examines them two by two, using the Multiple Comparisons method proposed by Tukey [54] (Figure 4). In general, most of the series have equal mean values. This reinforces the thesis that the DSP behavior is stable concerning the charge amount and the associated geographic region. Additionally, at the 0.1 level of significance of, the means of the DSP prices differ statistically from the others only in the following groups: MSE-LN, PNE-LN and PSE-LN. In order to test the hypothesis of equality of DSP prices, among groups 1 to 12 (PSE, MSE, LSE, PS, MS, LS, PNE, MNE, LNE, PN, MN and LN) ( ), we performed an Analysis of Variance (ANOVA) ( Table 2). The initial objective is to identify the existence of at least one difference among the prices in the DSP groups. As the P-value for the F statistic is significant, there is evidence that at least one difference among the average prices would be significant. In general, the main differences are centered in the north of Brazil. This is reasonable, since this region is not fully connected to the national electricity system and, thus, has specific characteristics [55].

Case study: applying DTSF to the heavy southeast energy submarket
According to the statistical evidence presented in section 3.2, there is robust indication of a similar pattern among the mean values for the twelve analyzed time series. Thus, we assume that the DTSF approach will generate similar forecastings for each group. Given that, our case study is based only on the DSP in the southeast of Brazil, and considers the heavy load level of energy. This choice is justified because the southeast is the wealthiest region of the country and concentrates nearly 55% of the country's gross development product [56]. Lastly, we kept the heavy load level as it relates to industrial energy demand [57].
As expressed in the Material and Methods (section 2.3), the new predictive DTSF model is faced to the eight "seminal statistical models" (classified here as the benchmark models), frequently used in the technical literature on forecasting competitions, such as the classical one "M4 Competition" [37][38]. There is no evidence of seasonal influence in the time series analyzed, since the variations of the Naïve method resulted in equivalent predictive metrics (Table 3). We also observed that the benchmark models presented similar results. On the other hand, according to the OWA, the DTSF method presented better performance than the Naïve (baseline) model. DTSF presents an efficient resolution for the Brazilian DSP prediction in the southeast region, considering the heavy load level of energy. Figure 5 graphically illustrates the fit of the models according to the sMAPE and MASE statistics. Nevertheless, DTSF should be examined in more detail. In Figure 2 (section 2.3) we presented the time series utilized and, according to that time series, the discontinuous nature of the observations over the weeks is evident. This occurs for different reasons, ranging from political influence on the energy pricing process [58] to theoretical limitations in defining the difference settlement price in Brazil [59].
To strengthen our predictive study, we divided the time series according to the seasons (spring, summer, autumn, and winter). Following this division, the predictive potential of the models was re-examined (Table 4). In general, the best performances were, respectively: (i) spring (DTSF); (ii) summer (Naïve and Damped); (iii) autumn (Naïve) and (iv) winter (Damped). It is noteworthy that our results are generally consistent. DTSF, based on the scanning method, exhibited predictive worsening due to the time series cutoff. Nevertheless, even with the cutoff, it was more statistically accurate in the spring and winter forecasts. Although all models have high predictive errors (spring), DTSF produces better results. The same goes for the inverse situation: whenever models are highly accurate (winter), DTSF is among the best predictors. Finally, due to the high discontinuity pattern of the analyzed series, the Naïve model presented good overall performance.
Our results, although early, shed light on some future research possibilities such as detailed examination of DTSF performance in other global markets, such as in the Nordic countries. These countries have a sturdy energy pricing system, "Nord Pool" [60], that use hourly pricing information for electricity. Thus, the available information exceeds 50,000 observations for each market, (country) which allows it to produce a bright body of investigation. Last, but not least, we suggest the examination of different DTSF parameters through a grid search inquiry. Also, we recommend testing the precision of models by cutting time series into hundreds of subsamples and then verifying the predictive power of DTSF under different circumstances.

Conclusions
Analysis of the electricity spot market is complicated, involving the relationship between forecasting models and uncertainty, distinctly regarding the stochastic behavior of variables. The National System Operator regulates the Brazilian spot price of electric energy, which weekly discloses a new electric energy price to minimize the operating cost of the whole system. The present paper is aimed at the policymakers, offering a big data analysis of the scientific research of electricity. It also proposes a new forecasting approach, based on Scan-clustering modelling of the buying and selling of energy in future markets.
Although still nascent, research on the electricity spot market is increasing. As proof of this, the annual growth of publications during the survey period (1992 to 2018) corresponds to 8.33%, with an average of 4.62±2.78 papers published per year. This indicates the growing significance of this research. There may be several reasons for this, including the development of technologies or the growing interest in intelligent and automated networks by agents. Given the above, we noted that recent research shown a interest in some specific study domains, such as non-parametric models.
We present an application of DTSF based on the electricity spot market and apply our results to the eight "seminal statistical models" regularly used in forecasting competitions. In general, the eight benchmark models presented similar results. However, DTSF exhibited the best performance, as measured by all accuracy metrics. Subsequently, we examined the accuracy of the DTSF against timeframes in the observations, considering the seasons. DTSF was designed for series with high frequency and its predictive performance remained high when all other models had high predictive errors (spring). Even when other models were highly accurate (winter), DTSF remained among the best ones. There were other cases, however, in which we observed the DTSF performance to falter.
For future research, we recommend fine-tuning the study of DTSF parameters, as well as testing the accuracy of the models by randomly splitting time series into subsamples. Further, we recommend the development of case studies that will take the pricing of the electricity spot market in different regions, such as the Nordic and Iberian countries that dispose of massively available, high frequency data, into consideration.
Finally, the present research contributes to the energy planning processes of different players, given that understanding of the price patterns has singular importance in minimizing risks and supporting reliable production planning. Good forecasts for future energy pricing can support operational arrangements, e.g., when the energy price is high, it may be more valuable for an industry temporarily to delay part of its production, trade the surplus electricity, and carry out preventive maintenance on machines and accessories.