G Simon

A Lendasse

M Cottrell

J.-C Fort

M Verleysen Ac

M Verleysen

Time Series Forecasting: Obtaining Long Term Trends with Self-Organizing Maps

Kohonen self-organisation maps are a well know classification tool, commonly used in a wide variety of problems, but with limited applications in time series forecasting context. In this paper, we propose a forecasting method specifically designed for multi-dimensional long-term trends prediction, with a double application of the Kohonen algorithm. Practical applications of the method are also presented.

Introduction

Time series forecasting is a problem encountered in many fields of applications, as finance (returns, stock markets), hydrology (river floods), engineering (electrical consumption), etc. Many methods designed for time series forecasting perform well (depending on the complexity of the problem) on a rather short-term horizon but are rather poor on a longer-term one. This is due to the fact that these methods are usually designed to optimize the performance at short term, their use at longer term being not optimized. Furthermore, they generally carry out the prediction of a single value while the real problem sometimes requires predicting a vector of future values in one step. For example, in the case of some a priori known periodicity, it could be interesting to predict all values for a period as a whole. But forecasting a vector requires either more complex models (with potential loss of performance for some of the vector components) or many distinct single value predicting models (with potential loss of the correlation information between the various values). Methods able to forecast a whole vector with the same precision for each of its components are thus of great interest.

While enlarging the prediction horizon is of course of primary interest for practitioners, there is of course some limit to the accuracy that can be expected for a long-term forecast. The limitation is due to the availability of the information itself, and not to possible limitations of the forecasting methods. Indeed, there is no doubt that, whatever forecasting method is used, predicting at long term (i.e. many time steps in advance) is more difficult that predicting at short term, because of the missing information in the unknown future time steps (those between the last known value and the one to predict). At some term, all prediction methods will thus fail. The purpose of the method presented in this paper is not to enlarge the time horizon for which accurate predictions could be expected, but rather to enlarge the horizon for which we can have insights about the future evolution of the series. By insights, we mean some information of interest to the practitioner, even if it does not mean accurate predictions. For example, are there bounds on the future values ? What can we expect in average ? Are confidence intervals on future values large or narrow ?

Predicting many steps in advance could be realized in a straightforward way, by subsampling the known sequence, then using any short-term prediction method. However, in this case, the loss of information (used for the forecast) is obviously even higher, due to the lower resolution of the known sequence. Furthermore, such solution does not allow in a general way to introduce a stochastic aspect to the method, which is a key issue in the proposed method. Indeed, to get insights about the future evolution of a series through some statistics (expected mean, variance, confidence intervals, quartiles, etc.), several predictions should be made in order to extract such statistics. The predictions should differ; a stochastic prediction method is able to generate several forecasts by repeated Monte-Carlo runs. In the method presented in this paper, the stochastic character of the method results from the use of random draws on a probability law.

Another attractive aspect of the method presented in this paper is that it can be used to predict scalar values or vectors, with the same expected precision for each component in the case of vector prediction. Having at disposal a time series of values x(t) with 1 ≤ t ≤ n, the prediction of a vector can be defined as follows :

[x(t+1), . . . , x(t+d)] = f (x(t), . . . , x(t-p+1))+ε t [START_REF] Kohonen | Self-organising Maps[END_REF] where d is the size of the vector to be predicted, f is the data generating process, p is the number of past values that influence the future values and ε t is a centred noise vector. The past values are gathered in a p-dimensional vector called regressor.

The knowledge of n values of the time series (with n >> p and n >> d) means that relation (1) is known for many (n-p-d+ 1) time steps in the past. The modeling problem then becomes to estimate a function f that models correctly the time series for the whole set of past regressors. The idea of the method is to segment the space of p-dimensional regressors. This segmentation can be seen as a way to make possible a local modeling in each segment. This part of the method is achieved using the Self-Organizing Map (SOM) [START_REF] Kohonen | Self-organising Maps[END_REF]. The prototypes obtained for each class model locally the regressors of the corresponding class. Furthermore, in order to take into account temporal dependences in the series, deformation regressors are built. Those vectors are constructed as the differences between two consecutive regressors. The set of regressor deformations can also be segmented using the SOM. Once those two spaces are segmented and their dependences characterized, simulations can be performed. Using a kind of Monte-Carlo procedure to repeat the simulations, it is then possible to estimate the distribution of these simulations and to forecast global trends of the time series at long term.

Though we could have chosen some other classical vector quantization (VQ) method as only the clustering property is of interest here, the choice of the SOM tool to perform the segmentation of the two spaces is justified by the fact that SOM are efficient and fast compared to other VQ methods with a limited complexity [START_REF] De Bodt | On the use of Self-Organizing Maps to accelerate vector quantization[END_REF] and that they provide an intuitive and helpful graphical representation.

