A Hybrid Model for Multi-Day-Ahead Electricity Price Forecasting considering Price Spikes

: This paper proposes a new hybrid model to forecast electricity market prices up to four days ahead. The components of the proposed model are combined in two dimensions. First, on the “vertical” dimension, long short-term memory (LSTM) neural networks and extreme gradient boosting (XGBoost) models are stacked up to produce supplementary price forecasts. The ﬁnal forecasts are then picked depending on how the predictions compare to a price spike threshold. On the “horizontal” dimension, ﬁve models are designed to extend the forecasting horizon to four days. This is an important requirement to make forecasts useful for market participants who trade energy and ancillary services multiple days ahead. The horizontally cascaded models take advantage of the availability of speciﬁc public data for each forecasting horizon. To enhance the forecasting capability of the model in dealing with price spikes, we deploy a previously unexplored input in the proposed methodology. That is, to use the recent variations in the output power of thermal units as an indicator of unplanned outages or shift in the supply stack. The proposed method is tested using data from Alberta’s electricity market, which is known for its volatility and price spikes. An economic application of the developed forecasting model is also carried out to demonstrate how several market players in the Alberta electricity market can beneﬁt from the proposed multi-day ahead price forecasting model. The numerical results demonstrate that the proposed methodology is effective in enhancing forecasting accuracy and price spike detection.


Introduction
Spot prices in competitive electricity markets exhibit seasonality, volatility, and price spike occurrence [1][2][3].The occurrence of price spikes is associated with different system events, for instance, the scheduled and forced outage of generation and transmission assets, transmission congestion, and extreme weather events leading to increased demand or shortage of supply [2,4,5].Accurately forecasting price spikes holds paramount importance [6] due to their potential to inflict significant financial losses upon unsuspecting business owners.Moreover, traditional forecasting models encounter significant challenges in effectively accounting for and managing these volatile market conditions [7].Even though price volatility can be observed in all power markets, real-time markets are more prone to the price risks associated with such unforeseen spikes [1].Higher price volatility in real-time electricity markets adds to the difficulty of producing reasonably accurate electricity price forecasts [8], while forecasting errors for day-ahead markets are often reported to be single-digit, comparable studies often report significantly higher errors for real-time markets [9,10].
There are plenty of studies in the literature that have undertaken the challenge of forecasting electricity market prices.Between a very recent review [11] and one that was published in 2014 [4], the interested reader can find a comprehensive summary of applied methods, best practices, and tips and recommendations for future research in this domain.There are, however, a few observations that are worth noting in the context of the present work.First, the vast majority of available methods are applied to day-ahead market prices.This is understandable because most electricity markets have a day-ahead market component in which most of the energy is traded [3,12,13].There are a few jurisdictions with only a real-time market mechanism, including Alberta and Ontario provinces in Canada, Australia, and New Zealand.Second, almost all available studies have limited their forecasting horizon to the next day, with a few exceptions, e.g., [14,15], that look beyond the next day.Longer forecast horizons are useful, and sometimes necessary, for optimizing operation plans and portfolio management for market participants.For example, in Alberta, participants in the ancillary services market rely on energy price forecasts generated before 1:00 p.m. on Fridays for the following Monday to optimize their portfolio [16].Third, only a limited number of papers have taken price spikes into account when designing their models or when evaluating the performance of their proposed models.For example, ref. [5] used an auto-regressive conditional hazard model to predict the probability of one-step-ahead price spikes in the Australian electricity market.In [8], system demand forecasts along with weather information were used in a hybrid neural-network-based model to forecast next-day normal and spike prices for Ontario's electricity market.In [17], other exogenous variables, such as reserve capacity, variable generation, and interconnection flows, were examined to predict the probability of extremely high or low prices for the next day in the Australian market.
In this paper, we propose a hybrid model to predict the real-time electricity market prices in Alberta for up to four days in advance.The model is designed particularly to handle the extended forecasting horizon and the high volatility of prices in this market caused by frequent price spikes.This is achieved through two main contributions.The first contribution is that the proposed hybrid model combines multiple models at two dimensions.More specifically, at a "vertical" dimension, we stack up two forecasting models, namely, long short-term memory (LSTM) [18] deep neural network and extreme gradient boosting, also called XGBoost [19].LSTM networks have proven effective in time series forecasting with nonlinear long-term patterns [20].However, neural networks are generally prone to over-fitting and are computationally taxing.Particularly, when deployed on cloud platforms, frequent training of deep learning models leads to high computation fees [21].XGBoost, on the other hand, is a scalable machine learning method with comparably better training speed and resilience against over-fitting.In addition, at a "horizontal" dimension, we cascade five models, each with different inputs to predict prices along the 96 h forecasting horizon.Each model takes advantage of available features, depending on its forecasting horizon.Observe that this approach can be considered as an ensemble model.Ensemble forecasting, in general, enhances forecast accuracy by leveraging the strengths of multiple models [22].However, we not only combine the predictions of the LSTM and XGBoost models, we also concatenate the outputs of multiple models to generate the final 96-hour-ahead forecast string.This approach distinguishes our method as a hybrid model rather than a conventional ensemble model.The second contribution is to identify and successfully deploy a new input that has not previously been explored in the context of enhancing price spike forecasting.In particular, we identify the real-time ramping of large baseload units within the system as effective inputs for predicting price spike events.
The rest of this paper is organized as follows: Section 2 presents a literature review on the analyzed market, the algorithms used in the proposed electricity price forecasting model, and the actual state of research in hybrid models for electricity price forecasting.The methodology of the proposed electricity price forecasting system and research contributions are described in Section 3. Section 4 discusses the results in terms of forecast accuracy and price spike detection.In Section 5, we conduct an economic application of the proposed electricity price forecasting system in Alberta's ancillary services market.Finally, Section 6 summarizes the findings of the proposed research work.

Background and Related Work
In this section, we first present a brief overview of Alberta's electricity market operation.Moreover, we discuss price volatility and the occurrence of price spikes in Alberta, Ontario, and one representative price zone of New York's electricity markets.We next review the basic structure of LSTM and XGBoost models and some of their previous applications in time series forecasting.We close this section with a review of a selected number of previous related papers that either have proposed hybrid models for electricity price forecasting, have focused on Alberta's market, or have developed methods to model and forecast price spikes in electricity markets.

