Browsing by Author "Vlok, Cassius Ray"
Now showing 1 - 1 of 1
Results Per Page
Sort Options
- ItemOn retraining intervals and sequence lengths for machine learning models in foreign exchange rate forecasting(Stellenbosch : Stellenbosch University, 2024-03) Vlok, Cassius Ray; Visagie, Stephanus Esterhuyse; Stellenbosch University. Faculty of Economic and Management Sciences. Dept. of Logistics.ENGLISH SUMMARY: The foreign exchange market is non-stationary, highly volatile, noisy and non-linear, making it challenging for time series predictions. Market conditions constantly evolve, and finding a robust model that can capture current patterns while adjusting to emerging ones is difficult. Machine learning (ML) models are prone to a phenomenon known as model decay, meaning performance tends to worsen over time as the characteristics of the data set begin to change. Additionally, ML models require sufficient data to learn from, and make accurate predictions. This study investigates the effects of varying how frequently a model is retrained (retraining interval) and the number of lagged data points to use as features (sequence length). The effects are measured on three ML models: a deep neural network capable of processing sequential time series data called long-short term memory (LSTM), an ensemble learning algorithm, random forests (RF), combining multiple decision trees to form a final output and a support vector machine (SVM) model capable of mapping non-linear data into higher dimensions to perform linear regression. Each model’s hyperparameters were optimised by a sequential model-based optimiser, Bayesian optimisation, to best fit the USD/ZAR exchange rate. The results from the calibration indicate that the activation function, ReLu, caused problems with convergence in the LSTM model, and the sigmoid and polynomial kernel functions led to poor results for the SVM model. The RF model was the most consistent and was less sensitive to the hyperparameters used. The retraining intervals tested were yearly, bi-yearly, quarterly and monthly. The sequence lengths tested ranged from one to ten previous days used as features. The LSTM model results showed that the best mean squared error (MSE) comes from the 12-month retraining interval, which outperformed the 6, 3 and 1-month intervals by 0.51%, 3.06% and 5.53%, respectively. Sequence lengths had a smaller impact on the LSTM models, with the best MSE values from sequence lengths above 3. The 9-day sequence length had the lowest MSE of 0.2157, which was a 1.76% improvement over the worst MSE from 1 day. Retraining intervals had a greater effect on the RF models, with the MSE of the 12-month intervals having a 1.54%, 6.35% and 10.71% improvement over the 6, 3, and 1-month intervals. RF models using the 1-day sequence length had a 1.54% lower MSE than the 2nd best sequence length. The sequence lengths of 2–10 days had similar performance with all these MSE values within 0.85% of each other. The SVM had the lowest MSE of all the models at 0.02068, with the sequence length being the more critical hyperparameter to consider. Using a 1-day sequence length saw a 1.19% improvement over the 2nd best sequence length of 2 days and was 2.13% lower than the worst sequence length of 10 days. The MSE values from the different retraining intervals were within 0.14%, indicating minimal effects from this hyperparameter.