In the following of this paper, we first recall some basic concepts about the SOM classification tool. Then we introduce the proposed forecasting method, the double vector quantization, for scalar time series and then for vector ones. Next we present some experimental results for both scalar and vector forecastings. A proof of the method stability is given in appendix.

The Kohonen Self-Organizing Maps

The Self-Organizing Maps (SOM), developed by Teuvo Kohonen in the 80's [START_REF] Kohonen | Self-organising Maps[END_REF], has now become a well-known tool, with established properties [START_REF] Cottrell | Theoretical aspects of the SOM algorithm[END_REF], [START_REF] Cottrell | Kohonen maps versus vector quantization for data analysis[END_REF]. Self-Organizing Maps have been commonly used since their first description in a wide variety of problems, as classification, feature extraction, pattern recognition and other related applications. As shown in a few previous works [START_REF] Cottrell | Simulating Interest Rate Structure Evolution on a Long Term Horizon: A Kohonen Map Application[END_REF], [START_REF] Cottrell | Forecasting of curves using a Kohonen classification[END_REF], [START_REF] Walter | Non-linear prediction with self-organising maps[END_REF], [START_REF] Vesanto | Using the SOM and Local Models in Time-Series Prediction[END_REF], [START_REF] Koskela | Recurrent SOM with Local Linear Models in Time Series Prediction[END_REF], [START_REF] Lendasse | Forecasting Time-Series by Kohonen Classification[END_REF], the SOM may also be used to forecast time series at short term.

The Kohonen Self-Organizing Maps (SOM) can be defined as an unsupervised classification algorithm from the artificial neural network paradigm. Any run of this algorithm results in a set, with a priori fixed size, of prototypes. Each one of those prototypes is a vector of the same dimension as the input space. Furthermore, physical neighbourhood relation links the prototypes. Due to this neighbourhood relation, we can easily graphically represent the prototypes in a 1-or 2-dimensional grid.

After the learning stage each prototype represents a subset of the initial input set in which the inputs share some similar features. Using Voronoi's terminology, the prototype corresponds to a centroid of a region or zone, each zone being one of the classes obtained by the algorithm. The SOM thus realizes a vector quantization of the input space (a Voronoi tessellation) that respects the original distribution of the inputs. Furthermore, a second property of the SOM is that the resulting prototypes are ordered according to their location in the input space. Similar vectors in the input space are associated either to the same prototype (as in classical VQ) or to two prototypes that are neighbours on the grid. This last property, known as the topology preservation, does not hold for other standard vector quantization methods like competitive learning.

The ordered prototypes of a SOM can easily be represented graphically, allowing a more intuitive interpretation: the 1-or 2-dimensional grid can be viewed as a 1-or 2-dimensional space where the inputs are projected by the SOM algorithm, even if, in fact, the inputs are rather projected on the prototypes themselves (with some interpolation if needed in the continuous case). This projection operation for some specific input is proceeded by determining the nearest prototype with respect to some distance metric (usually the Euclidian distance).

The double quantization method

The method described here aims to forecast long-term trends for a time series evolution. It is based on the SOM algorithm and can be divided into two stages: the characterization and the forecasting. The characterization stage can be viewed as the learning, while the forecasting can be viewed as the use of a model in a generalization procedure.

For the sake of simplicity, the method is first presented for scalar time series prediction (i.e. d = 1 in (1)) and then detailed later on for vector forecasting. Examples of the method application to scalar and vector time series will be provided in section 4.

Method description: characterization

Though the determination of an optimal regressor in time series forecasting (at least in a nonlinear prediction case) is an interesting and open question [START_REF] Verleysen | Forecasting financial time series through intrinsic dimension estimation and non-linear data projection[END_REF], it is considered here that the optimal, or at least an adequate, regressor of the time series is known. Classically, the regressor can for example be chosen according to some statistical resampling (cross-validation, bootstrap, etc.) procedure.

As for many other time series analysis methods, conversion of the inputs into regressors leads to n -p + 1 vectors in a p-dimensional space, where p is the regressor size and n the number of values at our disposal in the time series. The resulting regressors are denoted:

x t t-p+1 = {x(t), x(t -1), . . . , x(t -p + 1)}, (2)
where p ≤ t ≤ n, and x(t) is the original time series at our disposal with 1 ≤ t ≤ n. In the above x t t-p+1 notation, the subscript index denotes the first temporal value of the vector, while the superscript index denotes its last temporal value.

The obtained vectors x t t-p+1 are then manipulated and the so-called deformations y t t-p+1 are created according to:

