This repository contains R code for predicting exchange rates using Multilayer Perceptron (MLP) models. The code implements various MLP architectures and evaluates their performance on exchange rate prediction.
The code reads exchange rate data from an Excel file and preprocesses it to create lagged versions of the exchange rate series. Then, it normalizes the data and splits it into training and testing datasets. It trains multiple MLP models with different architectures using the training dataset and evaluates their performance using various performance metrics such as Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and Symmetric Mean Absolute Percentage Error (sMAPE).
- readxl
- neuralnet
- dplyr
- MLmetrics
- Metrics
- knitr
- Clone this repository to your local machine.
- Install the required R packages listed above if you haven't already.
- Run the R script in your preferred environment (e.g., RStudio).
- Modify the file path in the script to point to your exchange rate dataset if necessary.
The following MLP models are implemented and evaluated:
- Model 1: Single lagged feature (t1)
- Model 2: Multiple lagged features (t1, t2, t3)
- Model 3: Multiple lagged features (t1, t2, t3, t4)
- Model 4: Combined features (t1, t4, t2)
- Model 5: Combined features (t1, t2, t4)
- Model 6: Combined features (t1, t2, t3, t4)
- Model 7: Selected features (t2, t3)
- Model 8: Selected features (t1, t2)
- Model 9: Selected features (t1, t4)
- Model 10: Combined features (t1, t2, t3, t4)
- Model 11: Selected features (t2, t1)
- Model 12: Combined features (t1, t3, t4)
- Model 13: Combined features (t1, t2, t3)
- Model 14: Selected features (t1, t2)
This code provides a systematic approach to exchange rate prediction using MLP models with different architectures. It enables users to experiment with various model configurations and evaluate their performance on exchange rate prediction tasks.