You are on page 1of 5

Exchange rate prediction model analysis based on improved artificial neural

network algorithm

Shuheng Wang
University of California, San Diego, CA 92092, USA
Ziqing Tang
Minzu University of China, 100081,China
Binghao Chai
University College LondonWC1E 6BTUnited Kingdoms

Abstract: Predicting stock prices and currency exchange data analytical techniques including machine learning and
rates is attracting a great amount of research efforts because artificial intelligence. In both the literature and in practice,
of the increasing interests in the prediction models attributed many groups have been trying to employ the power of
to varying stock markets on a daily basis. This paper artificial neural networks to develop more accurate time series
investigates a prediction model combined with an ARIMA prediction.
(Auto regressive integrated moving average model) and a
three layer artificial neural network. The complete dataset of
from 2010 – 2013 has been collected, and nine descriptors
have been used to train the neural network. The experiment
has been tested on the USD/EURO exchange rates. The
performance measure is quantified in terms of mean
absolute error, mean square error and root mean square
error. Experimental results and comparisons demonstrate
that the proposed method outperforms the global modeling
techniques in terms of profit returns. The predictive power is
also clearly shown with a predictor accurately fitting the
actual exchange rate data. Figure 1. Exchange rate fluctuation (USD – EURO)

The figure 1 illustrates a time series of 10 year


