Results and Simulations

Tables 10.1-10.15 show the prediction performance of two different models: the LSTM model and the GRU model, over various days-ahead predictions. The historical forex data of five different currencies are taken and applied to the proposed model. The resulted outputs are then compared with the actual output to measure the performance characteristics of both approaches. Although monetary exchange values are dynamic in nature, sudden increments or decrements of an exchange rate is quite difficult to handle using traditional networks; they also require more time to understand the pattern and update the weights to adjust the model accordingly. As the recurrent neural networks can remember previous information, these two special kinds of RNN can handle complex data with long term dependency and execute them in few'er iterations. The results of the LSTM and GRU models are tabulated by taking different window sizes (i.e., 7, 10, and 13). While increasing the number of the days-ahead prediction, the values of the performance measuring parameters also increase.

For Sliding Window Size 7

According to Tables 10.1—10.5, the GRU model has performed better than the LSTM model. Some of the performance measuring parameters have similar values for both models but, as a whole, the GRU approach gives more accurate results for the given samples of the daily dataset for sliding window size 7.

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.4298

0.0041

0.9480

0.0550

0.0027

57

0.3724

0.0036

0.9585

0.0421

0.0024

57

CAD

0.3592

0.0061

0.9773

0.0231

0.0023

59

0.3397

0.0058

0.9792

0.0212

0.0022

58

GBP

0.4758

0.0079

0.9785

0.0219

0.0030

54

0.4068

0.0068

0.9840

0.0164

0.0026

54

INR

0.1889

0.1697

0.9762

0.0238

0.0013

50

0.1880

0.1694

0.9763

0.0240

0.0013

49

JPY

0.4238

0.6241

0.9339

0.0661

0.0028

50

0.4112

0.6097

0.9369

0.0626

0.0027

50

TABLE 10.2

The Three-Days-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.7073

0.0068

0.8527

0.1505

0.0044

55

0.7094

0.0068

0.8525

0.1454

0.0044

55

CAD

0.6392

0.0104

0.9331

0.0728

0.0040

57

0.6299

0.0103

0.9347

0.0697

0.0697

57

GBP

0.7754

0.0130

0.9419

0.0607

0.0050

53

0.7272

0.0122

0.9490

0.0519

0.0046

54

INR

0.3417

0.2934

0.9272

0.0709

0.0023

49

0.4434

0.3595

0.8907

0.1032

0.0028

49

JPY

0.7551

1.0412

0.8134

0.1817

0.0047

50

0.7265

1.0070

0.8255

0.1741

0.0045

51

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.9116

0.0089

0.7477

0.2584

0.0058

58

0.8951

0.0087

0.7599

0.2366

0.0057

60

CAD

0.8557

0.0137

0.8843

0.1340

0.0053

56

0.8952

0.0143

0.8746

0.1334

0.0055

56

GBP

0.9870

0.0165

0.9060

0.1014

0.0063

57

0.9074

0.0149

0.9239

0.0796

0.0057

58

INR

0.4801

0.3939

0.8688

0.1252

0.0030

54

0.4202

0.3612

0.8897

0.1076

0.0028

53

JPY

0.9572

1.3271

0.6969

0.2882

0.0060

57

0.9516

1.3142

0.7028

0.2883

0.0059

54

TABLE 10.4

The Seven-Days-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

1.1776

0.0114

0.5866

0.3865

0.0074

56

1.1946

0.0116

0.5738

0.3981

0.0076

57

CAD

1.0249

0.0164

0.8341

0.1980

0.0063

54

1.0274

0.0164

0.8332

0.1837

0.0064

55

GBP

1.2420

0.0210

0.8486

0.1631

0.0080

52

1.2090

0.0204

0.8572

0.1555

0.0078

53

INR

0.5236

0.4345

0.8403

0.1510

0.0033

54

0.5245

0.4360

0.8392

0.1503

0.0034

52

JPY

1.0706

1.4721

0.6270

0.3691

0.0066

49

1.0770

1.4700

0.6281

0.3789

0.0066

50

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

1.4997

0.0148

0.3057

0.5800

0.0096

55

1.3444

0.0131

0.4567

0.5167

0.0085

56

CAD

1.2397

0.0198

0.7582

0.3019

0.0077

55

