B. Gharleghi and A. H. S. Md Nor
IHART - Volume 22 (2012)
HYBRID SYSTEM APPLICATION FOR TIME SERIES FORECASTING:
THE CASE OF MYR/USD EXCHANGE RATE
Behrooz Gharleghi and Abu Hassan Shaari Md Nor
University Kebangsaan Malaysia, Malaysia
ABSTRACT
Exchange rate prediction is a great interest and also is an important task, because, successful prediction of exchange rate may
promise attractive benefits. This task is very difficult and highly complicated. In this paper, we investigate the predictability of
exchange rate’ return with a Neuro-Fuzzy system (as an intelligence system) that is a combination of neural networks and
fuzzy inference system. The main purpose of this research is to determine whether a Neuro-Fuzzy system is capable to predict
the exchange rate’ return accurately. We attempt to model and predict the return on Malaysia Ringgit return (MYR/USD) with
Neuro-Fuzzy system. The theory of relative price monetary model of exchange rate determination is used to determine the
macro variables as inputs for the developed system. The experimental results reveal that the model successfully forecasts the
monthly return of MYR/USD with a high accuracy. Furthermore, the constructed model easily outperformed the neural network
and also random walk. The developed Neuro-Fuzzy system provides a promising alternative for exchange rate prediction.
Neuro-Fuzzy system can be a useful tool for economists and practitioners dealing with the forecasting of the exchange rate
return.
Keywords: Exchange Rate, Forecasting, Hybrid Model, Intelligence Systems, Neural Networks.
INTRODUCTION
The outcomes of recent literature reveal that exchange rate return, and stock market returns are predictable from past returns
and other macroeconomics variables. The predictability of exchange rate return led the researchers to investigate the sources
of this predictability (Gencay, 1998). Exchange rate return forecasting is a highly complicated and very difficult task, because
there exist many factors such as economic conditions, political events, traders’ expectations and other environmental factors
that may influence exchange rate. Furthermore, exchange rate series are generally nonlinear, dynamic, noisy, complicated,
chaotic, and nonparametric in nature (Yudong & Lenan, 2009).
The techniques of soft computing are widely applied to exchange rate problems. These techniques offer useful tools to predict
the date series with noisy environments such as exchange rate, and capturing their non-linear pattern (Atsalakis & Valavanis,
2009a). Application of intelligent systems such as fuzzy system and neural networks for the purpose of forecasting in the field
of financial markets has extensive utilizations. For instance, artificial neural networks (ANNs) have been successfully applied to
solve the problems of financial time series forecasting, including exchange rate, and financial stock market prediction (Shaari,
Gharleghi 2011; Armano, Marchesi, & Murru, 2005; Egeli, Ozturan, & Badur, 2003; Hiemstra, 1995; Karaatli, Gungor, Demir, &
Kalayci, 2005; Leigh, Purvis, & Ragusa, 2002; Manish & Thenmozhi, 2006; Saad, Prokhorov, & Wunsch, 1998; Yudong &
Lenan, 2009, khashei, Bijari, 2010).
The distinguish difference between this paper and previous research is that, (i) the constructed Neuro-Fuzzy system is not
adaptive, unlike the common Adaptive Neuro Fuzzy Inference System (ANFIS) that rules are adapted. This means, in our
developed system, rules are not changing during the training of the system. (ii) Multivariate neural network is constructed
based on the relative price monetary model of exchange rate determination, i.e. the variables and also the interaction among
the variables are extracted from the monetary model. (iii) To the best of our knowledge, very few studies have been done for
the application of intelligent systems to predict the exchange rate in ASEAN-5 members, for instance ( Shaari, et. al 2011;
Shaari & Gharleghi 2011)
This research contributes to the field of financial market research. The main aim of this paper is to explore the predictability of
exchange rate return of the Malaysian Ringgit with a Neuro-Fuzzy system. The Malaysian Exchange rate is a major economic
variable that affect the other macro variables in Malaysia as a member of Association of South East Asia Nations (ASEAN).
The rest of the paper is organized as follows. Section two provides a review of prior studies. Section three introduces the basic
theory of Nuro-Fuzzy system. Section four describes the research findings and experimental results, while the last section
discusses the conclusion and major findings of the paper.
115
Hybrid System Application for Time Series Forecasting: The Case of MYR/USD Exchange Rate
LITERATURE REVIEW
There has been enormous studies focus on the prediction of financial time series such as exchange rate and stock market
using neuro-fuzzy systems. For instance, Kablan 2009, for the case of Euro/USD exchange rate. Abbasi and Abouec 2009 for
Tehran stock exchange; Alakhras 2005, for Turkey exchange rate; Long et.al. 2010, for Taiwan stock exchange. There are a
very large number of studies which concentrate on the exchange rate forecasting. In this section, we focus on the previous
studies regarding the prediction of exchange rate return with neural networks and fuzzy logic. Quek (2005) applied the ANFIS
to forecast the investors’ measures in the Stock Exchange Trade in United States. Model was successful to predict the stock
prices in the US Stock Exchange market.
Trinkle (2006) applied the ANFIS, neural network, and Autoregressive Integrating Moving Average (ARIMA) model to forecast
the annual excess returns of three publicly traded companies. The forecasting performance of the two intelligent techniques is
compared with ARMA model. The results reveal that the ANFIS and neural network techniques has a significant prediction
ability. Yunos, Shamsuddin, and Sallehuddin (2008) develop an ANFIS to forecast the daily movements of the Kuala Lumpur
Composite Index (KLCI). Four technical criteria are chosen to evaluate the performance of the models. The results show that,
ANFIS is competent in forecasting the KLCI compared to artificial neural networks.
Keles et al. (2008) also applied a neuro-fuzzy model to forecast domestic debt. Compared with neural network, fuzzy logic
offers better insight, but its performance depends on the fuzzification of the time series data. Atsalakis and Valavanis (2009b)
develop a neuro-fuzzy adaptive system to forecast the one step ahead of stock price trends for the ASE and the NYSE index.
The results reveal that the proposed model performs very well in trading simulations, returning results superior to the buy and
hold strategy.
DATA SET AND METHODOLOGY
The data used in this paper are monthly macroeconomic variables and the return of the Malaysian Ringgit over US Dollar. We
obtain the monthly data set from the Thomson Data Stream data base. The whole data set covers the period from January
1998 to September 2010, a total of 153 observations for each variable. The data set is divided into two parts. The first group of
the data (129 observations) is utilized for training purpose and the second group of the data (24 observations) is utilized for
prediction purpose.
In line with the previous literature, it is hypothesized that exchange rate return can be predicted with the financial and
macroeconomic variables. According to the relative price monetary model of exchange rate determination, money supply,
national income, interest rate, inflation, and customer price index as well as producer price index are the variables that
determine the behavior of exchange rate (Frenkel 1976 and 1979, Dornbusch 1976, chinn 1998, Meese and Rogoff 1983),
therefore, these variables used as inputs for developed neuro-fuzzy system and also neural network. In this paper, we use M2
as a representative for money supply, Industrial Production Index used as a proxy for national income due to the lack of
availability of monthly data for national income. Federal fund rate is used for interest rate, other variables are used as they
presented above. Output variable is the monthly return of the Malaysian Ringgit over USD exchange rate. Following the
literature, we calculate the exchange rate return as follows:
e
Rt ln t
e
t 1
(1)
Where Rt denotes the return at time t, and et and et-1 are the exchange rate values for time t and t-1, respectively.
THEORY OF FUZZY INFERENCE SYSTEM (FIS)
A FIS can use the human expertise by storing its essentials components in a rule base, and perform fuzzy reasoning to infer
the overall output value. The derivation of IF-THEN rules and corresponding membership functions depends on the a priori
knowledge about the system. On the other hand, ANN learning mechanism does not rely on human expertise due to the
homogenous structure of ANN, therefore it is difficult to extract the structured knowledge from either the weights or the
configuration of the ANN. FIS and ANN are complementary which induce the appearance of the capacity that takes advantage
of the capacity that FIS have to store human expertise knowledge and the capacity of learning of the ANN. (Vieira et.al. 2004)
In this paper, all the presented results on fuzzy systems as universal approximators deal with Mamdani fuzzy system. It was
proposed by Mamdani (1974) as an attempt to control a steam engine and boiler combination by synthesizing a set of linguistic
116
B. Gharleghi and A. H. S. Md Nor
IHART - Volume 22 (2012)
control rules obtained from experienced human operators. Mamdani’s efforts were based on Zadeh’s (1965) paper on fuzzy
algorithms for complex systems and decision processes. Mamdani type inference system suggests that the output membership
functions to be fuzzy sets.
The working of FIS can be explained as below. The crisp input is transformed in to fuzzy by the fuzzification method. After
fuzzification the rule base is made. The rule base and the database are together referred to as the knowledge base.
Defuzzification is used to transform fuzzy value to the real world value which is actually the output. (Figure 1)
Knowledge Base
Input
Database
Output
Rule Base
Fuzzification
Inference
Defuzzification
Inference
(Crisp)
(Crisp)
Decision Making Unit
(Fuzzy)
(Fuzzy)
Figure 1: Fuzzy Inference System
Fuzzification is the method where the crisp quantities are transformed to fuzzy sets. By identifying some of the uncertainties
present in the crisp values, we formulate the fuzzy values. The transformation of fuzzy values is represented by the
membership functions. It classifies the element in the set, for both discrete and continuous. The “shape” of the membership
function is an important criterion that is to be considered. The rule-based fuzzy system form uses linguistic variables as its
antecedents and consequents. The fuzzy rule-based system uses IF–THEN rule-based system, given by, IF antecedent, THEN
consequent.
The conversion of fuzzy to crisp values is defuzzification. The fuzzy results obtained cannot be used as such to the
applications, and thus it is necessary to transform the fuzzy quantities into crisp quantities for further processing. This can be
done by using defuzzification process. The decision-making is a major part in the entire system. The FIS forms suitable rules
and based upon those rules the decision is made. This is based on the concepts of the fuzzy set theory, fuzzy IF–THEN rules,
and fuzzy reasoning. FIS uses “IF. . . THEN. . . ” statements, and the connectors used in the rule statement are “OR” or “AND”
to formulate the necessary decision rules.
ARTIFICIAL NEURAL NETWORKS
Neural Network is a modeling method based on the human brain that can recognize and learn the pattern of the foreign
exchange rate through past data, save these rules and forecast the future exchange rate. For ANN, there is no need to specify
any particular model, because, ANN can be adapted based on the features presented in the data set. The great advantage of
neural networks is their flexible ability to model the nonlinear patterns and it is adapted based on the features of the data set
that can be called as a data driven approach. This approach is useful for many empirical researches in which there is no
theoretical guideline available to suggest an appropriate data generating process. (Shaari, Gharleghi 2011)
ANNs are the appropriate methods to forecast the exchange rate due to some unique features. First, ANNs are self adaptive in
that there are few assumptions about the models, so neural networks are less impressible in model misspecification problem.
Second, Generalization ability, after learning the pattern of data set given to them, ANNs can infer the unseen part of
population, even if data set contain noisy information. Third, ANNs are Non linear, based on time series prediction models like
ARIMA, always assumed that the time series generated from a linear process. Fourth, ANNs are universal functional
estimators; it means a network can estimate any continuous function to any desired accuracy. (khashei , bijari 2010)
Feed Forward Neural Network is the most widely used network in which all layers except input layer receive weights from their
previous layer. This network is consisted of three layers; input layer which includes explanatory variables (inputs) in the model.
Hidden layer; lies between the input and output layers. There can be many hidden layers, which allow the network to learn,
adjust, and generalize from the previously learned facts (data sets) to the new input. The number of hidden layers and nodes in
the network are determined by trial and error, and this paper follows this technique. Output layer is including the output of
network.
117
Hybrid System Application for Time Series Forecasting: The Case of MYR/USD Exchange Rate
Single hidden layer feed forward network is represented as follow for time series modeling and forecasting, it has three layers
of simple processing units connected by acyclic links:
yt w0 w j .g ( w0, j wi , j . yt i ) t
q
p
j 1
j 1
(2)
where, wij (i = 0,1,2,…,p, j=1,2,…,q) and wj (j=0,1,2,…,q) are model parameters called connection weights; p is the number of
input nodes; and q is the number of hidden nodes. Figure 2 represents the simple structure of feed forward neural network:
Figure 2: Structure of Three Layers Neural Network
Neurons must use activation function to generate the output. Activation function represents a degree of nonlinearity which is
valuable for neural networks applications. Activation function can take several forms; the type of this function is specified by the
situation of the neuron within the network. The sigmoid, tangent hyperbolic, and a combination of both are the activation
functions (tansig) which mostly used as the hidden layer transfer function. In this paper the “tansig” activation function is used
and can be represented in following equation:
tan sig ( x )
2
1
(1 e 2n )
(3)
RESEARCH RESULTS
In this paper, a stepwise procedure is followed to construct the neuro-fuzzy system; first, we attempt to form the fuzzy
inference system, and second, is to use the output (crisp value) of the fuzzy inference system as an input to the neural
network. In order to build up the fuzzy inference system, seven membership functions are introduced and the types of the
membership functions are the combination of trapezoidal and triangular for each input as well as output. Accordingly seven
rules have been contributed to the model to generate the result. The generated fuzzy system result, hence, becomes an input
for the artificial neural network to optimize the efficiency and accuracy of the model. Figure 3 shows an example of the type of
the membership function. From the figure, it can be seen that the first and the last membership functions are trapezoidal and
the rest are triangular type.
118
B. Gharleghi and A. H. S. Md Nor
IHART - Volume 22 (2012)
extreme low very low
1
low
average
high
very high
extreme high
Degree of membership
0.8
0.6
0.4
0.2
0
3.2
3.4
3.6
3.8
exr
4
4.2
4.4
Figure 3: Structure of the Membership Functions
In order to compare the performance of neuro-fuzzy system, a multivariate neural network is also introduced and include three
layer, one input layer with five neurons that represent the inputs, one hidden layer, and one output layer that represent the
return of exchange rate. In input layer, there are money supply, industrial production index, interest rates, inflation, consumer
price index, and producer price index. The return of the Malaysian Ringgit exchange rate is in the output layer. To compare the
forecasting performance of developed models, some statistical methods, such as the root mean squared error (RMSE), the
mean absolute error (MAE), the mean absolute percentage error (MAPE), and variance proportion (VP) are used to compare
the predicted and actual values for model validation. The RMSE and MAE can be defined as:
RMSE
MAE
(F X )
n
t 1
t
t
2
/n
(4)
1 n
Ft X t
n t 1
(5)
where F is the forecasted value and X is the actual value. RMSE and MAE criteria depend on the scale of the dependent
variable. These should be used as relative measures to compare forecasts for the same series across different models; the
smaller value means the better the forecasting of that model. In addition, the mean absolute percentage error and variance
proportion can be written as:
n
MAPE
V .P
t 1
Ft X t
Xt
n
100
(6)
(s yˆ s y ) 2
(F X )
(7)
n
t 1
t
t
2
/n
where, sŷ is the standard deviation of forecasted series and sy is the standard deviation of actual series. MAPE is scale
invariant and the better the forecasting performance results from smaller value of MAPE. The variance proportion tells us how
far the variation of the forecast is from the variation of the actual series.
119
Hybrid System Application for Time Series Forecasting: The Case of MYR/USD Exchange Rate
The computer program was performed on MATLAB (version 9, The MathWorks Inc., USA) environment by using the fuzzy
toolbox. The developed Neuro-Fuzzy topologies with seven input membership functions were trained. Figure 4 shows actual
return and generated return by Fuzzy inference system.
0.08
MYR/USD Return Series
Return Generated by FIS
0.06
0.04
0.02
0
-0.02
-0.04
-0.06
0
50
100
150
Figure 4: Factual and Forecasted return Series via Fuzzy Inference System
As figure above shows, the neuro-fuzzy system was able to recognize the pattern of the actual return series for MYR/USD
exchange rate. However, the prediction results are presented in table 1, and 2 for in sample forecasting and out of sample
forecasting respectively. As it can be observed from the table, random walk results also presented to ensure that the developed
models are adequate. In the case of in-sample forecasting, in general, intelligent systems easily outperform the random walk
model as indicated by smaller value of mentioned criteria. More specific, the prediction performance of neural network is better
than the developed neuro-fuzzy system that is due to the advantage of pattern recognition by multivariate neural networks.
Table 1: In Sample Forecasting Results for Return Series (MYR/USD)
Model
RW(with drift)
Neural Network
Neuro-Fuzzy
RMSE
0.3313
0.00308
0.0433
MAE
0.2653
0.00107
0.0235
MAPE
6.8
1.1
8
VP
0.1949
0.00131
0.00324
However, the out of sample forecasting results are provided for short, and medium term and reveals that, Intelligent systems
outperformed the random walk model in all time horizon forecasting. As it is clear for out of sample prediction, the ability of
neuro-fuzzy system is obvious to outperform the neural network. This is due to the advantage of fuzzy rule based system that
incorporates the macroeconomic relationships among the variables. As a result, it can be said that the developed neuro-fuzzy
system is an appropriate technique for the prediction of exchange rate return. Interestingly, as the longer horizon is considered,
the performance of intelligent systems declines (it can be seen as the greater value of criteria in longer horizon), means,
intelligence system are able to forecast with higher accuracy in short-term forecasting. But random walk provides a mixed
result.
120
B. Gharleghi and A. H. S. Md Nor
IHART - Volume 22 (2012)
Table 2: Out of Sample Forecasting Results for Return Series (MYR/USD)
Model
RW (with drift)
Neural Network
Neuro-Fuszzy
3 Steps Ahead
RMSE
0.0955
0.0403
0.0357
MAE
0.0857
0.0397
0.0323
MAPE
2.3
7.5
7
VP
0.3126
0.00682
0.00419
6 Steps Ahead
RMSE
0.1172
0.0492
0.0399
MAE
0.1087
0.0449
0.0374
MAPE
3
8.5
14
VP
0.1991
0.00795
0.00368
12 Steps Ahead
RMSE
0.0919
0.07390
0.0514
MAE
0.0790
0.07154
0.0416
MAPE
2.2
5.9765
8
VP
0.1257
0.0399
0.0278
CONCLUSION
Predicting the exchange rate return is important and is a great interest, because, successful prediction of exchange rate may
promise attractive benefits. It usually affects the financial trader’s decision, monetary policy makers, and government policy to
import or export the commodities. Soft computing techniques have been successfully applied to provide a high accuracy result
for exchange rate prediction. In this paper, the neuro-fuzzy system is adopted to predict the exchange rate return on the
Malaysian Ringgit. The result of the study shows that the performance of exchange rate prediction can be significantly
enhanced by using Neuro-fuzzy system. Based on the experimental results, the value of the comparison criteria is obtained
and they are very satisfying. The prediction performance of this method shows the advantages of Neuro-fuzzy system. The
findings demonstrate the learning and predicting potential of the Neuro-fuzzy system in financial applications. Furthermore,
these results indicate that neuro-fuzzy system can be a useful tool for the prediction of MYR/USD exchange rate.
REFERENCES
Abbasi, E., & Abouec, A. (2008) Stock price forecast by using neuro-fuzzy inference system, Proceedings of World Academy of
Science, Engineering and Technology, 36, pp. 320–323.
Alakhras, M.N.Y. (2005) Neural network-based fuzzy inference system for exchange rate prediction, Journal of Computer
Science (Special Issue), pp. 112-120.
Atsalakis, G. S., & Valavanis, K. P. (2009a). Surveying stock market forecasting techniques – part II: Soft computing methods.
Expert Systems with Applications, 36(3), 5932–5941.
Atsalakis, G. S., & Valavanis, K. P. (2009b) Forecasting stock market short-term trends using a neuro-fuzzy based
methodology, Expert Systems with Applications, 36(3), pp. 10696–10707.
Armano, G., Marchesi, M., & Murru, A. (2005) A hybrid genetic-neural architecture for stock indexes forecasting, Information
Sciences, 170, pp. 3–33.
Chinn, M. D. (1998) Before the fall: were East Asian currencies overvalued? NBER Working Paper No. 6491
Dornbusch, R. (1976) The theory of flexible exchange rate regimes and macroeconomic policy. The Scandinavian Journal of
Economics, 78(2), pp. 255-275.
Egeli, B., Ozturan, M., & Badur, B. (2003) Stock market prediction using artificial neural networks, In Proceedings of the 3rd
Hawaii international conference on business, Honolulu, Hawaii
Frenkel, J.A. (1976) A monetary approach to the exchange rate: a doctrinal aspects and empirical evidence, The Scandinavian
Journal of Economics, 78(2), pp. 200-224.
Frenkel, J. (1979) On the mark: a theory of floating exchange rates based on real interest differential. American Economic
Review, 69, pp. 610-622.
Gencay, R. (1998) The predictability of security returns with simple technical trading rules, Journal of Empirical Finance, 5, pp.
47–359.
121
Hybrid System Application for Time Series Forecasting: The Case of MYR/USD Exchange Rate
Hiemstra, Y. (1995) Modeling structured nonlinear knowledge to predict stock market returns. In R. R. Trippi (Ed.), Chaos and
Nonlinear Dynamics in the Financial Markets: Theory, Evidence and Applications, pp. 163–175, Chicago, IL: Irwin.
Kablan, A. (2009) Adaptive neuro-fuzzy inference system for financial trading using intraday seasonality observation model,
World Academy of Science, Engineering and Technology, 58, pp. 479-488.
Karaatli, M., Gungor, I., Demir, Y., & Kalayci, S. (2005) Estimating stock market movements with neural network approach,
Journal of Balikesir University, 2(1), pp. 22–48.
Keles, A., Kolcak, M., & Keles, A. (2008)The adaptive neuro-fuzzy model for forecasting the domestic debt, Knowledge-Based
Systems, 21, pp. 951-957.
Khashei, M., & Bijari, M. (2010) An artificial neural network (p,d,q) model for time series forecasting, Expert Systems with
Applications, 37, pp. 479-489.
Leigh, W., Purvis, R., & Ragusa, J. M. (2002) Forecasting the NYSE composite index with technical analysis, pattern
recognizer, neural network, and genetic algorithm: A case study in romantic decision support, Decision Support Systems,
32, pp. 361–377.
Long, C., Chuen J. C., & Ming, S. (2010) A self-organized neuro-fuzzy system for stock market dynamics modeling and
forecasting, International Journal Of Education And Information Technologies, 3(4), pp. 174-186.
Manish, K., & Thenmozhi, M. (2006) Support vector machines approach to predict the S&P CNX NIFTY index returns. In
Proceedings of 10th Indian Institute of Capital Markets Conference. Available from http://ssrn.com/abstract=962833.
Mamdani, E.H. (1974) Applications of fuzzy algorithm for control of a simple dynamic plant. Proceeding IEEE, 121(12), pp.
1585-1588.
Meese, R.A., & Rogoff, K. (1983) Empirical exchange rate models of the seventies, do they fit out of sample? Journal of
International Economics, 14, pp. 3-24.
Quek, C. (2005) Predicting the impact of anticipator action on US stock market – An event study using ANFIS (a neural fuzzy
model), Computational Intelligence, 23, pp. 117–141.
Shaari, A.H., Gharleghi, B., Omar, K., Sarmidi, T. (2011) A novel hybrid model for exchange rate forecasting in ASEAN, in
proc. 2nd International Conference on Business and Economic Research, Malaysia, pp. 99-108.
Shaari, A.H., Gharleghi, B. (2011) Application of dynamic models for exchange rate prediction, International Journal of
Innovation, Management and Technology, 2(6), pp. 459-464.
Saad, E. W., Prokhorov, D. C., & Wunsch, D. C. (1998) Comparative study of stock trend prediction using time delay, recurrent
and probabilistic neural networks, IEEE Transactions on Neural Networks, 9, pp. 1456–1470.
Trinkle, B. S. (2006) Forecasting annual excess stock returns via an adaptive network-based fuzzy inference system, Intelligent
Systems in Accounting, Finance and Management, 13(3), pp. 165–177.
Vieira, J., Dias, F. M., & Mota, A. (2004) artificial neural networks and neuro-fuzzy systems for modeling and controlling real
systems: a comparative study, Engineering Applications of Artificial Intelligence, 17, pp. 265-273.
Yunos, Z. M., Shamsuddin, S. M., & Sallehuddin, R. (2008) Data Modeling for Kuala Lumpur Composite Index with ANFIS. In
Second Asia International Conference on Modeling and Simulation, AICMS 08, Kuala Lumpur pp. 609–614.
Yudong, Z., & Lenan, W. (2009) Stock market prediction of S&P 500 via combination of improved BCO approach and BP
neural network. Expert Systems with Applications, 36(5), pp. 8849–8854.
Zadeh, L. A. (1965) Fuzzy sets. Information and Control, 8, pp. 338-353.
122