CN110135624A - A kind of data predication method of the combination LSTM model based on 2-D data stream - Google Patents

A kind of data predication method of the combination LSTM model based on 2-D data stream Download PDF

Info

Publication number
CN110135624A
CN110135624A CN201910298682.1A CN201910298682A CN110135624A CN 110135624 A CN110135624 A CN 110135624A CN 201910298682 A CN201910298682 A CN 201910298682A CN 110135624 A CN110135624 A CN 110135624A
Authority
CN
China
Prior art keywords
index
lstm
data stream
data
stock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910298682.1A
Other languages
Chinese (zh)
Inventor
邓春华
张晓龙
边小勇
朱子奇
丁胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan University of Science and Engineering WUSE
Wuhan University of Science and Technology WHUST
Original Assignee
Wuhan University of Science and Engineering WUSE
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan University of Science and Engineering WUSE filed Critical Wuhan University of Science and Engineering WUSE
Priority to CN201910298682.1A priority Critical patent/CN110135624A/en
Publication of CN110135624A publication Critical patent/CN110135624A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The present invention provides a kind of Prediction of Stock Index method of combination LSTM model based on 2-D data stream, 2-D data stream including by one-dimensional stock sequence data circulationization including time contextual information, and feature extraction is carried out to 2-D data stream using convolutional neural networks, then single branch stock price is established respectively on 2-D data stream, deep bid index, the step of affiliated index sector LSTM prediction model, and utilize above-mentioned LSTM model prediction list branch stock price respectively and deep bid index value and affiliated index sector value, then the relational model between single branch stock and deep bid index and affiliated index sector is established respectively, the step of forming combination forecasting on this basis.The Prediction of Stock Index method of combination LSTM model based on 2-D data stream of the invention has preferable robustness.

Description