Keywords: Forex exchange rates, neural networks, ARMA,
exchange rate fluctuation for the EUR - USD currency pair
ARIMA models, prediction
from 2008 – 2016. The fluctuations have been more
I. INTRODUCTION pronounced in the past decade, which could be clearly
observed from the graphical data. Consequently, several
Financial analytics on time series prediction plays a very advanced prediction models have been proposed. With the
critical role in global financial markets and international advent of machine learning techniques, neural networks [15]
policy making on a daily basis. Bullion rate determination and and artificial intelligence techniques have been researched and
stock determination [19] in financial markets heavily depend put forward. A survey of neural network models implemented
on exchange rates. Unlike the past period when exchange rate for prediction have been studied in the literature and presented.
An Artificial Neural Network (ANN), often just called a
fluctuation on a daily basis was very minimal, today’s
neural network, is a set of interconnected links that have
situation has attracted a great amount of investigation and
weights associated with them. The concept of ANN was
implementation of models for predicting the exchange rates. A
derived from biological neural networks. Any ANN can be
stable exchange rate can be helpful for countries. However,
thought of as a set of interconnected units broadly categorized
the time series of foreign exchange rates are inherently noisy.
More specifically, the non-stationary feature of the time series into three layers. These three layers are the input layer, the
provides challenging research problems. hidden layer and the output layer. Inputs are fed into the input
layer, and its weighted outputs are passed onto the hidden
layer. The neurons in the hidden layer (hidden neurons) are
The recent international financial crisis has highlighted the essentially concealed from view. Using additional levels of
need for banks to implement effective systems for estimating hidden neurons provides increased flexibility and more
the market risk. In particular, the cross border activities of the accurate processing. To tackle the non-stationary issues,
multinational financial institutions and the increasing volatility neural networks have the built-in noise tolerant quality, having
of exchange rates emphasize the importance of risk embed in the flexibility to learn complex systems with noisy data and
foreign exchange rate. The active management by the financial sometimes even with incomplete and corrupted data. However,
institutions utilizes effective forecasting models, including
the flexibility comes at the cost of extra complexity in the model [2] is developed in which a predefined number of
training algorithm. Having more hidden neurons than simulated data series is generated and they are tuned by an
necessary is wasteful, as a less number of neurons would serve efficient particle swarm optimization algorithm. Using two
our purpose just fine. datasets of real Euro/ Dollar rates, how the proposed hybrid
In the literature, many related research articles have model could reasonably enhance the results of GARCH-type
been published. For example, a prediction model through a models and the traditional neural network in terms of different
feed forward neural network [5] has been implemented where performance measures is demonstrated. Illustrations on how
a multilayer perceptron was trained using the back the respective simulated data series as the input variable to the
propagation algorithm. For US dollar, EURO, GBP and network could contribute to improve the accuracy of volatility
Japanese Yen against Nigerian Currency (Naira), the forecasting are presented in the paper.
activation function for the neural network is a sigmoid type. As a comparison, another model with the hybrid
Mean squared error and standard deviation have been taken as neural network architecture [3] of Particle Swarm
the output parameters and compared with Markov based Optimization and Adaptive Radial Basis Function (ARBF–
models and 81% accuracy has been reported. In another PSO) has been implemented for financial forecasting purposes
research, a different prediction model using a hybrid model [9] by benchmarking the ARBF–PSO results with those of three
comprising of the ANN and ARIMA (Auto regressive different neural networks architectures, a Nearest Neighbors
integrated moving average) has been implemented for the algorithm (NN), an autoregressive moving average model
weekly data of Indian rupee against US dollar. The output of (ARMA), a moving average convergence/divergence model
ARIMA has been used to train the neural feed. The outcome (MACD) plus a naive strategy. More specifically, the trading
of this hybrid model is observed to perform better than the and statistical performance of all models is investigated in a
linear autoregressive and random walk models and produced forecast simulation of the EUR/USD, EUR/GBP and
similar results to that of the ANN. A new fuzzy time series EUR/JPY ECB exchange rate fixing time series over the
model [7] [13] to improve forecasting have been presented period January 1999–March 2011 using the last 2 years for
where membership functions of varying degrees are used to out-of-sample testing.
relate the fuzzy outputs to the crisp outputs. These fuzzy
relationships are then used to forecast the stock index in II. PROPOSED WORK
Taiwan. This study performs out of sample for recasting and
the results are compared with those of previous studies to In this paper, we propose a model with a three layer
demonstrate the performance of the proposed model. In a neural network implemented using inputs from an ARIMA
different study of [11], the prediction of six different process. We will test the predictive power of the model on a
currencies against Australian dollar and their evaluation time series of USD-EURO exchange rates. Three critical
results are constructed by methodologies including Standard phases are involved in the construction of neural network for
Back propagation (SBP), Scaled Conjugate Gradient (SCG) the purpose of training. The three layers consist of the input
and Back propagation with Bayesian Regularization (BPR). A layer, hidden layer and the output layer. The interneuron
feed forward multilayer perceptron (MLP) [6] model by using connections have various strengths, also known as synaptic
the historic records regarding the stock share has been weights, which will be iteratively calculated. A three layer
implemented in order to predict a company’s stock value and neural network model is shown in figure 2.
compared it with Elman Recurrent Network and Regression
Model. Results indicate that MLP has lower MSE, MAPE, and
MAE values in comparison with Elman and linear regression
whereas the Elman recurrent neural network outperforms the
multilayer perceptron in predicting the direction of changes.
Time series forecasting has been carried out using two ANN
techniques [14], multilayer perceptron (MLP) and Volterra.
On the other hand, although the multilayer perceptron (MLP)
neural network is used widely in forecasting systems, it has
the drawback of being time consuming and not being able to
restore the memory of past events. The findings in [1] report
that hidden Markov Models are unstable for trading tool on
foreign exchange data as the results are dependent on too
many factors. To improve the existing prediction models, a
hybrid forecasting model [18] that optimizes the Elman Figure 2. A three layer neural network model
Recurrent Neural Network (Elman NN) for predicting the
Taiwan stock price trends has been implemented. That model The first and foremost process is the data collection
stands out among the other proposed models, due to nonlinear whose objective is to obtain regularization in the frequency of
prediction capabilities, faster convergence, and accurate the data for investigation. The relationship between the data
mapping abilities. Another new neural network based hybrid components is studied and trained in the neural network and
the output is used to predict the behaviour of the exchange
rates, data analysis and feature selection. Following the data First, the range of inputs we consider involves micro-
collection phase, it is the data analysis which is used to select economic data, macro-economic data, and trading data in the
the data used to train ANN among those initially collected. market. The size of data set amounts to approximately 900
This phase is crucial, because the learning capacity of the daily price quotes from 2010 to 2013 for each currency.
ANN depends on the quality of information provided. It Among the data set, 400 daily data is prepared for training,
involves whether this information provides a true while 300 daily data is for validation and the remaining 200
representation of the phenomenon without producing daily data is reserved for testing as shown in table 1. The first
ambiguous, distorting or amplifying effects in the phases of 400 daily data are used as inputs to the neural network. The
training networks. The final stage of selection of variables first 400 daily data are fed to the neural networks to predict
involves the calculation of the correlation coefficients among the following 100 daily’s rate after training and validation.
time series data, which will eventually provide selective The data were collected from January 2010 to December 31,
elimination of redundant variables and unwanted data. 2013. The variables of input are listed in the Table 1,
In general, models for time series can have many forms indicating the frequency of the data collection and the
and represent different stochastic processes. In the literature, acronyms of variables used in the tables of the similarity
two important models are widely studied, namely the ARMA matrix. During the data analysis phase, the variables
and ARIMA model. These two classical models are related characterized by a Pearson correlation coefficient with at least
with each other. The following sections will utilize the neural one other variable considered above the threshold level of
networks with an ARIMA model to forecast the fluctuations in acceptance equal to 0.802 monthly variables are eliminated
currency exchanges. because, having developed a neural network with a daily
frequency of data collection of variables of input and output,
A. ARMA model they were considered potentially able to produce ambiguous or
An ARMA (p, q) model is a combination of AR (p) and redundant signals during the training of ANN. As a result of
MA (q) models and is suitable for univariate time series the selection of variables conducted according to the criteria
modelling. In an AR (p) model the future value of a variable is outlined above, the final set of seven input variables to train
assumed to be a linear combination of p past observations and the neural network is obtained. The variables utilized for the
a random error together with a constant term. training process are the USD/EUR exchange rate, exchange
Just as an AR (p) model conducts regression over past rate return, and squared value of exchange rate return, absolute
values of the series, an MA (q) model uses past errors as the value of return, NASDAQ index, Crude oil price and Gold
explanatory variables. Autoregressive (AR) and moving spot price.
average (MA) models can be effectively combined together to The number of epochs for which the network is been
form a general and useful class of time series models, known trained plays an important role in the forecasting. The
as the ARMA models. Mathematically an ARMA (p, q) model performance of both networks were been analyzed by varying
is represented as the epoch size. It is been observed that on training the network
 
             (1) with more number of epochs the network learns the pattern in
