Advances in Fuzzy Systems

Volume 2012, Article ID 785709, 6 pages

http://dx.doi.org/10.1155/2012/785709

## A New Time-Invariant Fuzzy Time Series Forecasting Method Based on Genetic Algorithm

Department of Statistics, Faculty of Arts and Science, University of Ondokuz Mayıs, 55139 Samsun, Turkey

Received 8 April 2012; Revised 3 May 2012; Accepted 13 May 2012

Academic Editor: Ferdinando Di Martino

Copyright © 2012 Erol Eğrioğlu. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

In recent years, many fuzzy time series methods have been proposed in the literature. Some of these methods use the classical fuzzy set theory, which needs complex matricial operations in fuzzy time series methods. Because of this problem, many studies in the literature use fuzzy group relationship tables. Since the fuzzy relationship tables use order of fuzzy sets, the membership functions of fuzzy sets have not been taken into consideration. In this study, a new method that employs membership functions of fuzzy sets is proposed. The new method determines elements of fuzzy relation matrix based on genetic algorithms. The proposed method uses first-order fuzzy time series forecasting model, and it is applied to the several data sets. As a result of implementation, it is obtained that the proposed method outperforms some methods in the literature.

#### 1. Introduction

The fuzzy time series were firstly defined in Song and Chissom [1]. Many time series in the real life have uncertainty observations. This kind of the time series is called fuzzy time series. For example, some of these time series are stock index data, air pollution data, enrollment data, and temperature data. The observations of these time series are convertible to fuzzy sets. The fuzzy time series separate two classes which are time-variant and time-invariant. The time-invariant fuzzy time series have time-invariant relationship of lagged fuzzy time series variables. This relationship is proved from an “” matrix, which is invariant in the time space. The first method for forecasting time-invariant time series is proposed in Song and Chissom [2], in which the membership of observations is determined, subjectively. Chen [3] proposed fuzzy time series method which does not need complex matricial operations, and it uses fuzzy group relationship tables. Since these use order of fuzzy sets, the membership functions of fuzzy sets are not taken into consideration. Sullivan and Woodall [4] proposed fuzzy time series method based on Markov Chains. All of these methods forecast fuzzy time series based on first-order fuzzy time series forecasting model.

In the literature, many fuzzy time series forecasting method are based on high-order fuzzy time series model, bivariate fuzzy time series model, and multivariate fuzzy time series model. Some of these methods are due to Chen [5], Aladag et al. [6], and Egrioglu et al. [7]. Generally, fuzzy time series methods are based on three stages. These are fuzzification, determination of fuzzy relation, and defuzzification. In the literature, the fuzzy time series methods are improved by employing various artificial intelligence techniques in these three stages. The genetic algorithms, particle swarm optimization, and fuzzy c-means methods are used in the fuzzification stage. Feed forward neural networks are used determining fuzzy relation and defuzzification stage.

Many proposed methods in the literature neglected membership values of fuzzy sets. In this study, we proposed new fuzzy time series forecasting method for first order fuzzy time series forecasting model. The proposed method takes into account of membership values. Moreover, the proposed method does not need complex matricial operations and outperforms the well-known methods in the literature.

In Section 2 are given some important definitions. In Section 3, the fuzzy c-means method is summarized. In Section 4, genetic algorithm is briefly explained. In Section 5, we present details of our proposed methods. In Section 6, the proposed method is applied to some data sets, and we present results of implementation.

#### 2. The Some Definitions Related to Fuzzy Time Series

The fuzzy time series were firstly defined in Song and Chissom [1]. The time-variant and time-invariant fuzzy time series definitions are given below.

*Definition 1. * Let , a subset of real numbers, be the universe of discourse on which fuzzy sets are defined. If is a collection of , , then is called a fuzzy time series defined on .

*Definition 2. *Suppose is implied by only, that is, . Then this relation can be expressed as , where is the fuzzy relationship between and , and is called the first order model of .

*Definition 3. *Suppose is a first-order model of . If for any , is independent of , that is, for any , , then is called a time-invariant fuzzy time series, otherwise it is called a time-variant fuzzy time series.

The symbol “” stands for max-min composition of fuzzy sets. Song and Chissom [2] firstly introduced an algorithm based on the first order model for forecasting time invariant . In Song and Chissom [2], the fuzzy relationship matrix is obtained by many matricial operations. The fuzzy forecasts are obtained based on max-min composition as follows:
The dimension of is depending on number of fuzzy sets which are partition number of universe and discourse. If we use more fuzzy sets, we need more matricial operations for obtaining . In this situation, Song and Chissom’s [2] method is getting more complex.

#### 3. The Fuzzy C-Means Clustering Method: An Overview

