Application of Discrete-Interval Moving Seasonalities to Spanish Electricity Demand Forecasting during Easter

: Forecasting electricity demand through time series is a tool used by transmission system operators to establish future operating conditions. The accuracy of these forecasts is essential for the precise development of activity. However, the accuracy of the forecasts is enormously subject to the calendar effect. The multiple seasonal Holt–Winters models are widely used due to the great precision and simplicity that they offer. Usually, these models relate this calendar effect to external variables that contribute to modiﬁcation of their forecasts a posteriori. In this work, a new point of view is presented, where the calendar effect constitutes a built-in part of the Holt–Winters model. In particular, the proposed model incorporates discrete-interval moving seasonalities. Moreover, a clear example of the application of this methodology to situations that are difﬁcult to treat, such as the days of Easter, is presented. The results show that the proposed model performs well, outperforming the regular Holt–Winters model and other methods such as artiﬁcial neural networks and Exponential Smoothing State Space Model with Box-Cox Transformation, ARMA Errors, and Seasonal Components methods.


Introduction
Forecasting the electricity demand is a key process for the management of the electric and energetic system of a country. The responsibility for this management lies with the transmission system operators (TSOs). In Spain, the TSO has been Red Eléctrica de España (REE) since 1997, after a process of deregulation of the Spanish market. Garrués-Irurzun and López-García [1] describe this process of REE in considerable detail. Fernández and Xiberta [2] describe the current Spanish energy market. REE's functions as the TSO have varied with several modifications of the Spanish laws. Even though in principle its objective was to assure the reliability of system transmission, at present it is responsible for accomplishing planning of the power supply, as well as making demand and price predictions concerning the electrical system that can be used in the electric market and to establish the energy programming and prices. As a result, REE has become the core of the Spanish electricity market. Due to the nature of electricity, this type of energy cannot be stored in great quantities, which means that production should match demand as closely as possible. Any deviation between them causes huge losses and exorbitant prices. Hobbs [3] reported that a 1% improvement in the precision of the forecast can reduce costs by between $0.6 M and $1.6 M. Considering such a magnitude of responsibility, the forecasting models used by REE require continuous improvement and prevention of mismatches between demand and production. Additionally, the progressive augment of variable renewable energies in the transmission system along with changes in consumption habits to reduce electricity consumption increases the difficulty of making the forecasts and can also lead to supply security problems [4,5]. The tools used for predictions are based on time series analysis. The information provided by the data observed in the past is used to determine the possible future demand. Weron [6] details the different methodologies used, highlighting the statistical models such as ARIMA models [7,8], regression models [9], exponential smoothing [10][11][12][13], and models based on artificial neural networks (ANNs) [14][15][16]. The use of hybrid techniques is also common for forecasting tasks [17,18]. New techniques based on machine learning use searches for similar patterns to obtain forecasts [19,20]. In all these cases, only the information provided by the demand is used to feed the models. Sometimes, hybrid models are used in which exogenous variables are added, such as temperature. For example, REE uses the hybrid models described in [21][22][23].
Time series models aim to reproduce a common pattern from the observed series. This pattern, however, is not exempt from irregularities in addition to the natural variability of the series. The irregularities can be provoked by two distorting elements: a sudden change in the meteorological conditions or a special event.
The special events are days that differ from the workdays due to a holiday or a situation of another nature which modifies the general behaviour of the series during its occurrence. Holidays such as Easter or Christmas, among others, are clear examples. Additionally, there are other events such as strikes which are also associated with special events. Figure 1 shows the electricity demand in Spain and the forecast during the Easter period. The regular Holt-Winters model tries to reproduce the behaviour of the time series and predicts the values shown by the dashed line. However, the demand on these days is lower due to the reduction of activity, and the real values-indicated by the solid line-deviate from the predicted values by a considerable amount. Thus, the time series shows an anomalous demand that the time series model is not able to reproduce when it is different from the pattern observed previously. This is due to the special event. The rest of the paper is organised as follows: Section 2 reports relevant works related to predictions for special events. Section 3 introduces the methodology proposed in this paper and describes the model proposed for the study case. The most relevant results obtained by the methodology are discussed in Section 4. Finally, the conclusions drawn from this research work are summarised in Section 5.