1.2609

0.0200

0.7535

0.2948

0.0077

55

GBP

1.5861

0.0269

0.7491

0.2889

0.0103

56

1.4124

0.0242

0.7969

0.2503

0.0093

57

INR

0.6116

0.5181

0.7673

0.2162

0.0040

49

0.5996

0.5001

0.7832

0.1985

0.0038

51

JPY

1.3903

1.8456

0.4078

0.5589

0.0083

51

1.2942

1.7395

0.4739

0.5396

0.0078

50

TABLE 10.6

The One-Day-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.3934

0.0038

0.9540

0.0465

0.0025

57

0.3854

0.0038

0.9554

0.0449

0.0024

57

CAD

0.3614

0.0061

0.9769

0.0233

0.0024

59

0.3228

0.0055

0.9810

0.0194

0.0021

58

GBP

0.3983

0.0068

0.9841

0.0161

0.0026

54

0.4320

0.0073

0.9818

0.0186

0.0028

54

INR

0.1906

0.1706

0.9754

0.0245

0.0013

51

0.1901

0.1707

0.9754

0.0248

0.0013

49

JPY

0.4919

0.7028

0.9150

0.0802

0.0031

50

0.4183

0.6161

0.9347

0.0642

0.0028

51

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.7919

0.0076

0.8153

0.1835

0.0050

55

0.7096

0.0068

0.8518

0.1488

0.0044

55

CAD

0.6863

0.0111

0.9233

0.0821

0.0043

58

0.7460

0.0119

0.9119

0.0915

0.0046

57

GBP

0.7442

0.0125

0.9460

0.0578

0.0048

54

0.7498

0.0126

0.9453

0.0581

0.0048

54

INR

0.3368

0.2894

0.9292

0.0695

0.0022

49

0.4399

0.3577

0.8918

0.1019

0.0028

50

JPY

0.8005

1.1159

0.7857

0.2062

0.0050

50

0.7520

1.0431

0.8127

0.1827

0.0047

51

TABLE 10.8

The Five-Days-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.9427

0.0093

0.7248

0.2726

0.0060

59

0.9558

0.0094

0.7169

0.2874

0.0061

59

CAD

0.8518

0.0136

0.8859

0.1321

0.0053

56

0.8500

0.0136

0.8861

0.1257

0.0053

56

GBP

0.9937

0.0167

0.9032

0.1003

0.0064

58

0.9636

0.0162

0.9092

0.0994

0.0062

59

INR

0.4344

0.3658

0.8840

0.1119

0.0028

54

0.5691

0.4530

0.8221

0.1601

0.0035

53

JPY

0.9334

1.2612

0.7235

0.2802

0.0057

55

0.9145

1.2453

0.7304

0.2718

0.0056

54

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

1.1999

0.0117

0.5660

0.4089

0.0076

57

1.0788

0.0106

0.6406

0.3624

0.0069

56

CAD

1.0249

0.0164

0.8334

0.1984

0.0064

55

1.0200

0.0163

0.8356

0.1856

0.0063

55

GBP

1.2729

0.0215

0.8394

0.1672

0.0082

51

1.1683

0.0196

0.8660

0.1516

0.0075

52

INR

0.5267

0.4491

0.8252

0.1665

0.0035

54

0.5330

0.4405

0.8317

0.1564

0.0034

53

JPY

1.1341

1.5432

0.5860

0.4011

0.0069

49

1.1146

1.5135

0.6018

0.3987

0.0068

50

TABLE 10.10

The Ten-Days-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

1.4841

0.0146

0.3102

0.5934

0.0095

55

1.3396

0.0130

0.4548

0.5253

0.0085

55

CAD

1.3119

0.0209

0.7305

0.3186

0.0081

55

1.2552

0.0199

0.7565

0.2934

0.0077

55

GBP

1.4583

0.0250

0.7812

0.2566

0.0096

56

1.4464

0.0248

0.7844

0.2587

0.0095

58

INR

0.5878

0.4900

0.7857

0.1988

0.0038

48

0.5888

0.4932

0.7829

0.1951

0.0038

51

JPY

1.2346

1.7001

0.4932

0.5443

0.0077

51

1.3514

1.8036

0.4296

0.5654

0.0081

50

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.3708

0.0037