Alberta's Electricity Market
The Alberta power system is consists of more than 500 substations and a network of transmission lines that covers 26,000 km in length and transports electric energy in a single control area of around 660,000 km 2 [23].Alberta also transfers electric energy across interties with three neighboring jurisdictions, i.e., British Columbia, Montana, and Saskatchewan.There are close to 350 active generation units that provide electric power to the grid in Alberta.In total, there are close to 200 market participants in both the supply and demand sides.
In Alberta, a must-comply rule exists, which means all energy from generators above 1 MW must be sold through the market.Power generators and importers submit electricity supply offers to the Alberta Electric System Operator (AESO).Exporters of electricity to neighboring jurisdictions submit bids to purchase supply generated in Alberta.Finally, consumers submit demand bids to purchase at or below a specific price [24].The offers must be submitted a day ahead (by noon) for each hour and may be updated periodically.These offers cannot change within two hours before the applicable delivery hour [25].This means that the offers for the hour running from 8:00 a.m. to 9:00 a.m.(denoted using AESO's terminology as Hour Ending 9 or HE9) can be changed until 6:00 a.m.(the start of HE7).Note that these power generators are free to choose offer prices between the floor CAD 0/MWh and the cap CAD 999.99/MWh.
The AESO market clearing algorithm essentially sorts all supply (demand) offers (bids) from the lowest (highest) to the highest (lowest) price for each hour of the day into a so-called economic merit order curve.Following the changes in electricity demand throughout the day, the system controller keeps supply and demand in balance, dispatching from the merit order and maintaining, in this way, the reliability of the system.When the system demand increases, the system controller moves up the merit order and dispatches the next eligible supply or accepts the next demand bid.On the other hand, when the system demand declines, the system controller moves down the merit order and instructs suppliers to decrease their supply and/or consumers to increase demand.This way, the demand is always met with the lowest cost option available.The last supply offer used to meet the demand for each minute is called the system marginal price (SMP).The SMP reflects the intersection of supply and demand for each minute in the electricity market, and it is updated in real time.At the end of the hour, the time-weighted average of the sixty one-minute SMPs is calculated and published as the Hourly Alberta Pool Price (HAPP) [24].A uniform HAPP applies to all loads and suppliers within the province without any consideration of location.
The energy market is run in real time, whereas the Alberta ancillary services (ASs) market is run a day ahead.The AS market includes 10 min spinning, 30 min non-spinning, and frequency regulation reserves.For each reserve, an equilibrium price is determined based on available offers, and the settlement price is the equilibrium price plus the HAPP.The equilibrium price may be positive or negative [16].Ancillary services market participants must submit their offers to the market operator before 11:30 a.m. the day before the operation day for all 24 h of the next day.For Mondays, the offers must be submitted before 1:00 p.m. on preceding Fridays.The AESO procures standby and active volumes of each type of operating reserve.The system controller first dispatches the active reserves, which are used to maintain the balance of the electric system under normal operating conditions.When the available resources in the active reserves portfolio are not enough to meet the real-time reliability and operating requirements of the electric system, the system controller proceeds to dispatch the standby reserves [16].
Given the way the market clearing process is run, and depending on the nature of market participation, multi-hour-ahead electricity price forecasts could be used by market players to optimize their operation.For example, some large load consumers will need a short lead time to cut back their demand.For those, a one-hour-ahead or even a sub-hourahead forecast of high prices is often useful.On the other hand, suppliers need at least four hours heads up to change their offers within the permitted window.Furthermore, generators that participate in AS market use day-ahead for Tuesday-Friday (or multi-dayahead for Mondays or long weekends) price predictions to increase their profits in the AS market.
One of the most important features of the Alberta electricity market is that the HAPP fluctuates considerably from hour to hour.The pool price in Alberta can unexpectedly jump to a maximum of CAD 999.99/MWh, mainly due to short-term events, like outages at generation and transmission facilities, along with extreme weather conditions.On the other hand, the pool price can reach a minimum value of CAD 0/MWh due to surplus events.Figure 1 (top) shows the price fluctuations in the Alberta electricity market over the year 2021, where the occurrence of several price spikes can be appreciated.Furthermore, in Figure 1 (bottom), a heatmap shows the average price for every month of that same year per hour of the day.High monthly average hourly prices, starting at values around CAD 100-150/MWh and up to more than CAD 200/MWh, can be observed during the on-peak period, i.e., from 7 a.m. to 11 p.m. every day [26].Furthermore, observe the presence of clusters of very high prices during both the summer and winter seasons.Figure 2 shows a comparison of the occurrence of price spikes between Alberta's HAPP [27], Ontario's Hourly Ontario Energy Price [28] (HOEP), and New York's Locational-Based Marginal Price (LBMP) [29] in 2021.Prices are clustered based on different price thresholds in $/MWh (CAD/MWh for HAPP and HOEP, and USD/MWh for New York LBMP).Ontario's electricity market [28] is also a single-settlement real-time wholesale power pool, while the New York market [29] is a two-settlement, day-ahead, and real-time market.For the latter, the real-time LBMP of a high-demand zone (i.e., Zone J or the one corresponding to New York City) is considered.Observe from Figure 2 that the occurrence of price spikes in Alberta's market surpasses the other two markets at all the different thresholds.Furthermore, as the threshold increases towards $ 500/MWh, the occurrence of spikes for the Ontario and New York electricity markets dramatically decreases.For example, for the threshold between $ 400/MWh and $ 500/MWh, neither of these two markets registered any price spikes, while for that above $ 500/MWh, the occurrence of three price spikes for both the Ontario and New York markets was detected.Comparison of the occurrence of the number of price spikes between the Alberta, Ontario, and New York (real-time) electricity markets using different price thresholds in $/MWh (CAD/MWh for HAPP and HOEP, and USD/MWh for New York LBMP).For the New York market, we show the New York City zone, i.e., the highest demand zone in the New York electricity market.
Electricity price spikes can occur for several hours and this occurrence depends upon the system's available supply and electric demand [8], but also can depend on the bidding strategies used by different market participants [30].Higher-cost operating generators become operative usually when the demand increases, and they normally influence the price causing the occurrence of price spikes [5].The increasing number of price spikes in Alberta's electricity market means that expensive operating generators (usually gas generators) have been required during the on-peak hours to meet demand.Furthermore, among other reasons, like higher demand and higher gas prices, for the year 2021, for example, the occurrence of price spikes is also associated with changes in the bidding strategies of large market participants [26], following the expiration of their long-term power purchase agreements (PPAs).In other words, those participants are no longer subject to the contractual terms established in their PPAs to recover their fixed and variable operation costs, but now, they are recovered directly from the energy market.
As previously discussed, higher volatility levels can be observed in real-time electricity markets [31].Using the measure of return variation, σ h,T , presented in [1], we conduct a comparative analysis of hourly spot price return variations between the Alberta, Ontario, and New York electricity markets.For the latter, again, we selected the load zone J (i.e., New York City zone), being the one having higher load concentration in that market.In this analysis, the time series of spot prices are scaled to zero-one.The return variations are calculated first, as the difference between the spot price at time, t, and the spot price at t − h.For example, in [1], intra-hour return variations are calculated, i.e., h = 1.Second, each difference is divided by the average value of the spot prices over T, e.g., T = 3 (2019, 2020, and 2021) years in our case.Finally, σ h,T can be estimated as the standard deviation of the price differences over T. Furthermore, due to the increasing levels of renewable penetration, zero or negative spot prices can frequently be observed in modern electricity markets [32]; hence, we decide to use σ h,T , as defined in [1], to overcome the associated problems with arithmetic or logarithmic returns.In other words, prices differences, r t,h , are defined as follows: where p t denotes the spot price at time, t; p t−h the spot price at t − h; and T is the overall number of prices (T = 3 years in our case).Finally, the return variation, σ h,T , can be calculated as follows: where N o is the number of prices differences, r t,h , and rh,T is the simple r t,h average, all of them over the time window, T. Considering the volatility indices presented in [31], we extend the analysis for h = {1, 24, 168}, i.e., intra-hour, trans-day, and trans-week return variations, respectively.Table 1 shows the results for the return variations σ {1,3} , σ {24,3} , and σ {168,3} for each electricity market.Higher values are shown in bold letters.From the results observed in Table 1, Alberta's market presents the higher three-year return variations for each case, i.e., intra-day, trans-day, and trans-week.For example, Alberta's intra-day return variations (i.e., σ {1,3} ) are, on average, 5.3 times higher than intra-day return variations from the other analyzed markets.Likewise, Alberta's trans-day (i.e., σ {24,3} ) and trans-week (i.e., σ {168,3} ) return variations are, on average, 6.5 and 6.1 times higher than those from the other markets, respectively.
Furthermore, we observe from Table 1 that trans-week variations show the highest value in all markets.For example, on average, σ {168,3} is 2.3 times higher than σ {1,3} for all the analyzed electricity markets; similarly, σ {168,3} is 1.3 times higher than σ {24,3} .As [31] found in their work, trans-week price fluctuations are wider than those observed intrahourly.From the analyzed period T, and based on observations from Table 1, we can conclude that higher return variations tend to occur in single-settlement electricity markets like Alberta's and Ontario's.This is in comparison with two-settlement electricity markets, like the one in New York.Furthermore, Alberta's market presents higher intra-hour, transday, and trans-week return variations, thus, showing the challenging market dynamic faced by the proposed electricity price forecasting model.Table 1.Return variations for T = 3 corresponding to the years 2019, 2020, and 2021 (unit-less numbers).

Long Short-Term Memory Networks
Deep learning techniques have recently gained strength in the field of electricity price forecasting, mainly associated with the available computational power, volumes of data, and complexities of modern electricity markets [20].Recurrent neural networks (RNNs) are a popular method in time series forecasting.The structure of RNN consists of an input layer, one or more hidden layers, and an output layer.RNNs have a chain-like structure where connections between nodes form a directed graph along a temporal sequence.In contrast to feed-forward neural networks, RNNs include a feedback loop that allows the neural network to receive a sequence of inputs.In other words, in RNNs, the output of t − 1 is fed back into the network, having an impact on the outcome of step t and for each subsequent step, allowing information to persist.For this reason, different types of RNNs, like long short-term memory (LSTM) or gated recurrent units (GRUs) have been used for electricity price forecasting [20,33].In RNN, the backpropagation algorithm is used to calculate gradients and adjust weights between network layers during training [34].Nevertheless, the weights update scheme could stop the neural network from further training.The reason is that after a long chain, the gradient could vanish or increase notoriously.In other words, RNNs face many difficulties in learning from a long-term dependency [35].Long short-term memory neural networks are a variant of RNNs.They were proposed to address the drawbacks of the RNN on learning long-term dependencies [18] by including more interactions per module or cell and by remembering information for prolonged periods [36].
A typical LSTM network consists of memory blocks called cells.The cell state and the hidden state are transferred to the next cell.The main chain of data flow is given by the cell state, which permits the data to flow forward basically unchanged.Nevertheless, some linear transformations can happen and, via sigmoid gates, some data can be removed or added to the cell state.A gate is similar to a series of matrix operations that comprise distinct individual weights.Since the gates control the memorizing process, the LSTM networks can avoid the long-term dependency problem [36].The operation of the LSTM network is illustrated in (3a)-(3f): where f t is the forget gate that by the sigmoid function decides which information is not required and is going to be omitted or forgotten from the cell.In (3b), i t is the input gate that determines the amount of information of the network input, x t , but also the previous hidden state, h t−1 , that can pass into the memory cell.In (3c) and (3d), g t is the update gate that creates a vector of new cell values, and o t is the output gate that controls the amount of information of the current memory cell that can pass to the hidden state (h t ) in (3f).In (3e), c t is the cell state that updates itself recursively by the interaction of its old value (c t−1 ) with forget and input gates' values.In addition, W f , W i , W o , and W g are the weights matrices of the forget gate, input gate, output gate, and update gate, respectively.The biases of the forget gate, input gate, output gate, and update gate are represented by b f , b i , b o , and b g .Among others, electricity price forecasting is one of the research fields where LSTM neural networks have been used.By analyzing the market coupling impact on electricity price forecasts, different hybrid topologies of autoencoders based on LSTM and convolutional neural networks have been used to forecast the day-ahead electricity prices in the Nord Pool electricity market [37].Similarly, considering European market integration, ref. [20] used different deep learning topologies, one consisting of a hybrid deep learning forecasting model based on an LSTM and a convolutional neural network, to generate day-ahead price forecasts for several European countries.In [15], different forecasting models consisting of a single LSTM neural network and an LSTM part of one hybrid and two ensemble forecasting models were used to forecast day-ahead prices for the German market at one-, seven-, and thirty-day-ahead forecasting horizons.Similarly, ref. [38] used a statistical spike filter [8,20,39], Wavelet decomposition on the spot prices time series, in combination with an Adam-optimized LSTM neural network, to forecast electricity prices for the New South Wales region in Australia and French electricity markets.In [33], shallow and deep architectures of LSTM neural networks were used to forecast day-ahead electricity prices for the Turkish electricity market.

Extreme Gradient Boosting
Extreme gradient boosting, also called XGBoost, is a scalable machine learning for tree boosting that was proposed by [19].XGBoost is optimized under the gradient boosting framework.The concept of boosting is to combine a series of models with low accuracy (weak models) to build a more robust model with better prediction performance.Gradient boosting uses the residual of previous models to correct the next model.It is called gradient boosting because it uses the gradient descent algorithm to minimize the loss function when adding new models.As an improvement, XGBoost adds regularization to the loss function, having, in this way, a better performance against over-fitting.
Let us consider a data set, S = {(x l , p l ) : l = 1, . . ., n, x l ∈ R m , p l ∈ R}, where there are n samples with m features or variables.The predicted value of the model is defined as follows: where x l is the l-th training sample, f a represents an independent decision tree, f a (x l ) indicates the prediction score given by the a-th tree to the l-th sample, and F is the space of functions containing all the regression trees.XGBoost uses the same concept of gradient boosting but improves it by a adding regularization to the objective function to measure the model performance: The L term represents a training loss function, which measures how well the model fits on training data.Ω is the regularization term that avoids over-fitting by penalizing the complexity of the model (i.e., the regression tree functions), and is given by [19]: where T is the number of leaves in a decision tree, λ is a parameter to scale the penalty, γ is the complexity of each leaf, and w is the vector of scores on leaves.The tree ensemble model is trained in an additive manner.Each time a new tree is added, the score is equal to the previous score plus the new tree's score.Considering pl (b) , the prediction of the l-th sample at the b-th iteration, the objective function at the b-ith iteration is given by the following: Then, the second-order Taylor expansion is used to optimize the objective in the general setting.Assuming the loss function, L, is the mean square error (MSE), the objective function can finally be estimated as follows: where l are the first and second gradient of the loss function, L. The objective function can finally be rewritten as: where I s = {l | q(x l ) = s} denotes the instance set of a leaf, s.For a fixed tree structure, q, the optimal weight, w * s , of a leaf, s, and the corresponding optimal value can be obtained by: Equation (10b) can be used as a scoring function to measure the quality of a tree structure, q.A smaller value J means a better structure of the tree.Since it is impossible to enumerate all the possible tree structures, q, a greedy algorithm that starts from a single leaf and iteratively adds branches to the tree is used instead.I L and I R are the instance sets of the left and right nodes after the split, with I = I L ∪ I R .The gain formula, which is often used for evaluating the split candidates, is obtained by enumerating the feasible segmentation points and selecting the maximum gain partition and the minimum target function: Among others, boosting tree-ensemble-based algorithms have been part of the modeling strategies of leader-board teams in important energy forecasting competitions, e.g., GEFCom2014 [40,41].XGBoost is not the exception, and its robustness postulates it as a good candidate within the energy forecasting research field.For example, [42] used an ensemble model to generate one-hour-ahead locational marginal price forecasts for the New England day-ahead electricity market.The forecasting model is composed of two "relevance support vector machines" and an XGBoost regressor.Particularly, the latter is used to model the complex behavior of the price spikes.Additionally, [43] developed a hybrid forecasting model based on ANN with entity embedding to pre-process categorical data and an XGBoost regressor to forecast the day-ahead electricity prices in the PJM market.

Related Works
Hybrid electricity price forecasting systems consist of a combination of two or more existing price forecasting methods.These systems can be composed of only parametric, nonparametric, or a combination of both types of modeling approaches [15,44].For example, in [45], a hybrid system consisting of committee machines was employed to recursively generate electricity price forecasts within a 4-hour-ahead forecasting horizon.Each of the two forecasting models is composed of two support vector machines and two multi-layer perceptron Levenberg-Marquardt ANNs.This hybrid system was tested using data from real-time and day-ahead electricity markets, i.e., the Alberta and West Denmark Zone (Nordic) electricity markets, respectively.
A hybrid system composed of a seasonal auto-regressive integrated moving average model and a deep belief network was used by [46] to forecast half-hourly and hourly electricity normal and spiky prices, respectively.The analyzed markets correspond to the Australian, Spanish, and PJM electricity markets.Similarly, ref. [8] proposed a hybrid forecasting model purely based on ANNs to forecast normal and spiky prices in the realtime electricity market of Ontario.Forecasts were generated for a 24-hour-ahead forecasting horizon.In [47], a hybrid mid-term electricity price forecasting system was proposed.Each of the three models consists of an auto-regressive integrated moving average model, along with principal component analysis, and an ANN model.The system is used to recursively generate forecasts of weekly average electricity prices for a 12-week forecasting horizon in the Brazilian electricity market.
Some previous studies have focused on building forecasting models for volatile, realtime markets [8].For example, using data from the Ontario electricity market, ref. [9] forecasted 24-hour-ahead HOEP with ANN and fuzzy logic systems.Similarly, ref. [48] generated 3-and 24-hour-ahead electricity price forecasts using time series models and ANN in the Ontario market.In [49], half-hour-ahead forecasts for the Australian electricity market were generated using an extreme learning machine.Using daily electricity spot prices and a higher-order hidden Markov chain model in discrete time, the work in [50] generated one-step-ahead forecasts on a daily forecasting horizon for the Alberta electricity market.The model estimation was conducted through the decomposition of the time series of spot prices into a seasonal and stochastic component, like in [51,52].The former was modeled as the combination of sinusoidal functions, and the latter as the combination of an Ornstein-Uhlenbeck process and an additive compound Poisson component.Some of the existing works have focused specifically on modeling and forecasting price spikes in electricity markets.In [2], the demand-to-capacity ratio was used to estimate the probability of the occurrence of price spikes in the UK electricity market using a forecasting horizon that extends from 2 days up to 2 weeks ahead.The authors in [53] proposed an autoregressive Poisson model to forecast one-day-ahead price spikes in different interconnected regions of the Australian electricity market.The model used three exogenous variables and the short-term history of price spike occurrence.In reference [54], the authors studied the mutual effects of interconnected regions within the Australian electricity market on the occurrence of price spikes.To do so, a dynamic copula-based multivariate discrete choice model generated one-step-ahead predictions of the probability of price spike occurrence using half-hourly historical prices of electricity.In a classification approach, reference [55] used a variable threshold, along with feature selection via the Fisher score, to classify price spikes using a support vector machine for the Australian electricity market.However, the horizon over which the classification of new spikes was made was not specified.
Our proposed method distinguishes itself from the existing approaches by employing a different approach to model combination in two dimensions.Conventional methods typically combine models in a "vertical" dimension, where multiple models are ensembled to generate forecasts for the same fixed forecast horizon.In contrast, our method combines models vertically, specifically focusing on enhancing the predictive ability of our model in detecting and predicting price spikes.Additionally, we combine models at a "horizontal" dimension to take advantage of available market data for each forecast horizon and generate forecasts for an extended 96-hour-ahead forecasting horizon.In other words, we break the forecast horizon into multiple segments and train and build a model for each segment, depending on what explanatory features are available at each horizontal dimension.Furthermore, in the existing works that have used Alberta's market prices for their base case, no particular emphasis has been made on enhancing the ability of the models to predict the price spikes.

Methodology
Let us denote the hourly market price at time, t, with p t .Furthermore, we refer to the feature space as X = {x j , j = 1, . . ., N}, where x j is the j th feature.The proposed method is composed of five horizontally cascaded forecasting models, i.e., E i , {i = 1, . . ., 5}.Each model uses a subset of X, referred to here as Φ i .Furthermore, each Φ i contains a set of observed and predicted inputs that are selected depending on their availability and usefulness.E i s are only different in their corresponding set of features and the associated forecasting horizons.More specifically, E 1 to E 5 are used to generate 1-hour-ahead, 2-to 3-hour-ahead, 4-hour-ahead, 5-to 24-hour-ahead, and 25-to 96-hour-ahead price forecasts, respectively.Let us refer to the final k i -step-ahead price forecasts generated by model E i using the feature set, Φ i , as { pt+k i |Φ i }; thus, k i can be specified as k 1 = 1, k 2 ∈ {2, 3}, k 3 = 4, k 4 ∈ {5, . . ., 24}, and k 5 ∈ {25, . . ., 96}.This horizontal cascading of the five models is shown in Figure 3. Observe from Figure 3 that a set of 96 price forecasts are generated at each time step, i.e., hourly, at the forecasting origin, t.
Each model ,E i , is composed of two predictors, i.e., an LSTM and an XGBoost.The predictors are "vertically" stacked up and independently produce what we call preliminary price forecasts for each of the associated forecasting horizons.The final price forecasts, i.e., pt+k i , are defined accordingly as follows: History Future In (12), we refer to the preliminary forecasts produced by the two predictors for the k step ahead as p(LSTM) .The preliminary price forecasts generated by the LSTM models are compared against two price spike thresholds, T 1 and T 2 , where T 1 < T 2 .Essentially, the final forecasts are picked from either the LSTM model or the XGBoost models, depending on if they are normal, i.e., p(LSTM) < T 2 ; or a super-spike, i.e., p(LSTM) The observation is that the LSTM model performed better in predicting the trends and the sequences of prices, as expected.However, the XGBoost models outperformed the LSTM models for both low and very high prices.In this paper, finding the exact values of the two thresholds is conducted by examining the models' performance on the training data sets with some trial and error.However, determining the thresholds and even the weight of combining the two forecasts could be automated and optimized, which is left for future work.Figure 4 presents how the LSTM models and XGBoost models are integrated in this methodology and how they contribute to obtain the final price forecasts, pt+k i , for each E i model along each forecasting horizon, k i (i.e., the horizontal dimension).Here, a different input set, φ i , is used (i.e., the vertical dimension) depending on k i .ubmitted to Forecasting 12 A key factor to enhance the performance of the proposed model is to identify as many publicly input features that are available for a given forecast horizon.Here, we describe the features that we identified for Alberta's market.Electricity price time series show significant autocorrelation, and the literature is accordingly rich on how to choose the most informative lags using tools such as autocorrelation functions [48,56].We define the subset feature x 1 = p t−l to include the autocorrelated lagged values of the prices [56,57] up to 168 previous hours.The AESO [27] publishes hourly load forecasts [9,11,58], wind A key factor to enhance the performance of the proposed model is to identify as many publicly input features that are available for a given forecast horizon.Here, we describe the features that we identified for Alberta's market.Electricity price time series show significant autocorrelation, and the literature is accordingly rich on how to choose the most informative lags using tools such as autocorrelation functions [48,56].We define the subset feature, x 1 = p t−l , to include the autocorrelated lagged values of the prices [56,57] up to 168 previous hours.The AESO [27] publishes hourly load forecasts [9,11,58], wind energy production forecasts [11], and the total generation availability forecasts [20] for each technology for up to seven days ahead; we refer to these features as x 2 , x 3 , and x 4 , respectively.On the other hand, the AESO publishes the forecast imports/exports of energy into and from Alberta for the next 48 h.This feature is referred to here by x 5 .Although they do not use forecasts of the imports/exports, some works have used historical values of this variable (for example, [37,59,60]).
We propose to employ a new feature for price forecasting in this paper.Thermal generators often play a key role in electricity markets where they make up a significant portion of the supply side.This is the case, for example, in Alberta where coal and gas units make up 75% [26] of the total installed capacity (end of 2021).A sudden change in the output of the thermal units could indicate a change in the market supply curve and could help predict sharp changes in the prices in the short term.Thus, we propose to use the slope of the output of the online thermal generation capacity as a new feature, and we refer to it as x 6 .The slope is defined as the change in the output power over the past 10 min period.Moreover, the AESO also publishes pool price forecasts [61] for the next three hours.We, hence, define this feature subset as x 7 .Additionally, the latest system marginal price (SMP) values are found to be a useful input [61] in price forecasting models.The modeler may choose to feed its model with one or more of the latest available SMP values before the model is run.This feature is referred to as x 8 here.
Based on the availability of the identified features, the following feature subsets, Φ i , are proposed: Φ 2 = x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , x 7 (13b) In (13a)-(13e), Φ i corresponds to a multiple input to each E i , and depending on the forecasting horizon, the output of E i is single (i.e., k = 1, 4-hour-ahead) or multiple (i.e., k = 2-3-, 5-24-, or 25-96-hour-ahead) point forecast(s).E 1 takes advantage of all the information that we have, including the latest SMPs, the slope of the thermal generation, and the AESO price forecasts.On the other hand, we discovered that including the latest SMP does not improve model accuracy; thus, x 8 is excluded from E 2 .AESO price forecasts are not available for a 4-hour-ahead forecasting horizon; thus, the model for this horizon does not include x 7 .However, it is often observed in Alberta that price spikes last longer than one hour; thus, the slope of thermal generators, i.e., x 6 is included in the input set for E 3 .When it comes to import/export forecasts, their accuracy often drops for the second day.Thus, their forecasts are only considered for the next 24 h.This is the main reason for creating model E 4 , to focus on 5 to 24 hours ahead, where x 5 is included in the input set of this model.The last model, i.e., E 5 , benefits from the least available information, simply because not all of the identified features are available or useful for a long horizon for up to 96 h.

Numerical Results
In this section, we present the numerical results of the proposed hybrid forecasting system.Furthermore, we show the convenience of using the slope of the online thermal generators' output power as a feature, i.e., x 6 .Alberta's electricity market dataset comprises three years of data, ranging from January 2017 to December 2019.The training set considers data from January 2017 to July 2018; likewise, a validation set considers data from August 2018 to December 2018.The rest of the data, i.e., January 2019 to December 2019, is used for testing.In general, we use two years of data for training and validation, and one year for testing [11].Moreover, k i -step-ahead hourly price forecasts are generated following a forward rolling window.This is a common practice in electricity price forecasting [11,62].However, in our case, the computational burden makes it challenging for the model to be recalibrated daily; thus, monthly recalibration results in a better choice.
The input data from where the LSTM [18] and XGBoost [19] models are estimated is scaled between [−1, 1] [20].The inverse of this transformation is applied to the price forecasts at the error calculation stage [20].Furthermore, hyperparameter tuning for each E i is conducted via grid search and evaluated on the validation set [11].Likewise, due to its simple implementation, computational efficiency, and small memory requirements, the Adam algorithm [63] is selected to optimize the LSTM models.The corresponding hyperparameter search spaces for the LSTM and XGBoost models are presented in Tables 2 and 3, respectively.The grid search algorithm systematically explores all possible combinations of hyperparameter values from Tables 2 and 3.For each combination of hyperparameters, the model is trained on the training set, and its performance is evaluated using the mean squared error as the chosen metric on the validation set.The hyperparameter combination that yields the best result, based on the chosen evaluation metric, is selected.Finally, once the best hyperparameters are identified, the model is retrained using the training dataset, incorporating the optimized hyperparameter values.
The forecasting accuracy evaluation is conducted using two performance metrics, i.e., the root-mean-square error (RMSE) and the mean absolute error (MAE).Both can be expressed as follows: In (14a) and (14b), m ∈ {1, 2, 3, . . ., 96}, N h is the number of hours in the evaluation period, i.e., the test period.Likewise, p m e and pm e are the actual and predicted pool prices, respectively.Finally, the fixed price thresholds [5,53] presented in (12) correspond to T 1 ≥ CAD 150/MWh and T 2 ≥ CAD 400/MWh.
Figure 5 displays a comparison of the RMSE and MAE between the proposed forecasting system and a set of benchmark models.These benchmark models consist of a decision tree regressor (DTR), an LSTM, and an XGBoost.All models have the same inputs and training periods.Observe that the proposed hybrid forecasting system consistently outperforms the benchmark models along all the forecasting horizons, i.e., k 1 = 1 hour ahead, k 2 ∈ {2, 3} hours ahead, k 3 = 4 hours ahead, k 4 ∈ {5, . . ., 24} hours ahead, and k 5 ∈ {25, . . ., 96} hours ahead.As expected, shorter forecasting horizons present the lowest error rates.Observe, for example, the RMSE and MAE for k 1 = 1 hour ahead, k 2 ∈ {2, 3} hours ahead, and k 3 = 4 hours ahead are somewhere around CAD 38-65/MWh and CAD 10-24/MWh, respectively.The reason is because these forecasts contain the most recent market information (i.e., close to real time) from x 6 , x 7 , and x 8 (see Section 3).Beyond k 3 = 4 hours ahead, i.e., from k 4 ∈ {5, . . ., 24} hours ahead up to k 5 ∈ {25, . . ., 96} hours ahead, both the RMSE and MAE increase by approximately CAD 15/MWh and CAD 10/MWh, respectively.Observe that once they reach somewhere around CAD 80/MWh (RMSE) and CAD 35/MWh (MAE), both error metrics are kept almost constant.This demonstrates the capabilities of the proposed hybrid forecasting system to forecast long sequences of data without considerably decreasing its performance, i.e., significantly increasing the error.
Likewise, we demonstrate the usefulness of deploying different forecasting regressors following the proposed methodology.To do so, we compare the proposed hybrid forecasting system against a single LSTM forecaster, i.e., a single regressor that generates pool price predictions p(LSTM) . Observe that these predictions are made for all the forecasting horizons, from k 1 = 1 hour ahead up to k 96 = 96 hours ahead.The single forecaster is trained, validated, and tested using all input variables.Figure 6 shows the 96-hour-ahead forecasts made by the proposed forecasting system and the single forecaster for an arbitrary test period.Observe that the proposed model could effectively predict more price spikes (i.e., p t > T 1 ) than the single forecaster model.For example, the group of spikes between August 14 and 15 in Figure 6 is better captured by the proposed multi-horizon forecasting system than from the single forecaster.Similarly, this can be observed on 16 August 2019.
Based on the results shown in Figure 6, we estimate and compare the average RMSE and MAE along all k i s for the proposed forecasting model and a single forecaster.The average RMSE for the proposed forecasting model is CAD 66.41/MWh, compared to CAD 70.81/MWh for the single forecaster.Likewise, the average MAE for the proposed forecasting model is CAD 20.06/MWh, compared to CAD 21.78/MWh for the single forecaster.Overall, the proposed hybrid cascading forecasting model enhances the accuracy of the price spike predictions.The slope of power production of thermal generators during the initial minutes of the first predicted hour is a novel feature (i.e., x 6 ) of the proposed forecasting system.For example, coal generators usually offer blocks of power at low prices; thus, a reduction in output power could be indicative of price spikes in Alberta's electricity market.Furthermore, thermal generators (e.g., coal generators) have a steady ramp-up and ramp-down curve; therefore, their power production slope can help to determine if they are going to be available for the next two or three hours.
Figure 7 (left) shows an example case where three price spikes occurred in Alberta's market on 8 August 2019.Each price spike is shown with a value of CAD 762.83/MWh,CAD 507.4/MWh, and CAD 801.68/MWh.Furthermore, their occurrence is within the on-peak hours window, i.e., between 2:00 p.m. and 5:00 p.m.The main cause of these price spikes is associated with a reduction in thermal generation availability.Observe in Figure 7 (left) how the thermal units Thermal Gen 1 and Thermal Gen 2 reduced their power production considerably after midday.Thermal Gen 1 goes completely offline at 2:15 p.m., and Thermal Gen 2 reduces its production around 2:00 p.m., 3:00 p.m., and, again, at 4:00 p.m. during that day.
For the same period shown in Figure 7 (left), the dispatched energy of the economic merit order table from the AESO [27] indicates that high-price power blocks of other thermal generation units set high spot prices during these hours.To demonstrate the contribution that the slope of power production of thermal generators (i.e., x 6 ) has on the model's capabilities to better predict price spikes, Figure 7 (right) compares the one-hour-ahead forecasts (i.e., pt+1 ) produced by E 1 for the same period on 8 August 2019.As an example, we present the RMSE and MAE for this specific period.When using x 6 , the RMSE and MAE are CAD 140.63/MWh and CAD 46.74/MWh, respectively.Likewise, if x 6 is not used, the RMSE and MAE are CAD 197.79/MWh and CAD 75.09/MWh, respectively.This example shows the impact of x 6 on the proposed model's performance.In other words, using x 6 enhances the model's ability to forecast price spikes.00:00 03:00 06:00 09:00 12:00 15:00 18:00 21:00

Price Spike Predictions Accuracy Assessment
As previously emphasized, the proposed forecasting model is designed to enhance the prediction of price spikes.Thus, we analyze its performance to detect price spikes for the one-hour-ahead and four-hour-ahead forecasting horizons.The selection of these forecasting horizons is because, in Alberta's market, different market participants benefit from these forecasts (see Section 1).For example, large load consumers benefit from the onehour-ahead forecasts to decide if they need to reduce their demand.Likewise, generators benefit from the four-hour-ahead price forecasts to decide if they need to modify their bidding strategies.To conduct the analysis, we use the spike prediction confidence (SPC) and spike prediction accuracy (SPA) metrics [60]: In ( 15) and ( 16), N corr corresponds to the number of correctly predicted price spikes.Similarly, N as is the total number of predicted price spikes , and N sp is the actual number of price spikes.Moreover, prices greater than or equal to CAD 150/MWh (see definition of T 1 in Section 4) are used to decide whether a price is considered a spike, normal, or otherwise.The SPA and SPC metrics are computed for each month [61] in the test period, i.e., the year 2019.In each case, the final spike detection performance of the models is assessed with the average over this period.The higher the values of both SPA and SPC, the better the performance of the model.
Table 4 shows the results for the SPC corresponding to the one-hour-ahead forecasts.Observe that the proposed model has the highest SPC compared to the benchmark models.In other words, the proposed model outperforms the benchmark models in not labeling normal prices as price spikes.Similarly, Table 5 shows the performance of the proposed model and the benchmark models on the SPA metric for the one-hour-ahead forecasts.Here, the proposed model has the highest SPA compared to the benchmark models.Consequently, the proposed model is better at detecting price spikes compared to the benchmark models.
The difference between the perfect approach and the proposed model revenues represents the effect of the price forecast inaccuracies in the proposed forecasting system.Likewise, the total actual revenues are also compared against the other three approaches that do not consider any optimization techniques on their volume offers, i.e., the first, second, and third approaches.
Table 8 presents the total obtained revenues from each approach at the spinning reserves market.Observe that the proposed model provides the highest revenues when compared with the first, second, and third approaches.Its total revenues represent 89.67% of the maximum revenues that could have been obtained from the perfect approach.The difference in revenues between the developed model and the perfect approach is approximately CAD 450,000 per year.This difference represents the economic losses brought by the forecast inaccuracies, e.g., approximately equivalent to 10% per year of the maximum possible revenues.We recognize these inaccuracies are related to the ideas presented in Section 1 on the challenges of producing single-digit price forecast errors in real-time electricity markets.Observe also from Table 8 that the proposed model outperforms, on average, by more than 30 % or approximately CAD 1,197,000 per year compared to the revenues obtained from fixed volume offers, i.e., first, second, and third approaches.Table 8 also shows that for the case of the fixed volume offers, it is more profitable to increase the offers in the active spinning reserve market and decrease those in the standby spinning reserve market.Observe, for example, the difference in revenues of approximately more than CAD 500,000 per year between the second and third approaches.
Finally, Figure 8 shows the combined cumulative revenues for both types of spinning reserves (i.e., active and standby) for the analyzed period in 2019.It is possible to observe that the revenues between the perfect approach and the developed model significantly differ from the other three approaches approximately after February 2019.Likewise, observe the impact of the forecast error between the perfect approach and the developed model after March 2019.Such a tendency prevails and increases towards the end of the analyzed period.These results correspond to the economic evaluation of the proposed forecasting system compared to other approaches.

Conclusions
A hybrid electricity price forecasting model that takes advantage of a two-dimension strategy was presented in this paper.At the vertical dimension, the different forecasting regressors generated price predictions based on a stack array of an XGBoost and an LSTM model.Likewise, at the horizontal dimension, the proposed model took advantage of the available market information at the forecasting origin to generate price forecasts from 1 h ahead up to 96 h ahead.In addition, the novel input feature based on the slope of the output power production of thermal generators demonstrated and improvement in the price spike prediction accuracy of the proposed forecasting model.
Extensive numerical results were conducted to evaluate the accuracy of the proposed point forecasting model, and also to evaluate its ability to detect the occurrence of price spikes in the Alberta electricity market for the year 2019.In terms of MAE and RMSE, the proposed forecasting model outperformed the other benchmark models along all the forecasting horizons.The MAE and RMSE errors for price predictions from one to four hours ahead range between CAD 10-24/MWh and CAD 38-65/MWh, respectively.From five to ninety-six hours ahead, the MAE and RMSE increased by approximately CAD 10/MWh and CAD 15/MWh, respectively.Both error metrics also kept almost constant during this forecasting horizon, which demonstrates the capabilities of the proposed hybrid forecasting system to forecast long sequences of data without considerably decreasing its performance.Furthermore, our experiments showed that the proposed forecasting model enhanced the prediction of price spikes at further forecasting horizons when compared to a single forecaster.Moreover, in terms of the price spike detection assessment, we showed that the proposed forecasting model outperformed, on average, the benchmark models for both the SPC and SPA metrics.This demonstrates the importance of conducting a specific spike detection evaluation of the models to assure their performance not only in predicting, but also in detecting the occurrence of price spikes at different forecasting horizons.
Finally, the proposed price forecasting model was effectively employed to allocate, in the most profitable way possible, the contingency reserve volume offers of a hypothetical generation facility in the ancillary services market in Alberta.The output of the optimization problem showed that the proposed forecasting model was able to provide higher revenues for the generation facility when compared to the other presented approaches.Moreover, we also demonstrated that the impact of the forecast error in our study case represents a loss in revenues of approximately 10% per year of what could have been if a perfect approach was used.
One limitation of this study is that the proposed price forecasting model does not directly consider the historical offers and bids submitted by market players.By not considering these crucial inputs, the model may overlook important market dynamics and potential strategic behaviors, which could impact the accuracy of its forecasts.Incorporating the offers and bids of market players into the model has the potential to enhance its performance by capturing the influence of participant strategies and optimizing the forecasting outcomes.However, it is important to note that such types of input data are not publicly available in all markets.Future research should explore the integration of these additional inputs to further refine and strengthen the predictive capabilities of the model.Several other limitations should also be noted:

•
The input of recent variations in the output power of thermal units as an indicator of unplanned outages or shifts in the supply stack may be more relevant to coal generators, as their ramp-up and ramp-down times are typically longer compared to gas generators.The proposed methodology was tested using data from Alberta's electricity market, where more than five coal generators were still operational (the year 2019).

•
The literature presents some benchmark models for comparison for day-ahead market price forecasts [11].However, it lacks a standard benchmark model for testing price forecasting methods for real-time markets focused on price spike detection.Thus, we have reported the results of comparing the proposed method with two baseline models that we have developed to evaluate the performance of the proposed method.

•
The price spike thresholds (T 1 and T 2 ) will vary among different electricity markets and depend on the frequency and magnitude of price spikes.The optimal selection of these thresholds should be based on the training dataset specific to the electricity market under study.Automating and optimizing the process of determining these thresholds is recommended for future research.

•
The proposed methodology was only tested on the Alberta electricity market, which features the presence of more than five coal generators (the year 2019).However, it can be applied to other electricity markets where the presence of large generation units can have an impact on prices.
Furthermore, it is essential to acknowledge the significance of quantifying uncertainties associated with deterministic forecasts.As part of future research, developing a probabilistic forecasting model based on the proposed strategy would be valuable in addressing this aspect.

Figure 1 .
Figure 1.(Top): Alberta's spot market prices for the year 2021.(Bottom): Monthly average of hourly Alberta's spot prices at each hour of the day.

Figure 2 .
Figure 2.Comparison of the occurrence of the number of price spikes between the Alberta, Ontario, and New York (real-time) electricity markets using different price thresholds in $/MWh (CAD/MWh for HAPP and HOEP, and USD/MWh for New York LBMP).For the New York market, we show the New York City zone, i.e., the highest demand zone in the New York electricity market.

Figure 3 .
Figure 3.The horizontal dimension of the forecasting system.The width of each model represents how many forecasts are generated at each forecasting horizon.Moreover, each E i uses a different input set of features, Φ i .

Figure 4 .
Figure 4. Integration of XGBoost and LSTM models in the proposed methodolody to obtain final price forecasts pt+k i for each E i model that deploys a different input set of features Φ i .

Figure 4 .
Figure 4. Integration of XGBoost and LSTM models in the proposed methodology to obtain final price forecasts, pt+k i , for each E i model that deploys a different input set of features, Φ i .

Figure 5 .
Figure 5. Performance comparison between the proposed model (dashed line) and a set of benchmark models (dotted lines) for the testing period.(Top): root-mean-square error (RMSE).(Bottom): mean absolute error (MAE).

Figure 6 . 4 . 2 .
Figure 6.Forecast comparison between the proposed model and a single forecaster for the 96-hourahead forecasting horizon between 8 August 2019 and 22 August 2019.4.2.Impact of the Slope of Power Production of Thermal Generators on the Performance of the Developed Forecasting System

pt+k 1 without x6 pt+k 1 Figure 7 .
Figure 7.The arbitrarily selected period of 8 August 2019.(Left): Pool price dynamic reaction to changes in thermal generation.(Right): One-hour-ahead forecast (i.e., pt k+1 ) with and without using x 6 as a feature.

Figure 8 .
Figure8.Total cumulative revenues from the spinning reserve volume offers in the test period.These results correspond to the economic evaluation of the proposed forecasting system compared to other approaches.

Table 2 .
Hyperparameter search space for the LSTM models.

Table 3 .
Hyperparameter search space for the XGBoost models.

Table 8 .
Total revenues from the spinning reserve volume offers between January and December 2019, i.e., the test period.