Professional Documents
Culture Documents
AbstractRecently, fuzzy time series have attracted more aca- Recently, the theory of fuzzy logic has been widely recognized
demic attention than traditional time series due to their capability as a successful approach for dealing with data uncertainty.
of dealing with the uncertainty and vagueness inherent in the For time series, the uncertain values can be modeled as fuzzy
data collected. The formulation of fuzzy relations is one of the
key issues affecting forecasting results. Most of the present works variables, resulting in so-called fuzzy time series [1]. The term
adopt IFTHEN rules for relationship representation, which leads fuzzy time series has been used with several different meanings
to higher computational overhead and rule redundancy. Sullivan [2]: 1) time series with uncertain single data (fuzzy data) at each
and Woodall proposed a Markov-based formulation and a fore- point in time [3], [4]; 2) time series with fuzzified real-valued
casting model to reduce computational overhead; however, its single data at each point in time [5]; and 3) fuzzy time series
applicability is limited to handling one-factor problems. In this
paper, we propose a novel forecasting model based on the hidden based on a set of elementary finite time series and composed
Markov model by enhancing Sullivan and Woodalls work to allow of several significant representative courses [6]. It is the second
handling of two-factor forecasting problems. Moreover, in order definition that will be used for the rest of this paper.
to make the nature of conjecture and randomness of forecasting In 1993, Song and Chissom introduced the theory of fuzzy
more realistic, the Monte Carlo method is adopted to estimate the logic into forecasting time series problems and proposed a
outcome. To test the effectiveness of the resulting stochastic model,
we conduct two experiments and compare the results with those new paradigm known as fuzzy time series, capable of dealing
from other models. The first experiment consists of forecasting the with vague and incomplete data represented as linguistic values
daily average temperature and cloud density in Taipei, Taiwan, under uncertain circumstances [5], [7], [8]. They established
and the second experiment is based on the Taiwan Weighted a four-step framework to manipulate the forecasting problem:
Stock Index by forecasting the exchange rate of the New Taiwan 1) determine and partition the universe of discourse into inter-
dollar against the U.S. dollar. In addition to improving forecasting
accuracy, the proposed model adheres to the central limit theorem, vals; 2) define fuzzy sets from the universe of discourse and
and thus, the result statistically approximates to the real mean of fuzzify the time series; 3) derive fuzzy relationships existing
the target value being forecast. in the fuzzified time series; and 4) forecast and defuzzify the
Index TermsForecasting, fuzzy time series, hidden Markov forecasting outputs. Finally, they validated their model using
model (HMM), Monte Carlo method. enrollment data from the University of Alabama.
Since Song and Chissoms pioneering work, a number of
I. I NTRODUCTION related research works have been reported that follow their
framework and aim to improve forecasting accuracy and/or
In this paper, we propose a novel forecasting model by F (t 1), F (t 2), . . ., or F (t k), where the subscript o
enhancing Sullivan and Woodalls Markov-based forecasting denotes the relationship or.
one to allow handling two-factor forecasting problems. This In the literature, the fuzzy relation Rij (t, t 1) is usually
model is built on the basis of the hidden Markov model (HMM), represented by a fuzzy logical relationship rule (IFTHEN
a probabilistic model that is commonly applied to time series rule), as in [5], [8][10], [16], [17], [19][22]. In this paper, the
[25]. Moreover, by applying the Monte Carlo method when fuzzy relation is realized by an HMM, which will be discussed
estimating the forecasting outcome, the nature of conjecture in the following section.
and randomness of the forecasting are made more realistic
[1]. To test the effectiveness of our model, we conduct two
experiments in forecasting daily average temperature and the III. S TOCHASTIC HMM-BASED F ORECASTING M ODEL
Taiwan Weighted Stock Index and compare the results with Under realistic circumstances, there are usually multiple
those from other models. related factors that influence the behavior and outcome of any
The remainder of this paper is organized as follows. In event. For example, when trying to predict todays temperature,
Section II, the basic concept of fuzzy time series is briefly we could easily look up and observe the clouds in the sky. If
introduced, and in Section III, the new forecasting model based there are dense clouds, it can be intuitively inferred that the
on HMM is proposed. Section IV presents a performance temperature will be low. However, temperature depends on not
evaluation of the model and a comparison of the results. The only cloud density but also temperature values in previous days.
last section describes our conclusions and directions for future We thus might obtain a better forecast for todays temperature
work. by combining knowledge about what happened in previous
days with the observed cloud state. These kinds of problems
are constantly encountered in the real world, which is why
II. F UZZY T IME S ERIES
our paper focuses on targeting them. Of course, the state of
In this section, we briefly describe the concept of fuzzy time the temperature is not merely controlled by both factors, as
series and its forecasting framework. elements such as winds and air pressure are also likely to have
The definition of fuzzy time series used in this paper was first an impact. However, in this paper, we limit ourselves to prob-
proposed by Song and Chissom [7]. lems concerning two factors, in which both are probabilistically
Definition 1: Let Y (t) (t = . . . , 0, 1, 2, . . .), a subset of R, related. This can be formally represented as follows.
be the universe of discourse on which fuzzy sets fi (t) (i = Given two fuzzy time series F (t) = {fi (t)|t =
1, 2, . . .) are defined, and let F (t) be a collection of fi (t). Then, 1, 2, . . . , T, i = 1, 2, . . . , n} and G(t) = {gi (t)|t =
F (t) is called a fuzzy time series on Y (t) (t = . . . , 0, 1, 2, . . .). 1, 2, . . . , T, i = 1, 2, . . . , m}, where fi (t) and gi (t) are
Song and Chissom employed a fuzzy relational equation to the respective states at time t, the fuzzy relation among F (t),
develop their forecasting model under the assumption that the G(t), and F (t 1) can be formulated as a fuzzy relational
observations at time t are dependent only upon the accumulated equation
results of the observations at previous times, which is defined
as follows. F (t) = (F (t 1), G(t)) R(t, t 1).
Definition 2: If, for any fj (t) F (t), where j J, there
exist an fi (t 1) F (t 1), where i I, and a fuzzy relation To solve the forecasting problem of fi (t), which is dependent
Rij (t, t 1), such that fj (t) = fi (t 1) Rij (t, t 1), let on fi (t 1) and gi (t), the theory of HMM is applied, in which
R(t, t 1) = i,j Rij (t, t 1), where is the union oper- F (t) and G(t) are the hidden and observed state sequences,
ator and is the composition. R(t, t 1) is called the fuzzy respectively.
relation between F (t) and F (t 1), which can be represented
using the following fuzzy relational equation: A. HMM
F (t) = F (t 1) R(t, t 1). HMM is a statistical model to deal with symbols or signal
sequences that are assumed to be a Markov process [25],
Definition 3: If we suppose that F (t) is caused by F (t 1), [26]. The hidden Markov process is based on two essential
F (t 2), . . ., or F (t m) (m > 0), then the first-order model assumptions: 1) The next state is dependent only upon the
of F (t) can be expressed as current state, and 2) each state-transition probability does not
vary in time, i.e., it is a time-invariant model.
F (t) = F (t 1) R(t, t 1) (1) An HMM consists of two state sets and three
matrices of probabilities. The two sets are the hidden
or state set S = {s1 , s2 , . . . , sn } and the observable state
set O = {o1 , o2 , . . . , om }, where the hidden states are
F (t) = (F (t 1) F (t 2) F (t m)) Ro (t, t m) probabilistically related to the observable states and n and m
(2) are the number of hidden and observable states, respectively.
where is the union operator and is the composition. The three relational probability matrices are defined between
R(t, t 1) is called the fuzzy relation between F (t) and F (t the observable and hidden states: , A, and B. A triple
1), and Ro (t, t k) is the fuzzy relation that joins F (t) with compact notation = (, A, B) is given to indicate the
LI AND CHENG: STOCHASTIC HMM-BASED FORECASTING MODEL FOR FUZZY TIME SERIES 1257
complete parameter set of an HMM. is a 1 n into m equal intervals, v1 , v2 , . . . , vm , with length lo being
initial state vector, denoted as = [1 , 2 , . . . , n ] = defined as lo = (1/m)[(Dmax o
+ D2o ) (Dmin
o
D1o )].
[Pr(s1,t=1 ), Pr(s2,t=1 ), . . . , Pr(sn,t=1 )], where i is the Step 2Defining the fuzzy sets on the universe of dis-
probability of each state occurring at initial time step t = 1. course and fuzzifying the time series: Given a traditional crisp
A is an n n state-transition matrix A = {aij }, in which time series, one needs a fuzzification procedure to obtain
aij is the state-transition probability from states si to sj , i.e., the corresponding fuzzy one. For hidden states, n fuzzy sets
aij = Pr(sj,t |si,t1 ) = Pr(si,t1 sj,t ). s1 , s2 , . . . , sn can be defined on U s using general membership
B is an n m confusion matrix B = {bij }, where bij is the functions, as expressed as follows:
probability of observing a state oj , given the hidden state si ,
n
i.e., bij = Pr(oj,t |si,t ). si = ij /uj (5)
The following are three major problems that the HMM j=1
solution has been successfully applied to:
1) evaluation: finding the probability of an observed se- where ij is the membership degree of si belonging to uj and
quence, given an HMM; is defined by
2) decoding: finding the sequence of hidden states that most
1, if j = i
probably generated an observed sequence; ij = 0.5, if j = i 1 or i + 1
3) learning: generating an HMM, given a sequence of obser- 0, otherwise.
vations.
For problem 2), the Viterbi algorithm [27], [28] provides Then, for a given historical datum Yt , its membership degree
an effective way of finding the sequence of hidden states that belonging to interval ui is determined by the following heuristic
most probably generated an observed sequence, i.e., to find the rules.
single best state sequence Q = q1 q2 , . . . , qt , . . . , qT , for a given Rule 1) If Yt is located at u1 , the membership degrees are 1
observation sequence P = p1 p2 , . . . , pt , . . . , pT , where qt is a for u1 , 0.5 for u2 , and 0 otherwise.
hidden state at time t, qt S, and pt is an observable state at Rule 2) If Yt belongs to ui , 1 < i < n, then the degrees are
time t, pt O. Let t (i) be the best probability along a single 1, 0.5, and 0.5 for ui , ui1 , and ui+1 , respectively,
path at time t, which accounts for the first t observations and and 0 otherwise.
ends in state si Rule 3) If Yt is located at un , the membership degrees are 1
for un , 0.5 for un1 , and 0 otherwise.
t (i) = max Pr(q1 , q2 , . . . , qt = si , p1 , p2 , . . . , pt |). Then, Yt is fuzzified as sj , where the membership degree in
q1 ,q2 ,...,qt1
(3) interval j is maximal.
For observable states, m fuzzy sets o1 , o2 , . . . , om can be
To correctly retrieve the state sequence, the next best state is defined on U o , as expressed as follows:
obtained by
m
In this paper, our objective is to perform a short-term forecast where ij is the membership degree of oi belonging to vj and
in a fuzzy time series, which fits problem 2), as described. is defined by
1, if j = i
ij = 0.5, if j = i 1 or i + 1
B. Forecasting Model
0, otherwise.
The proposed forecasting model expands Sullivan and
Woodalls model by combining HMM and Monte Carlos sim- The observation variable can then be fuzzified in the same way
ulation and consists of the following five steps. Please note that as the hidden variable.
if the given time series is a fuzzy time series, steps 1 and 2 are Step 3Modeling fuzzy logical relationships using HMM:
unnecessary. The objective of forecasting is to estimate the probabil-
Step 1Partitioning the universe of discourse into ity of hidden state si,t at time t, given the condition
several intervals of equal length: Let U s and U o be the that observable state ok,t is obtained at the same time,
discourse universes of hidden and observation variables, re- i.e., Pr(si,t |ok,t ). Following Bayes theorem, we have the
spectively. In general, U s and U o are defined as U s = [Dmin s
following:
D1 , Dmax + D2 ] and U = [Dmin D1 , Dmax + D2 ], where
s s s o o o o o
Pr(si,t ) Pr(ok,t |si,t )
s
Dmin s
, Dmax o
, Dmin o
, and Dmax are the respective minimal Pr(si,t |ok,t ) = (7)
Pr(ok,t )
and maximal values of the historical data of hidden and
observation variables, and D1s , D2s , D1o , and D2o are proper Pr(si,t |sh,t1 ) Pr(sh,t1 ) Pr(ok,t |si,t )
positive numbers. U s is then partitioned into n equal = h .
intervals, u1 , u2 , . . . , un , with length ls being defined as Pr(ok,t )
ls = (1/n)[(Dmax s
+ D2s ) (Dmins
D1s )]. U o is partitioned (8)
1258 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICSPART B: CYBERNETICS, VOL. 40, NO. 5, OCTOBER 2010
Therefore, a particular HMM can be characterized by the not exist; therefore, Pr(si,1 |ok,1 ) in (7) is derived as
following three matrices:
Pr(si,1 ) Pr(ok,1 |si,1 ) Pr(si,1 , ok,1 )
A = {aij }, where aij = Pr(sj,t |si,t1 ) Pr(si,1 |ok,1 ) = = .
Pr(ok,1 ) Pr(ok,1 )
B = {bij }, where bij = Pr(oj,t |si,t ) (13)
TABLE I TABLE II
T RAINING DATA OF AVERAGE T EMPERATURE AND C LOUD D ENSITY FOR T RAINING DATA OF AVERAGE T EMPERATURE AND C LOUD D ENSITY FOR
J UNE AND J ULY 1993 IN TAIPEI , TAIWAN AUGUST AND S EPTEMBER 1993 IN TAIPEI , TAIWAN
Step 5Defuzzifying the forecasting outputs: There are sev- TABLE III
eral defuzzification methods that can be chosen. For simplicity, T RAINING DATA OF AVERAGE T EMPERATURE AND C LOUD D ENSITY FOR
J UNE AND J ULY 1994 IN TAIPEI , TAIWAN
we use the most popular one, namely, center of gravity, which
is expressed as
n
ci ti
i=1
n (20)
ci
i=1
where
1
(m1 + 0.5 m2 ), i=1
1.5
1
(0.5 mi1 + mi
ti = 2 (21)
+0.5 mi+1 ), i = 2, 3, . . . , n 1
1
1.5 (0.5 m n1 + mn ), i=n
TABLE IV TABLE VI
T RAINING DATA OF AVERAGE T EMPERATURE AND C LOUD D ENSITY FOR T RAINING DATA OF AVERAGE T EMPERATURE AND C LOUD D ENSITY FOR
AUGUST AND S EPTEMBER 1994 IN TAIPEI , TAIWAN AUGUST AND S EPTEMBER 1995 IN TAIPEI , TAIWAN
= [0.3333, 0, 0, 0.6667, 0, 0]. N June 1,1996 (o5,June 1,1996 ) = [0.522371, 0, 0, 0.477629, 0, 0].
1262 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICSPART B: CYBERNETICS, VOL. 40, NO. 5, OCTOBER 2010
We executed the Monte Carlo simulation 100 (l = 100) times of which hidden states 5, 84, and 11 belonged to s4 , s5 , and s6 ,
on the probability vector N June 1,1996 (o5,June 1,1996 ) and ob- respectively.
tained 100 stochastic forecasting hidden states, represented by Finally, the crisp forecasting output was calculated by car-
vector C rying out defuzzification, as defined in (20) (see the equation
shown at the bottom of the page).
C = [53, 0, 0, 47, 0, 0] All the forecasting results from June to September 1996 are
illustrated in Tables VIIX.
of which 53 and 47 hidden states belonged to s1 and s4 , With the forecasting results, we then evaluated the perfor-
respectively. Finally, the crisp forecasting output was calculated mance of the proposed fuzzy time series model by predicting
by carrying out defuzzification, which is defined in (20) (see the the temperature and comparing it with previous models. The
equation shown at the bottom of the page). forecasting accuracy was measured in terms of the mean square
Taking forecasting the temperature for June 4, 1996, error (mse)
as another example, the cloud density on that day
N
was o2 , and the temperature state for June 3 was s5 . i=1 (F orecasting_V aluei Actual_V aluei )2
Because the second column of confusion matrix B was mse = .
N
B(:, [2])T = [0, 0.0952, 0.0690, 0.0259, 0.1014, 0.1579] and
the fifth row of state-transition matrix A was A([5], :) = [0, 0, The performance comparison was further conducted using
0, 0.2230, 0.7095, 0.0676], the probability vector of hidden the average forecasting error percentage (AFEP), which is
states for June 4, 1996, could be calculated from (12) defined as follows:
n
ci ti
i=1 53 22.6667 + 0 24 + 0 26 + 47 28 + 0 30 + 0 31.333
n = = 25.1733
100
ci
i=1
n
ci ti
i=1 0 22.6667 + 0 24 + 0 26 + 5 28 + 84 30 + 11 31.3333
n =
100
ci
i=1
= 30.0467
LI AND CHENG: STOCHASTIC HMM-BASED FORECASTING MODEL FOR FUZZY TIME SERIES 1263
TABLE XI
P ERFORMANCE C OMPARISON B ETWEEN THE P ROPOSED M ODEL AND
L EE S M ODEL (n = 6, m = 5)
Fig. 1. Trend of the Taiwan Weighted Stock Index for 2005, 2006, and 2007.
TABLE XII
P ERFORMANCE C OMPARISON B ETWEEN THE P ROPOSED M ODEL AND
L EE S M ODEL (n = 12, m = 10)
TABLE XIII Fig. 2. Trend of the exchange rate of the New Taiwan dollar against the U.S.
I MPACT OF THE N UMBER OF I TERATIONS OF M ONTE C ARLO S IMULATION dollar for 2005, 2006, and 2007.
ON F ORECASTING P ERFORMANCE (n = 6, m = 5)
TABLE XV
P ERFORMANCE C OMPARISON OF THE TAIWAN
W EIGHTED S TOCK I NDEX (n = 6, m = 6)
TABLE XIV
C OMPARISON OF THE F ORECASTING ACCURACY OF THE P ROPOSED
M ODEL W ITH VARIOUS M ONTE C ARLO S IMULATION T IMES
(n = 12, m = 10)
Fig. 3. Correlation among predicted and actual stock indexes. (a) November to December of 2005. (b) November to December of 2006. (c) November to
December of 2007.
LI AND CHENG: STOCHASTIC HMM-BASED FORECASTING MODEL FOR FUZZY TIME SERIES 1265
Sheng-Tun Li (M94) received the B.S. and M.S. Yi-Chung Cheng received the B.S. degree in busi-
degrees in computer engineering from Tamkang ness mathematics from Soochow University, Taipei,
University, Tamsui, Taipei County, Taiwan, and the Taiwan, the M.S. degree in statistics from National
Ph.D. degree in computer science from the Univer- Central University, Jhongli City, Taiwan, and the
sity of Houston, University Park, TX. Ph.D. degree in industrial and information manage-
He is currently a Professor with the Institute of ment from National Cheng Kung University, Tainan,
Information Management and the Department of Taiwan, in 1985, 1989, and 2008, respectively.
Industrial and Information Management, National She is currently an Associate Professor with the
Cheng Kung University, Tainan, Taiwan. He is an Department of International Business Management,
author or coauthor of five books, over 50 journal Tainan University of Technology, Yongkang, Tainan,
articles, and numerous conference papers. He is a Taiwan. Her research interests include time series
holder of one patent. His research interests include knowledge engineering, data forecasting and data mining.
mining, knowledge management system, and soft computing.
Dr. Li is a Member of IEEE.