y t t-p+1 = x t+1 t-p+2 -x t t-p+1 . (3)
Note that, by definition, each y t t-p+1 is associated to one of the x t t-p+1 . In order to highlight this link, the same indices have been used. Putting all y t t-p+1 together in chronological order forms another time series of vectors, the deformations series in the so-called deformation space to be opposed to the original space containing the regressors x t t-p+1 . Of course, there exist n-p deformations of dimension p.

The SOM algorithm can then be applied to each one of these two spaces, quantizing both the original regressors x t t-p+1 and the deformations y t t-p+1 respectively. Note that in practice any kind of SOM map can be used, but it is assumed that one-dimensional maps (or strings) are more adequate in this context.

As a result of the vector quantization by the SOM on all x t t-p+1 of the original space, n 1 pdimensional prototypes xi are obtained (1 ≤ i ≤ n 1 ). The clusters associated to xi are denoted c i . The second application of the SOM on all deformations y t t-p+1 in the deformation space results in n 2 p-dimensional prototypes ȳj , 1 ≤ j ≤ n 2 . Similarly the associated clusters are denoted c ′ j . To perform the forecasting, more information is needed than the two sets of prototypes. We therefore compute a matrix f (ij) based on the relations between the x t t-p+1 and the y t t-p+1 with respect to their clusters (c i and c ′ j respectively). The row f ij for a fixed i and 1 ≤ j ≤ n 2 is the conditional probability that y t t-p+1 belongs to c ′ j , given that x t t-p+1 belongs to c i . In practice, those probabilities are estimated by the empirical frequencies:

f ij = #{x t t-p+1 ∈ c i and y t t-p+1 ∈ c ′ j } #{x t t-p+1 ∈ c i } (4) with 1 ≤ i ≤ n 1 , 1 ≤ j ≤ n 2 .
Note that, for a fixed i, elements f ij (1 ≤ j ≤ n 2 ) sum to one; this justifies the fact that each row of the matrix is an (empirically estimated) probability law. Therefore the matrix will be called transition matrix in the following.

The computation of this transition matrix completes the characterization part of the method.

Method description: forecasting

Once the prototypes in the original and deformation spaces together with the transition matrix are known, we can forecast a time series evolution over a rather long-term horizon h (where horizon 1 is defined as the next value t + 1 for time t).

The methodology for such forecasting can be described as follows. First, consider a time value x(t) for some time t. The corresponding regressor is x t t-p+1 . Therefore we can find the associated prototype in the original space, for example xk (this operation is in fact equivalent to determining the class c k of x t t-p+1 in the SOM). We then look at row k in the transition matrix and randomly choose a deformation prototype ȳl among the ȳj according to the conditional probability distribution defined by f kj , 1 ≤ j ≤ n 2 . The prediction for time t + 1 is obtained according to relation (3):

xt+1 t-p+2 = x t t-p+1 + ȳl , (5)
where xt+1 t-p+2 is the estimate of the true x t+1 t-p+2

given by our time series prediction model. However xt+1 t-p+2 is in fact a p-dimensional vector, with components corresponding to times from t -p + 2 to t + 1 (see relations ( 2) and ( 3)). As in the scalar case considered here we are only interested in a single estimate at time t + 1, we extract the scalar prediction x(t + 1) from the p-dimensional vector xt+1

t-p+2 . We can iterate the described procedure, plugging in x(t + 1) for x(t) in (2) to compute xt+2 t-p+3 by (5) and extracting x(t + 2). We then do the same for x(t + 3), x(t + 4), . . . , x(t + h). This ends the run of the algorithm to obtain a single simulation of the series at horizon h.

Next, as the goal of the method is not to perform a single long-term simulation, the simulations are repeated to extract trends. Therefore a Monte-Carlo procedure is used to repeat many times the whole long-term simulation procedure at horizon h, as detailed above. As part of the method (random choice of the deformation according to the conditional probability distributions given by the rows of the transition matrix) is stochastic, repeating the procedure leads to different simulations. Observing those evolutions allows estimating the simulation distribution and infer global trends of the time series, as the evolution of its mean, its variance, confidence intervals, etc.

It should be emphasized once again that the double quantization method is not designed to determine a precise estimate for time t + 1 but is more specifically devoted to the problem of longterm evolution, which can only be obtained in terms of trends.

Generalisation: vector forecasting

Suppose that it is expected to predict vectors x t+d t+1 of future values of the times series x(t); x t+d t+1 is a vector defined as:

x t+d t+1 = {x(t + d), . . . , x(t + 2), x(t + 1)}, (6) where d is determined according to a priori knowledge about the series. For example when forecasting an electrical consumption, it could be advantageous to predict all hourly values for one day in a single step instead of predicting iteratively each value separately.

As above regressors of this kind of time series can be constructed according to:

x t t-p+1 = {x t t-d+1 , x t-d t-2d+1 , . . . , x t-p+d t-p+1 }, (7)
where p, for the sake of simplicity, is supposed to be a multiple of d though this is not compulsory. The regressor x t t-p+1 is thus constructed as the concatenation of d-dimensional vectors from the past of the time series, as it is the concatenation of single past values in the scalar case. As the x t t-p+1 regressor is composed of p/d vectors of dimension d, x t t-p+1 is a p-dimensional vector. Deformation can be formed here according to:

y t t-p+1 = x t+d t-p+d+1 -x t t-p+1 . (8)
Here again, the SOM algorithm can be applied on both spaces, classifying both the regressors x t t-p+1 and the deformations y t t-p+1 respectively. We then have n 1 prototypes xi in the original space, with 1 ≤ i ≤ n 1 , associated to classes c i . In the deformation space, we have n 2 prototypes ȳj , 1 ≤ j ≤ n 2 , associated to classes c ′ j . A transition matrix can be constructed as a vector generalisation of relation (4):

f ij = #{x t t-p+1 ∈ c i and y t t-p+1 ∈ c ′ j } #{x t t-p+1 ∈ c i } (9) with 1 ≤ i ≤ n 1 , 1 ≤ j ≤ n 2 .
The simulation forecasting procedure can also be generalised:

• consider the vector input x t t-d+1 for time t. The corresponding regressor is x t t-p+1 ; • find the corresponding prototype xk ;

• choose a deformation prototype ȳl among the ȳj according to the conditional distribution given by elements f kj of row k;

• forecast xt+d t-p+d+1 as xt+d t-p+d+1 = x t t-p+1 + ȳl ; (10)
• extract the vector

{x(t + 1), x(t + 2), . . . , x(t + d)}
from the d first columns of xt+d t-p+d+1 ; • repeat until horizon h.

For this vector case too, a Monte-Carlo procedure is used to repeat many times the whole longterm simulation procedure at horizon h. Then the simulation distribution and its statistics can be observed. This information gives trends for the long term of the time series.

Note that using the SOM to quantize the vectors x t t-p+1 and y t t-p+1 , the method reaches the goal of forecasting vectors with the same precision for each of their components. Indeed each component from regressors x t t-p+1 and y t t-p+1 has the same relative weight while the distance between the considered regressor and prototype is computed in the SOM algorithm. None of the x t t-p+1 or y t t-p+1 components have thus a greater importance in the modification of the prototype weight during the learning of the SOM.

Extensions

Two important comments must be done. First, as illustrated in both examples below, it is not mandatory (in equations ( 1), ( 2), ( 6), [START_REF] Walter | Non-linear prediction with self-organising maps[END_REF]) to consider all successive values in the regressor; according to the knowledge of the series or to some validation procedure, it might be interesting to select regressors with adequate, but not necessarily successive, scalar values or vectors in the past.

Secondly, the vector case has been illustrated in the previous section on temporal vectors (see equation [START_REF] Cottrell | Forecasting of curves using a Kohonen classification[END_REF]). An immediate extension of the method would be to consider spatial vectors, for example when several series must be predicted simultaneously. The equations in the previous section should be modified, but the principle of the method remains valid.

Method stability

The predictions obtained by the model described in the previous subsections should ideally be confined in the initial space defined by the learning data set. In that case, the series of predicted values y t t-p+1 is said to be stable. Otherwise, if the series tends to infinity or otherwise diverges, it is said to be unstable. The method has been proven to be stable according to this definition; a proof is given in appendix.

Experimental results

This section is devoted to the application of the method on two times series. The first one is the well-known Santa Fe A benchmark presented in [START_REF] Weigend | Times Series Prediction: Forecasting the future and Understanding the Past[END_REF]; it is a scalar time series. The second time series is the Polish electrical consumption from 1989 to 1996 [START_REF] Cottrell | Forecasting of curves using a Kohonen classification[END_REF]. This real-world problem requires the prediction of a vector of 24 hourly values.

Methodology

In the method description, the numbers n 1 and n 2 of prototypes have not been fixed. Indeed, the problem is that different values of n 1 (n 2 ) result in different segmentations in the original (deformation) space and in different conditional distribution in the transition matrix. The model may thus slightly vary.

Selecting the best values for n 1 and n 2 is an important question too. Traditionally, such hyperparameters are estimated by model selection procedures such as AIC, BIC or computationallycostly resampling techniques (Leave-One-Out, kfold cross validation, bootstrap). As it will be shown further in this paper, exact values of n 1 and n 2 are not necessary, as the sensitivity of the method around the optimums is low. A simple validation is then used to choose adequate values for n 1 and n 2 . For that purpose the available data are divided into three subsets: the learning, the validation and the test set. The learning set is used to fix the values of the model parameters, such as the weights of the prototypes in the SOM and the transition matrix. The validation set is used to fix meta-parameters, such as the numbers n 1 and n 2 of prototypes in the SOM maps. The validation set is thus used for model selection. The test set aims to see how the model behaves on unused data that mimic real conditions.