0.9574

0.0421

0.0024

57

0.4139

0.0040

0.9497

0.0508

0.0026

57

CAD

0.3307

0.0056

0.9805

0.0199

0.0022

59

0.3275

0.0056

0.9807

0.0198

0.0022

58

GBP

0.3993

0.0068

0.9840

0.0161

0.0026

54

0.3958

0.0068

0.9843

0.0160

0.0026

55

INR

0.2427

0.2027

0.9653

0.0347

0.0016

51

0.2405

0.1952

0.9678

0.0318

0.0015

49

JPY

0.4156

0.6133

0.9353

0.0642

0.0028

50

0.5650

0.7871

0.8934

0.1005

0.0035

51

TABLE 10.12

The Three-Days-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.7027

0.0068

0.8535

0.1469

0.0044

55

0.7280

0.0071

0.8413

0.1581

0.0046

55

CAD

0.6300

0.0103

0.9344

0.0716

0.0040

57

0.6600

0.0108

0.9281

0.0757

0.0042

56

GBP

0.7564

0.0127

0.9442

0.0567

0.0048

53

0.9254

0.0152

0.9202

0.0829

0.0058

54

INR

0.3974

0.3326

0.9041

0.0896

0.0026

50

0.3721

0.3145

0.9143

0.0822

0.0024

51

JPY

0.7336

1.0225

0.8182

0.1798

0.0046

51

0.7233

1.0027

0.8252

0.1756

0.0045

51

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

0.9351

0.0092

0.7297

0.2667

0.0060

58

0.9847

0.0097

0.7005

0.2977

0.0063

59

CAD

0.8515

0.0136

0.8856

0.1311

0.0053

56

0.8814

0.0141

0.8780

0.1335

0.0054

56

GBP

0.9469

0.0158

0.9131

0.0889

0.0060

57

0.9548

0.0160

0.9109

0.1023

0.0061

59

INR

0.4223

0.3581

0.8888

0.1109

0.0028

54

0.4241

0.3609

0.8871

0.1087

0.0028

53

JPY

0.9701

1.3458

0.6851

0.2969

0.0060

55

0.9111

1.2293

0.7373

0.2681

0.0055

54

TABLE 10.14

The Seven-Days-Ahead Prediction Performance of the LSTM and GRU Models

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

1.2148

0.0118

0.5485

0.4285

0.0077

57

1.1356

0.0112

0.5996

0.3994

0.0073

57

CAD

1.0414

0.0167

0.8291

0.2027

0.0064

55

1.0168

0.0163

0.8367

0.1843

0.0063

55

GBP

1.2382

0.0211

0.8446

0.1721

0.0081

52

1.1744

0.0198

0.8629

0.1608

0.0076

52

INR

0.5220

0.4323

0.8332

0.1601

0.0033

55

0.5243

0.4372

0.8294

0.1546

0.0034

52

JPY

1.1153

1.5197

0.5950

0.3998

0.0068

50

1.1595

1.5735

0.5659

0.4233

0.0071

49

Currency

LSTM Model

GRU Model

MAPE

RMSE

R2

ARV

Theil's

DA

MAPE

RMSE

R2

ARV

Theil's

DA

AUD

1.3755

0.0134

0.4225

0.5294

0.0087

56

1.3174

0.0127

0.4779

0.5009

0.0083

55

CAD

1.4074

0.0225

0.6885

0.3523

0.0087

55

1.2817

0.0203

0.7465

0.3009

0.0078

55

GBP

1.8596

0.0307

0.6697

0.3690

0.0118

57

1.3180

0.0224

0.8241

0.1977

0.0086

57

INR

0.6131

0.5077

0.7699

0.2139

0.0039

48

0.5707

0.4841

0.7909

0.1868

0.0037

51

JPY

1.2529

1.7016

0.4923

0.5359

0.0076

49

1.2719

1.7172

0.4829

0.5405

0.0077

50

Exchange rate prediction graph of training and testing phase of LSTM model and GRU model for five different currencies with different sliding window sizes (WS)

FIGURE 10.2 Exchange rate prediction graph of training and testing phase of LSTM model and GRU model for five different currencies with different sliding window sizes (WS): (a) five-days-ahead prediction of AUD with WS 10; (b) three-days-ahead prediction of CAD with WS 7; (c) seven-days-ahead prediction of GBP with WS 10; (d) ten-days-ahead prediction of INR with WS 13; and (e) one-day-ahead prediction of JPY for WS 7.

