| Literature DB >> 35120138 |
Qihang Zhou1, Changjun Zhou1, Xiao Wang2.
Abstract
With the development of recent years, the field of deep learning has made great progress. Compared with the traditional machine learning algorithm, deep learning can better find the rules in the data and achieve better fitting effect. In this paper, we propose a hybrid stock forecasting model based on Feature Selection, Convolutional Neural Network and Bidirectional Gated Recurrent Unit (FS-CNN-BGRU). Feature Selection (FS) can select the data with better performance for the results as the input data after data normalization. Convolutional Neural Network (CNN) is responsible for feature extraction. It can extract the local features of the data, pay attention to more local information, and reduce the amount of calculation. The Bidirectional Gated Recurrent Unit (BGRU) can process the data with time series, so that it can have better performance for the data with time series attributes. In the experiment, we used single CNN, LSTM and GRU models and mixed models CNN-LSTM, CNN-GRU and FS-CNN-BGRU (the model used in this manuscript). The results show that the performance of the hybrid model (FS-CNN-BGRU) is better than other single models, which has a certain reference value.Entities:
Mesh:
Year: 2022 PMID: 35120138 PMCID: PMC8815979 DOI: 10.1371/journal.pone.0262501
Source DB: PubMed Journal: PLoS One ISSN: 1932-6203 Impact factor: 3.240
Fig 1Convolution process.
Fig 2GRU structure diagram.
Fig 3BGRU structure diagram.
Fig 4Experiment flow chart.
Some data of Shenzhen Composite Index.
| No | Closing | Hight | Low | Open | Previous Closing | Rise and Fall | Up and Down | Volume |
|---|---|---|---|---|---|---|---|---|
| 1 | 14134.9 | 14134.9 | 13819.7 | 13858.7 | 13854.1 | 280.7 | 2.0 | 1.47E+11 |
| 2 | 13854.1 | 13939.9 | 13806.6 | 13911.8 | 13889.9 | -35.8 | -0.3 | 1.22E+11 |
| 3 | 13889.9 | 13901.8 | 13688.8 | 13746.3 | 13751.1 | 138.8 | 1.0 | 1.30E+11 |
| 4 | 13751.1 | 13807.2 | 13709.8 | 13791.4 | 13763.3 | -12.2 | -0.1 | 1.11E+11 |
| 5 | 13763.3 | 13783.0 | 13641.7 | 13682.3 | 13692.1 | 71.2 | 0.5 | 1.08E+11 |
MAPE value of index stock obtained by different methods (%).
| Method/Stock | Shenzhen Composite Index | CSI 300 | Shanghai Composite Index | Growth Enterprise Index |
|---|---|---|---|---|
| Common | 6.5435 | 2.2448 | 3.7110 | 3.0161 |
| Feature Selection |
|
|
|
|
MAPE value of common stock obtained by different methods (%).
| Method/Stock | CNPC | CSCEC | CRRC | SAIC |
|---|---|---|---|---|
| Common | 4.2740 | 2.3357 | 3.1741 | 6.9912 |
| Feature Selection |
|
|
|
|
MAPE values of index stocks in convolution kernels with different numbers (%).
| Filters/Stock | Shenzhen Composite Index | CSI 300 | Shanghai Composite Index | Growth Enterprise Index |
|---|---|---|---|---|
| 8 | 5.2200 | 1.8972 | 1.4878 | 2.5249 |
| 16 | 4.3932 | 1.4162 | 1.3944 | 2.3679 |
| 32 |
|
|
|
|
| 64 | 2.4203 | 1.2754 | 1.2538 | 2.4133 |
MAPE value of common stock in convolution kernel with different number (%).
| Filters/Stock | CNPC | CSCEC | CRRC | SAIC |
|---|---|---|---|---|
| 8 | 2.7476 | 1.8167 | 2.4024 | 6.0518 |
| 16 | 2.4746 | 1.5089 | 2.3298 | 5.9222 |
| 32 |
|
|
|
|
| 64 | 2.3147 | 1.4635 | 2.1675 | 5.0786 |
MAPE value of index stocks in different number of units (%).
| Units/Stock | Shenzhen Composite Index | CSI 300 | Shanghai Composite Index | Growth Enterprise Index |
|---|---|---|---|---|
| 8 | 3.6526 | 1.3408 | 1.2452 | 2.0463 |
| 16 | 3.5708 | 1.2697 | 1.1991 | 1.8528 |
| 32 | 2.2845 | 1.2530 | 1.1397 | 1.8242 |
| 64 |
|
|
|
|
MAPE value of common stock in different number of units (%).
| Units/Stock | CNPC | CSCEC | CRRC | SAIC |
|---|---|---|---|---|
| 8 | 2.8631 | 1.4263 | 2.0908 | 3.0975 |
| 16 | 2.6367 | 1.2880 | 1.9241 | 2.6892 |
| 32 | 2.4953 | 1.2587 | 1.8071 | 2.3812 |
| 64 |
|
|
|
|
Parameters of FS-CNN-BGRU model.
| Parameter name | Parameter value |
|---|---|
| Network layers | 4 |
| Convolutional filters | 32 |
| Convolutional kernel size | 1 × 1 |
| Convolutional activation function | Tanh |
| Convolutional padding | Same |
| Pooling size | 1 × 1 |
| Pooling padding | Same |
| Pooling activate function | Relu |
| Number of BGRU layers | 64 |
| Batch size | 64 |
| Optimization | Adam |
| Epochs | 100 |
MAPE values of different methods (%).
| Model | MAPE (%) |
|---|---|
| CNN | 2.0601 |
| LSTM | 1.8654 |
| GRU | 1.8332 |
| CNN-LSTM [ | 1.6426 |
| CNN-GRU | 1.6354 |
| FS-CNN-BGRU |
|
R2 of different methods.
| Model |
|
|---|---|
| CNN | 0.971365 |
| LSTM | 0.977786 |
| GRU | 0.978228 |
| CNN-LSTM [ | 0.981674 |
| CNN-GRU | 0.980416 |
| FS-CNN-BGRU |
|
MAPE value of index stocks (%).
| Model | Shenzhen Composite Index | Growth Enterprise Index | CSI 300 | Shanghai Composite Index |
|---|---|---|---|---|
| CNN | 2.0601 | 2.0635 | 1.2630 | 1.1426 |
| LSTM | 1.8654 | 1.7784 | 1.1819 | 1.1049 |
| GRU | 1.8332 | 1.7675 | 1.0580 | 1.0877 |
| CNN-LSTM [ | 1.6426 | 1.7641 | 1.0430 | 1.0139 |
| CNN-GRU | 1.6354 | 1.7540 | 1.0424 | 1.0749 |
| FS-CNN-BGRU |
|
|
|
|
MAPE value of common stock (%).
| Model | CNPC | CSCEC | CRRC | SAIC |
|---|---|---|---|---|
| CNN | 2.2887 | 1.4477 | 2.0507 | 3.0975 |
| LSTM | 2.3027 | 1.2461 | 1.7875 | 2.3514 |
| GRU | 2.0583 | 1.2220 | 1.7651 | 2.5513 |
| CNN-LSTM [ | 2.0538 | 1.1891 | 1.6374 | 2.3029 |
| CNN-GRU | 2.1456 | 1.2022 | 1.6376 | 2.1789 |
| FS-CNN-BGRU |
|
|
|
|
R2 of index stocks.
| Model | Shenzhen Composite Index | Growth Enterprise Index | CSI 300 | Shanghai Composite Index |
|---|---|---|---|---|
| CNN | 0.971365 | 0.985536 | 0.977826 | 0.977393 |
| LSTM | 0.977786 | 0.990884 | 0.979814 | 0.978607 |
| GRU | 0.978228 | 0.990928 | 0.983899 | 0.979678 |
| CNN-LSTM [ | 0.981674 | 0.990064 | 0.984244 | 0.981210 |
| CNN-GRU | 0.980416 | 0.989636 | 0.984310 | 0.979707 |
| FS-CNN-BGRU |
|
|
|
|
R2 of common stock.
| Model | CNPC | CSCEC | CRRC | SAIC |
|---|---|---|---|---|
| CNN | 0.993983 | 0.991586 | 0.965107 | 0.995745 |
| LSTM | 0.993494 | 0.994723 | 0.973520 | 0.997467 |
| GRU | 0.993616 |
| 0.974131 | 0.997353 |
| CNN-LSTM [ | 0.994447 | 0.994956 | 0.975138 |
|
| CNN-GRU | 0.994152 | 0.995007 | 0.976248 | 0.997752 |
| FS-CNN-BGRU |
| 0.995020 |
| 0.997749 |
Fig 5Closing price of Shenzhen Composite Index.
Fig 12Closing price of SAIC.