The selection of n 1 and n 2 is done with regards to an error criterion, in our case a sum of squared error criterion, computed over the validation set V S:

e SSE = y(t+1)∈V S (y(t + 1) -ŷ(t + 1)) 2 . (11)
Once n 1 and n 2 have been chosen, a new learning is done with a new learning set obtained from the reassembled learning and validation sets. This new learning is only performed once with optimal values for n 1 and n 2 .

Note that, hopefully, the sensitivity of the method to specific values of n 1 and n 2 is not high. This has been experimentally verified in all our simulations, and will be illustrated on the first example (Santa Fe A) in section 4.2.

Another crucial question is the sensitivity of the method to various runs of the SOM algorithm (with the same n 1 and n 2 values). Indeed it is well known that initial conditions largely influence the exact final result of the SOM algorithm (by final result it is meant the prototype locations, and their neighborhood relations) [START_REF] De Bodt | Statistical tools to assess the reliability of selforganizing maps[END_REF]. Nevertheless, as mentioned above, the neighborhood relations of the SOM are used for visualization purposes only; they do not influence the results of the forecast. Moreover, the location of the centroids are used to quantize the space (therefore allowing the estimation of the empirical conditional frequencies of the clusters); small variations in the centroid location have thus a low influence on each prediction generated by the method, and an even lower one on the statistics (mean, confidence intervals, etc.) estimated from the predictions. This last result has been confirmed experimentally in all our simulations, for which no significant difference was observed after different runs of the two SOM algorithms.

Scalar forecasting: Santa Fe A

The Santa Fe A time series [START_REF] Weigend | Times Series Prediction: Forecasting the future and Understanding the Past[END_REF] has been obtained from a far-infrared-laser in a chaotic state. This time series has become a well-known benchmark in time series prediction since the Santa Fe competition in 1991. The completed data set contains 10 000 data. This set has been divided here as follows: the learning set contains 6000 data, the validation set 2000 data, and test set 100 data. Note that the best neural network models described in [START_REF] Weigend | Times Series Prediction: Forecasting the future and Understanding the Past[END_REF] do not predict much more than 40 data, making a 100-data test set a very long-term forecasting.

Here, the regressors x t t-p+1 have been constructed according to

x t t-p+1 = {x(t), x(t -1), x(t -2),
x(t -3), x(t -5), x(t -6)}. [START_REF] Weigend | Times Series Prediction: Forecasting the future and Understanding the Past[END_REF] This choice is made according to previous experience on this series [START_REF] Weigend | Times Series Prediction: Forecasting the future and Understanding the Past[END_REF]. In other words, d = 1, p = 6 (as value x(t -4) is omitted) and h = 100.

In this simulation, Kohonen strings of 1 up to 200 prototypes in each space have been used. All the 40 000 possible models have been tested on the validation set. The best model among them has 179 prototypes in the regressor space and 161 prototypes in the deformation space. After relearning this model on both the learning and validation sets, 1000 simulations were performed on a horizon of 100. Then the mean and confidence interval at 95% level were computed, giving information on the time series trends. Figure 1 shows the mean of the 1000 simulations compared to the true values contained in the test set, together with the confidence interval at 95% level. Figure 2 From figure 2, it should be noted that the method gives roughly the first 25 values of the time series, a result that is not so far from those obtained with the best neural network models of the Santa Fe competition [START_REF] Weigend | Times Series Prediction: Forecasting the future and Understanding the Past[END_REF]. From figure 1, we can infer that the series mean will neither increase nor decrease. In addition, the confidence interval does contain the whole evolution of the time series for the considered 100 future values. The trend for long term forecasting is thus that the series, though chaotic, will show some kind of stability in its evolution for the next 100 values.

As all the 40 000 models have been generated and learned, the influence of varying the n 1 and n 2 values can be observed. This influence is illustrated in figure 5. It is clear from this figure that there is a large flat region around the optimal values; in this region, all models generalize rather equivalently. This justifies, a posteriori, the choice of a simple resampling method to choose n 1 and n 2 . Table 1 Example of transition matrix, here with n 1 = 6 and n 2 = 8 as in figure 4. Note that in each row, the frequency values sum to one.

Vector forecasting: the Polish electrical consumption

As second example, we use the Polish electrical load time series [START_REF] Cottrell | Forecasting of curves using a Kohonen classification[END_REF]. This series contains hourly values from 1989 to 1996. The whole dataset con-tains about 72 000 hourly data and is plotted in figure 6. Due to the daily periodicity of the time series, we are interested in daily predictions. This is thus an illustration of the case d > 1, since it seems natural to forecast the 24 next values in one step (the next day), the time window becoming daily instead of hourly. Having now at our disposal 3000 x t t-p+1 data of dimension 24, we use 2000 of them for the learning, 800 for a simple validation and 200 for the test. Since the optimal regressor is unknown, many different regressors were tried, using intuitive understanding of the process. The final regressor is:

x t t-p+1 = {x t t-24+1 , x t-24 t-48+1 , x t-48 t-72+1 , x t-144 t-168+1 , x t-168 t-192+1 }, (13
) that is the 24 hourly values of today, of yesterday, of two, six and seven days ago. This regressor is maybe not the optimal one, but it is the one that makes the lowest error on the validation set in comparison with other tested ones. Since the regressor contains p = 5 data of dimension d = 24, we work in a 120-dimensional space. We then run the algorithm again on the learning set with values for n 1 and n 2 each varying from 5 to 200 prototypes by steps of 5. The lowest error is made by a model with n 1 = 160 and n 2 = 140 respectively.

Another model is then learned with 160 and 140 parameter vectors in each space with the new learning set, now containing 2000+800 data. The forecasting obtained from this model is repeated 1000 times. Figure 7 presents the mean of the 1000 simulations obtained with 24-dimensional vectors and with horizon h limited to 40 days (a single plot of the whole 24 * 200 predicted values becomes unreadable). For convenience, figure 8 shows a zoom and a comparison between the mean of those 1000 long-term predictions and the real values. A confidence interval at 95% level is also provided. From figure 8, it is clear that the mean of the prediction at long term will show the same periodicity as the true time series and that the values will be contained in a rather narrow confidence interval. This fact denotes a probable low variation of the series at long term.

Figure 9 shows 100 predictions obtained by the Monte-Carlo procedure picked up at random before taking the mean. See that different simulations have about the same shape; this is a main argument for determining long-term trends.

Finally, as in the previous example, the influence of n 1 and n 2 can be observed. In figure 10,

Conclusion

In this paper, we have presented a time series forecasting method based on a double classification of the regressors and of their deformations using the SOM algorithm. The use of SOMs makes it possible to apply the method both on scalar and vector time series, as discussed in section 3 and illustrated in section 4. A proof of the method stability is given in appendix.

The proposed method is not designed to obtain an accurate forecast of the next values of a series, but rather aims to determine long-term trends. Indeed, its stochastic nature allows repeating simulations by a Monte-Carlo procedure, allowing to compute statistics (variance, confidence intervals, etc.) on the predictions. Such a method could also be used for example in the financial context, for the estimation of volatilities.

To prove that the series is a Markov chain, we consider the starting vector of the simulation at time 0. The corresponding initial regressor of the series is denoted X 0 , and C 0 is the corresponding SOM cluster in the regressor space. The deformation that is applied to X 0 at this stage is Y 0 . Then the next values of the series are given by

X 1 = X 0 + Y 0 , X 2 = X 0 + Y 0 + Y 1 , .
. . , with Y 0 , Y 1 , . . . drawn randomly from the transition matrix for clusters C 0 , C 1 , . . . respectively. The series X t is therefore a Markov chain, homogeneous in time (the transition distribution are not time dependant), irreducible and defined over a numerable set (the initial X t are in finite number, and so are the deformations).

To show the stability of this Markov chain and thus the existence of a stationary distribution, Foster's criterion [START_REF] Fayolle | Topics in constructive theory of countable Markov chains[END_REF] is applied. Note that this criterion is a stronger result which proves the ergodicity of the chain, which in turns implies the stability. Foster's criterion is the following:

A necessary and sufficient condition for an irreducible chain to be ergodic is that there exists a positive function g(.), a positive ε and a finite set A such that:

∀x ∈ Ω : E(g(X t+1 )|X t = x) < ∞, ∀x / ∈ Ω : E(g(X t+1 )|X t = x) -g(x) ≤ -ε. (14)
Since the Markov chain is homogenous, it is sufficient to observe transition Y 0 from X 0 to X 1 . The same development can be deduced for any other transition.

The demonstration is done for two-dimensional regressors but can be generalized easily to other dimensions. Note that in the following, we use g(.) = . 2 in [START_REF] Fayolle | Topics in constructive theory of countable Markov chains[END_REF].

Before going in further details, let us remark that for a SOM with at least 3 classes in general position, class C 0 covers less than a half plane. Furthermore, we have to distinguish two cases for each cluster. First, the cluster may be included in a finite compact from IR 2 . The second case is the case of an infinite cluster i.e. of a cluster which may does have any neighbour in some direction; this happens to ckusters on the border of the map.

The first case is easely proved. Since X 0 < R 0 , where R 0 can be any constant, then we have by triangular inequality:

