Research 2
Research 2
a r t i c l e i n f o a b s t r a c t
Article history: Deep learning has achieved greater success in optimizing solutions associated with Artificial Intelligence
Received 5 April 2021 (AI). In the financial domain, it is widely used for stock market prediction, trade execution strategies and
Revised 9 June 2021 portfolio optimization. Stock market prediction is a very significant use case in this domain. Generative
Accepted 2 July 2021
Adversarial Networks (GANs) with advanced AI models have gained significance of late. However, it is
Available online 7 July 2021
used in image-image-translation and other computer vision scenarios. GANs are not used much for stock
market prediction due to its difficulty in setting the right set of hyperparameters. In this paper, overcome
Keywords:
this problem with reinforcement learning and Bayesian optimization. A deep learning framework based
Deep learning
Generative Adversarial Network (GAN)
on GAN, named Stock-GAN, is implemented with generator and discriminator. The former is realized with
Recurrent Neural Network (RNN) LSTM, a variant of Recurrent Neural Network (RNN), while the latter uses Convolutional Neural Network.
Convolutional Neural Network (CNN) An algorithm named Generative Adversarial Network based Hybrid Prediction Algorithm (GAN-HPA) is
Stock market analysis proposed. An empirical study revealed that Stock-GAN achieves promising performance in stock price
prediction when compared with the state of the art model known as Multi-Model based Hybrid
Prediction Algorithm (MM-HPA). Afterwards, MM-HPA and GAN-HPA combined to form yet another
hybrid model known as MMGAN-HPA for improved performance over MM-HPA and GAN-HPA.
Ó 2021 The Authors. Published by Elsevier B.V. on behalf of King Saud University. This is an open access
article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
1. Introduction Vector Machine (SVM) are used for forecasting (Polamuri et al.,
2019). Ensemble models as explored in (Asad, 2015) could provide
Stock market behavior prediction is of interest to investors and better performance. However, deep learning models in Vargas et al.
all stock market stakeholders. Deep learning models are proved to (2017), Akita et al. (2016), Mai et al. (2019), Liu et al. (2018), Eapen
be promising alternatives in stock price prediction research as they et al. (2019) and Katayama et al. (2019) outperformed traditional
achieved great success (Zhang et al., 2019). Technical analysis of machine learning models. CNN is studied in Hoseinzade and
stock markets reveals trends in stock portfolios. Many classical Haratizadeh (2019), Zhang et al. (2019), Sezer and Ozbayoglu
algorithms such as Autoregressive Integrated Moving Average (2018), Tsantekidis et al. (2017) and CNN with LSTM combination
(ARIMA) (Nau, 2014) came into existence. However, they are linear is explored for stock price forecasting. LSTM is used in (Nelson
models and suffer from performance issues as stock market data is et al., 2017) and (Bukhari et al., 2020) as a variant of RNN for over-
of time-series in nature revealing temporal dimension. Linear coming problem of losing gradients.
models with traditional machine learning methods such as Support In Chen et al. (2020) hybrid deep learning models are proposed
and found to be more efficient. In Polamuri et al. (2020) both linear
and non-linear models are combined to have better prediction per-
⇑ Corresponding author. formance. There are many insights from existing deep learning
E-mail addresses: [email protected] (S.R. Polamuri), [email protected] models that led to the research carried out in this paper. First,
(D.K. Srinivas), [email protected] (D.A. Krishna Mohan). CNN is better for classification. Second, LSTM can better capture
Peer review under responsibility of King Saud University.
temporal data variations than RNN (Vargas et al., 2017). Third,
deep learning models suffer from lack of pre-processing (or quality
of data) unless there is an efficient NLP based approach towards
feature selection (Bukhari et al., 2020). Fourth, GAN is found effec-
Production and hosting by Elsevier
tive in learning internal representations of data using unsupervised
https://doi.org/10.1016/j.jksuci.2021.07.001
1319-1578/Ó 2021 The Authors. Published by Elsevier B.V. on behalf of King Saud University.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
approach besides generating new data that resembles real data capabilities. Pang et al. (2020) used LSTM with an embedded layer
(Zhang et al., 2019). Fifth, a hybrid of linear and non-linear models to predict stock markets.
could provide better performance in stock prediction (Polamuri Zhang et al. (2019) proposed a GAN architecture for stock mar-
et al., 2020). Sixth, there is need for GAN based framework that ket prediction with LSTM as discriminator and MLP as generator.
exploits CNN, LSTM and novel pre-processing to improve the state They intend to optimize model in future by learning data distribu-
of the art. Considering these observations, in this paper, we pro- tions more accurately. Nelson et al. (2017) studied LSTM networks
posed a framework known as Stock-GAN based on deep learning to predict stock markets. Akita et al. (2016) used deep learning
models for better prediction of stock markets. models on financial data to predict bankruptcy. Hoseinzade and
The framework uses LSTM as generator and CNN as discrimina- Haratizadeh (2019) proposed a CNN based framework for stock
tor. There is strong feature extraction procedure from stock data prediction. Zhang et al. (2019) proposed a deep learning model
where linear models like ARIMA are applied. Novel pre- with LSTM and convolutional layers to process data of Limit Order
processing methodology is integrated as part of Stock-GAN. We Books (LOB). Their method showed better performance in extract-
investigated on right set of hyperparameters suitable for (G) and ing features and modelling. Polamuri et al. (2020) combined CNN
(D). In order to tune the hyperparameters dynamically, Stock- model and representation learning model for stock prediction.
GAN incorporates reinforcement learning framework along with Sezer and Ozbayoglu (2018) proposed a trading model known as
Bayesian optimization technique. The feature extraction process CNN-TA based on 2-D CNN for determining holding and selling
results in so many features and all of them may not contribute in strategies. Zhang et al. (2018) proposed a novel methodology for
stock prediction process. In order to filter them out (dimensionality stock market prediction with information fusion from different
reduction / feature selection), XGBoost is used to identify impor- sources.
tance of features. Then PCA is applied and Eigen portfolios are cre- Chen et al. (2020) proposed hybrid deep learning model based
ated so as to reduce number of features generated by on LSTM, MLP and attention mechanism. Their model is found to
autoencoders. Section 4 delves more details on Stock-GAN. Our have better forecasting accuracy. However, they intend to improve
contributions in this paper are as follows. it with sentiment models in future. Tsantekidis et al. (2017) pro-
posed deep learning model based on CNN to ascertain movement
1. A deep learning framework known as Stock-GAN is proposed of stocks using LOB data. Asad (2015) proposed an ensemble model
for effectiveness in prediction of stock prices. Stock-GAN is real- for stock market prediction. A meta-learning algorithm is used to
ized with LSTM as generator and CNN as discriminator. achieve ensemble of SVM, Random Forest and Relevance Vector
2. An algorithm named Generative Adversarial Network (GAN) Machine classifiers. They observed that ensemble method has least
based Hybrid Prediction Algorithm (GAN-HPA) is proposed with error rate. Eapen et al. (2019) proposed a deep learning model that
novel feature selection to realize and improve performance of combines bi-directional LSTM and CNN for stock index prediction.
Stock-GAN. They could improve prediction performance with the hybrid
3. A prototype application is built using Python data science plat- approach. Bukhari et al. (2020) proposed an improved ARIMA
form to evaluate the GAN-HPA and compared with same with and combined it with LSTM for stock market forecasting. Their
another deep learning based hybrid algorithm named Multi- model could improve accuracy in prediction.
Model based Hybrid Prediction Algorithm (MM-HPA). Katayama et al. (2019) proposed a deep learning model based
4. MM-HPA and GAN-HPA combined to form yet another hybrid on sentiment polarity identification for financial market predic-
model known as MMGAN-HPA for improved performance over tion. Their approach could improve polarity based market predic-
MM-HPA and GAN-HPA. tion. Lee et al. (2019) focused on a deep learning model that is
based on Deep Q-Network with CNN as function apprximator
The remainder of the paper is structured as follows. Section 2
and stock charts are taken as input for stock prediction. Polamuri
reviews literature on advanced data science concepts for stock
et al. (2020) proposed MM-HPA, a hybrid algorithm that combines
market prediction. Section 3 illustrates GAN architecture with its
linear and non-linear prediction models for better performance.
underlying mathematical model. Section 4 describes the proposed
There are several insights from the literature. First, CNN is better
Stock-GAN architecture and its algorithm. Section 5 presents
for classification. Second, LSTM can better capture temporal data
results of experiments with seven stock tickers collected from
variations than RNN (Mai et al., 2019). Third, deep learning models
National Stock Exchange, India. Section 6 concludes the paper
suffer from lack of pre-processing (or quality of data) unless there
and provides directions for future scope of the research.
is an efficient NLP based approach towards feature selection
(Bukhari et al., 2020). Fourth, GAN is found effective in learning
2. Related WORK internal representations of data using unsupervised approach
besides generating new data that resembles real data (Zhang
This section reviews literature on advanced data science con- et al., 2019). Fifth, a hybrid of linear and non-linear models could
cepts for stock market prediction. Vargas et al. (2017) studied both provide better performance in stock prediction (Rao et al., 2020).
CNN and RNN architectures for prediction of stock markets based Sixth, there is need for GAN based framework that exploits CNN,
on data of financial news. They found that RNN is better for ascer- LSTM and novel pre-processing to improve the state of the art.
taining temporal characteristics while CNN is better to obtain Considering these observations, in this paper, we proposed Stock-
semantics from text. They intended to use reinforcement learning GAN based on deep learning models for better prediction of stock
in future for better performance. Hiransha et al. (2018) investi- markets.
gated four deep learning models such as CNN, LSTM, RNN and
MLP (Multilayer Perceptron) for prediction of stock prices. They
found that deep learning models are better than non-linear models 3. Preliminaries
like ARIMA. Akita et al. (2016) used LSTM along with the concept of
paragraph vector generated from news articles from stock price Prediction of stock price movement using stock market data is
prediction. Chen et al. (2018) compared three traditional methods non-trivial. By IanGoodfellow and his colleagues in 2014, a class
such as radial basis function neural network, extreme learning of machine learning frameworks known as Generative Adversarial
machine and back propagation neural network with deep learning Networks (GAN) came into existence. It is in a game-theory setting
and found that deep learning models exhibited better prediction where two neural networks contest with each other. GAN learns to
7434
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
generate new data from training set similar to that of training set. the proposed framework known as Stock-GAN, shown in Fig. 2, is
The architecture of GAN is shown in Fig. 1. It has two important described.
components such as generator (G) and discriminator (D). ‘‘Genera-
tor is model used to generate new plausible examples from the 4.1. The Framework
problem domain while the discriminator is a model used to classify
examples as real (from the domain) or fake (generated)”. Unlike the GAN IN where MLP plays the role of generator, LSTM
Generator network directly generates a data sample that is preferred to realize generator in Stock-GAN while CNN is used as
appears like real data. On the other hand, its adversary, known as discriminator. The rationale behind this is that LSTM is that it can
discriminator network, distinguishes samples obtained from real handle time-series data well and is capable of learning long-term
data and samples generated by the generator framework. The dis- dependencies when compared with RNN while CNN is good for
criminator is a classification model. As discussed in (Uddin, 2019), classification. Hybrid models with linear and non-linear prediction
the objective function of the GAN architecture is in Eq. (1). approaches are found effective in stock prediction. Therefore, apart
min
from using LSTM and CNN as generator and discriminator respec-
max
arg G D V ðD; GÞ ¼ Ex pdata ðxÞ ½logðDðxÞÞ
tively in Stock-GAN, there is strong feature extraction procedure
from stock data where linear models like ARIMA are applied. Novel
þ Ez pz ðzÞ ½logð1 DðGðZ ÞÞÞ ð1Þ
pre-processing methodology (Polamuri et al., 2020) is integrated as
Where the discriminator function is denoted as D (x). This func- part of Stock-GAN. Otherwise deep learning models suffer from
tion results in probability that the input vector denoted as x is from performance problems. We investigated on right set of hyperpa-
training dataset. By taking x as input, the D(x) produces a value rameters suitable for (G) and (D). In order to tune the hyperparam-
between 0 and 1. Similarly, G (z) is known as generator function eters dynamically, Stock-GAN incorporates reinforcement learning
which results in a matrix whose dimension is same as that of x framework along with Bayesian optimization technique.
depending on the z (noise vector). From the training dataset, prob- A novel pre-processing methodology is used for improving
ability distribution of samples is denoted as Pdata(x). The probabil- quality of data prior to giving it to (G). Newest innovations in
ity distribution of samples obtained from noise generator is NLP are part of the methodology. For instance, BERT is used for
denoted as Pz(z). The expectation function which is resulted from observing sentiments. Trend directions are ascertained using Four-
the log-loss function as positive class is denoted as E(.). The log- ier transforms. High-level features are extracted using stacked
loss function is defined as in Eq. (2). autoencoders. Stock function approximation is made with a linear
learning model known as ARIMA. Self-Organized Maps (SOM) is
1 X
N
used to analyse anomalies in stock movements. This information
EðpjyÞ ¼ ðy ðlogpi Þ þ ð1 yi Þð1 pi ÞÞ ð2Þ
N i¼1 i is later useful to LSTM (G). Statistical checks are made to see that
data is of high quality. The feature extraction process results in
Where the actual data is denoted as yi, the estimation is so many features and all of them may not contribute in stock pre-
denoted as pi. When 0 or 1 is expected as response from the model, diction process. In order to filter them out (dimensionality reduc-
log function is used. When x is drawn from p(x), with regard to tion / feature selection), XGBoost is used to identify importance
probability distribution p(x), E(f(x) of given function f(x) is of features. Then PCA is applied and Eigen portfolios are created
expressed as in Eq. (3). so as to reduce number of features generated by autoencoders.
Z
Fourier transforms used in the methodology create series of sine
Ex p ðf ðxÞÞ pðxÞf ðxÞdx ð3Þ waves to analyse trend directions. The transforms are as in Eq. (4).
Z 1
Two loops such as minGV (D,G) and maxDV (D,G) are involved in Gðf Þ ¼ g ðt Þei2pft dt ð4Þ
Eq. (1). The aim of maxDV (D,G) is to maximize the right hand side
1
by discriminator’s parameter tuning. Equation (1) is the objective
function which contains two loops denoting maxDV (D,G) and ARIMA (Nau, 2014) is used to know stock trends and extract
minGV (D,G).Similarly, the aim of minGV (D,G) is to minimize by new features or patterns as in Eq. (5).
generator’s parameter tuning. ð1 k1 BÞð1 k2 BÞyt ¼ ð1 ht BÞet ð5Þ
ARIMA is an improved form of ARMA and provide better
4. Proposed Stock-GAN Framework
approximation of real stock price. After extracting high-level fea-
tures using autoencoders, XGBoost (Lee et al., 2019) model used
GAN based approach with generator (G) and discriminator (D) is
for feature importance prediction is as in Eq. (6).
found to be suitable for effectively dealing with time-series stock
market data. Without labelled data, GAN can quickly learn from X
n
internal representations of data, generate data, learn density distri- LðtÞ ¼ l yi; yt t1 þ f t ðX i Þ þ Xðf t Þ ð6Þ
t¼1
butions and use a trained discriminator as classifier. In this section,
7435
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
A combined loss function for (G) and (D) is as in Eq. (7). g t ¼ tanh X t W xg þ ht1 W hg þ bg ð8Þ
LðD; GÞ ¼ Ex pr ðxÞ ½logDðxÞ þ Ez pz ðzÞ ½logð1 DðGðzÞÞÞ ð7Þ it ¼ rðX t W xi þ ht1 W hi þ bi Þ ð9Þ
As RNN vanishes gradients many times, LSTM is used as (G)
f t ¼ r X t W xf þ ht1 W hf þ bf ð10Þ
where four gates are used namely update gate, input gate, forget
gate and output gate. LSTM is preferred over Gated Recurring Unit
ot ¼ rðX t W xo þ ht1 W ho þ bo Þ ð11Þ
(GRU) as LSTM has 4 gates, has internal memory state and supports
non-linearity. Equations from 8 to 13 show the mathematical
ct ¼ f t ct1 þ it g t ð12Þ
model involved with LSTM.
7436
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
forcement learning and Bayesian optimization techniques Fig. 4. Step 2: Find predictions with ARIMA (linear model)
ð1 k1 BÞð1 k2 BÞyt ¼ ð1 ht BÞet
Step 3: Apply stacked autoencoders on results of Step 1 and
4.2. Generative Adversarial Network based hybrid prediction Step 2 to extract new features (for further denoising of
Algorithm data)
Step 5: Find feature importance using XGBoost (output is
The Multi-Model based Hybrid prediction Algorithm (MM- given to generator)
HPA), MAE and MSE values are presented for non-linear or deep P
LðtÞ ¼ nt¼1 l yi; yt t1 þ f t ðX i Þ þ Xðf t Þ
learning model which is based on RNN. The error rate is very low
Step 6: For each iteration until convergence
indicating high performance of the mode in predicting stock
Step 7: Deep learning with LSTM as generator (takes Step 5
returns. The daily returns are predicted with least error rate on
output and hyperparameters)
both train and test data. The correlation between predicted and
Step 8: CNN as discriminator (takes real stock prices and LSTM
target returns is very high. High correlation reflects better perfor-
predictions)
mance of the model. All stock tickers in terms of MAE, MSE and
Step 9: Compute the combined loss function of generator and
correlation. The high correlation and low error rate reflected in
discriminator
the results indicate the performance of the proposed algorithm.
L(D,G) = Ex pr ðxÞ ½logD(x)] + Ez pz ðzÞ [log(1-D(G(z)))]
The reasoning behind this is that, as opposed to RNN, LSTM is
better at handling time-series data and learning long-term depen- Step 10: Tune hyperparameters H
dencies, while CNN is better at classification. In stock prediction, (continued on next page)
hybrid models with linear and non-linear prediction approaches
7437
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
Algorithm: Generative Adversarial Network based Hybrid Algorithm: Multi-Model Generative Adversarial Network
Prediction Algorithm Hybrid Prediction Algorithm
Step 11: Update D’ 2. Initialize F to 1 (number of non-liner prediction
Step 12: End For models)
Step 13: Compute error rate 3. For each prediction mode e in E
Step 13: Return D’ 4. Find br t;Li denoted as linear predictions
5. For each prediction model f in F
6. Find br t;NLj denoted as non-linear predictions
7. End For
8. End For
Algorithm 1:. Generative adversarial network based hybrid predic- 9. For each iteration until convergence
tion algorithm 10. Deep learning with LSTM as generator (takes outcomes
of Step 4 and Step 5 through Step 7 and
As presented in Algorithm 1, it takes different inputs such as
hyperparameters)
stock dataset and hyperparameters and produces predictions for
11. CNN as discriminator (takes real stock prices and LSTM
given stock ticker dataset. In Step 1, stock prices trend approxima-
predictions)
tions are made using Fourier transforms. As said before, Fourier
12. Compute the combined loss function of generator and
transforms is better technique for dealing with time-series data.
discriminatorL(D,G) = Ex pr ðxÞ ½logD(x)] + Ez pz ðzÞ [log(1-
In Step 2, ARIMA is used to find stock predictions that are reused
D(G(z)))]
further. With these two steps most of the features are extracted
13. Tune hyperparameters H
from stock dataset. However, the noise in the features is to be
14. Update D’
removed. Stacked autoencoders are applied in Step 3 in order to
15. End For
achieve it and to ensure final set of features. At this stage, it is
16. Compute error rate
important to reduce number of dimensions. XGBoost is used in
17. Return D’
Step 5 to find importance of features that have discriminative
power. The results of this and hyperparameters are given as input
to generator (LSTM). The outcome of the generator and original
stock data is given to discriminator. The discriminator classifies
data and the iterative process from Step 6 through Step 12 contin- Algorithm 2:. Multi-Model Generative Adversarial Network Hybrid
ues until convergence. In the process, parameters are tuned in Step Prediction Algorithm
10 using Bayesian approximation and predictions are updated in
Step 11. Finally, the algorithm returns final predictions besides Algorithm 2 takes stock dataset as input and it has pre-
evaluating the error rate. processing prior to GAN approach. In the pre-processing steps
(Step 1 through Step 8), the algorithm employs linear and non-
4.3. Hybrid of GAN-HPA and MM-HPA linear models in order to extract features from dataset. More on
the linear and non-linear models used to arrive at features can
Investigation is made further to exploit good features of MM- be found in our prior work. The results of pre-processing and
HPA defined in our previous research work and integrates with hyperparameters are given as input to generator (LSTM). The out-
GAN-HPA. The hybrid algorithm that combines GAN-HPA and come of the generator and original stock data is given to discrimi-
MM-HPA appropriately is named as Multi-Model Generative nator. The discriminator classifies data and the iterative process
Adversarial Network Hybrid Prediction Algorithm (MMGAN-HPA) from Step 9 through Step 15 continues until convergence. In the
in Fig. 4. process, parameters are tuned in Step 16 using Bayesian approxi-
mation and predictions are updated in Step 17. Finally, the algo-
rithm returns final predictions besides evaluating the error rate.
Algorithm: Multi-Model Generative Adversarial Network
Hybrid Prediction Algorithm
4.4. Evaluation metrics
Inputs
Stock market dataset denoted as rt (t = 1, . . .. . .., T) Performance of the GAN-HPA model is evaluated using metrics
Hyperparameters H such as Mean Absolute Error (MSA) and Mean Squared Error (MSE)
Output as in Eqs. (16) and (17).
Predicted stock prices D’
1X
1. Initialize E to 2 (number of linear prediction models) MAE ¼ jy b
yj ð16Þ
n
1 X 2
MSE ¼ yb
y ð17Þ
n
With these metrics, the prediction error is computed to ascer-
tain performance of the hybrid prediction model.
5. Experimental Results
Table 1
Performance of GAN-HPA.
As presented in Fig. 6, the timeline is provided in horizontal axis ing minimal error rate in prediction of stock prices. The prediction
while the vertical axis shows the stock price. There is close match is based on the Tata Steel dataset.
between the real stock price and predicted stock price thus reflect- As presented in Fig. 9, the timeline is provided in horizontal axis
ing minimal error rate in prediction of stock prices. The prediction while the vertical axis shows the stock price. There is close match
is based on the BHEL dataset. between the real stock price and predicted stock price thus reflect-
As presented in Fig. 7, the timeline is provided in horizontal axis ing minimal error rate in prediction of stock prices. The prediction
while the vertical axis shows the stock price. There is close match is based on the TCS dataset.
between the real stock price and predicted stock price thus reflect- As presented in Fig. 10, the timeline is provided in horizontal
ing minimal error rate in prediction of stock prices. The prediction axis while the vertical axis shows the stock price. There is close
is based on the Maruti dataset. match between the real stock price and predicted stock price thus
As presented in Fig. 8, the timeline is provided in horizontal axis reflecting minimal error rate in prediction of stock prices. The pre-
while the vertical axis shows the stock price. There is close match diction is based on the Wipro dataset.
between the real stock price and predicted stock price thus reflect-
7440
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
Table 2
Performance comparison among the three hybrid prediction models like MMHPA, GANHPA and MMGANHPA.
5.2. Results of MMGAN-HPA As presented in Fig. 11, the prediction results for all the stock
tickers are provided. The results revealed that there is further
Experimental results in terms of stock price predictions and improvement in prediction accuracy of MMGAN-HPA when com-
performance measures like MAE, MSE and correlation are provided pared with that of GAN-HPA. It is evident with the results compar-
in this section. ison presented in Section 5.3.
7441
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
5.3. Performance Comparison with the MM-PHA, another hybrid algorithm for stock prices pre-
diction, defined in (Pang et al., 2020).
This section evaluates the performance of the two prediction The prediction performance of the proposed hybrid prediction
algorithms namely GAN-HPA and MMGAN-HPA defined in this model named GAN-HPA is compared against state of the art hybrid
paper. Besides the performance of the two algorithms is compared prediction model named MM-HPA. Both models are based on deep
7442
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
learning. The main difference is that the former is based on GAN improvement of the GAN-HPA. In future, we intend to enhance
architecture while the latter is based on the combination of linear Stock-GAN further to deal with diversified forms of stock data.
and non-linear prediction models. Table 2 shows the performance Another direction for future work is to explore latent causal rela-
difference in terms of MAE, MSE and correlation and compares all tionships in the stock market data.
the three hybrid prediction models.
As presented in Figs. 12–14, the stock tickers are provided in Declaration of Competing Interest
horizontal axis and the error rate in terms of MAE, MSE and corre-
lation are provided in vertical axis respectively. Different MAE and The authors declare that they have no known competing finan-
MSE are exhibited by stock tickers. In the same fashion different cial interests or personal relationships that could have appeared
correlation values are observed for different stock tickers. How- to influence the work reported in this paper.
ever, the GAN-HPA showed relatively better performance over its
predecessor MM-HPA. Though the both are hybrid prediction
References
models, the Stock-GAN framework based hybrid prediction model
GAN-HPA has advantages of generator and discriminator Akita, R., Yoshihara, A., Matsubara, T., Uehara, K., 2016. 1XPHULFDO DQG 7H
(LSTM-CNN) combination with hyperparamters tuning. Thus, its [WXDO, QIRUPDWLRQ: Deep Learning for stock prediction using numerical and
prediction performance is better than that of MM-HPA. The data textual infromation. IEEE, 8–13.
Asad, M.: Optimized Stock market prediction using ensemble learning. 9th Int. Conf.
presented in Table 2 and further visualized in Fig. 15 reveal that Appl. Inf. Commun. Technol. AICT 2015 - Proc. 263–268 (2015). 10.1109/
there is performance improvement when the MM-HPA and ICAICT.2015.7338559.
GAN-HPA combined to form yet another hybrid model known as Bukhari, A.H., Raja, M.A.Z., Sulaiman, M., Islam, S., Shoaib, M., Kumam, P., 2020.
Fractional neuro-sequential ARFIMA-LSTM for financial market forecasting.
MMGAN-HPA. IEEE Access. 8, 71326–71338. https://doi.org/10.1109/Access.628763910.1109/
Hybrid deep learning models are proposed and found to be ACCESS.2020.2985763.
more efficient. Both linear and non-linear models are combined Chen, L., Qiao, Z., Wang, M., Wang, C., Du, R., Stanley, H.E., 2018. Which artificial
intelligence algorithm better predicts the chinese stock market? IEEE Access. 6,
to have better prediction performance. There are many insights 48625–48633. https://doi.org/10.1109/ACCESS.2018.2859809.
from existing deep learning models that led to the research carried Chen, Q., Zhang, W., Lou, Y.u., 2020. Forecasting stock prices using a hybrid deep
out in this paper. First, CNN is better for classification. Second, learning model integrating attention mechanism, multi-layer perceptron, and
bidirectional long-short term memory neural network. IEEE Access. 8, 117365–
LSTM can better capture temporal data variations than RNN. Third, 117376. https://doi.org/10.1109/Access.628763910.1109/
deep learning models suffer from lack of pre-processing (or quality ACCESS.2020.3004284.
of data) unless there is an efficient NLP based approach towards Eapen, J., Bein, D., Verma, A.: Novel deep learning model with CNN and bi-
directional LSTM for improved stock market index prediction. 2019 IEEE 9th
feature selection. Fourth, GAN is found effective in learning inter-
Annu. Comput. Commun. Work. Conf. CCWC 2019. 264–270 (2019). 10.1109/
nal representations of data using an unsupervised approach CCWC.2019.8666592.
besides generating new data that resembles real data. Fifth, a Hiransha, M., Gopalakrishnan, E.A., Menon, V.K., Soman, K.P., 2018. NSE stock
hybrid of linear and non-linear models could provide better perfor- market prediction using deep-learning models. Procedia Comput. Sci. 132,
1351–1362. https://doi.org/10.1016/j.procs.2018.05.050.
mance in stock prediction. Sixth, there is a need for a GAN based Hoseinzade, E., Haratizadeh, S., 2019. CNNpred: CNN-based stock market prediction
framework that exploits CNN, LSTM and novel pre-processing to using a diverse set of variables. Expert Syst. Appl. 129, 273–285. https://doi.org/
improve the state of art. Considering these observations 10.1016/j.eswa.2019.03.029.
Katayama, D., Kino, Y., Tsuda, K., 2019. A method of sentiment polarity
MMGAN-HPA is better performance. identification in financial news using deep learning. Procedia Comput. Sci.
159, 1287–1294. https://doi.org/10.1016/j.procs.2019.09.298.
Lee, J., Kim, R., Koh, Y., Kang, J., 2019. Global stock market prediction based on stock
chart images using deep q-network. IEEE Access. 7, 167260–167277. https://
6. Conclusion and Future Work doi.org/10.1109/Access.628763910.1109/ACCESS.2019.2953542.
Liu, Y., Zeng, Q., Yang, H., Carrio, A., 2018. Stock price movement prediction from
In this paper, Stock-GAN, a GAN based framework is proposed financial news with deep learning and knowledge graph embedding. Springer
International Publishing.
for stock price prediction. LSTM and CNN are used as generator Mai, F., Tian, S., Lee, C., Ma, L., 2019. Deep learning models for bankruptcy prediction
and discriminator models. The GAN gets selected features from using textual disclosures. Eur. J. Oper. Res. 274, 743–758. https://doi.org/
novel pre-processing methodology. The outcomes of the GAN are 10.1016/j.ejor.2018.10.024.
National Stock Exchange, India. Available at: http://www.nseindia.com.
subjected to reinforcement learning and Bayesian optimization in
Nau, R., 2014. Mathematical structure of ARIMA models. 1, 1–8.
order to adjust the hyperparameters of both models in Stock- Nelson, D.M.Q., Pereira, A.C.M., De Oliveira, R.A.: Stock market’s price movement
GAN. Linear model such as ARIMA is used for stock approximation. prediction with LSTM neural networks. Proc. Int. Jt. Conf. Neural Networks.
Autoencoders are used to extract features from data. XGBoost is 2017-May, 1419–1426 (2017). 10.1109/IJCNN.2017.7966019.
Pang, X., Zhou, Y., Wang, P., Lin, W., Chang, V., 2020. An innovative neural network
used to know the importance of features in order to filter out the approach for stock market prediction. J. Supercomput. 76 (3), 2098–2118.
features that do not contribute to the prediction objective function. https://doi.org/10.1007/s11227-017-2228-y.
An algorithm named Generative Adversarial Network (GAN) based Polamuri, S.R., Srinivas, K., Krishna Mohan, A.: Stock market prices prediction using
random forest and extra tree regression. Int. J. Recent Technol. Eng. 8, 1224–
Hybrid Prediction Algorithm (GAN-HPA) is proposed. Feature 1228 (2019). 10.35940/ijrte.C4314.098319.
extraction is made from dataset using Natural Language Processing Polamuri, S.R., Srinivas, K., Mohan, A.K., 2020. Multi model-based hybrid prediction
(NLP), Self-Organizing Maps (SOM), ARIMA, Eigen portfolios and algorithm (MM-HPA) for Stock Market Prices Prediction Framework (SMPPF).
Arab. J. Sci. Eng. https://doi.org/10.1007/s13369-020-04782-2.
Fourier transform. Further denoising of features is made with the Polamuri, S.R., Srinivas, K., Mohan, A.K., 2020. Novel greedy heuristic optimized
help of stacked autoencoders. Feature importance prediction and multi-instance quantitative for the prediction of stock price. Solid State Technol.
dimensionality reduction is made using Principal Component Anal- 63 (5), 4654–4672.
Rao, P.S., Srinivas, K., Mohan, A.K.: A Survey on Stock Market Prediction Using
ysis (PCA) and XGB. Apache MXNet API and Python data science Machine Learning Techniques. In: Machine Learning and Applications. pp. 923–
platform are used for implementation of Stock-GAN. Afterwards, 931 (2020).
MM-HPA and GAN-HPA combined to form yet another hybrid Sezer, O.B., Ozbayoglu, A.M., 2018. Algorithmic financial trading with deep
convolutional neural networks: Time series to image conversion approach.
model known as MMGAN-HPA. Empirical study revealed that
Appl. Soft Comput. J. 70, 525–538. https://doi.org/10.1016/j.asoc.2018.04.024.
Stock-GAN achieves promising performance in stock prices predic- Tsantekidis, A., Passalis, N., Tefas, A., Kanniainen, J., Gabbouj, M., Iosifidis, A.:
tion when compared with the state of the art in terms of stock Forecasting stock prices from the limit order book using convolutional neural
price prediction, MAE, MSE and correlation coefficient. The pro- networks. Proc. - 2017 IEEE 19th Conf. Bus. Informatics, CBI 2017. 1, 7–12
(2017). 10.1109/CBI.2017.23.
posed GAN-HPA algorithm outperforms the existing MM-HPA Uddin, S.M.N., 2019. Intuitive approach to understand the mathematics behind GAN
model in stock price forecasting. But MMGAN-HPA showed GAN. Intuitive Approach Math. 10.13140/RG.2.2.12650.36805.
7443
S.R. Polamuri, D.K. Srinivas, D.A. Krishna Mohan Journal of King Saud University – Computer and Information Sciences 34 (2022) 7433–7444
Vargas, M.R., De Lima, B.S.L.P., Evsukoff, A.G.: Deep learning for stock market Zhang, K., Zhong, G., Dong, J., Wang, S., Wang, Y., 2019. Stock market prediction
prediction from financial news articles. 2017 IEEE Int. Conf. Comput. Intell. based on generative adversarial network. Procedia Comput. Sci. 147, 400–406.
Virtual Environ. Meas. Syst. Appl. CIVEMSA 2017 - Proc. 60–65 (2017). 10.1109/ https://doi.org/10.1016/j.procs.2019.01.256.
CIVEMSA.2017.7995302. Zhang, Z., Zohren, S., Roberts, S., 2019. DeepLOB: Deep convolutional neural
Zhang, X., Zhang, Y., Wang, S., Yao, Y., Fang, B., Yu, P.S., 2018. Improving stock networks for limit order books. IEEE Trans. Signal Process. 67 (11), 3001–3012.
market prediction via heterogeneous information fusion. Knowledge-Based https://doi.org/10.1109/TSP.7810.1109/TSP.2019.2907260.
Syst. 143, 236–247. https://doi.org/10.1016/j.knosys.2017.12.025.
7444