Forecasting for Special Events
Due to the importance of the variation of the electricity demand on special days, a large number of methods have been developed to solve this issue. However, the developed works have aimed to use exogenous variables to modify the results of the prediction of a general model. Darbellay and Slama [24] separate the electricity demand of Wales into two models, one for special days and the other for the calendar days, and create different models for prediction in each of these situations. Smith [25] substitutes a holiday day for a Sunday. These methods have been used traditionally and are still used. Zhang and Wang [26] use similar techniques by developing decomposition-ensemble models.
Another way to tackle the problem is through the utilisation of hybrid models of regression with binary variables. Cancelo et al. [21] and later Moral-Carcedo and Vicens-Otero [27] explain how REE's model includes the calendar effect. In their work they present one model for the midterm (as many as 10 days) and 24 models, one for each hour. The procedure carried out to obtain those models consists in separating the regular component of the electricity demand, named basic consumption, from the other two components associated with the calendar effect and weather conditions. From this itemisation, the effects produced by the calendar effect are included using binary variables correlated with a polynomial of lags. This polynomial includes a set of parameters to be determined, which depend on the class of holiday, day, hour, and position in the week, amongst others. This leads to the need to use an extremely large number of variables. Other methods commonly used consist of ARIMA models with interventions. Pardo et al. [28] developed a new model based on interventions for Spanish demand. Elanim and Fusushige [29] developed a SARIMAX model for Japanese electricity generation forecasting using data obtained from Tokyo Electric Power Corporation. The SARIMAX model included exogenous variables called effects, which are split into two groups: main and cross effects. Holidays and weather variables are included as dummy variables. Çevik and Çunkas [30] used two fuzzy logic models, the first with the previous year's information and the second with a scaling process to produce forecasts. Kulkarni et al. [31] used spiking neural networks in which every holiday was modelled with a neuron. Erişen [32] presented a Holt-Winters model including a modification to improve forecasts for holidays.
In the last years, other points of view have been proposed that attempt to integrate these irregularities as part of their own models. Arora and Taylor [33] presented a triple seasonal Holt-Winters model based on rules and the concept of similar days. In particular, four rules are intended to change the recursivity length of the intra-annual seasonality to one similar to previous days. However, this method does not use the information provided by the method's own irregularities. The same method was also applied to ARIMA models in [34].
In addition, Bermúdez [35] used covariates in the exponential smoothing methods for Spanish electricity demand forecasting. A new quantitative covariate reflecting the type of special day was defined within the model. Thus, a weight depending on the category was assigned. Furthermore, another variable related to the period of Easter was also added. Göb et al. [36] also used covariates in state space models applied to electricity demand in Italy. Another different technique was developed by Martínez et al. [20], which proposed a forecasting algorithm based on sequences of patterns that make it possible to distinguish the different kinds of days as a step prior to the prediction of the Spanish electricity demand.
This work presents a new point of view in which irregularities are included within the multiple seasonal Holt-Winters model as new seasonalities. The special events occur on specific days of the year, but as a general standard they develop a pattern that repeats over and over in the course of its appearance. However, this circumstance can only appear in a certain moment of the time series, and therefore it should be discrete. Due to this fact, Holt-Winters models with discrete-interval moving seasonality are developed and proposed in this work to deal with the forecasting on special days.

Holt-Winters Models with Discrete Interval Moving Seasonalities
The multiple seasonal Holt-Winters models have their roots in the proposal made by Taylor in 2003. He presented a nested relation between intraday and intraweek seasonalities. Later in 2010, Taylor [11] presented a new model that included the intra-annual seasonality. Finally, García-Díaz and Trull [37] proposed a generalisation of this methodology, named nHWT, to deal with any number of seasonalities.
where L t and T t are the equations for the level and additive trend, with smoothing parameters α and γ. I (i) t are the seasonal indices of length s i , with smoothing parameters δ (i) . There are as many equations as seasonal patterns allocated in the time series, n s . X t is the observed data. Finally, X t+k is the equation to forecast k time instants ahead. It collects the information contained in the model and makes predictions. To include the adjustment for the first-order autocorrelation error, ϕ AR is added, and t is white noise. In case this adjustment is avoided: ϕ AR = 0.
Following [37], the following system of nomenclature simplified with three letters is used. The first indicates the type of trend, the second the type of seasonality, and the third whether the model has been adjusted with the first-order autocorrelation error. Numbers indicating the length of every seasonal period considered are additionally specified as subscripts. As an example, the model AMC 24,168 denotes the model described in Equations (1)-(4) with two seasonalities: intraday and intraweek, with lengths of 24 and 168 h, respectively.
The relation between seasonalities is governed by a fixed ratio during the whole-time range of the series (for instance, a week is 7 days). Moreover, both seasonalities should establish a fixed beginning (Monday at 0:00).
Nevertheless, Easter has a different behaviour. The holiday period is established according to a religious calendar and starts on a different date every year. In that period, the electricity demand varies substantially compared with a regular period. Holt-Winters models cannot adapt to this irregularity themselves. A similar case applies to Christmas.
The new seasonal pattern D t * h is defined only in t * h , which is a discretization of time that represents the time instants of the time series X t where the special event provokes one change of the demand. This time is not necessarily coincident with the holidays but coincides with the time of influence. It has a fixed period length s h . As the special event can take place on different dates, the recursivity of the pattern should vary and adapt at every new appearance. So, the recursivity is then defined as s * h regardless of the length of the seasonal pattern. This new seasonality is a discrete-interval moving seasonality (DIMS), with n DI MS being the number of DIMS considered. Thus DIMS is defined as follows: are the new seasonal equations defined for DIMS with a period length of s h , with smoothing This new seasonal pattern is integrated in the complete model according to the methods established for the seasonality, as expressed by Equations (6)-(10).
The model exhibited is a method that considers multiplicative seasonality. The methods that consider additive seasonality, such as AAC 24,168 , which include the additive trend and seasonalities, would be similar to the one shown, but with the DIMS multiplicative factors and seasonalities exchanged for addends. Working with DIMS needs a different procedure to the usual one since the initial values of the DIMS are calculated separately. However, when working with a seasonality, this seasonality needs to have appeared at least once before being able to be used to make forecasts. Figure 2 shows the workflow of the procedure, which is detailed hereafter.

