To evaluate the proposed model’s efficacy, it is compared to CNN, RNN, LSTM, CNN-RNN, and CNN-LSTM models. On the same data set, the models are trained and tested. The open price, high price, low price, close price, adj-close price, and volume are the stock parameters that influence it.
4.3. Implementation of Model
First, the data taken from the database are pre-processed to remove the null values in the data set. After pre-processing, normalization is used to transform the set of data to be on a similar scale. To normalize the data, data standardization is used. In data standardization,
Z-Score standardization is used, and the formula is shown in Equations (
12) and (
13).
Table 3 shows the proposed methodology (CNN-LSTM-RNN model) parameter settings for this experiment. The CNN-LSTM-RNN network’s parameter values demonstrate how the particular model is constructed. The input for the 3-D vector is (None, 10, 6), where 10 is the sample size and 6 is the number of input features. As input, the data are fed into the RNN Layer, LSTM Layer, and one-dimensional convolution layer.
In CNN, the best feature is recovered using the convolution layer, which outputs as 3-D vector (none, 10, 32), with 32 filters, and a kernel size of 1. The pooling Layer receives the convolution output. The pooling layer uses max pooling, which moves once for each output and has a max pooling size of two and a stride of one. Flatten layer takes input of pooling layer output and converts all the output into a single dimension. The fully connected layer takes input of flatten layer output and performed calculations and displays the two forecasting stock parameters values for the next day as a result. The model structures of these three models are shown in
Figure 5,
Figure 6 and
Figure 7.
Both the LSTM and RNN networks are running at the same time. These LSTM and RNN layers provide the input. The input data are passed from 64 units. These units carry out calculations and then provide results. The output layer then receives these outputs. In the end, the output layer does certain calculations and provides two forecasts the close price and the high price for the next day.
The selection process is used to choose the best model that performs better than the other two. The is used to make the selection. The is discussed in the following section.
4.5. Results
After performing the process to train the proposed methodology(CNN-LSTM-RNN) in which three models CNN, LSTM, and RNN are trained parallel on the training data set. After completing the training process, the validation is performed to select the best model. After getting the error rates, the selection method selects the best model on the basis of
. In this case, the selection method selects the RNN model because its
is closest to 1. To assess the model’s effectiveness, evaluation is done using the testing data set. A forecast is made using the test data set. After testing, the error rates of models are calculated as displayed in
Table 4.
The model’s validation findings are examined. The validation results verified that the RNN model is trained better than other models because its validation results are greater than the CNN and LSTM models and closest to 1. Evaluation of model performance is performed on the test data and calculated on basis of the MAE, RMSE, and , and we see that the RNN model has less MAE and RMSE while, on the other hand, is closest to 1, which means that RNN gives accurate results.
After performing the process to train the existing models CNN, RNN, LSTM, CNN-RNN, and CNN-LSTM are performed on the training data set. After completing the training process, forecasting is performed on the test dataset, which is compared with the actual values as shown in
Figure 8,
Figure 9,
Figure 10,
Figure 11,
Figure 12,
Figure 13,
Figure 14,
Figure 15,
Figure 16,
Figure 17,
Figure 18 and
Figure 19. The line graph of the six forecasting methods presents the actual prices and the forecasted prices. By analyzing the results, the CNN-LSTM-RNN model has the highest line-fitting graph among other models and the CNN model has the lowest.
Each method’s evaluation index is also computed. The comparison with other models’ results is displayed in
Table 5 and
Figure 20,
Figure 21 and
Figure 22, while CNN-LSTM-RNN has the lowest MAE and RMSE and the
is the greatest and closest to 1 among other models, CNN has the highest MAE and RMSE and the lowest
.
By comparing the RNN with CNN-LSTM, of CNN-LSTM increases from 0.982 to 0.983 by 0.1%, MAE decreases from 31.495 to 30.653 by 2.7%, RMSE also increases from 17.313 to 19.117 by 10.4%, so the results of CNN-LSTM was better than RNN. Another comparison was conducted between CNN-LSTM and CNN-RNN, and the MAE and RMSE of CNN-RNN decreased, and MAE decreased from 30.653 to 29.527 by 3.8%, and RMSE decreases from 19.117 to 16.756 by 14%, and increased from 0.983 to 0.984 by 0.1%, so the CNN-RNN performed better than CNN-LSTM. Another comparison was conducted between CNN-RNN and LSTM: MAE of LSTM decreased from 29.527 to 28.589 by 3.4%, RMSE decreased from 16.756 to 15.720 by 6.5%, and increased from 0.984 to 0.985 by 0.1%, so the LSTM performed better than CNN-RNN. Another comparison was conducted between LSTM and CNN-LSTM-RNN: MAE and RMSE of CNN-LSTM-RNN decreased, MAE decreased from 28.589 to 27.469 by 4%, RMSE decreased from 15.720 to 13.295 by 18%. and increased by 0.985 to 0.986 by 0.1%, so the CNN-LSTM-RNN performed better than LSTM.
By comparing the proposed technique with existing LSTM technique [
14], we see that the previous LSTM approach employed two layers, the first layer consisting of 32 units, and the second layer consisting of 16 units. Another existing RNN technique [
11] is compared with the proposed methodology. We see that the existing RNN technique used two layers. In the first layer, six units were used and, in the second layer, 11 units are used, while the proposed technique used a single layer and 64 units in the model.
The main difference with the existing methodologies is that the existing methodologies used the evaluation matrix to check the accuracy of the models, while the proposed techniques select the best model based on
error rate closest to 1. The proposed technique with a single layer and 64 units reduces the computation power and, by increasing the units in the layer, the performance of the model increases and also reduces the error rate. The results verify that the proposed methodology is performing better, and its prediction results are closer to actual prices as compared to the existing LSTM and RNN models. The results of the proposed approach are shown in
Table 6.
By comparing the error rates results of a single parameter and two parameters, we see that the MAE of the two parameters of CNN, RNN, CNN-LSTM, and CNN-RNN models remains high, whereas the MAE of the LSTM model remains a little bit lower than the then single parameter of the LSTM model. The RMSE of the two parameters is lower than the RMSE of a single parameter. The
error results of two parameters are closest to 1 as compared to the
error result of a single parameter, so the
error results are closest to 1, which means that models with two parameters are performing more accurately as compared to single parameters, as shown in
Table 7.
In this study, we have used three regression models, i.e., CNN, LSTM, and single layer RNN. Furthermore, our proposed single layer RNN outperformed as compared to other existing multi-layer and hybrid models shown in
Table 5. The proposed single layer RNN model reduces computational complexity as well as significantly reducing RMSE and MAE. In the future, we will extend the comparison parameters, i.e., accuracy, MSE, F1 score, precision, and recall.
By examining the results, we can see that our proposed approach on both scenarios outperforms in comparison to other existing models available in the literature. Besides, by comparing the results of existing single-parameter models with two-parameter models, we see that all the models are performing better on the forecasting of two parameters as compared to the single parameter, which is improved by 0.6%, 0.23%, 0.19%, 0.21%, 0.23%, and 0.6%. In terms of forecasting accuracy the proposed methodology (CNN-LSTM-RNN) of scenario two parameters, the MAE is 27.469, the RMSE is 13.295, and the is 0.986, which is very close to 1. The highest of the six forecasting approaches, CNN-LSTM-RNN, has a of 0.986 in the case of high predicting accuracy, which is improved by 2.2%, 0.4%, 0.3%, 0.2%, and 0.1%, respectively.
The technique proposed in this paper is based on CNN, LSTM, and RNN models. The proposed technique outperforms the other five models in forecasting two stock parameters, and the error rate is lower when compared to the other models. This model is forecasting the two stock parameters’ high price and close price for the next day, which will help the investor in investing in the future.