the data very well giving more accurate results. The learning
B. ARIMA model rate is a critical factor in the training of the neural networks.
The ARMA models are used for stationary time series On training with a high (0.30) learning rate, it is observed that
data. However in practice many time series such as those the network ends up going into local minima. On the other
related to socio-economic business show non-stationary hand, by keeping a low learning rate (0.10) the network learns
behaviour. Time series, which contain trend and seasonal slowly but tends to reduce the possibility of ending up in local
patterns, are also non-stationary in nature. Thus from minima.
application view point ARMA models are inadequate to
properly describe non-stationary time series, which are
frequently encountered in practice. For this reason the ARIMA
model is proposed, which is a generalization of an ARMA
model to include the case of non-stationary as well. In
ARIMA models a non-stationary time series is made
stationary by applying finite differencing of the data points.
The mathematical formulation of the ARIMA (p, d, q) model
using lag polynomials is given below.
          (2)
p, d and q in (2) are orders of the ARIMA model. The
parameter d controls the level of differencing.

III. RESULTS AND DISCUSSION


Figure 3. Neural network implementation
Figure 3 depicts the snapshot of the neural network
implementation. The neural network consists of the hidden
neurons with weights updated using the conventional weight
update algorithm. LM technique has been used for the training
process. Hybrid model developed using ANN and ARIMA
were compared with the conventional models using Fuzzy,
ANN techniques and the error measures Mean Absolute Error
(MAE), Mean Square Error (MSE) and Root Mean Square
Error (RMSE).