For Sliding Window Size 10

Tables 10.6-10.10 show the results for sliding window size 10. For AUD, CAD, and JPY daily forex, GRU gives better results; for the INR dataset, LSTM gives better results. When the samples have a long-term dependency problem, the LSTM model outperforms GRU, because it has more features and a more complex architecture than GRU.

For Sliding Window Size 13

From Tables 10.11—10.15 it is observed that LSTM and GRU give mixed results. LSTM is better for AUD, CAD. and JPY, when the number of the days-ahead prediction is less. The GRU model gives better results for INR, AUD, GBR and CAD. when the number of the days-ahead prediction is more.

The simulation of exchange rate forecasting of five different currencies using LSTM and GRU models and the convergence characteristics of both models are given in Figures 10.2 and 10.3.

MSE convergence graph over various sliding window sizes (WS) using the LSTM and GRU model

FIGURE 10.3 MSE convergence graph over various sliding window sizes (WS) using the LSTM and GRU model: (a) five-days-ahead prediction of AUD with WS 10; (b) three-days-ahead prediction of CAD with WS 7; (c) seven-days-ahead prediction of GBP with WS 10; (d) ten-days- ahead prediction of INR with WS 13; and (e) one-day-ahead prediction of JPY for WS 7.

Conclusion

This chapter has described the implementation of a special type of RNN, the GRU network for the exchange rate forecasting of five different currencies (AUD, CAD, GBR INR, and JPY). The GRU model reduces the complex gate structure of LSTM to two gated architectures having update and reset gates, and it also decreases the number of iterations needed to execute the program. This leads to fewer in-memory calculations which makes the proposed model faster than LSTM. The performance measure of LSTM and GRU is carried out by applying different sliding window sizes for various days-ahead predictions. For sliding window size 7. the GRU model gives the best results for almost all five different currencies; for sliding window sizes 10 and 13, LSTM performs better in some cases, with the GRU results being better for the rest. Thus, by overall performance measure, GRU outperforms LSTM and converges faster than LSTM with greater accuracy and efficiency for windows size 7.