Song and Chissom [1] method uses decomposition of the universe discourse in the stage of fuzzification. There are two problems: the number of intervals of arbitrary length and the arbitrary choice of membership degrees. In order to overcome these problems, Cheng et al. [8] and Li et al. [9] fuzzy c-means (FCM) clustering method was used. FCM clustering method was firstly introduced by Bezdek [10]. Let be the membership, the center of cluster, the number of variables, and the number of clusters. Then the objective function, which is minimized in FCM, is where is a constant greater than 1 and is a distance between the observation and the center of the cluster. is minimized with subject the constraints: In this method, the minimization is done by an iterative algorithm. In each repetition, the values of and are updated by the formulas given in (4):

#### 4. Genetic Algorithm: An Overview

Chen and Chung [11], Lee et al. [12] used genetic algorithm in fuzzification stage. The genetic algorithms were first proposed by Holland [13]. The genetic algorithms have population size, evaluation function, cross-over rate, mutation rate and maximum generation number. The genetic algorithm researches an optimal solution with many chromosomes. In a chromosome, there are many genes. Generally, the genetic algorithm starts with random population whose size is determined by user according to the problem under study. For example, Chen and Chung [11] used 50 as population size and the new generation is produced by various techniques in the iterations. Some of these techniques are crossover, mutation, and natural selection, summarized as follows.

*Crossover*

The system randomly selects two chromosomes from a population and randomly selects a crossover point from the two selected chromosomes to exchange genes after the crossover point. The crossover operation is depending on crossover rate. The random number generates uniform distribution, then the crossover operation is applied if random number is bigger than crossover rate.

*Mutation*

The user must determine a mutation rate. Then a chromosome is randomly selected. If the system randomly generates a real value between zero and one, which is smaller than or equal to the mutation rate, then the system performs the mutation operation with a randomly selected gene from the chromosomes.

*Natural Selection*

Each chromosome of any generation is evaluated according to evaluation function. All chromosomes are ordered according to evaluation function value. The best chromosomes are transferred to the next generation. Some worst chromosomes are discarded from generations, and the new chromosomes are admitted to the new generation.

#### 5. The Proposed Method for Forecasting First Order Fuzzy Time Series Method

Here, we study forecasting time-invariant fuzzy time series. The FCM is used for fuzzification of time series, and genetic algorithm is used for finding the fuzzy relation. The proposed method has the following important advantages:(i)the membership values of the fuzzy sets are taken into consideration;(ii)there is no necessity of complicated matricial operations;(iii)FCM no needs subjective decisions by using partition of the universe of discourse.The algorithm is given below in step by step as follows.

*Step 1 (Time series are fuzzified by FCM). *Let be the number of fuzzy sets such that . FCM initially assigns crisp values to the fuzzy sets. After this application, the center of each cluster is determined and denoted by .

*Step 2 (Determination of the parameters of genetic algorithm). *The evaluation function is the RMSE as follows:
being the crisp time series, the defuzzified forecast, and is the number of forecasts. The other parameters are selected as follows: population size: 30; crossover rate: 1; mutation rate: 0.01; maximum generation: 300; number of discarded chromosomes in the natural selection: 10.

*Step 3 (Initialization). *The genes are the elements of the crisp relation (Figure 1):

*Step 4 (Crossover operation). *The crossover operation is applied if the random number is bigger than the crossover rate. The system randomly selects two chromosomes from a population and randomly selects a crossover point from the two selected chromosomes to exchange genes after the crossover point. The crossover operation is shown in Figure 2.

*Step 5. *If the system randomly generates a real value between zero and one which is smaller than or equal to the mutation rate, then the system performs the mutation operation with a randomly selected gene from the chromosomes. The mutation operation is demonstrated in Figure 3. is randomly generated from interval.

*Step 6. *The method for calculating RMSE for any chromosome is given in Substeps 6.1–6.4.

*Substep 6.1. ** c*-gens constitute in the rows of .

*Substep 6.2. * Fuzzy forecasts are obtained using (1). After is estimated, fuzzy forecasts can be obtained by using FCM algorithm. For example, for any , the th fuzzy observation is given as follows:
The fuzzy forecast for time is computed by (1) as follows:

*Substep 6.3. *If the membership values of a fuzzy forecast have only one maximum, then select the center of this cluster as the defuzzified forecasted value. If the membership values of an fuzzy forecast has two or more maximum, then select the arithmetic mean of centers of the corresponding clusters as the defuzzified forecasted value. For example, if , then the maximum is 0.7 and then the fuzzified forecast is , center of . If , then the maximum is 0.7 and then fuzzified forecast is arithmetic mean of center of cluster and , center of .

*Substep 6.4. * RMSE is computed by (5).

