IIKI2018_生成对抗网络_Stock Market Prediction Based on Generative Adversarial Network

 

Stock Market Prediction Based on Generative Adversarial Network

Department of Computer Science and Technology, Ocean University of China, Qingdao, 266100, China

  最近看的一篇关于生成对抗网络在股票市场预测中的运用的文献,是由中国海洋大学的kangzhang等人于2018年发表在IIKI上,主要方法是以多层感知机(MLP)为鉴别器,长短期记忆网络(LSTM)为生成器来预测收盘价。其中生成器用LSTM构建,用于从股票市场的给定数据中挖掘股票的数据分布,并在相同的分布中生成数据;鉴别器由MLP设计,包含7210010个神经元的3个隐层单元,用以区分真实的股票数据和生成的数据。数据集为标准普尔S&P500指数的日数据和多个交易日的多支股票,特征为:(开盘价,最高价,最低价,收盘价,成交量,换手率以及五日均值),从而对收盘价进行预测,对比以LSTM,ANN,SVR等baseline,它取得了相对较好的结果。

1.Abstract:

Deep learning has recently achieved great success in many areas due to its strong capacity in data process. For instance, it has been widely used in financial areas such as stock market prediction, portfolio optimization, financial information processing and trade execution strategies. Stock market prediction is one of the most popular and valuable area in finance. In this paper, we propose a novel architecture of Generative Adversarial Network (GAN) with the Multi-Layer Perceptron (MLP) as the discriminator and the Long Short-Term Memory (LSTM) as the generator for forecasting the closing price of stocks. The generator is built by LSTM to mine the data distributions of stocks from given data in stock market and generate data in the same distributions, whereas the discriminator designed by MLP aims to discriminate the real stock data and generated data. We choose the daily data on S&P 500 Index and several stocks in a wide range of trading days and try to predict the daily closing price. Experimental results show that our novel GAN can get a promising performance in the closing price prediction on the real data compared with other models in machine learning and deep learning.

文章主要方法介绍:

1.A novel Generative Adversarial Network (GAN) architecture with Long-Short Term Memory (LSTM) network as the generator and Multi-Layer Perceptron (MLP) as the discriminator is proposed. The model trained in an end-to-end way to predict the daily closing price by giving the stock data in several past days.

2.We try to generate the same distributions of the stock daily data through the adversarial learning system, instead of only utilizing traditional regression methods for the price forecasting.

2.The generator:

The generator of our model is designed by LSTM with its strong ability in processing time series data. We choose the daily data in the last 20 years with 7 financial factors to predict the future closing price. The 7 factors of the stock data in one day are High Price, Low Price, Open Price, Close Price, Volume, Turnover Rate and Ma5 (the average of closing price in past 5 days). The 7 factors are valuable and significant in price prediction with the theory of technical analysis, Mean Reversion, or MAR. Therefore, these factors can be used as 7 features of the stock data for the price prediction. Suppose our input is X = {x1, ..., xt}, which consists of the daily stock data of t days. Each xk in X is a vector, which is composed of 7 features as follows:

1.Abstract:

Deep learning has recently achieved great success in many areas due to its strong capacity in data process. For instance, it has been widely used in financial areas such as stock market prediction, portfolio optimization, financial information processing and trade execution strategies. Stock market prediction is one of the most popular and valuable area in finance. In this paper, we propose a novel architecture of Generative Adversarial Network (GAN) with the Multi-Layer Perceptron (MLP) as the discriminator and the Long Short-Term Memory (LSTM) as the generator for forecasting the closing price of stocks. The generator is built by LSTM to mine the data distributions of stocks from given data in stock market and generate data in the same distributions, whereas the discriminator designed by MLP aims to discriminate the real stock data and generated data. We choose the daily data on S&P 500 Index and several stocks in a wide range of trading days and try to predict the daily closing price. Experimental results show that our novel GAN can get a promising performance in the closing price prediction on the real data compared with other models in machine learning and deep learning

文章主要方法介绍:

1.A novel Generative Adversarial Network (GAN) architecture with Long-Short Term Memory (LSTM) network as the generator and Multi-Layer Perceptron (MLP) as the discriminator is proposed. The model trained in an end-to-end way to predict the daily closing price by giving the stock data in several past days.

2.We try to generate the same distributions of the stock daily data through the adversarial learning system, instead of only utilizing traditional regression methods for the price forecasting.

2.The generator:

The generator of our model is designed by LSTM with its strong ability in processing time series data. We choose the daily data in the last 20 years with 7 financial factors to predict the future closing price. The 7 factors of the stock data in one day are High Price, Low Price, Open Price, Close Price, Volume, Turnover Rate and Ma5 (the average of closing price in past 5 days). The 7 factors are valuable and significant in price prediction with the theory of technical analysis, Mean Reversion, or MAR. Therefore, these factors can be used as 7 features of the stock data for the price prediction. Suppose our input is X = {x1, ..., xt}, which consists of the daily stock data of t days. Each xk in X is a vector, which is composed of 7 features as follows:

输入为X={x1,,,xt},表示t天的股票数据,每个x是一个包含7个股票属性特征的7维向量。提取LSTM输出的ht,将其放入一个包含7个神经元的全连接层,来生成x^t+1的股票数据(生成器生成的,不是真实的),x^t+1的目标是接近xt+1(真实数据),从而从生成的数据中得到t+1天的预测收盘价。

The output of generator G(X) is defifined as follows:

g(·):LSTM的输出。

ht:股票数据X = {x1, ..., xt}经过LSTM模型作用后的输出。

δ:激活函数(ReLU修正线性单元)。

Wh:全连接层的权重。

Bh:全连接层的偏置。

Target:通过历史数据X和生成数据x^t+1来预测x^t+2的数据。

3.The Discriminator:

  The purpose of the discriminator is to constitute a differentiable function D(可微函数D) to classify the input data. The discriminator is expected to output 0 when inputting a fake data and output 1 when inputting a real data.(如果是真实数据,鉴别器输出1,如果是伪造数据,则鉴别器输出0) Here, we choose an MLP as our discriminator with three hidden layers h1,h2,h3 including 72,100,10 neurons, respectively. The Leaky ReLU is used as the activation function among the hidden layers and the sigmoid function is used in the output layer.

  In addition, the cross entropy loss is chosen as the loss function to optimize the MLP. In particular, we concatenate the X = {x1, ..., xt} and xˆt+1 to get {x1, ..., xt, xˆt+1} as the fake data Xfake. Similarly, we concatenate the X = {x1, ..., xt} and xt+1 to get {x1, ..., xt, xt+1} as the real data Xreal. The output of the discriminator is defined as follows:

 

d(·) :多层感知机的输出和sigmoid激活函数。

XfakeXreal为标量。

  方法:某一天前的历史数据和这天的生成器生成的数据用来生成伪造数据Xfake某一天前的历史数据和这天的真实数据用来生成真实数据Xreal

4.The Architecture of GAN:

 

生成器生成股票数据Xfake和Xreal,鉴别器通过隐层单元输出判别结果。

 

方法:定义两个损失:Gloss和Dloss来得到最优化函数值,我们将经典的GAN的生成器损失和Mean Square Error(MSE均方误差)组合起来,组成鉴别器的损失Gloss

5.experiment results

评测标准:

1.Mean Absolute Error(MAE),平均绝对误差

2.Root Mean Square Error (RMSE),均方根误差

3.Mean Absolute Percentage Error (MAPE) ,平均绝对百分比误差

4.Average Return (AR),平均收益率

第k天的真实收盘价为yk,预测收盘价为yk^,评测指标计算方法如下:

  评测对比:本实验通过Root Mean Square Error (RMSE),均方根误差,Mean Absolute Error(MAE),平均绝对误差和Average Return (AR),平均收益率等指标。对比了3种经典的股票预测方法Support Vector Regression (SVR), ANN and LSTM作为baselineLow MAE, RMSE and MAPE indicate that the prediction of closing price is approximate to the real data. AR shows the daily average return of these stocks based on four prediction methods.

预测结果对比:

6.阅读总结

  这篇文章使用了目前比较热门的生成对抗网络用在股票价格预测,是一个新方法上的突破。实验结果只和三个很简单的模型的baseline进行对比,虽然各项指标都比较高,但是并没有和目前做的比较好的模型进行对比。

改进:

1.增加股票因子以提高准确率。

2.结合自然语言处理。

参考文献:

[1]Kang Zhang, Guoqiang Zhong, Junyu Dong, Shengke Wang, Yong Wang:Stock Market Prediction Based on Generative Adversarial Network. IIKI 2018: 400-406

[2]Teema Leangarun, Poj Tangamchit, Suttipong Thajchayapong:Stock Price Manipulation Detection using Generative Adversarial Networks. SSCI 2018: 2104-2111

posted @ 2019-04-19 15:11  A-inspire  Views(2314)  Comments(0Edit  收藏  举报