References

  • 1. Taylor, S. J. “Forecasting the volatility of currency exchange rates.” International Journal of Forecasting 3.1 (1987): 159-170.
  • 2. Kamruzzaman, J., R. A. Sarker, and I. Ahmad. “SVM based models for predicting foreign currency exchange rates." Third IEEE International Conference on Data Mining. IEEE. Los Alamitos, CA, 2003.
  • 3. Nanda, S. K., R. Vyas, and H. K. Vamshidhar. “Forecasting foreign exchange rate using robust lagueree neural network.” 2018 3rd International Conference and Workshops on Recent Advances and Innovations in Engineering (ICRAIE). IEEE, Jaipur, India. 2018.
  • 4. Nagarajan, V., et al. “Forecast studies for financial markets using technical analysis.” 2005 International Conference on Control and Automation. Vol. 1. IEEE. Budapest. Hungary, 2005.
  • 5. Galeshchuk. S. “Neural networks performance in exchange rate prediction.” Neurocomputing 172 (2016): 446-452.
  • 6. Huang, W„ et al. “Comparisons of the different frequencies of input data for neural networks in foreign exchange rates forecasting.” In: International Conference on Computational Science. Springer. Berlin. 2006.
  • 7. Bui, L. T. and T. T. H. Dinh. “A novel evolutionary multi-objective ensemble learning approach for forecasting currency exchange rates." Data & Knowledge Engineering 114 (2018): 40-66.
  • 8. He. K., et al. “Forecasting exchange rate value at risk using deep belief network ensemble based approach." Procedia Computer Science 139 (2018): 25-32.
  • 9. Das, S. R.. D. Mishra, and M. Rout. “An optimized feature reduction based currency forecasting model exploring the online sequential extreme learning machine and krill herd strategies.” Physica A: Statistical Mechanics and Its Applications 513 (2019): 339-370.
  • 10. Yong. Y. L., et al. “Foreign currency exchange rate prediction using neuro-fuzzy systems.” Procedia Computer Science 144 (2018): 232-238.
  • 11. Andreou. A. S.. E. F. Georgopoulos, and S. D. Likothanassis. “Exchange-rates forecasting: A hybrid algorithm based on genetically optimized adaptive neural networks.” Computational Economics 20.3 (2002): 191-210.
  • 12. Ni. H. and H. Yin. “Exchange rate prediction using hybrid neural netw'orks and trading indicators.” Neurocomputing 72.13-15 (2009): 2815-2823.
  • 13. Jena, P. R., R. Majhi, and B. Majhi. “Development and performance evaluation of a novel knowledge guided artificial neural netw'ork (KGANN) model for exchange rate prediction.” Journal of King Sand University-Computer and Information Sciences 27.4 (2015): 450-457.
  • 14. Rehman, M.. G. M. Khan, and S. Ali Mahmud. “Foreign currency exchange rates prediction using cgp and recurrent neural network.” IERI Procedia 10 (2014): 239-244.
  • 15. Ni. L.. et al. “Forecasting of Forex time series data based on deep learning.” Procedia Computer Science 147 (2019): 647-652.
  • 16. Chao. J., F. Shen. and J. Zhao. “Forecasting exchange rate with deep belief networks.” The 2011 International Joint Conference on Neural Networks. IEEE. San Jose. CA, 2011.
  • 17. Shen, F., J. Chao, and J. Zhao. “Forecasting exchange rate using deep belief networks and conjugate gradient method.” Neurocomputing 167 (2015): 243-253.
  • 18. Naik, N. and B. R. Mohan. “Stock price movements classification using machine and deep learning techniques—The case study of Indian Stock Market.” In: International Conference on Engineering Applications of Neural Networks. Springer, Cham. 2019.
  • 19. Yu. L., S. Wang, and К. K. Lai. “Adaptive smoothing neural networks in foreign exchange rate forecasting.” In: International Conference on Computational Science. Springer. Berlin. Heidelberg, 2005.
  • 20. Hussain, A. J.. et al. “Regularized dynamic self-organized neural network inspired by the immune algorithm for financial time series prediction.” Neurocomputing 188 (2016): 23-30.
  • 21. Usmani, M.. et al. “Predicting market performance with hybrid model.” 2018 3rd International Conference on Emerging Trends in Engineering, Sciences and Technology (ICEEST). IEEE. Karachi. Pakistan. 2018.
  • 22. Kamruzzaman, J. and R. A. Sarker. “Forecasting of currency exchange rates using ANN: A case study.” International Conference on Neural Networks and Signal Processing. 2003, Vol. 1. IEEE, Nanjing. 2003.
  • 23. Majhi. R., G. Panda, and G. Sahoo. “Efficient prediction of foreign exchange rate using nonlinear single layer artificial neural model." 2006 IEEE Conference on Cybernetics and Intelligent Systems. IEEE. Bangkok. Thailand, 2006.
  • 24. He. H. and X. Shen. “Bootstrap methods for foreign currency exchange rates prediction." 2007 International Joint Conference on Neural Networks. IEEE, Atlanta. GA. 2007.
  • 25. Ince, H. and T. B. Trafalis. “A hybrid model for exchange rate prediction." Decision Support Systems 42.2 (2006): 1054-1062.
  • 26. Zhang. K., et al. “Stock market prediction based on generative adversarial network.” Procedia Computer Science 147 (2019): 400-406.
  • 27. Ranjit. S., et al. “Comparison of algorithms in Foreign Exchange Rate Prediction.” 2018 IEEE 3rd International Conference on Computing, Communication and Security (ICCCS). IEEE, Kathmandu, Nepal, 2018.
  • 28. Naik, N. and B. R. Mohan. “Study of stock return predictions using recurrent neural networks with LSTM.” In: International Conference on Engineering Applications of Neural Networks. Springer, Cham. 2019.
  • 29. Chung, J.. et al. “Empirical evaluation of gated recurrent neural networks on sequence modeling.” arXiv preprint arXiv: 1412.3555 (2014).
  • 30. Hochreiter, S. and J. Schmidhuber. “Long short-term memory.” Neural Computation 9.8 (1997): 1735-1780.
 
Source
< Prev   CONTENTS   Source   Next >