Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 301 https://internationalpubls.com Prediction of Exchange Rates using Neural Networks and Performance by Friedman’s Test Ashwini1, Dr. N. Konda Reddy2, Dr. K Murali Krishna3 1 Research Scholar, Department of Engineering Mathematics, K L E F, Vaddeswaram, Guntur Dt, Andhra Pradesh. Email : ashwini.sunder@gmail.com 2 Associate Professor, Department of Engineering Mathematics, K L E F, Vaddeswaram, Guntur Dt, Andhra Pradesh. Email : kondareddymamatha@gmail.com 3Assistant Professor, Department of Statistics, G Pulla Reddy Degree and PG College,Mehdipatnam, Hyderabad Telangana. Email : kmuralik68@gmail.com Article History: Received: 15-05-2024 Revised: 25-06-2024 Accepted: 10-07-2024 Abstract: Forecasting of exchange rates plays a pivotal role in global trade, stocks and making the policies of exports and imports. USD exchange rates used widely for many business areas. In this paper an attempt is made to predict INR/USD exchange rates using Feed forward Neural Networks and Box-Jenkins methodology. The forecasting performance of the developed models were tested using error measures like MAE, MAPE and RMSE. The results shows FFNN model has better model than ARIMA model. The predicted exchange rates would vary between 83.06 and 83.28 for the out sample and this variation is exchange rates would help the business people and also for framing the government policies in the future. Keywords: Exchange Rates, Box Jenkins methodology, FFNN, MAE, MAPE and RMSE 1. Introduction The value of one currency for the purpose of conversion to another is called exchange rate. In finance, and exchange rate is the rate at which one currency will be exchanged for another. Reserve Bank of India buys foreign exchange when the exchange rate is low and sells the same when it is sufficiently high. The exchange rate is a key financial variable affects decisions made by foreign exchange investor, exporters, importers, banks, business, financial institutions, policy makers and tourists in the developed as well as developing world. Foreign exchange rates are affected by many highly correlated economic, political and even psychological factors. The interaction of these factors is in a very complex fashion. Therefore to forecast the changes of foreign exchange rates is generally very difficult. Researchers and practioners have been striving for an explanation of movement of exchange rates. Thus various kinds of forecasting methods have been developed by many researchers and experts. Currency forecasts are useful in the international aspects of project evaluation, strategic planning, pricing, working capital management and the analysis of portfolio investments. Most conventional econometric models are not able to forecast exchange rates with significantly higher accuracy. In recent years, there has been a growing interest to opt the state–of–the–art artificial intelligence technology to solve the problem. One stream of these advanced techniques Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 302 https://internationalpubls.com focuses on the use of artificial neural networks (ANN) to analyse the future movements in the Foreign exchange Market. Neural networks applications in time series forecasting is discussed by Krishna Reddy and Kalyani 2005[4] and Zhang et-al1998 [13]. Modelling exchange rates using Box- Jenkins methodology, Neural networks and its applications presented by Huang and Lai 2004[2] Kuan and Liu, 1995[5], Kamruzzaman,2004[3]. 2. Review of Forcasting Methods 2.1 Box-Jenkins Methodology In this section, the modelling of exchange rates INR-USD in India per 10gm using Box-Jenkins methodology is discussed. The Box-Jenkins procedure is concerned with the fitting of an ARIMA model of the following form for the a given set of data {Zt : t=1, 2, …….. n} and the general form of ARIMA (p, d, q) model is given by ∅(𝐵)∇dZt = θ(B)at Where ∅(𝐵) = 1 − ∅1𝐵 − ∅2𝐵2 − − − − − ∅𝑝𝐵𝑝 𝜃(𝐵) = 1 − 𝜃1𝐵 − 𝜃2𝐵2 − − − −𝜃𝑞𝐵𝑞 and ∇𝑑= (1 − 𝐵)𝑑 where 𝐵𝐾𝑍𝑡 = 𝑍𝑡−𝑘 𝑎𝑛𝑑 𝑎𝑡 is a white noise process with zero mean and variance 𝜎𝑎 2. The Box- Jenkins procedure consists of the following four stages. (i) Model Identification, where the orders d, p, q are determined by observing the behavior of the corresponding autocorrelation function (ACF) and partial autocorrelation function (PACF). (ii) Estimation, where the parameters of the model are estimated by the maximum likelihood method. (iii) Diagnostic checking by the “Portmanteau Test”, where the adequacy of the fitted model is checked by the LJung-Box statistic, applied to the residual of the model. (iv) Forecast is obtained from an adequate model using minimum mean squared error method. If the model is judged to be inadequate, stages (i) to (iii) are repeated with different values of d, p, and q until an adequate model is obtained L Jung G.M. et al., 1979 [9]. 2.2 NEURAL NETWORKS MODEL An artificial neural networks (ANN) is a mathematical model which is inspired by the structure and functional aspects of biological neural networks is a powerful forecasting model. It consists of an interconnected group of artificial neurons, and it processes information using a approximate approach to computation. In this paper we develop a feed forward neural networks (FFNN) model for fore casting exchange rates. Feed forward neural network (FFNN) structure is a three layer network and it consists of an input layer, a hidden layer and an output layer. Total number of input neurons needed in this model is one, and it representing the values of lag1 (previous day exchange rate). In this model only one output unit is needed and it indicates the forecasts of exchange rate for INR-USD. The following table displays information about the neural networks model, including the dependent variable, number of input and output units, rescaling method, number of hidden layers and units and activation functions. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 303 https://internationalpubls.com Network Information Input Layer Covariates 1 Lag1 Number of units a 1 Rescaling method of covariates standardized Hidden Layer(s) Number of Hidden Layers 1 Number of units in Hidden Layer 1a 3 Activation Function Hyperbolic Tangent Output Layer Dependent Variables 1 INR-USD Number of Units 1 Rescaling method for scale Dependents. Standardized Activation Function Identity Error Function Sum of Squares a. Excluding the bias unit. Back propagation Theorem is used in learning of the network. The network is trained using back propagation algorithm until the sum of squares of error is small for the training set. Haykin, 1999, Rama Krishna et al., 2013, [1,11]. 2.3 Testing Equality Of Forecasting Performance Of The Models To compare the multiple forecasting models with respect to absolute errors Friedman’s test is used. Under the null hypothesis that all models are equivalent in performance the Friedman’s test statistics is given by 𝜒𝐹 2 = 12 𝑛𝑘(𝑘+1) ∑ 𝑅𝑗 2𝑘 𝑗=1 - 3n (k+1) is approximately distributed as 𝜒2 with k-1 degrees of freedom and where k=1 number of models, n = number observations in each model. The data are daily FEDAI indicative from 1st January,2019 to 23rd October, 2023 from http://dbie.rbi.org.in and the same is divided into training sample (till 29th September, 2023) and out- of-sample (from 3rd April, 2023 to 23rd October, 2023). The ARIMA and FFNN models fitted to the training sample and validated on the out of sample. The actual time series data was plotted in Figure- 1 and it shows more fluctuations in the INR-USD exchange rates over a period of time. 3. BUILDING ARIMA MODEL The development of ARIMA model for any variable involves Identification, Estimation, Diagnostics Checking and Forecasting. The time plot of daily exchange rates from 1st January, 2019 to 23rd October 2023 is given in figure- 1. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 304 https://internationalpubls.com Figure-1: Time Plot of Daily Exchange Rates. The sample autocorrelation function is computed to check whether the series is stationary or non- stationary. The sample ACF for 50 lags is given in figure-2. Figure-2 : Auto Correlation Function Figure-3 : Partial Auto Correlation Function From the figure-2 & 3, it is observed that the time plot as a downward trend and ACF dies out slowly for higher lags, this indicates the time series is not stationary. ARIMA model is estimated only after transforming the variable under forecasting into a stationary series. Non stationarity in variance is corrected through natural log transformation and non-stationarity in mean is corrected through appropriate differencing of the data. The time plot of transformed series is given in figure-4. Figure-4 : Time plot of Transformed Series Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 305 https://internationalpubls.com In this case is observed that difference of order 1 (d=1) is sufficient to achieve stationary in mean the newly constructed variable 𝑊𝑡 = ∇1 ln(𝑍𝑡) can now be examined for stationarity and it is observed that 𝑊𝑡 is stationary in Mean and variance. The next step is to identifying the values of 𝑝 𝑎𝑛𝑑 𝑞 for autocorrelations and partial auto correlations of various orders 𝑊𝑡 are computed. Figure-5 : ACF for transformed series. Figure-6: PACF for transformed series From the above ACF and PACF and the SPSS skilled creator was accustomed to determine the most effective ARIMA model for the prediction of USD exchange rates, as this plan to estimate the best – filtering ARIMA for one or additional variable series, therefore eliminating the necessity to spot an applicable model through trial and error methodology. It is discovered that, ARIMA (1, 1, 1) model fits the data well and therefore the same is tested on the validation set. Table 1 : ARIMA Model (1, 1, 1) Parameter Estimates Estimate SE t USD- Model_1 USD No Transformation AR Lag 1 -0.993 0.018 -55.842 Difference 1 MA Lag 1 -0.990 0.022 -44.335 From the above table ARIMA (1, 1, 1) significant with respective parameters as well as adequacy of the model. Hence the fitted model for the forecasting of USD exchange rate is (1 + 0.993B)∇1𝐼𝑛(𝑍𝑡) = (1 + 0.990𝐵)𝑎𝑡 Diagnostic checking is done through examining autocorrelations and partial autocorrelations of the residual of various orders. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 306 https://internationalpubls.com Figure 7: Residual ACF and PACF As the result indicates none of these auto correlations of residuals is significantly different from 0 at the level 0.05. The adequacy of the model is tested using L Jung-Box statistic. L Jung-Box statistic is 21.846 for 16 d. f. and the significant probability corresponding to L Jung-Box 𝑄 statistic is 0.147 which is greater than 0.05.Therefore null hypothesis of model adequacy and we conclude that (1, 1, 1) model is an adequate model for a given time series. Future exchange rates or forecasted using minimum square error method and the forecast for the period 3rd October 2023 to 23rd October 2023 are following table. Table1 2: Forecasts of Exchange Rates using ARIMA (1, 1, 1) Date USD original values USD Predicted Values 03.10.23 83.18 83.05 04.10.23 83.26 83.19 05.10.23 83.24 83.25 06.10.23 83.24 83.25 09.10.23 83.25 83.23 10.10.23 83.26 83.26 11.10.23 83.24 83.25 12.10.23 83.18 83.25 13.10.23 83.26 83.18 16.10.23 83.26 83.27 17.10.23 83.26 83.26 18.10.23 83.26 83.26 19.10.23 83.27 83.25 20.10.23 83.2 83.28 23.10.23 83.17 83.19 The Graphical representation of out of sample forecasts are given in the following table Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 307 https://internationalpubls.com Figure 8: Out of sample forecasts using ARIMA Table 3 : ARIMA (1, 1, 1) Model Performance MAE MAPE MSE RMSE In sample 0.105 0.138046 0.01105 0.105119 Out sample 0.075 0.090167 0.00865 0.093005 From the above table it is observed that ARIMA model as lowest errors measures in fitting stage and out of sample MAPE is less than 5. Therefore the model is an appropriate model for forecasting the exchange rates. Like any other measure this ARIMA technique also doesn’t guaranty perfect forecast. Nevertheless, it can be successfully used for forecasting long time series data and it should be updated from time with incorporation of current data. 4. BUILDING OF FEED FORWARD NEURAL NETWORKS (FFNN) The Feed Forward Neural Networks model for forecasting of daily exchange rates is developed using SPSS packages. The FFNN model having one input layer, hidden layers and an output layer. The hyperbolic tangent function is takes as an activation function under the back propagation algorithm. The FFNN model was trained till the testing sample error is smaller than the training sample. Table 4 : Descriptive statistics N Minimum Maximum Mean Std. Deviation Statistic Statistic Statistic Statistic Statistic USD 1164 68.3665 83.2746 75.646088 4.3568512 lag1 1163 68.37 83.27 75.6396 4.35313 Valid N (list wise) 1163 By applying trial and error method, the optimum number of hidden neurons is four and in the hidden layer and the optimum network is 1-4-1 since this network has minimum MAE, MAPE and RMSE. The following figure of feed ward neural network gives clear idea about selected model for the given data. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 308 https://internationalpubls.com Figure 9: FFNN model for prediction of INR-USD exchange rates. The FFNN Model 1-4-1 parameters are obtained and given in the following table Table 5 : FFNN 1-4-1 Model Parameter Estimates Parameter Estimates Predictor Predicted Hidden Layer 1 Output Layer H(1:1) H(1:2) H(1:3) H(1:4) USD Input Layer (Bias) 0.161 -0.204 0.184 -0.398 lag1 -0.317 0.262 0.285 -0.317 Hidden Layer 1 (Bias) 0.104 H(1:1) -1.161 H(1:2) 1.434 H(1:3) 0.380 H(1:4) -0.791 The hidden activation functions are as follows : H11 = Tanh[0.161-0.317(Zt-1 –75.6396)/ 4.3531)] H12 = Tanh[(-0.204-0.262(Zt-1 –75.6396)/ 4.3531)] H13 = Tanh[(0.184-0.285(Zt-1 –75.6396)/ 4.3531)] H14 = Tanh[(-0.398 -0.317(Zt-1 –75.6396)/ 4.3531)] Where Zt-1 is the rescaled input variable and the forecasting model is �̂�𝑡 = 𝜇𝑧 + 𝜎𝑧 (0.104 − 1.161𝐻1:1 +1.434𝐻1:2+0.380𝐻1:3-0.791𝐻1:4) The forecasting performance of FFNN model is given below Table 6 : FFNN 1-4-1 Model Performance MAE MAPE MSE RMSE In sample 0.117651 0.150968 0.01525 0.12349 Out sample 0.171566 0.206274 0.029436 0.171569 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 309 https://internationalpubls.com From the above table it is observed that the FFNN model has lowest error measures in fitting stage and forecasting stage. Since MAPE is less than 5 therefore the FFNN model is an appropriate model for forecasting the exchange rates. Table 7 : Out sample forecasts using FFNN 1-4-1 Date USD Predicted Values 03-Oct-23 83.1812 83.00856 04-Oct-23 83.2588 83.07481 05-Oct-23 83.2413 83.05989 06-Oct-23 83.2388 83.05776 09-Oct-23 83.2542 83.07089 10-Oct-23 83.2556 83.07208 11-Oct-23 83.2368 83.05605 12-Oct-23 83.1834 83.01044 13-Oct-23 83.2574 83.07362 16-Oct-23 83.2632 83.07856 17-Oct-23 83.2555 83.072 18-Oct-23 83.2571 83.07336 19-Oct-23 83.2746 83.08826 20-Oct-23 83.1982 83.0231 23-Oct-23 83.1663 82.99581 The graphical representation of out sample forecasts is given below. This presents the forecasts generated from FFNN model is close to original series and it indicates a good performance of FFNN model. Figure 10: Forecasts of USD-INR exchange rates using FFNN model 5. COMPARISION AND CONCLUSIONS The performance of ARIMA, FFNN models and its graphical representation is given below: Table 8 : Performance of the ARIMA and FFNN models Model In sample Out sample MAE MAPE RMSE MAE MAPE RMSE ARIMA 0.105 0.138046 0.105119 0.075 0.090167 0.093005 FFNN 0.117651 0.150968 0.12349 0.171566 0.206274 0.171569 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 310 https://internationalpubls.com Figure 11: Out of sample forecasts of ARIMA and FFNN models From the above table, it is observed that ARIMA and FFNN models has moderately minimum error measures in-sample and out-of-sample. One can use either ARIMA or FFNN model to forecasts of daily exchange rates for USD. But by adopting FFNN model can study the complexity and non linearity of the data. Hence it was concluded that FFNN and ARIMA models are equally performed for the daily exchange rates of USD Table 9 : Friedman’s Test for out of sample forecasts sample model Mean ranks n Chi-square p-value Out-of-sample ARIMA 1.03 15 14.00 < 0.001 FFNN 1.97 It is noticed that the significant possibility is less than 0.05, therefore the invalid speculation is dismissed and presume that there is a critical difference in the performance of the models. But based on the mean ranks of the models ARIMA gets first rank and FFNN gets the second rank. Therefore ARIMA model moderately performs better than FFNN model. References [1] Haykin, S.S., 1999, “Neural Networks. A Comprehensive Foundation”. Upper Saddle River, N.J., Printice Hall. [2] Huang, W., Lai, K. K., Nakamoni, Y. and Wang, S., (2004), forecasting foreign exchange rates with artificial neural networks: A review, International Journal of information technology and decision making, 3(1), 145-165. [3] Kamruzzaman, J., and Sarkar R.A. (2004), “ANN-Based Forecasting of Foreign Currency Exchange Rates” Neural Information Processing – Letters and Reviews 3(2), 49-58. [4] Krishna Reddy, M and Kalyani, D (2005), “Applications of Neural Networks in Time Series Forecasting”, International Journal of Management and Systems, Vol. 21. 53-64. [5] Kuan, C. M., and T.Liu (1995), “Forecasting Foreign Exchange Rates using feedforward and recurrent neural networks”. Journal of Applied Econometrics, 10:347-364. [6] K.Murali Krishna, Dr.M. Raghavender Sharma and Dr.N.Konda Reddy, Forecasting of silver prices using Artificial Neural Networks. JARDCS, Volume 10, 06 issue 2018. [7] K.Murali Krishna, Dr.M.Raghavender Sharma and Dr.N. Konda Reddy, Forecasting of Daily prices of Gold in India using ARIMA and FFNN models. IJEAT, ISSN:2249-3958,Volume-8,Issue-3,February 2019. [8] Marrewijk, C. (2004), An introduction to international money and foreign exchange markets, Discussion paper No. 0407, Centre for international economic studies, University of Adelaide, Australia. [9] L. Jung. G.M and Box, GE.P, (1979) “On A measure of Lack Fit in Time series models”. [10] Pami Dua and Rajiv Ranjan (2011), Modelling and forecasting the indian RE/US Dollar Exchange rate, working paper No. 197, Centre for development economics, University of Delhi. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 31 No. 5s (2024) 311 https://internationalpubls.com [11] R.Rama Krishna & Naveen Kumar.B. 2013, Forecasting yield per Hectore of Rice in AP, IJMCAR, ISSN 2249- 6955, Volume 3, Issue 1, March 2013, 9-14. [12] Venugopala Rao Manneni, Naveen Kumar Boiroju and M.Krishna Reddy (2011), Classification using feed forward neural network, International J. of Math. Sci. &Engg. Appls. (IJMSEA), Vol.5 (6), 223-227. [13] Zhang, G., Patuwo, B.E. and Hu, M.Y. (1998), Forecasting with Artificial Neural Networks: The State of the Art, International Journal of Forecasting, 14, 35-62.