A kind of data predication method of the combination LSTM model based on 2-D data stream
Technical field
The present invention relates to Prediction of Stock Price field, in particular to a kind of combination LSTM model based on 2-D data stream Prediction of Stock Index method.
Background technique
In recent years, as artificial intelligence technology and big data technology are fast-developing, tending to become strong demand day in financial market It is strong, wherein most strong one of the field of Prediction of Stock Index demand.Traditional Prediction of Stock Index method has: support vector machines, random forest, Adboost, logistic regression etc..As performance of the deep learning method in each field is constantly promoted, RNN (circulation nerve net Network), GRU (gating cycle unit), the new work such as LSTM (Long-Short Term Memory, shot and long term Memory Neural Networks) Tool is gradually favored.
Stock market is a kind of dynamical system of multivariable nonlinearity, and the rule of variation is influenced by many factors, example Such as company's emergency event, deep bid index fluctuation, subject matter hot spot, industrial trend.Therefore, the accurate price of stock or in short-term Interior ups and downs range is difficult to predict.However, the essence of stock is the case where company's operation and the following potential investment value, Medium-term and long-term investment value tends to be embodied in stock price, and steady stock trend forecasting method is particularly important.
The essence of Stock Price Forecasting problem is a kind of the problem of being based on time series forecasting, and shot and long term memory network LSTM has been widely used in the modeling to time series data, the prediction modeling including stock certificate data.It is existing to be based on The method of LSTM Prediction of Stock Index is largely all only limitted to the Price advisor modeling to certain branch stock itself, without considering market ring Border (deep bid index, affiliated index sector etc.);Used stock certificate data is often simple one-dimensional historical price data, is lacked Time contextual information.There are many random enchancement factor in stock market, very big to short period price influence of fluctuations.In addition also have Certain methods predict stock trend using the method that stock price and news messages combine, but the tool of news messages Body influences and positioning is difficult to define.Uncertainty in traffic of the above-mentioned such methods in the more Chinese A share market of casual household is brighter It is aobvious.This kind of model complex model still based on various message of the either tradition simply based on stock price itself, for The prediction of stock all lacks robustness.
Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide a kind of combination LSTM mould based on 2-D data stream The Prediction of Stock Index method of type.
Design of the invention is as follows:
(1) the characteristics of being directed to non-linear stock market time series, non-stationary: by one-dimensional stock sequence data circulationization 2-D data stream comprising time contextual information, and feature extraction is carried out to 2-D data stream using convolutional neural networks, so LSTM time series predicting model is established on 2-D data stream afterwards.
(2) it is influenced for single branch stock market by factors such as deep bid index, affiliated index sectors: utilizing above-mentioned LSTM mould Type predicts single branch stock price and deep bid index value and affiliated index sector value respectively, then establishes single branch stock and big respectively Relational model between disk index and affiliated index sector forms the Prediction of Stock Index side of the LSTM model of combination on this basis Method.
The purpose of the present invention is what is be achieved through the following technical solutions:
A kind of Prediction of Stock Index method of the combination LSTM model based on 2-D data stream, comprising the following steps: step S1: point Not using single branch stock price, deep bid index, affiliated index sector multiple nodes historical data as basic data, using following The basic data of single branch stock price, deep bid index, affiliated index sector is turned to two by one-dimensional data circulation respectively by ring matrix Dimension data stream;Step S2: the deep learning network model that construction feature extracts;Step S3: it is mentioned using the feature that step S2 is obtained The network model taken, single branch stock price that step S1 respectively is obtained, deep bid index, affiliated index sector 2-D data stream Two-dimensional convolution neural network (CNN) feature for continuously extracting multiple nodes is correspondingly formed single branch stock price, deep bid index, affiliated The 2-D data stream feature of index sector constructs single branch stock price respectively in corresponding 2-D data stream feature, deep bid refers to The LSTM prediction model of several, affiliated index sector;Step S4: it is utilized respectively single branch stock price LSTM prediction that step S3 is obtained Model is predicted single branch stock price ups and downs value, is carried out using deep bid index LSTM prediction model to deep bid index ups and downs value Prediction predicts affiliated index sector ups and downs value using affiliated index sector LSTM prediction model, by resulting predicted value It is combined, combination forecasting is constructed, to obtain final advance-decline forecasting value.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: in step S1, for a node of single branch stock price or deep bid index or affiliated index sector, before taking the node The historical data of 56 day of trade is expressed as { x as basic data, general formula56,x55,...,x1, wherein x1Indicate that the node is worked as It closing share price, x56Indicate the closing share price of the 56th day of trade forward;It will using 56 × 56 circular matrix One-dimensional data circulation chemical conversion 2-D data stream.2-D data is converted to as basic data using the historical data of 56 day of trade Stream output is square form, and 56 × 56 network stabilizations are good and have preferable sensibility.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: step S2 is specifically includes the following steps: step S2-1, using the structural model of residual error network, and in existing image Pre-training is carried out on database, obtained weight is used to initialization network parameter;Step S2-2, by the last one of residual error network Full articulamentum and softmax classifier are substituted for recurrence layer;Step S2-3, using at least 100,000 sample datas to step S2-2 Obtained network carries out small parameter perturbations training, after training, removes linear regression layer, obtains feature extraction network, this feature Extracting network inputs is 56 × 56 2-D datas, and output is the vector of 1 × 2048 dimension.It is carried out using at least 100,000 sample datas Small parameter perturbations training, parameter is more, data foot, it is ensured that trained network stabilization is good, good reliability.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: in step S2-1 using residual error network be preferably 18 layers of residual error network, 34 layers of residual error network, 50 layers of residual error net Any one in network.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: specific step is as follows by step S2-2: (1) being chosen at the network weight of pre-training on image classification data library as just Beginningization network parameter;(2) it is modified using deep learning frame to weight file.Repack sorter network into Recurrent networks, Linear feature is made it have, data analysis prediction is facilitated.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: where image classification data library preferably uses ImageNet data set, any one in PascalVoc data set.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: where deep learning frame preferably uses any one in karas, caffe, pyTorch.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: in the training process of step S2-3, accelerated using GTX1080Ti video card GPU, the training time is at least 15 small When.Ensure that loss function value is substantially steady, guarantees the reliable and stable of trained network.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: specific step is as follows by step S3: step S3-1: continuously extract 10 nodes two-dimensional convolution neural network characteristics shape At 2-D data stream feature, general formula is expressed as { X1,X2,…,X10, Xi∈R1×2048, XiIndicate the two-dimensional convolution mind of i-th of node Through network characterization feature;Step S3-2: being based on two-dimensional convolution neural network characteristics feature, and the LSTM of 10 nodes of continuous structure is mono- First cell forms LSTM prediction model, wherein the node data X of given time tt∈R1×2048With upper a moment hidden state ht∈ R1×1, input gate It∈R1×1, forget door Ft∈R1×1With out gate Ot∈R1×1, the calculation process formula of LSTM unit cell is such as Under:
In above-mentioned formula (1), ItIndicate input gate;FtIt indicates to forget door;OtIndicate out gate;CtIndicate the cell of t moment State;Ct-1Indicate the cell state of last moment;Indicate the first stage that cell state updates;σ () indicates sigmoid Activation primitive;Tanh () indicates tangent activation primitive;Xt,ht-1It is variable, XtIndicate the node data of given time t, ht-1 Indicate Hidden unit;Wxo,Who,Wxi,Whi,Wxf,Whf,Wxc,WhcIt is the coefficient of variable respectively;bi, bf, bo, bcIt is constant;* table Show convolution algorithm;Step S3-3: the LSTM network training tool called directly in advanced deep learning frame predicts mould to LSTM Type is trained, which preferably uses karas or pytorch.
In the Prediction of Stock Index method of the combination LSTM model provided by the invention based on 2-D data stream, also have in this way Feature: specific step is as follows by step S4: step S4-1: being utilized respectively single branch stock price LSTM prediction that step S3 obtains Model is predicted to obtain advance-decline forecasting value to be y to single branch stock price ups and downs value0;Utilize deep bid index LSTM prediction model pair Deep bid index ups and downs value is predicted to obtain advance-decline forecasting value to be y1;Utilize the affiliated index sector LSTM prediction model pair of the stock Affiliated index sector ups and downs value is predicted that the stock has N number of industry for propagandizing concept, and N number of industry obtains advance-decline forecasting value Respectively y2,y3,…,yN+1;Step S4-2: constructing following combination forecasting, and final advance-decline forecasting value y is calculated:
In above-mentioned formula (2),It is normalized related coefficient, specific calculation is as follows:
In above-mentioned formula (3), Cov () indicates covariance, and σ () indicates standard deviation.
Beneficial effects of the present invention:
In the Prediction of Stock Index method of combination LSTM model based on 2-D data stream of the invention, by one-dimensional stock sequence Data flow converts 2-D data stream, and 2-D data stream includes time contextual information more abundant;Residual error network is a kind of depth Convolutional neural networks are spent, it is stronger can to extract robustness on this basis for the abstracting capabilities with very strong contextual information Two-dimensional convolution neural network characteristics;Small parameter perturbations training is carried out to network using a large amount of sample data, improves its stability; Single branch stock price and deep bid index value and affiliated index sector value are predicted respectively using independent LSTM model, are then built respectively Relational model between vertical list branch stock and deep bid index and affiliated index sector, forms the LSTM mould of combination on this basis Type has comprehensively considered the factor that single branch stock market is influenced by factors such as deep bid index, affiliated index sectors in this way, therefore, The prediction technique tool of the Prediction of Stock Index method of combination LSTM model based on 2-D data stream of the invention compared to the prior art There is stronger robustness, stability is more preferable, is a kind of more optimal prediction technique.
Detailed description of the invention
Fig. 1 is the Prediction of Stock Index method flow diagram of the combination LSTM model in the present invention based on 2-D data stream;
Fig. 2 is the schematic diagram that one-dimensional data circulation turns to 2-D data stream in the present invention;
Network configuration schematic diagram when Fig. 3 is the ResNet difference number of plies in the present invention;
Fig. 4 is the schematic diagram of LSTM unit cell in the present invention;
Fig. 5 is the schematic diagram of each step of LSTM unit cell in the present invention;
Fig. 6 is the schematic diagram of LSTM prediction model in the present invention;
Fig. 7 is the schematic diagram that the circulation of the embodiment of the present invention Zhong Chen electricity world one-dimensional data turns to 2-D data stream.
Specific embodiment
It is real below in order to be easy to understand the technical means, the creative features, the aims and the efficiencies achieved by the present invention Example combination attached drawing is applied to be specifically addressed the Prediction of Stock Index method of the combination LSTM model the present invention is based on 2-D data stream.It is following Embodiment is only a concrete case of the invention, the protection scope being not intended to limit the invention.
<embodiment>
Using the international (stock code: 600969) on the November 27th, 22 days 1 of August in 2018 of Chen electricity in the present embodiment The closing price data of (totally 65 day of trade) predict the amount of increase in Chen electricity international on November 28th, 2018.
As shown in Figure 1, a kind of Prediction of Stock Index method of the combination LSTM model based on 2-D data stream specifically include it is following Step:
Step S1: one-dimensional data circulation turns to 2-D data stream
Respectively by single branch stock price, deep bid index, affiliated index sector multiple nodes historical data based on Data, using circular matrix respectively by single branch stock price, deep bid index, affiliated index sector basic data by one-dimensional data Circulation turns to 2-D data stream.
For a node of single branch stock price or deep bid index or affiliated index sector, 56 transaction before the node are taken The historical data of day is expressed as { x as basic data, general formula56,x55,...,x1, wherein x1Indicate the stock on the day of the node Closing price, x56Indicate the closing share price of the 56th day of trade forward.Remember nearest 56 days closing prices of certain branch stock ForThe nearest 56 days closing prices of deep bid index areThe stock has N number of propagation concept Industry, the nearest 56 days closing prices of equivalency index are respectively
One-dimensional data is circulated using 56 × 56 circular matrix and is melted into 2-D data stream (as shown in Figure 2), from Fig. 2 two dimension Data flow finds out, x1It is distributed in right clinodiagonal, frequency is most;And x56It is distributed on two points of left diagonally opposing corner, frequency is most Less, it is smaller to meet specific gravity remoter from current time, shared, and, shared specific gravity bigger generally rule closer from current time Rule.
The data of continuous 56 day of trade are converted 2-D data by the present invention, forms a node, adopts on this basis Use 10 continuous nodes data as the input of LSTM prediction model.Therefore list branch stock (or deep bid index or affiliated industry refer to Number) LSTM network need the historical data of continuous 65 (continuous 10 56 days of trade) days of trade as original analysis number According to.
The following are the detailed process (deep bids that the one-dimensional data circulation of the international single branch stock price of Chen electricity turns to 2-D data stream Index, the operation of affiliated index sector are similar, no longer elaborate herein): the world Chen electricity (stock code: 600969) 2018 years The closing price in August on November 27th, 22 days 1 (totally 65 day of trade), Then respectively willIt is respectively converted into two-dimemsional number According toFig. 3 illustrates wherein one-dimensional dataBe converted to 2-D dataProcess.
Step S2: the deep learning network model that construction feature extracts
Step S2-1, using the structural model of residual error network (resnet), and it is enterprising in existing image classification data collection Row pre-training, obtained weight is as initialization network parameter.Fig. 4 illustrates net when different layers of ResNet difference numbers of plies Network (resnet18, resnet34, resnet50) configuration schematic diagram.Preferred 50 layers of residual error network (resnet50) is as initial Change network.
The last one full articulamentum and softmax classifier of residual error network are substituted for recurrence layer by step S2-2.Specifically Are as follows: the network weight of pre-training on ImageNet data set is chosen at as initialization network parameter.Image on ImageNet It is 3 channels, and the 2-D data that above-mentioned steps 1 obtain is 1 channel.Weight file is carried out using karas deep learning frame Modification, the convolution kernel in 3 channels of first convolutional layer is directly removed into channel, by the N of the last one full articulamentum (data set Categorical measure) a tie point becomes 1 tie point, and removes softmax layers, using mean square deviation loss function, by sorter network Repack Recurrent networks into.
Step S2-3 carries out small parameter perturbations training to the network that step S2-2 is obtained using at least 100,000 sample datas, After training, remove linear regression layer, obtains feature extraction network, it is 56 × 56 two-dimemsional numbers that this feature, which extracts network inputs, According to output is the vector of 1 × 2048 dimension, each node uses 1 × 2048 vector to describe.Specifically:
For single branch stock, the data of continuous 65 day of trade are known as a data by the present invention.The present invention collects The historical data of -2018 years 2007 Chinese A-shares carries out removing power operation first, and removal is comprising limit-up in continuous 2 days or more or continuously The data of not year and a day are issued in the data of limit down in two days or more, removal, remove st stock certificate data, and removal is suspended trades more than 3 The unstable data of certain laws such as the data of day, have chosen altogether 158560 sample datas.Wherein, 100,000 (5,600,000 A node data) as training, in addition 58560 (380.6 ten thousand node datas) as test verifying.
Resnet50 network is trained in the data of 5,600,000 nodes, carries out small parameter perturbations to former network.Training When, each node data predicted value is second day true amount of increase.In trained process, carried out using GTX1080Ti video card GPU Accelerate, 15 hour loss function values of training are substantially steady, stop.
Step S3: it is continuous to extract CNN feature, single branch stock price, deep bid index, the building of affiliated index sector are constructed respectively LSTM prediction model.
It is illustrated for constructing single branch stock price LSTM prediction model, (deep bid index LSTM prediction model, affiliated industry Index LSTM prediction model is similar therewith, no longer elaborates), construct single branch stock price LSTM prediction model specifically:
Step S3-1: after step 2 trains network weight, feature extraction is carried out to the 2-D data of each node, is obtained To 2048 dimension datas.Such as 2-D data shown in Fig. 3By trained Resnet50 propagated forward, one is obtained The vector of 2048 dimensionsTherefore, available 10 1 × 2048 of each data The characteristic of dimension, the input as next step LSTM network.Such as the data of Chen electricity international 65 day of trade are available {Xi 0, Xi 0∈R1×2048, i=1,2 ..., 10.
Step S3-2: the LSTM unit cell (LSTM unit cell is as shown in Figure 5) of 10 nodes of continuous structure is formed LSTM prediction model (LSTM prediction model is as shown in Figure 7).
As shown in figure 5, the hidden state of LSTM includes hidden layer variable h and cell C, the node data X of given time tt ∈R1×2048With upper a moment hidden state ht∈R1×1, input gate It∈R1×1, forget door Ft∈R1×1With out gate Ot∈R1×1。 The calculation process formula of LSTM unit cell is as follows:
In above-mentioned formula (1), ItIndicate input gate;FtIt indicates to forget door;OtIndicate out gate;CtIndicate the cell of t moment State;Ct-1Indicate the cell state of last moment;Indicate the first stage that cell state updates;σ () indicates sigmoid Activation primitive;Tanh () indicates tangent activation primitive;Xt,ht-1It is variable, XiIndicate the node data of given time t, ht-1 Indicate Hidden unit;Wxo,Who,Wxi,Whi,Wxf,Whf,Wxc,WhcIt is the coefficient of variable respectively;bi, bf, bo, bcIt is constant;* table Show convolution algorithm.
According to Fig. 6 (d) it is found that out gate OtPurpose be from cell state Ct-1Generate Hidden unit ht-1.It is not Ct-1 In all information and Hidden unit ht-1It is related, Ct-1It may includes much to ht-1Useless information.Therefore the work of out gate Be exactly judgement in which be partially to ht-1Useful, which is useless.Out gate be by a linear function and Sigmoid function is constituted.As shown in formula (1), wherein linear function part, Wxo,WhoIt is variable X respectivelyt,ht-1Coefficient, bo It is constant;σ () indicates sigmoid function.
According to Fig. 6 (b) it is found that input gate ItIt is control current data XtInformation incorporate cell state Ct.It is entire understanding When period data flow, current data XtIt may be critically important to entire period data flow, it is also possible to not important.Input gate Purpose is exactly to judge current data XtTo global importance.Out gate is also by a linear function and sigmoid function structure At.As shown in formula (1), wherein linear function part, Wxi,WhiIt is variable X respectivelyt,ht-1Coefficient, biIt is constant;σ(·) Indicate sigmoid activation primitive.
According to Fig. 6 (a) it is found that forgeing door FtIt is for controlling last moment cell state Ct-1Information incorporate it is cellular State Ct.When understanding data flow, as data XtIt may continue to continue the meaning above and continue to describe, it is also possible to from current data Xt Be illustrated starting at new content, with above it is unrelated.Forget door and input gate ItOn the contrary, FtNot to current data XtImportance work sentence It is disconnected, and judge be last moment cell state Ct-1Cell state C current to calculatingtImportance.Forgeing door is also by one A linear function and sigmoid function are constituted.As shown in formula (1), wherein linear function part, Wxf,WhfIt is variable X respectivelyt, ht-1Coefficient, bfIt is constant;σ () indicates sigmoid activation primitive.
Such as Fig. 6 (b), 6 (c), in the data updating process for completing three above door, cell state C and hidden state h are also needed It is updated operation.Hidden state ht=Ot*tanh(Ct), it is hidden by the way that whether the information that out gate controls memory cell is output to Containing in state;As shown in formula (1), the update of cell state C is divided into two stages, first stageIt is by a linear function It is constituted with a tangent activation primitive, wherein linear function part, Wxc,WhcIt is variable X respectivelyt,ht-1Coefficient, bcIt is constant, Tanh () indicates tangent activation primitive.
Step S3-3: after the feature for extracting every data, the LSTM network instruction in advanced deep learning frame is called directly Practice tool to be trained LSTM prediction model, obtains parameter W in formula (1)xi,Whi,bi,Wxf,Whf,bf,Wxo,Who,bo,Wxc, Whc,bcValue.The present invention using 100,000 data samples in training set as training, learn as verifying by 58560 data samples Practise above-mentioned parameter value.
The LSTM model of trained list branch stock price selects some node for any one stock, can predict Second day amount of increase and amount of decrease.For example, the world prediction 28 Chen electricity November in 2018 (stock code: 600969) amount of increase and amount of decrease, first Using the closing price in August on November 27th, 22 days 1 in 2018 (totally 65 day of trade) as original analysis data.It will be with { the X that upper several steps obtaini 0, Xi 0∈R1×2048, i=1,2 ..., 10, it is input to the LSTM of trained single branch stock price In model, propagated forward is carried out, prediction obtains the amount of increase in Chen electricity international on November 28th, 2018 and is 3.26% (practical amount of increase is 2.58%).
Step S4: building combination forecasting
Although single branch stock price LSTM prediction model can predict second day amount of increase and amount of decrease of stock from the above, It is only to be predicted according to the stock history ups and downs situation, does not account for the exponential effect of deep bid index and industry.
Specific step is as follows by step S4:
Step S4-1: it is utilized respectively single branch stock price LSTM prediction model that step S3 is obtained and rises to single branch stock price Fall value to be predicted to obtain advance-decline forecasting value to be y0;Deep bid index ups and downs value is carried out using deep bid index LSTM prediction model pre- Measuring advance-decline forecasting value is y1;Using the affiliated index sector LSTM prediction model of the stock to affiliated index sector ups and downs value into Row prediction, the stock have N number of industry for propagandizing concept, and it is respectively y that N number of industry, which obtains advance-decline forecasting value,2,y3,…,yN+1
Step S4-2: based on above-mentioned advance-decline forecasting as a result, according to single branch stock and deep bid index and industry concept index Correlation construct following combination forecasting, final advance-decline forecasting value y is calculated:
In above-mentioned formula (2),It is normalized related coefficient, specific calculation is as follows:
In above-mentioned formula (3), Cov () indicates covariance, and σ () indicates standard deviation.
For predicting the amount of increase and amount of decrease in Chen electricity international on November 28th, 2018, single branch stock is constructed accordingly by step 3 Price LSTM prediction model, deep bid index LSTM prediction model, affiliated index sector LSTM prediction model can be predicted to rise in itself Fall situation y0=3.26%;Deep bid index amount of increase and amount of decrease y1=0.92%;Electric power index amount of increase and amount of decrease y2=1.15%.It utilizes formula (3) Corresponding normalizated correlation coefficient can be calculated to be respectively as follows:
WhereinFor September in 2018 4 days- On November 27th, 2018 Index of Shanghai Stock Exchange (stock code in straight flush software for speculation on stocks: 1A0001) of totally 56 day of trade closing quotation Index,For -2018 years on the 4th November 27 of September in 2018 (stock code in straight flush software for speculation on stocks: 881145) closing quotation of index refers to the power industry concept of totally 56 day of trade day Number.Finally utilize formula (2)
The final amount of increase predicted value in available Chen electricity international on November 28th, 2018 is y=2.16%.
Reality it can be concluded that, is closer to by the final advance-decline forecasting value that combination forecasting is predicted by above-described embodiment Amount of increase (practical amount of increase is 2.58%), this is more preferably than the more scientific, robustness solely according to single branch Prediction of Stock Price amount of increase.

Claims (10)

1. a kind of Prediction of Stock Index method of the combination LSTM model based on 2-D data stream, comprising the following steps:
Step S1: respectively using single branch stock price, deep bid index, affiliated index sector multiple nodes historical data as base Plinth data, using circular matrix respectively by single branch stock price, deep bid index, affiliated index sector basic data by a dimension 2-D data stream is turned to according to circulation;
Step S2: the deep learning network model that construction feature extracts;
Step S3: using the network model of the obtained feature extraction of step S2, single branch stock price that step S1 respectively is obtained, Deep bid index, affiliated index sector 2-D data stream continuously extract the two-dimensional convolution neural network characteristics of multiple nodes and correspond to shape The 2-D data stream feature of Cheng Danzhi stock price, deep bid index, affiliated index sector, in corresponding 2-D data stream feature Construct respectively single branch stock price, deep bid index, affiliated index sector LSTM prediction model;
Step S4: be utilized respectively single branch stock price LSTM prediction model that step S3 is obtained to single branch stock price ups and downs value into Row prediction predicts deep bid index ups and downs value using deep bid index LSTM prediction model, utilizes affiliated index sector LSTM Prediction model predicts affiliated index sector ups and downs value, and resulting predicted value is combined, and constructs combination forecasting, To obtain final advance-decline forecasting value.
2. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as described in claim 1, it is characterised in that:
In step S1, for a node of single branch stock price or deep bid index or affiliated index sector, take 56 before the node The historical data of a day of trade is expressed as { x as basic data, general formula56,x55,...,x1, wherein x1On the day of indicating the node Closing share price, x56Indicate the closing share price of the 56th day of trade forward;
One-dimensional data is circulated using 56 × 56 circular matrix and is melted into 2-D data stream.
3. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 2, it is characterised in that:
Step S2 specifically includes the following steps:
Step S2-1 carries out pre-training using the structural model of residual error network, and on existing image classification data collection, obtains Weight as initialization network parameter;
The last one full articulamentum and softmax classifier of residual error network are substituted for recurrence layer by step S2-2;
Step S2-3 carries out small parameter perturbations training, training to the network that step S2-2 is obtained using at least 100,000 sample datas After good, remove linear regression layer, obtains feature extraction network, it is 56 × 56 2-D datas that this feature, which extracts network inputs, defeated It is the vector of 1 × 2048 dimension out.
4. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 3, it is characterised in that:
Use the residual error network for 18 layers of residual error network, 34 layers of residual error network, 50 layers of residual error network in step S2-1 In any one.
5. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 3, it is characterised in that:
Specific step is as follows by step S2-2:
(1) network weight of pre-training on image classification data library is chosen at as initialization network parameter;
(2) it is modified using deep learning frame to weight file.
6. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 5, it is characterised in that:
Wherein, described image taxonomy database is ImageNet data set, any one in Pascal Voc data set.
7. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 5, it is characterised in that:
Wherein, the deep learning frame is any one in karas, caffe, pyTorch.
8. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 3, it is characterised in that:
In the training process of step S2-3, accelerated using GTX1080Ti video card GPU, the training time is at least 15 hours.
9. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as claimed in claim 3, it is characterised in that:
Specific step is as follows by step S3:
Step S3-1: the continuous two-dimensional convolution neural network characteristics for extracting 10 nodes form 2-D data stream feature, general formula table It is shown as { X1,X2,…,X10, Xi∈R1×2048, XiIndicate the two-dimensional convolution neural network characteristics feature of i-th of node;
Step S3-2: being based on two-dimensional convolution neural network characteristics, and the LSTM unit cell of 10 nodes of continuous structure forms LSTM Prediction model, wherein the node data X of given time tt∈R1×2048With upper a moment hidden state ht∈R1×1, input gate It∈R1 ×1, forget door Ft∈R1×1With out gate Ot∈R1×1, the calculation process formula of LSTM unit cell is as follows:
In above-mentioned formula (1), ItIndicate input gate;FtIt indicates to forget door;OtIndicate out gate;CtIndicate the cell state of t moment; Ct-1Indicate the cell state of last moment;Indicate the first stage that cell state updates;σ () indicates that sigmoid activates letter Number;Tanh () indicates tangent activation primitive;Xt,ht-1It is variable, XiIndicate the node data of given time t, ht-1Indicate hidden Layer unit;Wxo,Who,Wxi,Whi,Wxf,Whf,Wxc,WhcIt is the coefficient of variable respectively;bi, bf, bo, bcIt is constant;* convolution is indicated Operation;
The LSTM prediction model of step S3-3: training step 3-2 building.
10. the Prediction of Stock Index method of the combination LSTM model based on 2-D data stream as described in claim 1 or 9, feature It is:
Specific step is as follows by step S4:
Step S4-1: single branch stock price LSTM prediction model that step S3 is obtained is utilized respectively to single branch stock price ups and downs value It is predicted to obtain advance-decline forecasting value to be y0;Deep bid index ups and downs value is measured in advance using deep bid index LSTM prediction model It is y to advance-decline forecasting value1;Affiliated index sector ups and downs value is carried out using the affiliated index sector LSTM prediction model of the stock pre- It surveys, which has N number of industry for propagandizing concept, and it is respectively y that N number of industry, which obtains advance-decline forecasting value,2,y3,…,yN+1
Step S4-2: constructing following combination forecasting, and final advance-decline forecasting value y is calculated:
In above-mentioned formula (2),It is normalized related coefficient, specific calculation is as follows:
In above-mentioned formula (3), Cov () indicates covariance, and σ () indicates standard deviation.
CN201910298682.1A 2019-04-15 2019-04-15 A kind of data predication method of the combination LSTM model based on 2-D data stream Pending CN110135624A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910298682.1A CN110135624A (en) 2019-04-15 2019-04-15 A kind of data predication method of the combination LSTM model based on 2-D data stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910298682.1A CN110135624A (en) 2019-04-15 2019-04-15 A kind of data predication method of the combination LSTM model based on 2-D data stream

Publications (1)

Publication Number Publication Date
CN110135624A true CN110135624A (en) 2019-08-16

Family

ID=67569675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910298682.1A Pending CN110135624A (en) 2019-04-15 2019-04-15 A kind of data predication method of the combination LSTM model based on 2-D data stream

Country Status (1)

Country Link
CN (1) CN110135624A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112561187A (en) * 2020-12-22 2021-03-26 武汉理工大学 Network taxi booking target order prediction method based on CNN-LSTM

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112561187A (en) * 2020-12-22 2021-03-26 武汉理工大学 Network taxi booking target order prediction method based on CNN-LSTM
CN112561187B (en) * 2020-12-22 2022-06-03 武汉理工大学 Network taxi booking target order prediction method based on CNN-LSTM

Similar Documents

Publication Publication Date Title
CN109754113B (en) Load prediction method based on dynamic time warping and long-and-short time memory
CN113962364B (en) Multi-factor power load prediction method based on deep learning
Gao et al. Interpretable deep learning model for building energy consumption prediction based on attention mechanism
CN110751318B (en) Ultra-short-term power load prediction method based on IPSO-LSTM
CN107967542B (en) Long-short term memory network-based electricity sales amount prediction method
CN111861013B (en) Power load prediction method and device
CN107506865B (en) Load prediction method and system based on LSSVM optimization
CN114358213B (en) Error ablation processing method, system and medium for nonlinear time series data prediction
CN112163689A (en) Short-term load quantile probability prediction method based on depth Attention-LSTM
CN115130741A (en) Multi-model fusion based multi-factor power demand medium and short term prediction method
Tian et al. An adaptive ensemble predictive strategy for multiple scale electrical energy usages forecasting
Wei A method of enterprise financial risk analysis and early warning based on decision tree model
CN113449919B (en) Power consumption prediction method and system based on feature and trend perception
Fan Research on deep learning energy consumption prediction based on generating confrontation network
CN110135624A (en) A kind of data predication method of the combination LSTM model based on 2-D data stream
CN113033898A (en) Electrical load prediction method and system based on K-means clustering and BI-LSTM neural network
CN116245259B (en) Photovoltaic power generation prediction method and device based on depth feature selection and electronic equipment
Hadavandi et al. A genetic fuzzy expert system for stock price forecasting
CN115481788B (en) Phase change energy storage system load prediction method and system
Abdelaziz et al. Convolutional Neural Network With Genetic Algorithm for Predicting Energy Consumption in Public Buildings
CN113762591B (en) Short-term electric quantity prediction method and system based on GRU and multi-core SVM countermeasure learning
CN115759343A (en) E-LSTM-based user electric quantity prediction method and device
He et al. GA-based optimization of generative adversarial networks on stock price prediction
CN114372558A (en) Residential electricity load prediction method, medium and equipment based on multi-model fusion
CN113222216A (en) Method, device and system for predicting cooling, heating and power loads

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190816