*Step 7 (Natural selection operation). *All chromosomes are ordered according to the RMSE value. The best 20 chromosomes are transferred to the next generation. 10 chromosomes are discarded from the generation. The new 10 randomly generated chromosomes are replaced in the new generation.

*Step 8. * Steps 4 and 7 are repeated 300 times.

#### 6. Implementation

The proposed method is firstly applied to Alabama University Enrollment data (1971–1992) which is well known in the literature. The Enrollment data are given Table 1.

The proposed method is programmed in Matlab 7.9 version. In the application, we use seven fuzzy sets () in Step 1. The centers of clusters and the membership values from FCM algorithm are given Tables 2 and 3, respectively. The fuzzy and defuzzified forecasts are given in Table 4.

Consider The RMSE of well-known methods [2–4] is given in Table 5.

The proposed method is successively applied to daily Istanbul stock market time series data between 28/12/2010 and 29/02/2012 dates (IMKB 100). The graph of the time series is given in Figure 4. The data between 28/12/2010 and 10/10/2011 dates are used as training data, the data between 11/10/2011 and 29/02/2012 dates are used as test data.

The number of fuzzy clusters is changed from 7 to 15. The obtained results from three methods are given in Table 6.

The RMSE values of the proposed method are smaller than Chen’s [3] and Song and Chissom’s [1, 2] methods.

#### References

- Q. Song and B. S. Chissom, “Fuzzy time series and its models,”
*Fuzzy Sets and Systems*, vol. 54, no. 3, pp. 269–277, 1993. View at Google Scholar · View at Scopus - Q. Song and B. S. Chissom, “Forecasting enrollments with fuzzy time series—part I,”
*Fuzzy Sets and Systems*, vol. 54, no. 1, pp. 1–9, 1993. View at Publisher · View at Google Scholar · View at Scopus - S. M. Chen, “Forecasting enrollments based on fuzzy time series,”
*Fuzzy Sets and Systems*, vol. 81, no. 3, pp. 311–319, 1996. View at Google Scholar · View at Scopus - J. Sullivan and W. H. Woodall, “A comparison of fuzzy forecasting and Markov modeling,”
*Fuzzy Sets and Systems*, vol. 64, no. 3, pp. 279–293, 1994. View at Google Scholar · View at Scopus - S. M. Chen, “Forecasting enrollments based on high-order fuzzy time series,”
*Cybernetics and Systems*, vol. 33, no. 1, pp. 1–16, 2002. View at Publisher · View at Google Scholar · View at Scopus - C. H. Aladag, M. A. Basaran, E. Egrioglu, U. Yolcu, and V. R. Uslu, “Forecasting in high order fuzzy times series by using neural networks to define fuzzy relations,”
*Expert Systems with Applications*, vol. 36, no. 3, pp. 4228–4231, 2009. View at Publisher · View at Google Scholar · View at Scopus - E. Egrioglu, C. H. Aladag, U. Yolcu, V. R. Uslu, and M. A. Basaran, “A new approach based on artificial neural networks for high order multivariate fuzzy time series,”
*Expert Systems with Applications*, vol. 36, no. 7, pp. 10589–10594, 2009. View at Publisher · View at Google Scholar · View at Scopus - C. H. Cheng, G. W. Cheng, and J. W. Wang, “Multi-attribute fuzzy time series method based on fuzzy clustering,”
*Expert Systems with Applications*, vol. 34, no. 2, pp. 1235–1242, 2008. View at Publisher · View at Google Scholar · View at Scopus - S. T. Li, Y. C. Cheng, and S. Y. Lin, “A FCM-based deterministic forecasting model for fuzzy time series,”
*Computers and Mathematics with Applications*, vol. 56, no. 12, pp. 3052–3063, 2008. View at Publisher · View at Google Scholar · View at Scopus - J. C. Bezdek,
*Pattern Recognition with Fuzzy Objective Function Algorithms*, Plenum Press, New York, NY, USA, 1981. - S. M. Chen and N. Y. Chung, “Forecasting enrollments using high-order fuzzy time series and genetic algorithms,”
*International Journal of Intelligent Systems*, vol. 21, no. 5, pp. 485–501, 2006. View at Publisher · View at Google Scholar · View at Scopus - L. W. Lee, L. H. Wang, and S. M. Chen, “Temperature prediction and TAIFEX forecasting based on fuzzy logical relationships and genetic algorithms,”
*Expert Systems with Applications*, vol. 33, no. 3, pp. 539–550, 2007. View at Publisher · View at Google Scholar · View at Scopus - J. H. Holland,
*Adaptation in Natural and Artificial Systems*, MIT Press, Cambridge, Mass, USA, 1975.