Figure 5. Prediction of exchange rate for 50 days

It could be seen that there is a drastic improvement in


the efficiency of proposed ARIMA model in predicting the
Figure 4. Observed MAE for USD/EURO USD/EURO currency rates which is evident from the mean
Mean absolute error is given as absolute error and root mean squared error values.
 
    (3)
   IV. CONCLUSION
The MSE on the other hand specifies the difference
between the estimator and what is estimated. MSE is a risk
Exchange rate data is highly time-variant and are normally
function, corresponding to the expected value of the squared
in a nonlinear pattern, predicting the future exchange rate
error loss or quadratic loss. Figure 4 depicts the observed
between any two currencies is highly challenging. The noisy
mean absolute error values against the epoch number. 500
feature of the time series is due to the unavailability of
epochs have been used for convergence of the error. The
complete information from the past history of financial
difference occurs because of randomness or because the
markets to capture the full dependency between future and
estimator doesn't account for information that could produce a
past prices. Because the historical data is the major source of
more accurate estimate.
information in the prediction, the noisy data affects the results
And MSE is given as
  
dramatically. In the literature review, different data mining
      (4) techniques for time series prediction are reviewed. It is noticed

that Artificial Neural Network technique is very useful in
predicting exchange rates. Because of the high volatility,
Table 1. Analysis of output parameters (USD – EURO) complexity and noise market environments, neural networks
Quality Fuzzy ANN ANN- ANN - techniques are prime candidates for prediction purpose. The
measures ARMA ARIMA proposed ARIMA model using neural network is seen to
MSE 0.774 0.658 0.447 0.284 exhibit superior performance in prediction of exchange rates
RMSE 0.874 0.641 0.325 0.254 for a period of 50 days. It could be seen that the predictor
MAE 0.611 0.417 0.370 0.262 follows the actual result very closely throughout the test
period of 50 days. In the literature, many other algorithms
Table 1 illustrates the comparison of the proposed ANN – have been used with neural networks. The empirical results
ARIMA against the conventional Fuzzy and ANN predictor show that the model developed in this study has the predictive
models. power as follows. For the USD/EURO exchange rate, the
model exhibits an absolute relative error between the predicted
value and the actual value of 0.343%, and the correlation
coefficient is as high as 0.99545.
Time series forecasting is a fast growing area of
research and it provides many opportunities for future research.
One of possible directions is the Combining Approach, i.e., to
combine a number of different and dissimilar methods to
improve forecast accuracy. Recent research done on this field
has shown that by combining these predictive tools it is
possible to produce a more effective mixed model with the
potential advantages for exchange rate forecasting. Another
research possibility could be to examine the impact of external [17] Gitansh Khirbat, Rahul Gupta, Sanjay Singh, “Optimal Neural Network
variables, such as political events, on the exchange rate Architecture for Stock Market Forecasting”, IEEE International Conference
on Communication Systems and Network Technologies, 2013.
mechanism. Recent political situations have shown that the [18] Wei, L. Y., & Cheng, C. H. “A hybrid recurrent neural networks model
governmental instability experienced by one country could based on synthesis features to forecast the Taiwan stock market”, International
have irreversible consequences on the economical journal of innovative computing information and control, Vol. 8, No. 8, pp.
development of neighbouring countries, and thus affect or 5559-5571, 2012.
[19] Kunwar Singh Vaisla and Dr. Ashutosh Kumar Bhatt, “An Analysis of
inhibit any advantageous agreement fostered by neutral parties. the Performance of Artificial Neural Network Technique for Stock Market
These sources of systemic risk may be taken into account for a Forecasting”, International Journal on Computer Science and Engineering,
better model. Vol. 02, No. 06, pp. 2104-2109, 2010.

REFERENCES