Obtaining Seeds of the Model
The first step to get seeds for the model consists in determining the initial values of the regular model. For this case, multiple seasonal techniques have been used. The level is determined as the moving average for the two first cycles of greater length. The trend is obtained from the slope between the two first cycles of longer length and modified by the contribution of the cycles of shorter length. Finally, the seasonality is determined as the ratio between the values of the series for the first cycles over the moving average, with this value being distributed between the different seasonalities next.
In order to determine the seeds of DIMS, firstly a decomposition of the time series is carried out using an appropriate technique. In this work, decomposition of the trend and multiple seasonality based on Loess (STL) is used [38]. The series is thus decomposed as in Equation (11).
where T t represents the trend and S (s i ) t are the seasonal indices for each of the considered seasonal patterns in the model. U t stands for the residuals, from which the information for DIMS will be obtained.
In the second step, the series is reassembled again using Equation (12). Here it is fundamental to understand clearly that the remainder should not be included in the rebuilt series, since the information that needs to be analysed is found in it.
where R t is the rebuilt series without including the remainder U t . Finally, it is necessary to get values from the indices. For this purpose, it is first necessary to get the weights for the time series over the reassembled time series. Table 1 shows how to calculate the values of the weights. This table is organised so that each column represents every one of the appearances of the discrete seasonality. Each of the data observed in each seasonality is arranged in the rows. The necessary quantity of data will be determined for s h , which is the length of the DIMS period. The values of p i are the time positions within the time series, and n stands for the number of occurrences of the event within the time series. Table 1. Estimate of the weights of the values of the series on the rebuilt time series. In the columns each appearance of the discrete-interval moving seasonality (DIMS) is shown, and in the rows every time instant within the discrete seasonality.
Finally, the seasonal indices are obtained as the average of the values indicated previously, as shown in Equation (13).
It is important to distinguish s h and s * h . The former refers to the length of the seasonal discrete pattern, while the latter refers to the recurrent distance to find the previous event.

Parameter Optimisation and Forecast
The role of the parameters is fundamental in the Holt-Winters models. A search for parameters is performed, to determine their ability to adapt the model, as far as possible, to the observed data. For this purpose, methods of minimisation of the forecasting error for a training set are used. There are many measures that can be used to determine the level of the error in the prediction and that are useful for the process of minimisation. In this work, the root mean square error (RMSE) is used Equation (14).
The minimisation of the RMSE is a nonlinear problem and the search space is defined by the smoothing parameters as shown in Equation (15).
Note that the feasibility region Ω is bounded between 0 and 1. As can be appreciated from Figure 2, two options are proposed in order to minimise the RMSE: • The first consists in determining all parameters simultaneously. Chatfield [39] studied the optimisation of the parameters separately and jointly. He concluded that the best solution is to accomplish the joint optimisation of the parameters.
• The second consists in accomplishing an optimisation of the regular model and subsequently optimising the parameters of the DIMS. Although this contradicts the previous point of view, no differences in precision are found, but there are differences in optimisation time.
Once the model has been adjusted, the forecast is carried out for a test set. In order to measure the accuracy of the prediction, the RMSE can be used again. But in this case, the predictions are commonly compared using the Mean Absolute Percentage Error (MAPE), as defined in Equation (16).
This work analyses very short-term forecasts: usually 24 h ahead, but also 168 h ahead. The forecasts are obtained from the last observed data and are compared with the real values in order to check the accuracy of the proposed model.

