{'fraction_non_alphanumeric': 0.037980974016754224, 'fraction_numerical': 0.009903450234275166, 'mean_word_length': 4.543683589138134, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Short-Term Load Forecasting: The Similar Shape Functional Time Series Predictor

We introduce a novel functional time series methodology for short-term load forecasting. The prediction is performed by means of a weighted average of past daily load segments, the shape of which is similar to the expected shape of the load segment to be predicted. The past load segments are identified from the available history of the observed load segments by means of their closeness to a so-called reference load segment, the later being selected in a manner that captures the expected qualitative and quantitative characteristics of the load segment to be predicted. Weak consistency of the suggested functional similar shape predictor is established. As an illustration, we apply the suggested functional time series forecasting methodology to historical daily load data in Cyprus and compare its performance to that of a recently proposed alternative functional time series methodology for short-term load forecasting.


Introduction
Load forecasting is an integrable process in the design of power systems faced by electricity authorities worldwide, involving accurate predictions of electric load over different time periods in the furure. It can be broadly classified as short-term, medium-term and long-term forecasting, in terms of planning time horizons. Although different planning time horizons for these categories seem to exist in the literature, we have adopted herein the load forecasting classification scheme of Srinivasan and Lee (1995), viz., up to 1 day for short-term load forecasting (STLF), more than 1 day up to 1 year for medium-term load forecasting (MTLF), and more than 1 year up to 10 years for long-term load forecasting (LTLF). See also Alfares & Nazeeruddin (2002).
Competition, the need of saving raw materials that are used in the production of electrical energy, the reduction of emissions and the avoidance of money wasting in general, are the main reasons 1 arXiv:1201.2617v1 [math.ST] 12 Jan 2012 that force electricity authorities worldwide to proceed to a better planning for the production of electricity. The main characteristics of the programming are the quantity of electrical energy that needs to be produced and the type of machine that is going to be used. This can be achieved by requiring accurate STLF, an important category of load forecasting, that plays a major role in realtime control and security functions for designing larger power systems, see, e.g., Srinivasan (1998) and Laurent et al. (2007). Additionally, the particular characteristics of the electricity production process are essential for optimal planning of daily power generation. In connection with the fact that the produced electricity that is not consumed instantly is lost (electricity cannot be stored), it becomes obvious that the right planning of daily power generation must have as a result the avoidance of emergency situations as well as of producing much greater quantities of electricity than the ones needed. It must also offer the capability to electricity authorities worldwide to use as far as possible the low functionality cost machines for covering the electrical energy needed. As a result, it becomes easily understood that an accurate STLF, like the prediction of the consumption of electrical energy of the next day, is an important tool for good power planning. Over the years, a large number of methodologies have been developed to perform STLF. These methodologies are mainly emerged from two different paradigms, namely classical statistical techniques and computational intelligent techniques. In particular, classical statistical techniques include, among others, regression models, ARIMA time series models, Kalman filtering models, etc., see, e.g., Hyde & Hodnett (1997), Sargunaraj, Gupta & Devi (1997) and Huang & Shih (2003), while computational intelligent techniques include, among others, artificial neural networks, expert systems, etc., see, e.g., Rahman &d Hazim (1993) and AlFuhaid, El-Sayed & Mahmoud (1997). For extensive reviews on classical statistical techniques and computational intelligent techniques for STLF, we refer to, e.g., Hippert Here, we focus on statistical techniques for STLF. It should be stressed that STLF is commonly considered as a difficult task because the daily load demand is influenced by many factors, viz., weather conditions, holidays, weekdays, weekends, economic conditions, and, last but not least, idiosyncratic and social habits of individuals. Moreover, daily load demand is commonly recorded at a finite number of equidistance time points, viz., every half of each hour or every quarter of each hour. Thus, in order to forecast the load demand of next day, one has to predict the load demand at forty-eight or ninety-six, respectively, time points. From a statistical point of view, it is convenient to think of the daily load demand recorded at these forty-eight or ninety-six time points as a segment and to perform load prediction for the whole segment of time points rather than forecasting the load demand at each one of these time points separately. This implies that we adopt the functional time series framework in our approach, see, e.g., Bosq (2000, Chapter 9) and Ferraty & Vieu (2006, Chapter 12).
Based on the previous discussion, we introduce below a novel functional time series methodology for STLF. The prediction is performed by means of a weighted average of past daily load segments, the shape of which is similar to the expected shape of the load segment to be predicted. The past load 2 segments are identified from the available history of the observed load segments by means of their closeness to a so-called reference load segment, the later being selected in a manner that captures the expected qualitative and quantitative characteristics of the load segment to be predicted.
The paper is organized as follows. In Section 2, we provide some methodological background and review alternative functional time series methodologies that can be applied for STLF. We then describe the suggested functional time series forecasting methodology and establish weak consistency of the resulting functional predictor. As an application, we illustrate in Section 3, how the proposed functional predictor performs by applying it to the historical daily electricity load data in Cyprus and compare its performance to that of a recently proposed alternative functional time series methodology for STLF. Some concluding remarks are provided in Section 4.

Functional Time Series Forecasting
Putting the above discussion in a statistical methodological context, one seeks information on the evolution of a (real-valued) continuous-time stochastic process X = (X(t); t ∈ R) in the future.
Given a trajectory (curve) of X observed on the interval [0, T ], one would like to predict the behavior of X on the entire interval [T, T + δ], where δ > 0, rather than at specific time-points. An appropriate approach to this problem is to divide the interval [0, T ] into subintervals [lδ, (l +1)δ], l = 0, 1, . . . , k −1 with k = T /δ, and to consider the (function-valued) discrete-time stochastic process S = (S n ; n ∈ N), For the specific STLF application in mind, where the aim is one-day ahead prediction, the segmentation parameter δ corresponds to the daily electricity demand. In practice, the electricity demand is recorded at a finite number of equidistance time points within each day, say t 1 , t 2 , . . . , t P , for instance, every half of each hour (viz., P = 48) or every quarter of each hour (viz., P = 96).
Letting S n (t i ) to be the observation at time point t i , i = 1, 2, . . . , P , within curve S n , n ∈ N, we denote by the segment of the total number of observations of the n-th curve S n , n ∈ N.
Therefore, given a 'sample' S 1 , S 2 , . . . , S L of segments, our aim is then to predict the whole next segment S L+1 , viz., to predict

Existing Approaches
In the recent statistical literature, practically all investigations to date for the aforementioned functional time series prediction problem are for the case where one assumes that the underlying 3 stochastic process is driven by a Hilbert-valued, first-order, autoregressive processes, which implies that the best predictor,Ŝ L+1 , of curve S L+1 given its past history (the 'sample' of curves) S 1 , S 2 , . . . , S L , is the conditional mean of S L+1 given S L , see, e.g., Bosq (1991) The common implicit assumption in developing the above functional time series forecasting methodologies is that all the available information for predicting segment S L+1 is essentially contained in the last observed segment, viz., segment S L . However, it is more appropriate to assume that the profile of the daily electricity load demand depends, in a complicated and unknown way, on a set of quantitative variables, such as, daily temperature, daily humidity, daily wind speed, etc., as well as on a set of qualitative variables, such as, weekdays, weekends, holidays, seasonal characteristics, etc., of the day to be predicted. Apparently, this information is not necessarily contained in the behavior of the last (observed) segment S L . Thus, functional time series forecasting approaches that are based on conditioning ideas on the past behavior of the observed segments can ignore important information concerning the segment to be predicted, which is not necessarily contained in the past observed segments. The numerical results we present in Section 3 clearly show that this information is proved valuable for accurate daily load demand forecasting. such as, daily temperature, daily humidity, daily wind speed, etc., the resulting functional kernel regression approach could be used for STLF. However, this functional regression-based approach does not take appropriately into account a number of specific factors, the behavior of which turns out to be important for STLF. For instance, the same behavior of the daily temperature as an explanatory variable could lead to a different response, viz., daily load demand, depending on the seasonal characteristics and on other factors, such as, weekdays, weekends, holidays, etc. This suggests that in order to perform accurate STLF, one needs to appropriately take into account not only the behavior of some quantitative variables but also on qualitative characteristics of the segment to be predicted, such as, weekdays, weekends, holidays, and seasonal factors, that jointly affect the daily load demand behavior.
The above results in typical curves of daily load demand behavior depending on a number of quantitative and qualitative variables. Thus, in order to perform STLF one has to: (i) identify the appropriate curve of next day's load demand based on next day's behavior of these variables, and (ii) find in the entire time series history those curves that are similar to the identified one. With this in mind, we introduce below an alternative functional time series forecasting methodology for daily electricity load demand which performs the prediction by means of a weighted average of past segments, the shape of which is similar to the expected shape of the segment to be predicted. The past segments are identified from the entire history of the observed segments by means of their closeness to a so-called reference segment, the later being selected in a manner that captures the expected qualitative and quantitative characteristics of the segment to be predicted. Since the proposed STLF methodology is looking at the entire past for 'shapes' that are similar to the expected 'shape' of the day to be predicted, the resulting predictor is called the similar shape functional time series predictor (SSP).

The Similar Shape Functional Time Series Predictor
Based on the previous discussion, it is not unrealistic to assume that daily load demand depends on several quantitative factors, such as, daily temperature, daily humidity, daily wind speed, etc., and qualitative variables, such as, weekdays, weekends, holidays, season characteristics, etc. Suppose that these quantitative and qualitative characteristics result in a typical daily load demand shape, so that each curve S n can be expressed as Remark 2.1. Notice that, in order to identify the seasonal characteristics, we do not only take into account the 'global seasonality', as this is described by autumn, winter, spring and summer, but also the 'local seasonality', which refers to the weather conditions during the very recent past and which affect the behavior of the daily load demand. This is important since, for instance, a period of warm days in the winter causes a different behavior of the daily load demand compared to the one caused by a period of similar warm days in the spring or in the summer. This local seasonality aspects are also one of the reasons why regression based approaches are not very appropriate in this context. For instance, the same value of the daily temperature (the explanatory variable) may cause a different daily load demand (the response variable), depending on these local seasonal characteristics.
• T n (t), H n (t), W n (t), . . . are exogenous random variables, denoting quantitative characteristics, e.g., T n (t) is the daily temperature curve, H n (t) is the daily humidity curve, W n (t) is the daily wind speed curve, etc.
Notice that these curves are function-valued random variables, usually called functional random variables in the statistical literature. In other words, they are random variables defined on a common probability space with values in an infinite-dimensional metric space. In what follows, for simplicity and data availability issues, we restrict our attention to the daily temperature curve T n , n ∈ N, which is one of the main exogenous functional random variables affecting daily load demand, that is, we consider the following model (However, we note that the suggested methodology can be straightforwardly modified to any available number of exogenous functional random variables.) Let T L+1 (t i ) to be the observation at time point t i , i = 1, 2, . . . , P , within curve T L+1 , viz., we denote by the segment of the total number of observations of the (L + 1)-th curve T L+1 .
Given model (3) and based on the 'sample' S 1 , S 2 , . . . , S L of segments, the suggested prediction procedure consists of the following two main steps: (a) identify among the M typical daily load demand shapes the one which is appropriate for the prediction of segment S L+1 , depending on the quantitative and qualitative characteristics of the segment to be predicted, and (b) obtain the prediction as a weighted average of all past segments by giving more weight to the segments the shape of which is more similar to the identified shape (obtained in (a)) of the segment to be predicted.
The following algorithm describes in more detail how to construct the suggested SSP,Ŝ L+1 , of segment S L+1 . In particular, Steps 1 and 2 sort out the problem of identifying the appropriate shape of the segment to be predicted described in (a) while Step 3 refers to the calculation of the predictor described in (b).
Step 1. Specify the group membership G 1,m and the local season membership G 2,m , where segment S L+1 belongs to. While specifying the group membership is easily done based on the particular day to be predicted (weekdays, weekends, holidays), the specification of the 'local seasonality' is more difficult and rather arbitrary. This is so, since, as explained before, local seasonality depends on the specific seasonal and weather characteristics of the very recent past of the time series and their stability. In our approach, local seasonality is essential and is taken into account by selecting a small number n L of past segments that are further considered for selecting what it is called the typical shape or reference segment. This is done in Step 2 of the algorithm.
Step 2. Determine a relevant load profile by specifying a so-called reference segment, S (Re) , as follows: • Find among the last n L segments those belonging to same group memberships G 1,m , m ∈ {1, 2, . . . , M } as segment S L+1 . Let C L+1 be the set of the selected segments, viz., Notice that the length of local seasonality and its stability is controlled by the parameter n L which determines how far in the past one goes to select a possible set of segments for specifying the reference segment S (Re) .
• Let T L+1 be a predictor of segment T L+1 , which should not necessarily be available on the entire set of time points {t 1 , t 2 , . . . , t P } (see below).
• Let D be any of the (equivalent) distances in R P . Then, the reference segment S (Re) is obtained as Notice that the reference segment S (Re) is obtained as a simple average of those segments S l ∈ C L+1 belonging to the same group and having the same local seasonal characteristics, the temperature segments T l , l = 1, 2, . . . , n L , of which are close enough to the predicted temperature T L+1 of the segment S L+1 to be predicted. This 'closeness' is controlled by the parameter δ. We also point out (and this is important for practical applications) that it is not necessary to have the prediction T L+1 on the entire set of time points {t 1 , t 2 , . . . , t P } to specify the set C * . In fact, one can compare the temperature segments T l and T L+1 using only the subset of time points on which the predictions for the segment T L+1 are available (or provided by other sources).

Remark 2.2.
Notice that the SSPŜ L+1 is obtained as a weighted average of past segments, where more weight w r , r = 1, 2, . . . , L, is placed on the segment the shape of which is similar (in terms of the particular distance D used) to the shape of the reference segment S (Re) . This clarifies the differences between the suggested approach and several other approaches proposed in the literature that are based on conditioning ideas. In the case of conditioning on the last observed segment S L (see, e.g., (2006)), the predictor is obtained as a weighted average of past segments, where the weight given to a segment depends on its closeness to the conditioning segment S L . For the suggested approach, the role of the conditioning segment is taken over by the reference segment S (Re) which comprehensively contains all relevant information regarding the shape of the daily load demand to be predicted. Thus, the selection of the reference segment S (Re) is essential for the quality of the predictor obtained. This is stated more precisely in Lemma 5.1 which, in fact,

Antoniadis, Paparoditis & Sapatinas
shows that weak consistency of the suggested SSP is equivalent to weak consistency of the selected reference segment S (Re) .
Regarding the behavior of the smoothing parameters involved in the suggested prediction procedure, we assume the following.

2.1(i) requires that the number of segments taken into account to calculate the reference segment
S (Re) , viz., the number of segments belonging to the set C * , grows as the sample size increases.
Assumption 2.1(ii) requires that the bandwidth δ, used for obtaining the reference segment S (Re) , goes to zero in such a way that the number of segments effectively used in calculating S (Re) , viz., |C * |δ, increases to infinity, which is also as standard assumption for weak consistency in non-parametric kernel estimation.
The following theorem establish the weak consistency of the suggested SSP.

Description of the Data Set
Electricity Authority of Cyprus (EAC) is the organization that is responsible for the generation, transmission and distribution of electricity in Cyprus. The target of EAC is to provide Cypriots with high quality of safe and reliable services and activities at competitive prices. EAC uses two types of machines to produce electricity. The first type of machine is a steam turbine that uses dynamic pressure generated by expanding steam to turn the blades of a turbine. Almost all large non-hydro plants use this system. About 80% of all electric power produced in the world is by use of steam turbine. The advantages of using such a type of machine are the high overall cogeneration efficiencies of up to 80%, the wide range of possible fuels including waste fuel and biomass, the production of high temperature/pressure steam and the established technology. On the contrary, we can mark the low electrical efficiencies, the slow start up times, the poor part load performance and especially the need for expensive high-pressure boilers and other equipment. The second type of machine is a diesel engine which uses an electrical generator. Diesel generating sets are used in places without connection to the power grid, as emergency power-supply if the grid fails. Of course, they are widely used not only for emergency power but also many of them have a secondary function of feeding power to utility grids either during peak periods or during periods with a shortage of large power generators.
Although, we may say that the cost of their functionality is forbidding.
The best planning for EAC is to avoid these emergency situations, use machines which have low functionality cost and high electrical efficiencies for electricity generation and distribution, which would cover the needs of the whole island. The most important characteristic of the right plan should be the fact that the quantity of electricity produced must not be greater than one needs since the additional electricity produced can not be stored and is lost. An extremely useful tool for the right plan is the accurate prediction of the consumption of the electrical energy of the next day.
Below, we apply the suggested SSP methodology proposed in Subsection 2.2 to a set of daily load data that were provided by EAC, concerning the electrical energy consumption, in megawatts (MW), per fifteen minute intervals, viz., P = 96, for the period from 01/01/2007 to 31/12/2010. The data set is displayed in Figure 5.1. From this figure, a slightly upward trend can be observed along with a strong periodic component within each year. It is also evident that the electrical energy consumption slightly increases every year and during the summer months attains its maximum. Since the goal is to predict the daily shape of electrical energy consumption, and not the overall trend, the EAC rescales daily curves by dividing them by their maximum value. This leads to daily shape curves that vary between zero and one. The aim is then to produce accurate predictions of the shape of the rescaled consumption of next day's electrical energy. We then transform the predictor to the original scale, by multiplying the resulting SSP by the maximum value of the electrical load of the day to be predicted, provided by EAC. In the next section, we demonstrate how the SSP methodology proposed in Subsection 2.2, can be implemented to fulfill this aim.

Implementation of the SSP
In our context, the curves S n , n = 1, 2, . . . , L, that are derived from equation (1) To determine the reference segment S (Re) , as mentioned previously, we restrict our attention only to the exogenous random variable T n (t), n ∈ N, that denotes the daily temperature segment.
We then find all days belonging to same group memberships G 1,m , m ∈ {1, 2, . . . , M }, as the segment we want to predict. The parameter n L , described in Subsection 2.2, is set equal to n L = 14 if the segment to be predicted corresponds to Monday, Tuesday, Thursday or Friday and is set equal to n L = 28 if the segment to be predicted corresponds to Wednesday, Saturday or Sunday. This seems to be appropriate in order to have enough information to select the reference segment while at the same time retains local seasonality. Regarding the exogenous random variable T n (t), n ∈ N, we use a predictor T L+1 of T L+1 . As mentioned earlier, it is not necessary to have the prediction T L+1 on the entire set of time points {t 1 , t 2 , . . . , t P }, P = 96, to specify the set C * . In fact, one can compare the temperature segments T l , l = 1, 2, . . . , n L , and T L+1 using only a subset of time points on which the predictions for the segment T L+1 are available (or provided by other sources). More specifically, we have used predictions of next day's temperature at only four time points, that is, those corresponding to 08:00, 12:00, 16:00 and 20:00. The actual temperatures predictions of segment T L+1 at these time points were provided to us by EAC.
3. To further simplify the selection of the reference segment S (Re) , we set in (6) that is, the reference segment S (Re) is obtained as where C L+1 is given by (4).
4. The SSPŜ L+1 is obtained by (7), where the weights w r , r = 1, 2, . . . , L, are determined by (8) with the kernel function K being the Gaussian kernel and the bandwidth h being selected by the empirical risk of prediction methodology suggested by Antoniadis, Paparoditis & Sapatinas Finally, the computational algorithm related to the above implementation as well as the overall numerical study presented in Subection 3.3 has been carried out in the Matlab 7.7.0 programming environment.

Numerical Results
Based on the above implementation, we apply the SSP functional time series forecasting methodology to a randomly selected number of days within the year 2010, from the dataset displayed in The quality of both SSP and WKP were measured by the relative mean-absolute error (RMAE) defined as For both SSP and WKP, we also report the Maximum Difference (MaxDiff) and Minimum Difference (MinDiff) defined as It is evident from the analysis (see

Conclusions
We introduced a novel functional time series methodology for short-term load forecasting, named the functional similar shape time series predictor. The predictor was performed by means of a weighted average of past daily load segments, the shape of which is similar to the expected shape of the load segment to be predicted. To quantify this similarity, the notion of reference segment was introduced which captures the expected qualitative and quantitative characteristics of the load segment to be predicted. The functional similar shape predictor was theoretically justified by proving a weak consistency property. Furthermore, its usefulness for short-term load forecasting was demonstrated by applying it to historical daily load data in Cyprus. The numerical results obtained showed that the functional similar shape predictor works very satisfactory and outperforrms the functional wavelet-kernel time series predictor, a recently established alternative functional time series methodology for short-term load forecasting.
We note that, although for simplicity and data availability issues, we restricted our attention to the daily temperature, which is one of the main exogenous functional random variables, the suggested functional time series methodology for short-term load forecasting can be also modified to take into account other daily exogenous functional random variables, like humidity, wind speed, sunshine, etc., which might affect daily load demand. Although the above modification is straightforward from a theoretical point of view, its practical implementation depends on the availability of the required time series data.
5 Appendix: Proof of Theorem 2.1 To prove Theorem 2.1, we first prove the following auxiliary result, showing that weak consistency of the suggested SSPŜ L+1 , defined by (7), is equivalent to the weak consistency of the selected reference segment S (Re) , defined by (5).
Lemma 5.1. Assume model (3), that Assumption 2.1 (iii) is satisfied, and that (9) holds true. Let S (Re) andŜ L+1 be defined by (5) and (7), respectively. Then, (10) holds true, if and only if Proof. We first prove the "if" part of the lemma. Assume that (12) holds true. Since We now prove the "only if" part of the lemma. Assume that (10) holds true. Note that, for each t ∈ {t 1 , t 2 , . . . , t P }, We are now ready to prove Theorem 2.1. In view of Lemma 5.1, it suffices to prove (12). From (5), it is easily seen that S (Re) has the expression of a non-parametric estimator with a uniform kernel.