Applied Soft Computing 12 (2012) 3291–3299
Contents lists available at SciVerse ScienceDirect
Applied Soft Computing journal homepage: www.elsevier.com/locate/asoc
A new time invariant fuzzy time series forecasting method based on particle swarm optimization Cagdas Hakan Aladag a,∗ , Ufuk Yolcu b , Erol Egrioglu c , Ali Z. Dalar c a
Hacettepe University, Faculty of Science, Department of Statistics, 06800 Ankara, Turkey Giresun University, Faculty of Arts and Science, Department of Statistics, 28000 Giresun, Turkey c Ondokuz Mayis University, Faculty of Arts and Science, Department of Statistics, 55139 Samsun, Turkey b
a r t i c l e
i n f o
Article history: Received 14 November 2011 Received in revised form 25 March 2012 Accepted 4 May 2012 Available online 30 May 2012 Keywords: Determination of fuzzy relations Fuzzy time series Particle swarm optimization University of Alabama’s enrollment data Linguistic modeling Fuzzy relations
a b s t r a c t In the analysis of time invariant fuzzy time series, fuzzy logic group relationships tables have been generally preferred for determination of fuzzy logic relationships. The reason of this is that it is not need to perform complex matrix operations when these tables are used. On the other hand, when fuzzy logic group relationships tables are exploited, membership values of fuzzy sets are ignored. Thus, in defiance of fuzzy set theory, fuzzy sets’ elements with the highest membership value are only considered. This situation causes information loss and decrease in the explanation power of the model. To deal with these problems, a novel time invariant fuzzy time series forecasting approach is proposed in this study. In the proposed method, membership values in the fuzzy relationship matrix are computed by using particle swarm optimization technique. The method suggested in this study is the first method proposed in the literature in which particle swarm optimization algorithm is used to determine fuzzy relations. In addition, in order to increase forecasting accuracy and make the proposed approach more systematic, the fuzzy c-means clustering method is used for fuzzification of time series in the proposed method. The proposed method is applied to well-known time series to show the forecasting performance of the method. These time series are also analyzed by using some other forecasting methods available in the literature. Then, the results obtained from the proposed method are compared to those produced by the other methods. It is observed that the proposed method gives the most accurate forecasts. © 2012 Elsevier B.V. All rights reserved.
1. Introduction In recent years, fuzzy time series method was firstly introduced by Song and Chissom [30]. The method has been widely used in the literature since it does not require any assumption. Fuzzy time series can be split into two subclasses which are time variant and time invariant. In time invariant fuzzy time series, it is assumed that auto correlations do not change due to the time. However, it is assumed that auto correlations change due to the time in time variant ones. Fuzzy time series methods generally consist of three main phases such as fuzzification, determination of fuzzy logic relationships, and defuzzification. In the literature, new methods have been proposed by making contributions to these phases. There have been various methods suggested for fuzzification phase of fuzzy time series. Song and Chissom [31–33], Chen [6], Chen [7], Tsaur [35], Singh [30], Egrioglu et al. [12,13] used fuzzification methods based on partition of universe of discourse. The
∗ Corresponding author. Tel.: +90 312 2977900; fax: +90 312 2977913. E-mail address:
[email protected] (C.H. Aladag). 1568-4946/$ – see front matter © 2012 Elsevier B.V. All rights reserved. http://dx.doi.org/10.1016/j.asoc.2012.05.002
operation of partition of universe of discourse is to divide universe of discourse into equal or unequal sub-intervals according to a predefined interval length. The effect of the predefined interval length on the forecasting performance was examined by Huarng [18]. Huarng [18] also suggested two methods such as mean and distribution based approaches to determine the length of interval. Huarng and Yu [19] suggested using a dynamic interval length, which is increased due to a ratio value, instead of a static one. Yolcu et al. [36] improved the ratio based method proposed by Huarng and Yu [19] by using optimization to determine the ratio value. Later on, the idea of dynamic length of interval has been also used in other studies in the fuzzy time series literature. Davari et al. [11], Kuo et al. [22,23], Park et al. [28], Hsu et al. [16], Fu et al. [15], and Huang et al. [17] utilized particle swarm optimization technique to determine the dynamic length of interval. Lee et al. [24,25] also utilized genetic algorithm for the same purpose. Another way for fuzzification is to employ a clustering method. Cheng et al. [9] and Li et al. [26] used the fuzzy c-means clustering method in the fuzzification phase. While hierarchical clustering algorithms which are non-fuzzy are employed in Chen and Tanuwijaya [8], and Bang and Lee [4], Gustafson–Kessel fuzzy clustering method is used utilized in Egrioglu et al. [14] for fuzzification.
3292
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
In the phase of defuzzification, feed forward neural networks are employed by Song and Chissom [33]. Chen [6], Huarng [18], and Huarng and Yu [19] used centroid method for defuzzification. Cheng et al. [10] and Aladag et al. [2] preferred to use adaptive expectation method in the defuzzification process. In time invariant fuzzy time series, fuzzy logic relationship can be expressed by only one fuzzy logic relation matrix. Sullivan and Woodall [34] used transition matrices based on Markov chain instead of using fuzzy logic relation matrix. Chen [6] proposed an approach that makes the phase of determination of fuzzy relations easier. In the method proposed by Chen [6], instead of using fuzzy logic relation matrix, fuzzy logic group relationships tables are used to establish fuzzy logic relationships. Also, fuzzy logic group relationships tables have been used in many studies such as Huarng [18], Yu [38], Huarng and Yu [19], Cheng et al. [10], and Egrioglu et al. [14]. Huarng and Yu [20] suggested a method in which feed forward neural networks are used to determine fuzzy relations. A high order fuzzy time series forecasting method in which feed forward neural networks are employed to establish fuzzy relations was proposed by Aladag et al. [1]. In Aladag et al. [3], Elman recurrent neural networks were also used to determine fuzzy relations. Yu and Huarng [39], and Yolcu et al. [37] proposed a different approach in which membership function values are employ to use feed forward neural networks in the phase of determination of fuzzy relations. In the analysis of time invariant fuzzy time series, the phase of determination of fuzzy logic relationships has important impact on forecasting performance. By establishing fuzzy logic relations, Song and Chissom [31] obtained a relationship matrix consists of these fuzzy logic relations. Obtaining a relationship matrix requires complex operations. Thus, Chen [6] proposed to use fuzzy logic group relationships tables in the phase of determination of fuzzy logic relationships differently from the method proposed by Song and Chissom [31]. Instead of complex matrix operations, fuzzy logic group relationships tables have been generally preferred in the literature to establish fuzzy relations. However, when fuzzy logic group relationships tables are used, membership values of fuzzy sets are ignored and in defiance of fuzzy set theory, fuzzy sets’ elements whose membership value is 1 are only taken into account. This situation causes information loss and decrease in the explanation power of the model. To overcome these problems, particle swarm optimization method is used to calculate membership values in the fuzzy relationship matrix in the time invariant fuzzy time series approach proposed in this study. The method suggested in this study is the first method proposed in the literature in which particle swarm optimization algorithm is used to determine fuzzy relations. In addition to this, the fuzzy c-means clustering method is employed for fuzzification in the proposed method. The decision of the number of intervals, arbitrary determination of interval length, and arbitrary choice of degree of membership are some problems arise in the fuzzification phase. In order to overcome these problems, the fuzzy c-means clustering method is employed in the proposed method. Therefore, the proposed time invariant fuzzy time series forecasting approach works in a systematic way and more accurate forecasts can be obtained when the proposed model is employed. To show the performance of the proposed method, it is applied to three data sets which are well known in the fuzzy time series literature. The enrollment data of University of Alabama, Index 100 in stocks and bonds exchange market of I˙ stanbul, and TAIFEX (Taiwan Futures Exchange) data are employed in the implementation. The results obtained from the proposed method are compared to those produced by other fuzzy time series forecasting approaches available in the literature. Basic definitions of fuzzy time series are given in the next section. The fuzzy c-means clustering and particle swarm optimization methods are briefly presented in Sections 3 and 4, respectively.
Section 5 introduces the proposed method. The implementation is given in Section 6. Finally, the last section concludes the paper.
2. Preliminaries on fuzzy time series The fuzzy time series was firstly defined by Song and Chissom [31]. The basic definitions of fuzzy time series, and time variant and time invariant fuzzy time series definitions are given below. Definition 1. Let Y(t) (t = . . ., 0, 1, 2, . . .), a subset of real numbers, be the universe of discourse on which fuzzy sets fj (t) are defined. If F(t) is a collection of f1 (t), f2 (t), . . . then F(t) is called a fuzzy time series defined on Y(t). Definition 2. Suppose F(t) is caused by F(t − 1) only, i.e., F(t − 1) → F(t). Then this relation can be expressed as F(t) = F(t − 1) ◦ R(t, t − 1) where R(t, t − 1) is the fuzzy relationship between F(t − 1) and F(t), and F(t) = F(t − 1) ◦ R(t, t − 1) is called the first order model of F(t). “◦” represents max–min composition of fuzzy sets. Definition 3. Suppose R(t, t − 1) is a first order model of F(t). If for any t, R(t, t − 1) is independent of t, i.e., for any t, R(t, t − 1) = R(t − 1, t − 2), then F(t) is called a time invariant fuzzy time series otherwise it is called a time variant fuzzy time series. Song and Chissom [30] firstly introduced an algorithm based on the first order model for forecasting time invariant F(t). In [30], the fuzzy relationship matrix R(t, t − 1) = R is obtained by many matrix operations. The fuzzy forecasts are obtained based on max–min composition as below: F(t) = F(t − 1) ◦ R
(1)
The dimension of R matrix depends on the number of fuzzy sets. The number of fuzzy sets equals to the number of intervals that compose of universe of discourse. The more fuzzy sets are used, the more matrix operations are needed for obtain R matrix. When the number of fuzzy set is high, using the method proposed by Song and Chissom [32] considerably increases the computational cost.
3. The fuzzy c-means clustering method In the method proposed by Song and Chissom [31], partition of universe of discourse method is used in the fuzzification phase. However, there are several problems related to the decomposition of universe of discourse. These problems are that determination of the number of intervals, arbitrarily choice of interval length and membership degrees. In order to deal with these problems, Cheng et al. [9] and Li et al. [26] used fuzzy c-means clustering method for fuzzification. The fuzzy c-means clustering method was firstly introduced by Bezdek [5]. This clustering method is the most widely used clustering algorithm. In this method, fuzzy clustering is conducted by minimizing the least squared errors within groups. Let uij be the membership values, vi be the center of cluster, n be the number of variables, and c be the number of clusters. Then the objective function, which is tried to be minimized in fuzzy clustering, is
Jˇ (X, V, U) =
n c
ˇ
uij d2 (xj , vi )
(2)
i=1 j=1
where ˇ is a constant (ˇ > 1) and called the fuzzy index. d(xj , vi ) is a similarity measure between an observation and the center of
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
corresponding fuzzy cluster. The objective function Jˇ is minimized subject to constraints given below. 0 ≤ uij ≤ 1, 0< c
n
uij ≤ n,
∀ i, j
∀j
In fuzzy c-means clustering method, to solve the minimization problem given above, an iterative algorithm is used. In each iteration, the values of vi and uij are updated by using the formulas given in (3) and (4), respectively.
n
ˇ u x j=1 ij j ˇ u j=1 ij
vi = n
c k=1
(3) 1
(d(xj , vi )/d(xj , vk ))
2/(ˇ−1)
Particle swarm optimization, which is a population based heuristic algorithm, was firstly proposed by Kennedy and Eberhart [21]. Distinguishing feature of this heuristic algorithm is that it simultaneously examines different points in different regions of the solution space to find the global optimum solution. Local optimum traps can be avoided because of this feature. In a few fuzzy time series studies, particle swarm optimization method has been exploited in fuzzification phase. While the particle swarm optimization method was employed by Davari et al. [11] for fuzzification in the first order fuzzy time series forecasting model, Kuo et al. [23] utilized the method in high order models. In the fuzzification phase, Kuo et al. [22] utilized the particle swarm optimization method in both the first and the high order models. Park et al. [28] used same method for fuzzification in a two factor high order model. However, the particle swarm optimization method has never been used to establish fuzzy logic relations in the literature. In time invariant fuzzy time series forecasting method proposed in this study, the modified particle swarm optimization whose algorithm given below is exploited. In the literature, it was shown that using some time varying parameters can increase the convergence speed of the algorithm [27,29]. Ma et al. [27] employed time varying acceleration coefficient in standard particle swarm optimization method. In another study, Shi and Eberhart [29] used time varying inertia weight. In the modified particle swarm optimization, these time varying constituents are used together. This is the only difference between standard and modified particle swarm optimization methods. Algorithm 1 (The modified particle swarm optimization). Step 1. Positions of each kth (k = 1, 2, . . ., pn) particles’ positions are randomly determined and kept in a vector Xk given as follows: k = 1, 2, . . . , pn
(5)
where xik (i = 1, 2, . . ., d) represents ith position of kth particle. pn and d represents the number of particles in a swarm and positions, respectively. Step 2. Velocities are randomly determined and stored in a vector Vk given below. Vk = {vk,1 , vk,2 , . . . , vk,d },
k = 1, 2, . . . , pn
(6)
(7) (8)
where Pbestk is a vector stores the positions corresponding to the kth particle’s best individual performance, and Gbest represents the best particle, which has the best evaluation function value, found so far. Step 4. Let c1 and c2 represents cognitive and social coefficients, respectively, and w is the inertia parameter. Let (c1i , c1f ), (c2i , c2f ), and (w1 , w2 ) be the intervals which includes possible values for c1 , c2 and w, respectively. At each iteration, these parameters are calculated by using the formulas given in (9)–(11). c1 = (c1f − c1i )
t + c1i maxt
(9)
c2 = (c2f − c2i )
t + c2i maxt
(10)
w = (w2 − w1 )
maxt − t + w1 maxt
(11)
(4)
4. The modified particle swarm optimization
Xk = {xk,1 , xk,2 , . . . , xk,d },
k = 1, 2, . . . , pn
Gbest = (pg,1 , pg,2 , . . . , pg,d )
∀i
i=1
uij =
Step 3. According to the evaluation function, Pbest and Gbest particles given in (7) and (8), respectively, are determined. Pbestk = (pk,1 , pk,2 , . . . , pk,d ),
j=1
uij = 1,
3293
where maxt and t represent maximum iteration number and current iteration number, respectively. Step 5. Values of velocities and positions are updated by using the formulas given in (12) and (13), respectively.
vt+1 = [w × vt+1 + c1 × rand1 × (pi,d − xi,d ) i,d i,d + c2 × rand2 × (pg,d − xi,d )]
t+1 xi,d = xi,d + vt+1 i,d
(12)
(13)
where rand1 and rand2 are random values from the interval [0 1]. Step 6. Steps 3–5 are repeated until a predetermined maximum iteration number (maxt) is reached. 5. The proposed method In this study, we focused on forecasting time invariant fuzzy time series. A novel first order time invariant fuzzy time series forecasting approach in which artificial intelligent techniques such as particle swarm optimization and fuzzy c-means clustering methods are utilized for determination of fuzzy relations and fuzzification, respectively, is proposed. In the fuzzification phase of the fuzzy time series approach, there are some common problems such as the decision of the number of intervals, arbitrary determination of interval length, and arbitrary choice of degree of membership. In order to deal with these problems, fuzzy c-means clustering method is exploited for fuzzification in the proposed approach. By using this clustering method, center values of fuzzy sets, and the membership values of observations in these fuzzy sets are computed. Some fuzzy time series approaches in which fuzzy logic group relationship tables are used disregards the fuzzy set theory since fuzzy sets’ elements whose membership value is 1 are only taken into account in the fuzzification phase. Thus, information loss occurs and it is expected to decrease the explanation power of the model. In order to overcome these problems, the particle swarm optimization method is employed in the proposed approach to define fuzzy relations. Since it is not need to perform complex matrix operations when the particle swarm optimization method is used, it is expected that the computational cost of the proposed approach is reasonable. The proposed method has some important advantages which can be summarized as follows:
3294
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
• In the proposed approach, membership values of observations are employed when fuzzy relations are defined. Therefore, information loss, and decrease in explanatory power of the model are prevented. • The number of intervals, the interval length, and the degrees of memberships are not arbitrarily determined in the fuzzification phase so the proposed approach is a systematic method. • As a result of the advantages of the proposed method given above, it is expected that the method has high forecasting accuracy. • The proposed method is the first method proposed in the literature in which particle swarm optimization algorithm is used to define fuzzy relations. The algorithm of the proposed method is given below step by step. Algorithm 2 (The proposed approach). Step 1. Fuzzify observations of time series by using fuzzy c-means clustering method. Let c be the number of fuzzy sets, (2 ≤ c ≤ n). The fuzzy c-means clustering algorithm c is applied to the time series consists of crisp values. Then, after the center of each fuzzy set is determined, the degrees for each observation, which denote a degree of belonging to a fuzzy set for that observation, are calculated with respect to the obtained center values of fuzzy sets. Finally, ordered fuzzy sets Lr (r = 1, 2, . . ., c) are obtained according to the ascending ordered centers, which are denoted by vr (r = 1, 2, . . ., c). Step 2. Determine the parameters of the modified particle swarm optimization. The parameters of the modified particle swarm optimization which are pn, c1i , c1f , c2i , c2f , w1 , and w2 that were given in the previous section are determined. Root mean square error (RMSE) given in (14) is used as evaluation function.
n 1 2 RMSE = (yt − yˆ t )
(14)
n
t=1
where yt , and yˆ t , n represent crisp time series, defuzzified forecasts, and the number of forecasts, respectively. Step 3. Generate a random initial population. Each swarm consists of particles whose elements are positions. The number of elements in a particle equals to square of the number of fuzzy sets c. Each particle represents a fuzzy relation matrix R (R = [rij ], i, j = 1, 2, . . ., c). Thus, the elements of R are positions of a particle. For the number of fuzzy sets c, representation of a particle is given in Fig. 1. In this step, rij (i, j = 1, 2, . . ., c) values of all particles are randomly generated from the interval [0, 1] to generate a random initial population. Step 4. Calculate the evaluation function values of all particles in the current swarm. The method for calculating RMSE for any particle is given in Steps 4.1–4.3. Step 4.1. Calculate fuzzy forecasts by using Eq. (1). Fuzzy forecasts are computed by using fuzzy observations calculated in Step 1 and a fuzzy relation matrix R. For instance, for a time t, let (t − 1)th fuzzy observation and fuzzy relation matrix R be as follows:
⎡
1
⎢0 ⎢ F(t − 1) = [ 1 0.5 0.3 0 0 ], R = ⎢ ⎢0 ⎣0
1
0.5
0
0
0
1
0
⎤
F(t) = F(t − 1) ◦ R = [ 1 0.5
= [1
0.5 0.5
0.3
0
⎢0 ⎢
0
1
0
⎣0
0
0
0.5
0
0
0
0
0
0
0]◦⎢ ⎢0
0
⎤
0⎥
⎥
0⎥ ⎥ 0⎦ 0
0]
Determining the proper number of clusters is a vital issue in clustering. In a clustering process, objective function of this process is tried to be optimized. Fuzzy-c means clustering is a method utilized in the fuzzification phase of the proposed approach. The main aim of the proposed method is to obtain accurate forecasts. Therefore, in the proposed fuzzy time series forecasting approach, to minimize forecasting error is more important than to optimize the objective function of clustering. The best cluster number determined for successful clustering cannot guarantee the minimum forecasting error so it would be wiser to determine the number of clusters in the proposed approach according to forecasting accuracy. Therefore, the number of clusters is determined in the proposed method by using trial and error method and the cluster number which leads to minimum forecasting error is selected as the best one for the related data. 6. The implementation Three different data sets are employed to evaluate the performance of the proposed approach and the results obtained from the proposed method are compared to those produced by other approaches. For the enrollment data one of all data sets, comparison is made over the training set like in other studies available in the literature. When the other data sets are used, comparison is performed over the test sets. In the comparison, root mean square error (RMSE) is being calculated for the training sets while RMSE, mean absolute percentage error (MAPE) given in (15), and direction accuracy (DA) given in (16) are being calculated for the test sets.
0
0
0
0
Step 4.2. Defuzzify the fuzzy forecasts. • If the membership values of the fuzzy forecast have only one maximum, then take the center value of this set as the defuzzified forecasted value. • If membership values of fuzzy forecast have two or more consecutive maximums, then select arithmetic mean of centers of corresponding clusters as the defuzzified forecasted value. • Otherwise, standardize the fuzzy output and use the center of the fuzzy sets as the forecasted value. Step 4.3. Calculate RMSE values for all particles using (14). Step 5. According to RMSE, Pbest and Gbest particles given in (7) and (8), respectively, are determined. Step 6. Update cognitive coefficient c1 , social coefficient c2 , and the inertia parameter w at each iteration by using the formulas (9)–(11), respectively. Step 7. New positions of the particles are calculated by using the formulas given in (12) and (13). Step 8. Repeat Steps 4–8 until maximum iteration bound (maxt) is reached.
1 DA = at , n−1
0
0.3
1 0.5
1
0⎥
0
0
⎡
1
yt − yˆ t
MAPE =
yt × 100 n
0
⎥ 0 0.5 0 ⎥ ⎥ 0 0 0⎦
0
Thus, the fuzzy forecast F (t) is calculated by using the formula given in (1) as follows:
n
t=1
n−1
t=1
at =
(15)
1,
(yt+1 − yt )(ˆyt+1 − yt ) > 0
0,
otherwise
(16)
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
3295
Fig. 1. The structure of a particle.
Table 1 The enrollment data. Years
Actual
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981
Years
13,055 13,563 13,867 14,696 15,460 15,311 15,603 15,861 16,807 16,919 16,388
Actual
1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992
15,433 15,497 15,145 15,163 15,984 16,859 18,150 18,970 19,328 19,337 18,876
The algorithm of the proposed method is coded in MATLAB version 7.9. In the literature, there are no general rules to determine parameter values of PSO. Parameter values for PSO have been generally specified intuitively due to the data in most of the applications. Therefore, the parameters of PSO used in this study were intuitively determined like in other studies available in the literature. In the applications, the parameters of the modified particle swarm optimization for each data set are determined as follows: (c1i , c1f ) = (1, 2), (c2i , c2f ) = (1, 2), (w1 , w2 ) = (0.4, 0.9), pn = 30, and maxt = 100. When the proposed method was applied to time series, the number of fuzzy set was chosen as 7 (c = 7) for all data sets. The selection of the number of fuzzy set was performed as described in the previous section in which the proposed approach is introduced. For all data sets, the values from 5 to 10 were examined and the best one which produces the best forecasts was chosen. 6.1. The enrollment data of University of Alabama Firstly, the proposed method is applied to the enrollment data of University of Alabama whose yearly observations are between 1971 and 1992. The enrollment data is given in Table 1. The center values of fuzzy sets and the membership values obtained from fuzzy c-means clustering algorithm are presented in Tables 2 and 3, respectively. The optimal R matrix obtained from the methods is given below. The fuzzy and defuzzified forecasts of proposed method are given in Table 4.
1.0000
1.0000
1.0000
R = 0.0000
0.7788
0.0000
0.0000
0.0000
0.8126
0.0000
0.0328
0.9965 0.5310 0.7225
0.0000
1.0000
1.0000
0.0000
1.0000
0.0000
0.0000
0.0145
0.0000
0.2108
1.0000
0.0000
1.0000
0.9426
0.9420
0.0013
1.0000
0.0000
0.0000
0.0000
0.0001
0.0000
0.0000
0.7366
0.0000
0.0000
0.0000
0.4649
Fig. 2. The data set 1.
6.2. Index 100 in stocks and bonds exchange market of I˙ stanbul The second time series is index 100 in stocks and bonds exchange market of I˙ stanbul (IMKB). Two different data sets for IMKB time series are used to compare the results obtained from the proposed method to ones produced by other methods. Data sets 1 and 2 include observations between 01.10.2009–31.12.2009 and 01.10.2010–23.12.2010, respectively. Graphs of data sets 1 and 2 are shown in Figs. 2 and 3, respectively. In Figs. 2 and 3, vertical and horizontal axes represent observation values and the date, respectively. As mentioned before, the forecasting performance of the proposed method is evaluated for this data by using test sets which includes the last 7 observations of data sets. The proposed approach is based on first order fuzzy time series forecasting model. The forecasts calculated from the proposed approach are compared to the other methods introduced in [32,18,19,10,6]. In [6], interval lengths between 200 and 1000 with increment 100. The interval length in the methods given in [18,19] was determined when the method was progressing. The number of fuzzy sets was experienced between 5 and 15 in the proposed method and the paper [32,10]. After practicing, the forecasts obtained from the case where the best result was obtained for the test data and the error criteria related to those forecasts are presented in Tables 6 and 7.
0.0000 0.0000
0.0000
0.0000
1.0000
0.8187 0.0000
The mean square error (MSE) value produced by the proposed method and MSE values obtained from the methods proposed by Song and Chissom [32], Sullivan and Woodall [34], Chen [6], Tsaur et al. [35], Singh [30], Cheng et al. [9], Cheng et al. [10] are presented in Table 5. The proposed time invariant fuzzy time series forecasting model is a first order model so the other methods used in the comparison are also first order models. When the Table 5 is examined it is clearly seen that the proposed method gives the most accurate forecasts in terms of MSE for the enrollment data.
Fig. 3. The data set 2.
3296
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
Table 2 The center values of fuzzy sets. Centers of clusters
v1
v2
v3
v4
v5
v6
v7
13,480.38
14,998.82
15,454.55
15,965.03
16,837.83
18,161.54
19,144.40
Table 3 The membership values. Years
Cluster 1
Cluster 2
Cluster 3
Cluster 4
Cluster 5
Cluster 6
Cluster 7
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992
0.88877 0.99248 0.80622 0.04735 0.00001 0.00481 0.00390 0.00174 0.00009 0.00055 0.00927 0.00012 0.00044 0.00605 0.00688 0.00006 0.00004 0.00001 0.00095 0.00095 0.00104 0.00210
0.04256 0.00329 0.09407 0.76300 0.00014 0.16538 0.04818 0.01328 0.00029 0.00175 0.04059 0.00245 0.00714 0.78516 0.72315 0.00037 0.00013 0.00001 0.00182 0.00173 0.00189 0.00406
0.02793 0.00189 0.04782 0.12160 0.99971 0.78213 0.79811 0.05976 0.00052 0.00302 0.08991 0.99546 0.98298 0.17509 0.22932 0.00128 0.00023 0.00002 0.00232 0.00216 0.00236 0.00521
0.01899 0.00117 0.02738 0.04345 0.00012 0.03768 0.13419 0.91209 0.00134 0.00711 0.43788 0.00163 0.00809 0.02495 0.03030 0.99769 0.00056 0.00003 0.00317 0.00287 0.00313 0.00720
0.01124 0.00063 0.01365 0.01525 0.00002 0.00691 0.01153 0.01035 0.99708 0.98207 0.38714 0.00023 0.00099 0.00585 0.00695 0.00049 0.99870 0.00008 0.00630 0.00524 0.00570 0.01469
0.00617 0.00032 0.00653 0.00583 0.00000 0.00198 0.00269 0.00187 0.00052 0.00419 0.02490 0.00006 0.00025 0.00184 0.00217 0.00008 0.00026 0.99972 0.04382 0.02386 0.02577 0.11956
0.00434 0.00022 0.00433 0.00354 0.00000 0.00110 0.00140 0.00092 0.00017 0.00131 0.01031 0.00003 0.00013 0.00105 0.00123 0.00004 0.00009 0.00013 0.94162 0.96319 0.96010 0.84718
Table 4 The forecasts produced by the proposed method. Years
Fuzzy forecasts
1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992
0.88877 0.99248 0.80622 0.76300 0.99971 0.78213 0.79811 0.05976 0.77879 0.77879 0.38714 0.99546 0.98298 0.78516 0.72315 0.00128 0.77879 0.00008 0.00630 0.00524 0.00570
Defuzzified forecasts 0.03282 0.00329 0.04782 0.12160 0.99971 0.78213 0.79811 0.05976 0.94260 0.94260 0.38714 0.99546 0.98298 0.17509 0.22932 0.00128 0.94260 0.00013 0.73658 0.73658 0.73658
0.81262 0.81262 0.80622 0.76300 0.99971 0.78213 0.79811 0.21077 0.94202 0.94202 0.38714 0.99546 0.98298 0.78516 0.72315 0.21077 0.94202 0.00008 0.00630 0.00524 0.00570
Table 5 The comparison of the obtained results. Methods Song and Chissom [32] Sullivan and Woodall [34] Chen [6] Tsaur et al. [35] Singh [30] Cheng et al. [9] Cheng et al. [10] The proposed method
0.04256 0.00329 0.09407 0.53098 0.00014 0.16538 0.13419 0.91209 0.00134 0.00711 0.43788 0.00245 0.00809 0.53098 0.53098 0.99769 0.00125 0.00008 0.00317 0.00287 0.00313
0.04256 0.00329 0.09407 0.72248 0.00014 0.16538 0.04818 0.01328 0.99708 0.98207 0.38714 0.00245 0.00714 0.72248 0.72248 0.00049 0.99870 0.00008 0.00630 0.00524 0.00570
0.02793 0.01448 0.04782 0.12160 0.99971 0.78213 0.79811 0.91209 0.00134 0.00711 0.43788 0.99546 0.98298 0.17509 0.22932 0.99769 0.00056 0.00013 0.46493 0.46493 0.46493
0.00617 0.00032 0.00653 0.00583 0.00000 0.00198 0.00269 0.00187 0.00052 0.00419 0.02490 0.00006 0.00025 0.00184 0.00217 0.00008 0.00026 0.99972 0.81866 0.81866 0.81866
13,480.38 13,480.38 14,780.95 15,474.17 15,523.89 15,609.76 15,562.98 16,751.87 16,837.83 16,837.83 15,901.87 15,524.96 15,527.33 15,492.78 15,570.69 16,906.56 16,837.83 19,144.40 19,144.40 19,144.40 19,144.40
The best results given in Table 3 are obtained when MSE 412,499 386,055 407,507 134,923 133,700 228,918 192,086 46,422
• The method proposed by Song and Chissom [32] is applied with 9 fuzzy sets. • The interval length is 1300 for the method of Chen [6]. • The interval length is 800 for the distribution based method [18]. • The interval length is 200 for the average based method [18]. • The ratio sample percentile is 0.50 for the ratio based method [19]. • The number of fuzzy sets is 15 for the method of Cheng et al. [10].
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
3297
Table 6 The obtained results for data set 1. Date
IMKB
[32]
[6]
[18] a
[18] b
[19]
[10]
[37]
The proposed method
23.12.2009 24.12.2009 25.12.2009 28.12.2009 29.12.2009 30.12.2009 31.12.2009
51,162 51,461 51,661 51,619 51,786 51,668 52,825
51,137 51,137 51,137 51,137 51,137 51,137 51,137
52,150 50,850 50,850 52,150 52,150 52,150 52,150
51,900 50,700 50,700 51,900 51,900 51,900 51,900
51,573 50,373 51,240 51,573 51,573 51,773 51,573
51,033 51,033 51,033 51,033 51,033 52,004 51,033
50,872 50,763 50,763 50,763 50,763 50,763 50,763
51,317 51,317 51,317 51,317 51,317 51,317 51,317
51,682.64 51,682.64 51,682.64 51,682.64 51,682.64 51,682.64 51,682.64
771 1.16% 33.33%
667 1.23% 33.33%
660 1.11% 33.33%
671 0.97% 33.33%
830 1.28% 16.67%
1084 1.85% 33.33%
640 0.90% 50.00%
484 0.57% 83.33%
The proposed method
RMSE MAPE DA a b
Distribution based method. Average based method.
Table 7 The obtained results for data set 2. Date
IMKB
[32]
[6]
[18] a
[18] b
[19]
[10]
[37]
15.12.2010 16.12.2010 17.12.2010 20.12.2010 21.12.2010 22.12.2010 23.12.2010
65,499 64,429 63,524 63,502 64,820 65,440 66,219
65,355 65,355 65,974 64,736 64,736 65,974 65,355
65,500 65,500 65,500 64,950 64,950 65,500 65,500
66,167 65,500 66,000 63,500 63,500 66,000 65,500
66,500 66,300 64,500 63,500 63,500 65,500 66,300
67,254 66,035 65,435 63,668 63,668 66,038 66,035
65,992 65,992 65,992 65,992 65,992 65,992 65,992
65,999 64,813 64,864 64,871 64,858 65,522 64,813
1161 1.39% 50.00%
1048 1.20% 50.00%
1213 1.51% 50.00%
1015 1.17% 50.00%
1257 1.63% 50.00%
1545 2.00% 50.00%
930 1.13% 50.00%
RMSE MAPE DA a b
66,177.15 65,332.19 64,841.98 64,841.98 64,841.98 64,841.98 66,397.62 862 1.12% 66.67%
Distribution based method. Average based method.
• The number of fuzzy sets is 13 and the number of the neurons in the hidden layer is 7 for the method of Yolcu et al. [37].
The best results are calculated
• The number of fuzzy sets is 7 and the number of the neurons in the hidden layer is 6 for the method of Yolcu et al. [37].
6.3. TAIFEX data
• When Song and Chissom [32] is applied with 9 fuzzy sets. • For the method of Chen [6] with the interval length 1100. • For the distribution based method [18] with the interval length 1000. • For the average based method [18] with the interval length 200. • For the ratio based method [19] with the ratio sample percentile 0.50. • When the number of fuzzy sets is 9 for the method of Cheng et al. [10].
Finally, the proposed forecasting approach is applied to TAIFEX data presented in Table 8. The time series has 47 daily observations between 03.08.1998 and 30.09.1998. The last 16 observations between 10.09.1998 and 30.09.1998 are used for test set. The forecasting performance of the proposed method is evaluated over the test set. For the proposed method, same values of parameters used for other time series are employed. The time series is also forecasted by using approaches introduced in [24,25,16]. Then, the forecasts obtained from all methods are compared
Table 8 TAIFEX data. Date
TAIFEX
Date
TAIFEX
Date
TAIFEX
03.08.1998 04.08.1998 05.08.1998 06.08.1998 07.08.1998 10.08.1998 11.08.1998 12.08.1998 13.08.1998 14.08.1998 15.08.1998 17.08.1998 18.08.1998 19.08.1998 20.08.1998 21.08.1998
7552.00 7560.00 7487.00 7462.00 7515.00 7365.00 7360.00 7330.00 7291.00 7320.00 7320.00 7219.00 7220.00 7285.00 7274.00 7225.00
24.08.1998 25.08.1998 26.08.1998 27.08.1998 28.08.1998 29.08.1998 31.08.1998 01.09.1998 02.09.1998 03.09.1998 04.09.1998 05.09.1998 07.09.1998 08.09.1998 09.09.1998 10.09.1998
6955.00 6949.00 6790.00 6835.00 6695.00 6728.00 6566.00 6409.00 6430.00 6200.00 6403.20 6697.50 6722.30 6859.40 6769.60 6709.75
11.09.1998 14.09.1998 15.09.1998 16.09.1998 17.09.1998 18.09.1998 19.09.1998 21.09.1998 22.09.1998 23.09.1998 24.09.1998 25.09.1998 28.09.1998 29.09.1998 30.09.1998
6726.50 6774.55 6762.00 6952.75 6906.00 6842.00 7039.00 6861.00 6926.00 6852.00 6890.00 6871.00 6840.00 6806.00 6787.00
3298
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299
Table 9 The obtained results for TAIFEX data. Date
TAIFEX
[24]
[25]
[16]
The proposed method
10.09.1998 11.09.1998 14.09.1998 15.09.1998 16.09.1998 17.09.1998 18.09.1998 19.09.1998 21.09.1998 22.09.1998 23.09.1998 24.09.1998 25.09.1998 28.09.1998 29.09.1998 30.09.1998
6709.75 6726.50 6774.55 6762.00 6952.75 6906.00 6842.00 7039.00 6861.00 6926.00 6852.00 6890.00 6871.00 6840.00 6806.00 6787.00
6621.43 6677.48 6709.63 6732.02 6753.38 6756.02 6804.26 6842.04 6839.01 6897.33 6896.83 6919.27 6903.36 6895.95 6879.31 6878.34
6917.40 6852.23 6805.71 6762.37 6793.06 6784.40 6970.74 6977.22 6874.46 7126.05 6862.49 6944.36 6831.88 6843.24 6858.45 6825.64
6745.45 6757.89 6731.76 6722.54 6753.72 6761.54 6857.27 6898.97 6853.07 6951.95 6896.84 6919.94 6884.99 6894.10 6866.17 6865.06
6778.28 6778.28 6778.28 6778.28 6778.28 6856.52 6925.15 6856.52 6856.52 6856.52 6856.52 6856.52 6856.52 6856.52 6856.52 6778.28
94 1.09% 53.33%
103 1.14% 80.00%
80 0.87% 73.33%
75 0.75% 73.33%
RMSE MAPE DA
with each other and the all obtained results are summarized in Table 9. According to Table 9, it is clear that the proposed method produces the best results in terms of all three criteria. As a result of all comparisons, it can be concluded that the proposed method gives the most accurate forecasts for all time series.
the comparison, it is observed that the most accurate forecasts are obtained when the proposed fuzzy time series forecasting approach is used. Acknowledgement This work is supported by the Scientific and Technological Research Council of Turkey (TUBITAK), under grant 210T150.
7. Conclusion and discussion In this study, a new time invariant fuzzy time series forecasting approach that exploits advanced techniques such as particle swarm optimization and fuzzy c-means clustering methods to determine fuzzy relations and to fuzzify observations, respectively. Instead of complex matrix operations, fuzzy logic group relationships tables have been generally preferred in the literature to define fuzzy relations. However, such methods that utilize fuzzy logic group relationship tables disregard the fuzzy set theory since only some elements of fuzzy sets are taken into account in the fuzzification phase. Thus, information loss occurs and it is expected to decrease the explanation power of the model. To overcome these problems, in the proposed method, particle swarm optimization method is used to calculate membership values in the fuzzy relationship matrix. It is also expected that the computational cost of the proposed method is reasonable since the proposed approach in which particle swarm optimization is employed does not require complex matrix operations. In the fuzzification phase of the fuzzy time series approach, there are also some common problems such as the decision of the number of intervals, arbitrary determination of interval length, and arbitrary choice of degrees of membership. In order to overcome these problems, the fuzzy c-means clustering method is employed in the proposed method. Therefore, the proposed approach works in a systematic way. And, because of the advantages mentioned before, it is expected that the proposed method has high forecasting accuracy. Also, the proposed method is the first method proposed in the literature in which particle swarm optimization algorithm is used to define fuzzy relations. In order to show the forecasting performance of the proposed method based on first order fuzzy time series forecasting model, it is applied to the three well-known time series. For the comparison, these time series are also forecasted by using other fuzzy time series approaches which are also first order methods. The forecasts obtained from the proposed approach are compared to those produced by other methods available in the literature. As a result of
References [1] C.H. Aladag, M.A. Basaran, E. Egrioglu, U. Yolcu, V.R. Uslu, Forecasting in high order fuzzy time series by using neural networks to define fuzzy relations, Expert Systems with Applications 36 (2009) 4228–4231. [2] C.H. Aladag, U. Yolcu, E. Egrioglu, A high order fuzzy time series forecasting model based on adaptive expectation and artificial neural networks, Mathematics and Computers in Simulation 81 (2010) 875–882. [3] C.H. Aladag, E. Egrioglu, S. Gunay, U. Yolcu, High order fuzzy time series forecasting model and its application to IMKB, Anadolu University Journal of Science and Technology 11 (2) (2010) 95–101. [4] Y.K. Bang, C.H. Lee, Fuzzy time series prediction using hierarchical clustering algorithms, Expert Systems with Applications 38 (2011) 4312–4325. [5] J.C. Bezdek, Pattern Recognition with Fuzzy Objective Function Algorithms, Plenum Press, NY, 1981. [6] S.M. Chen, Forecasting enrollments based on fuzzy time-series, Fuzzy Sets and Systems 81 (1996) 311–319. [7] S.M. Chen, Forecasting enrollments based on high order fuzzy time series, Cybernetics and Systems 33 (2002) 1–16. [8] S.M. Chen, K. Tanuwijaya, Multivariate fuzzy forecasting based on fuzzy time series and automatic clustering techniques, Expert Systems with Applications 38 (2011) 10594–10605. [9] C.H. Cheng, T.L. Chen, H.J. Teoh, C.H. Chiang, Fuzzy time series based on adaptive expectation model for TAIEX forecasting, Expert Systems with Applications 34 (2008) 1126–1132. [10] C.H. Cheng, G.W. Cheng, J.W. Wang, Multi-attribute fuzzy time series method based on fuzzy clustering, Expert Systems with Applications 34 (2008) 1235–1242. [11] S. Davari, M.H.F. Zarandi, I.B. Turksen, An improved fuzzy time series forecasting model based on particle swarm intervalization, in: The 28th North American Fuzzy Information Processing Society Annual Conferences (NAFIPS 2009), Cincinnati, Ohio, USA, June 14–17, 2009. [12] E. Egrioglu, C.H. Aladag, U. Yolcu, V.R. Uslu, M.A. Basaran, Finding an optimal interval length in high order fuzzy time series, Expert Systems with Applications 37 (2010) 5052–5055. [13] E. Egrioglu, C.H. Aladag, M.A. Basaran, V.R. Uslu, U. Yolcu, A new approach based on the optimization of the length of intervals in fuzzy time series, Journal of Intelligent and Fuzzy Systems 22 (2011) 15–19. [14] E. Egrioglu, C.H. Aladag, U. Yolcu, V.R. Uslu, N.A. Erilli, Fuzzy time series forecasting method based on Gustafson–Kessel fuzzy clustering, Expert Systems with Applications 38 (2011) 10355–10357. [15] F.P. Fu, K. Chi, W.G. Che, Q.J. Zhao, High-order difference heuristic model of fuzzy time series based on particle swarm optimization and information entropy for stock markets, in: International Conference on Computer Design and Applications, 2010.
C.H. Aladag et al. / Applied Soft Computing 12 (2012) 3291–3299 [16] L.Y. Hsu, S.J. Horng, T.W. Kao, Y.H. Chen, R.S. Run, R.J. Chen, J.L. Lai, I.H. Kuo, Temperature prediction and TAIFEX forecasting based on fuzzy relationships and MTPSO techniques, Expert Systems with Application 37 (2010) 2756–2770. [17] Y.L. Huang, S.J. Horng, T.W. Kao, R.S. Run, J.L. Lai, R.J. Chen, I.H. Kuo, M.K. Khan, An improved forecasting model based on the weighted fuzzy relationship matrix combined with a PSO adaptation for enrollments, International Journal of Innovative Computing, Information and Control 7 (7) (2011) 4027–4046. [18] K. Huarng, Effective length of intervals to improve forecasting in fuzzy time series, Fuzzy Sets and Systems 123 (2001) 387–394. [19] K. Huarng, T.H.K. Yu, Ratio-based lengths of intervals to improve fuzyy time series forecasting, IEEE Transactions on Systems, Man, and Cybernetics-Part B: Cybernetics 36 (2006) 328–340. [20] K. Huarng, T.H.K. Yu, The application of neural networks to forecast fuzzy time series, Physica A 363 (2006) 481–491. [21] J. Kennedy, R. Eberhart, Particle swarm optimization, in: Proceedings of IEEE International Conference on Neural Networks, IEEE Press, Piscataway, NJ, USA, 1995, pp. 1942–1948. [22] I.H. Kuo, S.J. Horng, T.W. Kao, T.L. Lin, C.L. Lee, Y. Pan, An improved method for forecasting enrollments based on fuzzy time series and particle swarm optimization, Expert Systems with Applications 36 (2009) 6108–6117. [23] I.H. Kuo, S.J. Horng, Y.H. Chen, R.S. Run, T.W. Kao, R.J. Chen, J.L. Lai, T.L. Lin, Forecasting TAIFEX based on fuzzy time series and particle swarm optimization, Expert Systems with Application 37 (2010) 1494–1502. [24] L.W. Lee, L.H. Wang, S.M. Chen, Temperature prediction and TAIFEX forecasting based on fuzzy logical relationships and genetic algorithms, Expert Systems with Applications 33 (2007) 539–550. [25] L.W. Lee, L.H. Wang, S.M. Chen, Temperature prediction and TAIFEX forecasting based on high-order fuzzy logical relationships and genetic simulated annealing techniques, Expert Systems with Applications 34 (2008) 328–336. [26] S.T. Li, Y.C. Cheng, S.Y. Lin, FCM-based deterministic forecasting model for fuzzy time series, Computers and Mathematics with Applications 56 (2008) 3052–3063.
3299
[27] Y. Ma, C. Jiang, Z. Hou, C. Wang, The formulation of the optimal strategies for the electricity producers based on the particle swarm optimization algorithm, IEEE Transactions on Power Systems 21 (4) (2006) 1663–1671. [28] J.I. Park, D.J. Lee, C.K. Song, M.G. Chun, TAIFEX and KOSPI 200 forecasting based on two factors high order fuzzy time series and particle swarm optimization, Expert Systems with Application 37 (2010) 959–967. [29] Y. Shi, R.C. Eberhart, Empirical study of particle swarm optimization, Proceedings of IEEE Congress on Evolutionary Computation 3 (1999) 1945–1950. [30] S.R. Singh, A simple method of forecasting based on fuzzy time series, Applied Mathematics and Computation 186 (2007) 330–339. [31] Q. Song, B.S. Chissom, Fuzzy time series and its models, Fuzzy Sets and Systems 54 (1993) 269–277. [32] Q. Song, B.S. Chissom, Forecasting enrollments with fuzzy time series – Part I, Fuzzy Sets and Systems 54 (1993) 1–10. [33] Q. Song, B.S. Chissom, Forecasting enrollments with fuzzy time series – Part II, Fuzzy Sets and Systems 62 (l) (1994) 1–8. [34] J. Sullivan, W.H. Woodall, A comparison of fuzzy forecasting and Markov modeling, Fuzzy Sets and Systems 64 (3) (1994) 279–293. [35] R.C. Tsaur, J.C. Yang, H.F. Wang, Fuzzy relation analysis in fuzzy time series model, Computers and Mathematics with Application 49 (2005) 539–548. [36] U. Yolcu, E. Egrioglu, V.R. Uslu, M.A. Basaran, C.H. Aladag, A new approach for determining the length of intervals for fuzzy time series, Applied Soft Computing 9 (2009) 647–651. [37] U. Yolcu, C.H. Aladag, E. Egrioglu, V.R. Uslu, Time series forecasting with a novel fuzzy time series approach: an example for Istanbul stock market, Journal of Statistical Computation and Simulation, in press. [38] H.K. Yu, Weighted fuzzy time series models for TAIEX forecasting, Physica A 349 (2005) 609–624. [39] T.H.K. Yu, K.H. Huarng, A neural network-based fuzzy time series model to improve forecasting, Expert Systems with Application 37 (2010) 3366–3372.