A Case Study: Easter
The objective of this section is to show the prediction models for a study case, in particular, the forecasting of electricity demand when modelling the Easter effect by means of the DIMS.
For the study, it is important to observe Figure 3, which presents the hourly electricity demand in Spain in the weeks around Easter for the years from 2008 to 2015. It can be appreciated that the effect of Easter provokes a decrease in electricity consumption during a fixed period and that this decrease remains from Holy Thursday to the day after Easter Sunday. This is repeated in all of the years, although Easter happens in different periods of the year. The date of Easter is variable, since it depends on the first full moon after the spring equinox.
It can be seen that all days of the week are affected by the holidays. This is due to the fact that the official Easter in Spain begins on Good Friday and ends with Resurrection Sunday. However, in many regions, Thursday, Monday, or both are also holidays. This provokes a decrease in activity. In this work, forecasts for Easter in 2014 and 2015 are obtained using the information provided by the time series and considering the Easter periods from 2008. For that purpose, two Holt-Winters models with DIMS and two seasonal patterns (24 and 168 h) have been used. The first is a model with multiplicative seasonality named AMC 24,168,Easter . The second one has additive seasonality and  (24) )I (24) t−24 Next, it is necessary to determine the values of t * Easter and s * Easter in order to define the aforementioned models completely.
Due to the fact that the Easter holidays are not the same across the whole of Spain and that they also have a small annual variation in some regions, it is difficult to establish an exact period for the Easter prediction. As a starting point, the discrete period between Holy Thursday and Easter Monday has been analysed, since it seems to be where a greater influence is clearly seen. The Easter period for each year is illustrated in Table 2. It starts with Palm Sunday and ends with Resurrection Sunday. This table shows when these special days occur. Not all regions in Spain apply the same Easter period for holidays, but all of them include, at least, Holy Thursday and Friday. In columns 4 and 5, the interval in which the discrete seasonality is defined for each year is shown. The 'Beginning' column starts with Holy Thursday and shows the position of the DIMS in the hourly time series. In the last column, the value of recursivity, in hours, is shown for each event. As an example, Easter starts on Holy Thursday on 28 March 2013 (position 45,913 in the time series) and finishes on Easter Sunday (position 46,033), which represents a length s h of 120 h. Therefore, D (Easter) t * Easter in 2013 only is defined between these two values. In order to determine the recursivity, the previous year has to be analysed. The Easter of the year 2012 ended up in 8 April (position 37,465 in the time series), and therefore the recursivity was 8448 h in that year.

Results and Discussion
With the aim of validating the new proposal experimentally, the Spanish electricity demand data from REE have been used. In particular, the time series is the hourly electricity demand aggregated for the Iberian Peninsula from January 2008 to July 2015. As Easter is a source of important irregularity, the two DIMS models specified in Section 4 (AAC 24,168,Easter and AMC 24,168,Easter ) have been applied to obtain predictions for the days of Easter in 2014 and 2015.

Analysis of Results
In order to obtain the parameters of the model, minimisation of the RMSE is carried out using data from 1 January 2008 until the day before Holy Thursday of 2014. Both methods, that is, the all-in-one method (hereafter M1) and the two-step method (M2), have been used but the differences amongst the parameters and the results are not significant. The parameters obtained using the two-step optimisation method are shown in Table 3. The data used to fit the model went up to the day before Holy Thursday of 2014. From the point of view of demand, it is not really clear whether the discrete beginning of the period should begin on Holy Thursday or on Monday, since, as mentioned above, the holidays are different in each region. In a similar way, the Monday after Easter is not always a holiday, even in the same region. This point led us to analyse several options and to check which one of them offered the best results. On one hand, the day on which Easter begins is considered, as well as the period included in the analysis and the method of optimising the parameters of the model. Therefore, several starting positions and lengths were tested with the aim of finding out the best DIMS definitions for the Easter period. The setting used for the analysis are summarised in Table 4. It can be seen that three cases have been analysed. Case 0 represents the regular nHWT model, without including any DIMS. Case 1 is associated with period 1, which includes the DIMS starting on Monday after Palm Sunday, with a length of 192 h (up to Monday after Resurrection Sunday). In Case 2, corresponding to period 2, the DIMS starts on Holy Thursday and has a length of 120 h. All periods started at 00:00 hours.  Table 5 summarises the results obtained when predicting the Easter demand for the years 2014 and 2015. For case 0, it can be seen that the model cannot operate with Easter and therefore the MAPE rises, reaching values of up to 13%, in comparison to the forecast on a typical day, when it hovers around 2% [37]. Models that include DIMS provide MAPE under 5%. This provides evidence that the inclusion of the DIMS has improved the results substantially. However, the comparison between cases 1 and 2 does not yield big differences, and therefore case 2 has been selected in order to show the results obtained by the optimisation methods M1 and M2, since it includes a shorter period of seasonality. In relation to the optimisation method, the variation of the MAPE is not fundamental, being the two-step method much faster. The ranges of precision obtained have MAPE values that hover around 1.5% to 3%, very near to the typical values for nHWT on a workday. In order to verify this situation, Figure 4 shows the forecast for the next 24 h for each day of Easter in 2015, with a regular nHWT model in comparison to the new AMC 24,168,Easter including DIMS. It can be appreciated that the new methodology obtains forecasts nearer to the real data.