E( X 1 ) < R 0 + Y 0 ≤ R 0 + max j ( Y j ). ( 15
)
As the deformations Y j are in finite number, the maximum of their norm is finite. This proves the first inequality of ( 14) in an obvious way for the first case (i.e. bounded cluster case). The other case thus appens when X 0 → +∞. This happens in unbounded clusters. The unbounded cluster case is much more technical to prove.

Looking at figure 11, we see that each unbounded cluster is included in a cone with vertex A and delimited by the normalized vectors a 1 and a 2 . There are two possibilities: either a 1 and a 2 form an acute angle, either an obtuse one, as shown in figure 11(a Before going on and applying Foster's criterion, note that the three following geometrical properties can be proven:

Property 1. Denoting lim x →∞ x x • a i = δ i , (16)
we have δ 1 and δ 2 both positive in the acute angle case, while either δ 1 or δ 2 is positive for an obtuse angle. Indeed, using the origin O, we define:

-→ Ox = -→ OA + -→ Ax. ( 17
)
We thus have:

x x • a i = -→ OA • a i x + -→ Ax -→ A x -→ A x x • a i (18)
which can be bounded by a strictly positive constant as

--→ OA•ai x → 0 and -→ Ax x → 1 for x → +∞.
Property 2.

We define b 1 such that the angle (a 1 , b 1 ) is + π 2 . Similarly b 2 is defined such that the angle (b 2 , a 2 ) is also + π 2 . Then, for both the acute and obtuse angle cases, we have:

inf x∈C -→ Ax x • b i = r i > 0, ( 19
)
where C is the considered cone which has border vectors a 1 and a 2 .

Rewrite the first term of (19) as:

inf x∈C -→ Ax x • b i = inf x∈C -→ Ax -→ A x -→ A x x • b i ; ( 20
)
the result is obtained easily since

- → A x x → 1 when x → +∞. Property 3.
Assume that:

E µ0 (Y 0 ) • a 1 < 0 and E µ0 (Y 0 ) • a 2 < 0 (21)
where µ 0 is the empirical distribution corresponding to class C 0 in the transition matrix. Denoting

E µ0 (Y 0 ) • a i = -γ i < 0 (22)
with γ i > 0, then we have:

E µ0 (Y 0 ) • b i < 0 ( 23
)
for either i = 1 or i = 2 in case of an acute angle (figure 12 Note that the initial assumption can easily be proved numerically.

Those three properties will be used as lemmas in the following. Now we can apply Foster's criterion for the unbounded cluster case.

Foster's criterion

Considering an unbounded class C 0 and the corresponding transition distribution, with g(x) = x 2 , we have

E(g(X 1 )|X 0 = x) -g(x) = E(g(X 0 + Y 0 |X 0 = x) -g(x) = E( X 0 + Y 0 2 |X 0 = x) -x 2 = 2 x x•Eµ 0 (Y0) x + Eµ 0 ( Y0 2 ) 2 x . (24)
The second term between the brackets can be bounded by a strictly positive constant α 0 . Indeed, as Y 0 2 is finite, E µ0 ( Y 0 2 ) < M 0 is also finite. Therefore, for α 0 > 0 and x > M0 α0 , we have

1 x E µ0 ( Y 0 2 ) < α 0 . (25)
For the first term, we chose either i = 1 or i = 2 such that:

lim x →+∞ x x • a i = δ i > 0, E µ0 (Y 0 ) • b i < 0. ( 26
)
In case of an unbounded cluster, those two conditions are fulfilled using Properties 1. and 3.

By hypothesis, suppose that i = 2 satisfies those two conditions (26). The term E µ0 (Y 0 ) can be decomposed in the (b 2 , a 2 ) basis. Then, for x sufficiently large, as:

• E µ0 (Y 0 ) • a 2 = -
≤ (E µ0 (Y 0 ) • a 2 ) =-γ2 x x • a 2 > δ 2 2 + (E µ0 (Y 0 ) • b 2 ) <0 x x • b 2 ≥ r 2 2 < -γ 2 δ 2 2 ,
when x is large enough, denoted here x > L 0 . The same development can be achieved using i = 1 to satisfy the two initial conditions (26). We obtain:

x x E µ0 (Y 0 ) < -γ 1 δ 1 2 , (27)
when x > L ′ 0 . Equation (24) can now be simplified in:

E(g(X 1 )|X 0 = x) -g(x) = 2 x x•Eµ 0 (Y0) x + Eµ 0 ( Y0 2 ) 2 x < 2 x -α 0 + 1 2 α 0 = -2 x α0 2 , (28)
where x > K 0 = max(L 0 , L ′ 0 ) and α 0 in (25) is chosen such that α 0 = min γ1δ1 2 , γ2δ2 2 . This development has been done for cluster C 0 . All values α 0 , M 0 , L 0 , K 0 depends on this cluster C 0 . Now considering all unbounded clusters C i and taking α = inf Ci α i and K = sup Ci K i , we have:

∀ x ≥ K : xE µ0 (Y 0 ) x + E µ0 ( Y 0 2 ) 2 x < - α 2 < 0. ( 29
)
Finally, we obtain, using (29) in ( 28):

E(g(X 1 )|X 0 = x) -g(x) < -α x , (30)
where the right member tends to -∞ for x → +∞.

To conclude, we define the set Ω used in Foster's criterion according to

Ω = i∈I C i {X 0 | X 0 < K} , (31)
where I denotes the set of bounded cluster indexes as discussed in the introduction to the proof. With this definition, the above developments prove Foster's criterion [START_REF] Fayolle | Topics in constructive theory of countable Markov chains[END_REF]. Thus the Markov chain defined by the X i for i > 0 is ergodic, and admits a unique stationary distribution.

  shows a zoom on the first 30 values. In figure 3, we can see 100 simulations for the same 30 values. Note the stability obtained through the replications. For a simpler model with n 1 = 6 and n 2 = 8 (used for illustrations purposes), figure 4 shows the code vectors and regressors (resp. deformations) in each class; table 1 shows the corresponding transition matrix.

Figure 1 .

 1 Figure 1. Comparison between the mean of the 1000 simulations (solid) and the true values (dashed), together with confidence intervals at 95% level (dotted).

Figure 2 .

 2 Figure 2. Comparison for the first 30 values between the mean of the 1000 simulations (solid) and the true values of the test set (dashed), together with confidence intervals at 95% level (dotted).

Figure 3 .

 3 Figure 3. 100 simulations picked out at random from the 1000 simulations made for the Santa Fe A long-term forecasting.

Figure 4 .

 4 Figure 4. The code vectors and associated curves in the regressor (top) and deformation (bottom) spaces (when n 1 = 6 and n 2 = 8). The code vectors are represented in white as 6-dimensional vectors (according to (12)). Regressors (resp. deformations) belonging to each class are shown in black.

Figure 5 .

 5 Figure 5. Impact of the variation of n 1 and n 2 on the model generalization ability for the Santa Fe A time series.

Figure 6 .

 6 Figure 6. The Polish electrical consumption time series, between 1989 and 1996.

Figure 7 .

 7 Figure 7. Mean of the 1000 simulations at long term (h = 40).

Figure 8 .

 8 Figure 8. Comparison between the true values (dashed), the mean of the predictions (solid) and the confidence interval at 95 % level (dotted).

Figure 9 .

 9 Figure 9. Plot of 100 simulations chosen at random from the 1000 simulations.

Figure 10 .

 10 Figure 10. Impact of the variation of n 1 and n 2 on the model generalization ability for the Polish electrical consumption problem.

Figure 11 .

 11 Figure 11. Notations for the cone containing an unbounded cluster of a SOM; see text for details.

  ) and figure11(b) respectively.

  (a)) or for both of i = 1 and i = 2 for the obtuse case (figure12(b)).

  (a) Acute angle case. (b) Obtuse angle case.

Figure 12 .

 12 Figure 12. Third geometrical property, see text for details.

  γ 2 by Property 3.;• E µ0 (Y 0 ) • b 2 < 0 byProperty 3.;

	•	x x	• a 2 >	δ 2 2	by Property 1.;
	•	x x	• b 2 ≥	r 2 2	as	-→ Ox =	-→ OA +	-→ Ax and by
		Property 2.;
	we have
		x x	E µ0 (Y 0 )

Acknowledgements

We would like to thank Professor Osowsky from Warsaw Technical University for providing us the Polish Electrical Consumption data used in our example.

Appendix

Method stability

Intuitively, the stability property of the method is not surprising. Indeed, the model is designed such that it will mostly produce predictions that are in the range of the observed data. By construction, deformations are chosen randomly according to an empirical probability law and the obtained predictions should stay in the same range. If, for some reason, the prediction is about to exceed this range during one of the simulations, the next deformations will then tend to drive it back inside this range, at least with high probability. Furthermore, as simulations are repeated with the Monte-Carlo procedure, the influence of such unexpected cases will be reduced when the mean is taken to obtain the final predictions. The following of this section is intended to prove this intuitive result.

The proof consists in two steps: it is first shown that the series generated by the model is a Markov chain; secondly, it is demonstrated that this particular type of Markov chain is stable. In order to improve the readability of the proof, lighter notations will be used. For a fixed d and a fixed p, notation X t will represent the vector x t t-p+1 . The last known regressor will be denoted X 0 . The prototype of a cluster C ′ j of deformations will be noted Y j . Finally, hats will be omitted for simplicity as all regressors X t are estimations, except for t = 0.