| Literature DB >> 34956352 |
Shambhavi Mishra1, Tanveer Ahmed1, Vipul Mishra1, Manjit Kaur2, Thomas Martinetz3, Amit Kumar Jain4, Hammam Alshazly5.
Abstract
This paper proposes a multivariate and online prediction of stock prices via the paradigm of kernel adaptive filtering (KAF). The prediction of stock prices in traditional classification and regression problems needs independent and batch-oriented nature of training. In this article, we challenge this existing notion of the literature and propose an online kernel adaptive filtering-based approach to predict stock prices. We experiment with ten different KAF algorithms to analyze stocks' performance and show the efficacy of the work presented here. In addition to this, and in contrast to the current literature, we look at granular level data. The experiments are performed with quotes gathered at the window of one minute, five minutes, ten minutes, fifteen minutes, twenty minutes, thirty minutes, one hour, and one day. These time windows represent some of the common windows frequently used by traders. The proposed framework is tested on 50 different stocks making up the Indian stock index: Nifty-50. The experimental results show that online learning and KAF is not only a good option, but practically speaking, they can be deployed in high-frequency trading as well.Entities:
Mesh:
Year: 2021 PMID: 34956352 PMCID: PMC8709756 DOI: 10.1155/2021/6400045
Source DB: PubMed Journal: Comput Intell Neurosci
Algorithm 1The central idea of the QKLMS algorithm.
Time window of 1 day (stock-Reliance).
| Day | Actual price | Change in price |
|---|---|---|
| 1 day | 1987.5 | 0.1685 |
| 2 day | 1990.85 | −1.2431 |
| 3 day | 1966.1 | −2.6372 |
| 4 day | 1914.25 | −0.16194 |
| 5 day | 1911.15 | 1.17991 |
| 6 day | 1933.7 | −1.8849 |
| 7 day | 1897.25 | 3.1519 |
| 8 day | 1957.05 | −0.9325 |
| 9 day | 1938.8 | 1.1244 |
| 10 day | 1960.6 | — |
If we choose M = 3, then Input = [{0.1685,-1.2431,-2.6372}] and Output = [{−0.16194}].
Figure 1Proposed close price prediction framework.
Parameter description for close price using ten different KAF algorithms.
| Parameter | KAPA | KLMS | KMCC | KNLMS | KRLS | LKAPA | LMS | NORMA | PROB-LMS | QKLMS |
|---|---|---|---|---|---|---|---|---|---|---|
| ( | 4.0 | 4.0 | 4.0 | 4.0 | 3.0 | 5.0 | 7.0 | 3.0 | ||
| ( | 1.7 | 1.1 | 1.5 | 1.7 | 0.09 | 1.1 | 1.2 | |||
| ( | 1E-4 | 1E-2 | 0.3 | |||||||
| (Λ) | 1E-4 | 1E-2 | 0.4 | |||||||
| ( | 2 | |||||||||
| ( | 6 | |||||||||
| mu0 | 0.2 | 2 | 0.2 | |||||||
| (P) | 20 | 20 | ||||||||
| nu | 1E-2 | |||||||||
|
| 500 | |||||||||
| tcoff | 0.9 |
σ = kernel width, σ2n = variance of observation noise, σ2d = variance of filter weight diffusion, η = step size, ɛ = regularization parameter, Λ = Tikhonov regularization, tcoff = learning rate coefficient, τ = memory size (terms retained in truncation), mu0 = coherence criterion threshold, P = memory length, and nu = approximate linear dependency (ALD) threshold.
Figure 2Prediction for one stock (Reliance) using KRLS: (a) 2020 dataset and (b) 2021 dataset.
Figure 3Error convergence for one stock (Reliance) using KRLS: (a) 2020 dataset and (b) 2021 dataset.
Figure 4Error residuals for one stock (Reliance) using KRLS: (a) 2020 dataset and (b) 2021 dataset.
Best embedding dimension for all time windows according to evaluation metrics MSE, MAE, and DS (2020).
| Time window | MSE | Best embedding dimensions | Algorithms |
|
| |||
| 1 day | 0.014 3 | 2 | KRLS |
| 60 minutes | 0.003 4 | 2 | KRLS |
| 30 minutes | 0.002 0 | 2 | KRLS |
| 25 minutes | 0.001 8 | 2 | KRLS |
| 20 minutes | 0.001 5 | 2 | KRLS |
| 15 minutes | 0.001 2 | 2 | KRLS |
| 10 minutes | 0.000 8 | 2 | KRLS |
| 5 minutes | 0.000 4 | 2 | KRLS |
| 1 minute | 0.000 10 | 2 | KRLS |
| Time window | MAE | Best embedding dimensions | Algorithms |
| 1 day | 2.132 4 | 2 | KRLS |
| 60 minutes | 0.660 2 | 2 | KRLS |
| 30 minutes | 0.466 6 | 2 | KRLS |
| 25 minutes | 0.431 7 | 2 | KRLS |
| 20 minutes | 0.381 2 | 2 | KRLS |
| 15 minutes | 0.329 5 | 2 | KRLS |
| 10 minutes | 0.266 7 | 2 | KRLS |
| 5 minutes | 0.188 6 | 2 | KRLS |
| 1 minute | 0.085 2 | 2 | KRLS |
| Time window | DS | Best embedding dimensions | Algorithms |
| 1 day | 0.501 3 | 5 | LKAPA |
| 60 minutes | 0.491 9 | 5 | KRLS |
| 30 minutes | 0.491 3 | 5 | KRLS |
| 25 minutes | 0.492 5 | 3 | KRLS |
| 20 minutes | 0.488 1 | 2 | PROB-LMS |
| 15 minutes | 0.489 3 | 7 | QKLMS |
| 10 minutes | 0.490 2 | 2 | KRLS |
| 5 minutes | 0.491 0 | 2 | PROB-LMS |
| 1 minute | 0.471 5 | 2 | KRLS |
Best embedding dimension for all time windows according to evaluation metrics MSE, MAE, and DS (2021).
| Time window | MSE | Best embedding dimensions | Algorithms |
|---|---|---|---|
| 1 day | 0.034 2 | 2 | KRLS |
| 60 minutes | 0.008 1 | 2 | KRLS |
| 30 minutes | 0.004 7 | 2 | KRLS |
| 25 minutes | 0.004 2 | 2 | KRLS |
| 20 minutes | 0.003 3 | 2 | KRLS |
| 15 minutes | 0.002 8 | 2 | KRLS |
| 10 minutes | 0.002 0 | 2 | KRLS |
| 5 minutes | 0.001 1 | 2 | KRLS |
| 1 minute | 0.000 3 | 2 | KRLS |
| Time window | MAE | Best embedding dimensions | Algorithms |
| 1 day | 1.690 1 | 2 | KRLS |
| 60 minutes | 0.548 0 | 2 | KRLS |
| 30 minutes | 0.396 1 | 2 | KRLS |
| 25 minutes | 0.367 1 | 2 | KRLS |
| 20 minutes | 0.323 8 | 2 | KRLS |
| 15 minutes | 0.280 3 | 2 | KRLS |
| 10 minutes | 0.225 9 | 2 | KRLS |
| 5 minutes | 0.160 1 | 2 | KRLS |
| 1 minute | 0.072 9 | 2 | KRLS |
| Time window | DS | Best embedding dimensions | Algorithms |
| 1 day | 0.487 0 | 4 | NORMA |
| 60 minutes | 0.493 0 | 4 | KNLMS |
| 30 minutes | 0.484 9 | 4 | KRLS |
| 25 minutes | 0.487 8 | 6 | LKAPA |
| 20 minutes | 0.489 1 | 7 | LKAPA |
| 15 minutes | 0.488 1 | 2 | PROB-LMS |
| 10 minutes | 0.489 1 | 2 | PROB-LMS |
| 5 minutes | 0.484 6 | 2 | PROB-LMS |
| 1 minute | 0.475 1 | 2 | KRLS |
Comparison of the proposed work with other state-of-the-art stock prediction method for 60-minute time window (2020 dataset) from January 01, 2020, to December 31, 2020.
| Method | MSE | RMSE | Execution time (s) |
|---|---|---|---|
| Gao et al. [ | 0.519 17 | 0.7205 | 400.39 |
| Moghar et al. [ | 0.518 00 | 0.7197 | 1265.11 |
| Nikou et al. [ | 0.518 38 | 0.7199 | 5006.19 |
| Proposed method | 0.003 4 | 0.0583 | 5.234 |
Comparison of the proposed work with other state-of-the-art stock prediction method for 60-minute time window (2021 dataset) from January 01, 2021 to May 31, 2021.
| Method | MSE | RMSE | Execution time (s) |
|---|---|---|---|
| Gao et al. [ | 0.702 02 | 0.8378 | 362.67 |
| Moghar et al. [ | 0.697 5 | 0.8351 | 1082.90 |
| Nikou et al. [ | 0.702 32 | 0.8380 | 2250.87 |
| Proposed method | 0.008 1 | 0.09 | 4.256 |
Effect of dictionary size.
| Dictionary size | MSE | MAE | DS | Execution time (seconds) |
|---|---|---|---|---|
| 500 dictionary size | 0.020 2 | 0.687 | 0.511 | 0.675 |
| 1000 dictionary size | 0.019 3 | 0.674 | 0.497 | 0.696 |
| 5000 dictionary size | 0.019 3 | 0.674 | 0.497 1 | 0.702 |
The algorithm chose KMCC (60 minutes, 2021 dataset).