Comparison
An analysis in order to benchmark the proposed method against other methods commonly used in the literature have been conducted. Three alternative methods have been considered: Artificial Neural Network (ANN), the TBATS model, and the TBATS model including exogenous variables. ANN is a general-purpose method and TBATS are models that include moving seasonal effects to predict special days.
ANN is a computational method that tries to simulate the behaviour of the human brain. It comprises interconnected neurons that are organised in layers and can be trained. This training assigns weights to neurons according to a determined pattern. In the last years, the use of neural network methods is increasing, according to new studies about the human brain, and offer new possibilities. In short-term load forecasting, the ANN learns from past data and can provide forecasts of future demands. In many works the ANN is not used as a standalone method but as a part of other models. He et al. [40] provides a good explanation of the usage of ANN. Our study uses a neural network regression model, as shown in Figure 5. It has a hidden layer with 20 neurons, and as inputs, in addition to load forecasting, the day of the week, a variable indicating the special day events, and some other variables to help deal with seasonalities have been included. The Exponential Smoothing State Space Model with Box-Cox Transformation, ARMA Errors, Trend and Seasonal Components (TBATS) evolved from state space models. De Livera [41] described how the addition of the Box-Cox transformation dealing with the non-linearities in the time series and including an ARMA process in the residuals to include possible autocorrelations improved the results obtained with state space models. These are BATS models. Latterly, De Livera et al. [12], developed TBATS by developing a Fourier series to deal with seasonalities in the model, which reduced the number of parameters to be used. They applied a methodology to include special days in the model. In this analysis, the same procedure to Spanish electricity demand, with and without regressors, has been applied. Figure 6 shows the MAPE obtained by all methods using the same dataset for all of the Easter days from Thursday to Monday. The names used in the graph correspond to the method used to obtain the forecasts. The name TBATS JASA refers to TBATS with regressors; this name is used due to the fact that the method explained in [12] has been applied. It is clear that TBATS using regressors outperforms TBATS, but AMC 24,168,DI MS outperforms the rest. The ANN obtained an average MAPE of 3.08%, while AMC 24,168,DI MS obtained a value of 2.5%.

Conclusions
After analysing the problems of the existence of irregularities in the time series of the electricity demand in Spain, the possibility of using Holt-Winters models with discrete-interval seasonalities has been analysed. The DIMS have been described as a logical solution and are in-built within the regular Holt-Winters models. Then, the models have been applied to predict the demand for the Easter holidays, allowing the efficacy of the DIMS to be checked. The different possibilities for forecasting the demand for Easter using the DIMS have been analysed, and it has been concluded that the best choice is to use one DIMS from Holy Thursday to the Monday after Easter. The obtained results shown a MAPE improvement of around 11% from the regular models to below 3%. The utilisation of discrete seasonalities makes it possible to apply singular patterns at punctual moments of the time series. These patterns are not necessarily related to a fixed sequence and they can be arranged in different moments of the time series. Furthermore, the patterns can be repeated as often as necessary in a period of time and in different periods, but does not necessarily have to be repeated. It is only necessary for it to have appeared prior to the forecast. Regarding the smoothing parameters, the inclusion of this new discrete seasonality helped the intraweek seasonality to deal with the irregularities that are associated with it. As a result, their smoothing parameters have lower values that are closer to 0. A comparison among different methods is also conducted. The results show that the use of DIMS improves the results and that this method outperforms the other methods.
Future works should aim to exploit the characteristic of being flexible in respect of the position in time. Moreover, the model could permit the coexistence of a large number of discrete seasonalities when more than one discrete seasonality is able to coexist with another seasonality. This can allow DIMS to be used in a general model and thus to model the calendar effect.