[1] Philip, A. A., Taofiki, A. A., Bidemi, A. A, “Artificial Neural Network


Model for Forecasting Foreign Exchange Rate”, World of Computer Science
and Information Technology Journal, Vol. 1, No. 3, pp. 110-118, 2011.
[2] Aladag, C.H., Yolcu, U., Egrioglu, E., Dalar, A.Z., “A new time invariant
fuzzy time series forecasting method based on particle swarm optimization”,
Applied Soft Computing, Vol. 12, pp. 3291–3299, 2012.
[3] Sermpinis G, Theofilatos K, Karathanasopoulos A, Georgopoulos EF,
Dunis C, “Forecasting foreign exchange rates with adaptive neural networks
using radial-basis functions and particle swarm optimization”, European
Journal of Operations Research, Vol. 225, pp. 528–540, 2013.
[4] Sheikhan M, Mohammadi N, “Time series prediction using PSO-
optimized neural network and hybrid feature selection algorithm for IEEE
load data”, Neural Computer Applications, Vol. 23, pp. 1185–1194, 2013.
[5] Adewole Adetunji Philip, Akinwale Adio Taofiki, Akintomide Ayo
Bidemi, “Artificial Neural Network Model for Forecasting Foreign Exchange
Rate”, in World of Computer Science and Information Technology Journal
Vol. 1, No. 3,pp. 110-118,2011.
[6] Naeini, M. P., Taremian, H., & Hashemi, H. B. “Stock market value
prediction using neural networks”, Proceedings of International conference on
Computer Information Systems and Industrial Management Applications, pp.
132-136, 2010.
[7] Khaled A, Hosseini S, “Fuzzy adaptive imperialist competitive algorithm
for global optimization”, Neural Computing Applications, Vol. 25, pp. 1–13,
2014.
[8] Akhter Mohiuddin Rather, “A prediction based approach for stock returns
using autoregressive neural networks”, IEEE, 978-1-4673-0126-8, 2011.
[9] Mehdi Khashei, Mehdi Bijari, “Exchange Rate Forecasting Better with
Hybrid Artificial Neural Networks Models”, in Journal of Mathematical
Computational Science, Vol. 1, No. 1, 103-125, 2011.
[10] Yusuf Perwej and Asif Perwej, “Prediction of the Bombay Stock
Exchange (BSE) Market Returns Using Artificial Neural Network and
Genetic Algorithm”, Journal of Intelligent Learning Systems and Applications,
Vol. 4, pp. 108-119, 2012
[11] Mehreen Rehman, Gul Muhammed Khan and Sahibzada Ali Mahmud,
“Foreign currency exchange rates prediction using CGP and recurrent neural
network”, Proceedings of international conference on future information
engineering, Vol. 10, pp. 239 – 244, 2014.
[12] Ravi, V., Lal, R., Raj Kiran, N., “Foreign Exchange Rate Prediction
using computational Intelligence methods”, International Journal of Computer
Information Systems and Industrial Management Applications, Vol. 4, pp.
659–670, 2012.
[13] T. H.-K. Yu and K.-H. Huarng, “A Neural Network-Based Fuzzy Time
Series Model to Improve Forecasting,” Expert Systems with Applications, Vol.
37, No. 4, 2010.
[14] Kryuchin, O. V., Arzamastsev, A. A., & Troitzsch, K. G. “The prediction
of currency exchange rates using artificial neural networks”, Exchange
Organizational Behavior Teaching Journal, No. 4, 2007.
[15] Gheyas, I.A., Smith, L.S., “A novel neural network ensemble architecture
for time series forecasting”, Neuro Computing Journal, Vol. 74, pp. 3855–
3864, 2011.
[16] Sermpins, K., Theofilatos, K., Karanthanpoulos, A., Georgopoulos, E.F.,
Dunis,C., “Forecasting foreign exchange rates with adaptive neural networks
using radial basis functions and particle swarm optimization”, European
Journal of Operational Research, Vol. 225, pp. 528–540, 2013.

You might also like