WO2020000715A1 - 基于指数特征提取的股指预测方法、服务器及存储介质 - Google Patents
基于指数特征提取的股指预测方法、服务器及存储介质 Download PDFInfo
- Publication number
- WO2020000715A1 WO2020000715A1 PCT/CN2018/107484 CN2018107484W WO2020000715A1 WO 2020000715 A1 WO2020000715 A1 WO 2020000715A1 CN 2018107484 W CN2018107484 W CN 2018107484W WO 2020000715 A1 WO2020000715 A1 WO 2020000715A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- time series
- index
- hidden layer
- vector
- preset
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- the present application relates to the field of computer technology, and in particular, to a stock index prediction method based on index feature extraction, a server, and a computer-readable storage medium.
- Factors generally refer to the characteristics or factors that have an effect on the study of things. Relative to other indicators, the index often has the characteristics of time series dependence.
- the current index factor feature extraction method can be to extract the features of a specific dimension of the index at a certain moment, or to extract the trend and periodic characteristics of the index over a long period of time. Difficult to extract, and thus cannot scientifically measure the trend of the index.
- this application provides a stock index prediction method based on index feature extraction, a server, and a computer-readable storage medium. Its main purpose is to extract comprehensive information contained in multiple index features to predict the index trend scientifically and accurately.
- the present application provides a stock index prediction method based on index feature extraction, which method includes:
- Sample collection steps extract the index factors and corresponding returns at all time points in a preset number of time series, select n index factors according to preset rules to form an n-dimensional vector x i , i> 0 and i is an integer, and The n-dimensional vector x i and its corresponding rate of return at each time point constitute the sample data to be trained;
- Extraction step extract the n-dimensional vector x i at all time points of each time series in the sample data as the input of the first layer of the bidirectional long-term and short-term memory network model;
- n-dimensional vector x i is calculated at the time point of the first hidden layer state vector h i, a hidden layer and the n-dimensional vector x i in accordance with the time point and a time point after n-dimensional vector x i + 1 of
- the state vector h i + 1 calculates the second hidden layer state vector h i ′ of the n-dimensional vector x i at the time point, and averages the first hidden layer state vector h i and the second hidden layer state vector h i 'to obtain The comprehensive hidden layer state vector at this time point, until the comprehensive hidden layer state vector of all time points is calculated, and then the feature vector T i of each time series is obtained according to the comprehensive hidden layer state vector
- Calculation step In the third layer of the bidirectional long-term and short-term memory network model, according to the feature vector T i of each time series, a preset index calculation formula is used to calculate the comprehensive explanatory index S of the next time series;
- Weight determination step At the last layer of the bidirectional long-term and short-term memory network model, the comprehensive explanatory index S of each time series and all the returns corresponding to the time series are substituted into the back-propagation algorithm to obtain the weights of each time series a i ;
- Prediction step Receive the time series to be analyzed, extract n-dimensional vectors at all time points in the time series, and input them into the trained bidirectional long-term and short-term memory network model to obtain the comprehensive explanatory index S of the time series.
- the present application also provides a server, which includes a memory, a processor, and a display.
- the memory stores a stock index prediction program, and the stock index prediction program is executed by the processor, which can implement the following steps:
- Sample collection steps extract the index factors and corresponding returns at all time points in a preset number of time series, select n index factors according to preset rules to form an n-dimensional vector x i , i> 0 and i is an integer, and The n-dimensional vector x i and its corresponding rate of return at each time point constitute the sample data to be trained;
- Extraction step extract the n-dimensional vector x i at all time points of each time series in the sample data as the input of the first layer of the bidirectional long-term and short-term memory network model;
- n-dimensional vector x i is calculated at the time point of the first hidden layer state vector h i, a hidden layer and the n-dimensional vector x i in accordance with the time point and a time point after n-dimensional vector x i + 1 of
- the state vector h i + 1 calculates the second hidden layer state vector h i ′ of the n-dimensional vector x i at the time point, and averages the first hidden layer state vector h i and the second hidden layer state vector h i 'to obtain The comprehensive hidden layer state vector at this time point, until the comprehensive hidden layer state vector of all time points is calculated, and then the feature vector T i of each time series is obtained according to the comprehensive hidden layer state vector
- Calculation step In the third layer of the bidirectional long-term and short-term memory network model, according to the feature vector T i of each time series, a preset index calculation formula is used to calculate the comprehensive explanatory index S of the next time series;
- Weight determination step At the last layer of the bidirectional long-term and short-term memory network model, the comprehensive explanatory index S of each time series and all the returns corresponding to the time series are substituted into the back-propagation algorithm to obtain the weights of each time series a i ;
- Prediction step Receive the time series to be analyzed, extract n-dimensional vectors at all time points in the time series, and input them into the trained bidirectional long-term and short-term memory network model to obtain the comprehensive explanatory index S of the time series.
- the present application also provides a computer-readable storage medium, where the computer-readable storage medium includes a stock index prediction program, and when the stock index prediction program is executed by a processor, the index-based program as described above may be implemented Any step in the stock index prediction method for feature extraction.
- the stock index prediction method, server, and computer-readable storage medium based on index feature extraction proposed in this application extract the index factors and corresponding returns at all time points of each time series, and select n index factors to form an n-dimensional vector x i , then, the n-dimensional vector xi and the rate of return are substituted into the two-way long-term short-term memory network model to obtain a complete model. Finally, the n-dimensional vector of the time series to be analyzed is extracted and input into the model to obtain the time series.
- Comprehensive explanatory indicators so as to reduce gradient explosion or gradient disappearance, accurately predict the trend of stock index.
- FIG. 1 is a schematic diagram of a preferred embodiment of a server of the present application
- FIG. 2 is a schematic block diagram of a preferred embodiment of a stock index prediction program in FIG. 1;
- FIG. 3 is a flowchart of a preferred embodiment of a stock index prediction method based on index feature extraction of this application;
- FIG. 4 is a schematic diagram of a bidirectional long-short-term memory network model of the present application.
- FIG. 1 it is a schematic diagram of a preferred embodiment of the server 1 of the present application.
- the server 1 refers to a product service platform.
- the server 1 may be a server, a tablet computer, a personal computer, a portable computer, and other electronic devices with computing functions.
- the server 1 includes: a memory 11, a processor 12, and a network interface 13.
- the network interface 13 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
- the memory 11 includes at least one type of readable storage medium.
- the at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, and the like.
- the memory 11 may be an internal storage unit of the server 1, such as a hard disk of the server 1.
- the memory 11 may also be an external storage unit of the server 1, such as a plug-in hard disk, a Smart Memory Card (SMC), and a secure digital ( Secure Digital (SD) card, Flash card, etc.
- the memory 11 may not only be used to store application software and various types of data installed on the server 1, such as a stock index prediction program 10 and a trained two-way long-term and short-term memory network model.
- the processor 12 may be a central processing unit (CPU), a microprocessor or other data processing chip in some embodiments, and is configured to run program codes or process data stored in the memory 11, such as executing a stock index prediction program. 10 computer program code, training to perform bidirectional long-term and short-term memory network models, etc.
- CPU central processing unit
- microprocessor or other data processing chip in some embodiments
- program codes or process data stored in the memory 11 such as executing a stock index prediction program.
- 10 computer program code, training to perform bidirectional long-term and short-term memory network models, etc.
- FIG. 2 only shows the server 1 with components 11-13 and the stock index prediction program 10, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
- the server 1 may further include a display, and the display may be referred to as a display screen or a display unit.
- the display may be an LED display, a liquid crystal display, a touch-type liquid crystal display, an organic light-emitting diode (OLED) touch device, or the like.
- the display is used to display information processed in the server 1 and to display a visual working interface, such as displaying the current execution status of each task.
- the server 1 may further include a user interface.
- the user interface may include an input unit such as a keyboard, a voice output device such as a stereo, a headset, and the like.
- the user interface may further include a standard wired interface and a wireless interface.
- the server 1 further includes a touch sensor.
- An area provided by the touch sensor for a user to perform a touch operation is referred to as a touch area.
- the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like.
- the touch sensor includes not only a touch sensor of a contact type, but also a touch sensor of a proximity type and the like.
- the touch sensor may be a single sensor, or may be a plurality of sensors arranged in an array, for example. The user can start the stock index prediction program 10 by touching the touch area.
- the area of the display of the electronic device 1 may be the same as that of the touch sensor, or may be different.
- a display and the touch sensor are stacked to form a touch display screen. The device detects a touch operation triggered by a user based on a touch display screen.
- the server 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, and the like, and details are not described herein again.
- RF radio frequency
- FIG. 2 it is a schematic block diagram of a preferred embodiment of the stock index prediction program 10 in FIG. 1.
- the module referred to in this application refers to a series of computer program instruction segments capable of performing specific functions.
- the stock index prediction program 10 includes: a sample collection module 110, an extraction module 120, a processing module 130, a calculation module 140, a weight determination module 150, and a prediction module 160.
- a sample collection module 110 includes: a sample collection module 110, an extraction module 120, a processing module 130, a calculation module 140, a weight determination module 150, and a prediction module 160.
- the functions or operation steps implemented by the modules 110-160 are as follows:
- a sample collection module 110 is used to extract index factors and time indices of all time points in each time series of the Shanghai and Shenzhen 300 Index within two months from data platforms such as financial data and analysis tool service providers (Wind) and Bloomberg. Corresponding rate of return, and n index factors are selected to be mapped into an n-dimensional vector x i according to a preset rule, where i> 0 and i is an integer.
- the preset rule includes analyzing a user's needs, determining a user's intention according to the user's needs, and selecting a corresponding index factor according to a preset correspondence between the intention and the index factor.
- the user intention refers to a result that the user wants to be reflected in the comprehensive indicator, including that the result reflected in the comprehensive indicator is a time series index trend or a specific rate of return at a time point.
- the rate of return refers to the daily rate of return, that is, the relative rate of return with a day interval.
- time series is intercepted in a preset manner to obtain a suitable length.
- the extraction module 120 is configured to extract n-dimensional vectors x i at all time points of each time series in the sample data, and use them as input of the first layer of the bidirectional long-term and short-term memory network model. For example, extract daily n exponential factors and corresponding returns from each time series in the sample data, construct n-dimensional vectors according to the n exponential factors, and divide the n-dimensional vectors and corresponding yields into training sets and data. Validation set. The n-dimensional vector in the training set is input to the bidirectional long-term and short-term memory network for training.
- a second layer short and long term memory bidirectional network model according to the n-dimensional vector x i n-dimensional vector of a point in time before a certain time and a series of time points x i-1 hidden layer state vector h i-1 n-dimensional vector x i is calculated at the time point of the first hidden layer state vector h i, and n-dimensional vector x i according to the n-dimensional vector x i and the time point after a time point + 1 Of the hidden layer state vector h i + 1 at the time point, calculate the second hidden layer state vector h i 'of the n-dimensional vector x i at that time point, and average the first hidden layer state vector h i and the second hidden layer state vector h i ' Processing to obtain the comprehensive hidden layer state vector of the n-dimensional vector at each time point in the time series.
- the comprehensive hidden layer state vector of all time points in the time period is calculated, and the feature vector T i of each time series
- first hidden layer state vector h i and the second hidden layer state vector h i 'of the n-dimensional vector at each time point in the time series may also be stitched to obtain each time point.
- the first hidden layer state vector h i and the second hidden layer state vector h i ′ of the n-dimensional vector of each day in April are stitched to obtain a comprehensive hidden layer state vector for each day.
- the calculation module 140 is configured to calculate a state index T i of a hidden layer state vector T i of an n-dimensional vector at each time point of each time series at a third layer of the bidirectional long-term and short-term memory network model.
- T 1 , T 2 , ..., T k are respectively Represents the comprehensive hidden layer state vector of the n-dimensional vector at each time point, and a 1 , a 2 , ..., a k represent the weights of T 1 , T 2 , ..., T k , respectively.
- a weight determination module 150 is used to substitute the comprehensive explanatory index S of each time series and all the returns corresponding to the time series into the back propagation (Back Propagation, BP) at the last layer of the bidirectional long-term and short-term memory network model. Algorithm to get each weight a i . For example, according to the comprehensive explanatory index S of the Shanghai and Shenzhen 300 Index for each month and the daily return rate, the BP algorithm is used to determine each weight a i .
- the expression of the BP algorithm is:
- a ′ k represents the k-th weight after the update
- a k represents the k-th weight before the update
- ⁇ represents the learning rate
- 0.1 ⁇ ⁇ 3 Represents the partial derivative of the overall error E for a k .
- the overall error E (SS ′) ⁇ 2
- S represents the predicted value of the comprehensive explanatory index, that is, the comprehensive explanatory index calculated by the above formula for calculating the index
- S ′ represents the true value of the comprehensive explanatory index, that is, each Comprehensive explanatory indicators of daily returns.
- E a k to find the partial derivative of the learning rate is multiplied to obtain the offset value, a k value updated by subtracting the offset worth of a k a 'k. Keep cycling until the bias value When the preset value is reached, the model is the optimal model, and the final weight values are output.
- the prediction module 160 is configured to receive a time series to be analyzed, extract n-dimensional vectors at all time points in the time series, and input them into a trained bidirectional long-term and short-term memory network model to obtain a comprehensive explanatory index of the time series. For example, when you need to explain the index trend in May 2018, you can select the daily data of the previous months, extract the daily n-dimensional vector, and input it into the trained two-way long-term and short-term memory network model to get the index trend in May. .
- FIG. 3 it is a flowchart of a preferred embodiment of a stock index prediction method based on index feature extraction in this application.
- the processor 12 executes the computer program of the stock index prediction program 10 stored in the memory 11 to implement the stock index prediction method based on the index feature extraction, including: step S10 to step S60, wherein step S10 is a step of collecting sample data
- step S20-50 is a training step of a bidirectional long-term and short-term memory network model, as shown in FIG. 4, which is a schematic diagram of a bidirectional long-term and short-term memory network model of the present application
- step S60 is a step of predicting a stock index trend.
- step S10 the sample collection module 110 extracts the index factors and data of all time points of each time series of the CSI 300 index from the data platform such as financial data and analysis tool service providers (Wind), Bloomberg, etc.
- the data platform such as financial data and analysis tool service providers (Wind), Bloomberg, etc.
- Corresponding rate of return, and n index factors are selected to be mapped into an n-dimensional vector x i according to a preset rule, where i> 0 and i is an integer.
- the preset rule includes analyzing a user's needs, determining a user's intention according to the user's needs, and selecting a corresponding index factor according to a preset correspondence between the intention and the index factor.
- the user intention refers to a result that the user wants to be reflected in the comprehensive indicator, including that the result reflected in the comprehensive indicator is a time series index trend or a specific rate of return at a time point.
- n-dimensional vector x i and its corresponding rate of return at each time point are composed of sample data to be trained.
- the rate of return refers to the daily rate of return, that is, the relative return at a time interval of one day.
- the sampling method reconstructs the sequence and classifies the time series length into 25 time units.
- step S20 the extraction module 120 extracts n-dimensional vectors x i at all time points of each time series in the sample data as the input of the first layer of the bidirectional long-term and short-term memory network model. For example, extract daily n exponential factors and corresponding returns from each time series in the sample data, construct n-dimensional vectors according to the n exponential factors, and divide the n-dimensional vectors and corresponding yields into training sets and data. Validation set. The n-dimensional vector in the training set is input to the bidirectional long-term and short-term memory network for training.
- Step S30 the second layer, short and long term memory processing module bidirectional network model 130 according to n-dimensional vector x i and a point in time before a point in time of a period of time sequence n-dimensional vector x i-1 hidden layer state vector h i-1 n-dimensional vector x i is calculated at the time point of the first hidden layer state vector h i, and n-dimensional vector x i according to the n-dimensional vector x i and the time point after a time point + 1 Of the hidden layer state vector h i + 1 at the time point, calculate the second hidden layer state vector h i 'of the n-dimensional vector x i at that time point, and average the first hidden layer state vector h i and the second hidden layer state vector h i ' Processing to obtain the comprehensive hidden layer state vector of the n-dimensional vector at each time point in the time series.
- the comprehensive hidden layer state vector of all time points in the time period is calculated, and the feature vector T i of each time series is obtained according to the comprehensive hidden layer state vector of all time points in each time series.
- the n-dimensional vector x i of April 15th and the hidden layer state vector h i-1 of n-dimensional vector x i-1 on April 14 are used to calculate the 15th n-dimensional vector x i a hidden layer state vector h i, and x i-dimensional vector, and April 16, according to the n n April 15 CSI 300-dimensional vector hidden layer state vector x i-1 h i + 1 is calculated day
- the second hidden layer state vector h i 'of the n-dimensional vector x i is obtained by averaging the first hidden layer state vector h i and the second hidden layer state vector h i ' on April 15 to obtain the Comprehensive hidden layer state vector.
- the comprehensive hidden layer state vector at all time points in the time series is calculated, and the feature vector T
- first hidden layer state vector h i and the second hidden layer state vector h i 'of the n-dimensional vector at each time point in the time series may also be stitched to obtain each time point.
- the first hidden layer state vector h i and the second hidden layer state vector h i ′ of the n-dimensional vector of each day in April are stitched to obtain a comprehensive hidden layer state vector for each day.
- step S40 at the third layer of the bidirectional long-term and short-term memory network model, the calculation module 140 calculates the comprehensive explanatory index S of the next time series based on the feature vector T i of each time series using a preset index calculation formula.
- the feature vectors T 1 -T 4 from January to April are input into a preset index calculation formula to obtain a comprehensive explanatory index S in May.
- step S50 at the last layer of the bidirectional long-term and short-term memory network model, the weight determination module 150 substitutes the comprehensive explanatory index S of each time series and all the returns corresponding to the time series into the BP algorithm to obtain the respective weights a i .
- the BP algorithm is used to determine each weight a i .
- the expression of the BP algorithm is:
- a ′ k represents the k-th weight after the update
- a k represents the k-th weight before the update
- ⁇ represents the learning rate
- 0.1 ⁇ ⁇ 3 Represents the partial derivative of the overall error E for a k .
- the overall error E (SS ′) ⁇ 2
- S represents the predicted value of the comprehensive explanatory index, that is, the comprehensive explanatory index calculated by the above formula for calculating the index
- S ′ represents the true value of the comprehensive explanatory index, that is, each Comprehensive explanatory indicators of daily returns.
- E a k to find the partial derivative of the learning rate is multiplied to obtain the offset value, a k value updated by subtracting the offset worth of a k a 'k. Keep cycling until the bias value When the preset value is reached, the model is the optimal model, and the final weight values are output.
- step S60 the prediction module 160 receives the time series to be analyzed, extracts n-dimensional vectors at all time points in the time series, and inputs them into the trained bidirectional long-term and short-term memory network model to obtain a comprehensive explanatory index of the time series. For example, when you need to explain the index trend in May 2018, you can select the daily data of the previous months, extract the daily n-dimensional vector, and input it into the trained two-way long-term and short-term memory network model to get the index trend in May. .
- the stock index prediction method based on index feature extraction proposed in the above embodiment extracts index factors and corresponding returns at all time points in each time series, and selects n index factors to form an n-dimensional vector x i . After that, the method substitutes the n-dimensional vector xi and the rate of return into the two-way long-term and short-term memory network model for training to obtain a complete model. Finally, the method extracts the n-dimensional vector of the time series to be analyzed and inputs it into the model to obtain a comprehensive explanatory index of the time series, thereby avoiding the disappearance of gradients and gradient explosions, and accurately analyzing the trend of the stock index.
- an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium includes a stock index prediction program 10, and when the stock index prediction program 10 is executed by a processor, the following operations are implemented:
- Sample collection steps extract the index factors and corresponding returns at all time points in a preset number of time series, select n index factors according to preset rules to form an n-dimensional vector x i , i> 0 and i is an integer, and The n-dimensional vector x i and its corresponding rate of return at each time point constitute the sample data to be trained;
- Extraction step extract the n-dimensional vector x i at all time points of each time series in the sample data as the input of the first layer of the bidirectional long-term and short-term memory network model;
- n-dimensional vector x i is calculated at the time point of the first hidden layer state vector h i, a hidden layer and the n-dimensional vector x i in accordance with the time point and a time point after n-dimensional vector x i + 1 of
- the state vector h i + 1 calculates the second hidden layer state vector h i ′ of the n-dimensional vector x i at the time point, and averages the first hidden layer state vector h i and the second hidden layer state vector h i 'to obtain The comprehensive hidden layer state vector at this time point, until the comprehensive hidden layer state vector of all time points is calculated, and then the feature vector T i of each time series is obtained according to the comprehensive hidden layer state vector
- Calculation step In the third layer of the bidirectional long-term and short-term memory network model, according to the feature vector T i of each time series, a preset index calculation formula is used to calculate the comprehensive explanatory index S of the next time series;
- Weight determination step At the last layer of the bidirectional long-term and short-term memory network model, the comprehensive explanatory index S of each time series and all the returns corresponding to the time series are substituted into the back-propagation algorithm to obtain the weights of each time series a i ;
- Prediction step receiving the time series to be analyzed, extracting n-dimensional vectors at all time points in the time series, and inputting them into a trained bidirectional long-term and short-term memory network model to obtain a comprehensive explanatory index S 'of the time series.
- the preset rules include:
- a corresponding index factor is selected.
- the preset index calculation formula is:
- T 1 , T 2 ,..., T k respectively represent the feature vectors of each time series
- a 1 , a 2 ,..., A k respectively represent the weights of T 1 , T 2 ,..., T k .
- the formula of the back propagation algorithm is:
- a ′ k represents the k-th weight after the update
- a k represents the k-th weight before the update
- ⁇ represents the learning rate
- the method further comprises:
- the specific implementation manner of the computer-readable storage medium of the present application is substantially the same as the specific implementation manner of the stock index prediction method based on the index feature extraction described above, and details are not described herein again.
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- Finance (AREA)
- Human Resources & Organizations (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Game Theory and Decision Science (AREA)
- Technology Law (AREA)
- Entrepreneurship & Innovation (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
本申请提供了一种基于指数特征提取的股指预测方法、装置及存储介质,该方法提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量,将各个时间点的n维向量及其对应的收益率分别组成一个待训练的样本数据。之后,该方法利用样本数据中的n维向量及其对应的收益率对双向长短期记忆网络模型进行训练,确定模型参数。最后,该方法接收待分析的时间序列,提取出该时间序列所有时间点的n维向量输入到训练好的双向长短期记忆网络模型中,得到该段时间序列的综合解释性指标。利用本申请,能够深层次的提取指数的特征,提高股指预测的准确性。
Description
本申请要求于2018年06月29日提交中国专利局、申请号为201810694893.2,名称为“基于指数特征提取的股指预测方法、服务器及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合本申请中。
本申请涉及计算机技术领域,尤其涉及一种基于指数特征提取的股指预测方法、服务器及计算机可读存储介质。
因子一般是指对研究事物具有影响作用的特征或因素。指数相对于其他指标而言,往往具有时序依赖的特征。目前的指数因子特征提取方法,可以是提取指数位于某一时刻的特定维度的特征,也可以是提取长时间段上指数的趋势性与周期性特征,而对于相邻时序间的依赖关系特征较难提取,从而不能够科学地衡量指数走势。
发明内容
鉴于以上内容,本申请提供一种基于指数特征提取的股指预测方法、服务器及计算机可读存储介质,其主要目的在于提取多重指数特征所包含的综合信息,科学、准确地预测指数走势。
为实现上述目的,本申请提供一种基于指数特征提取的股指预测方法,该方法包括:
样本采集步骤:提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量x
i,i>0且i为整数,将各个时间点的n维向量x
i及其对应的收益率组成待训练的样本数据;
提取步骤:提取样本数据中每段时间序列的所有时间点的n维向量x
i,作为双向长短期记忆网络模型第一层的输入;
处理步骤:在双向长短期记忆网络模型的第二层,根据某段时间序列的 某个时间点的n维向量x
i及前一个时间点的n维向量x
i-1的隐藏层状态向量h
i-1计算该时间点的n维向量x
i的第一隐藏层状态向量h
i,并根据该时间点的n维向量x
i及后一个时间点的n维向量x
i+1的隐藏层状态向量h
i+1计算该时间点n维向量x
i的第二隐藏层状态向量h
i’,将第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行平均处理,得到该时间点的综合隐藏层状态向量,直至算出所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T
i;
计算步骤:在双向长短期记忆网络模型的第三层,根据每段时间序列的特征向量T
i,利用预设的指标计算公式计算下一段时间序列的综合解释性指标S;
权重确定步骤:在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播算法,得到各段时间序列的权重a
i;
预测步骤:接收待分析的时间序列,提取该段时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标S。
此外,本申请还提供一种服务器,该服务器包括:存储器、处理器及显示器,所述存储器上存储股指预测程序,所述股指预测程序被所述处理器执行,可实现如下步骤:
样本采集步骤:提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量x
i,i>0且i为整数,将各个时间点的n维向量x
i及其对应的收益率组成待训练的样本数据;
提取步骤:提取样本数据中每段时间序列的所有时间点的n维向量x
i,作为双向长短期记忆网络模型第一层的输入;
处理步骤:在双向长短期记忆网络模型的第二层,根据某段时间序列的某个时间点的n维向量x
i及前一个时间点的n维向量x
i-1的隐藏层状态向量h
i-1计算该时间点的n维向量x
i的第一隐藏层状态向量h
i,并根据该时间点的n维向量x
i及后一个时间点的n维向量x
i+1的隐藏层状态向量h
i+1计算该时间点n维向量x
i的第二隐藏层状态向量h
i’,将第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行平均处理,得到该时间点的综合隐藏层状态向量,直至算出所有时间点 的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T
i;
计算步骤:在双向长短期记忆网络模型的第三层,根据每段时间序列的特征向量T
i,利用预设的指标计算公式计算下一段时间序列的综合解释性指标S;
权重确定步骤:在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播算法,得到各段时间序列的权重a
i;
预测步骤:接收待分析的时间序列,提取该段时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标S。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括股指预测程序,所述股指预测程序被处理器执行时,可实现如上所述基于指数特征提取的股指预测方法中的任意步骤。
本申请提出的基于指数特征提取的股指预测方法、服务器及计算机可读存储介质,通过提取每段时间序列所有时间点的指数因子及对应的收益率,并选取n个指数因子构成n维向量x
i,接着,将n维向量xi及收益率代入双向长短期记忆网络模型中训练,得到完整的模型,最后,提取待分析的时间序列的n维向量,输入到模型中,得到该时间序列的综合解释性指标,从而减少梯度爆炸或梯度消失,准确的预测股指的走势。
图1为本申请服务器较佳实施例的示意图;
图2为图1中股指预测程序较佳实施例的模块示意图;
图3为本申请基于指数特征提取的股指预测方法较佳实施例的流程图;
图4为本申请双向长短期记忆网络模型的示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
如图1所示,是本申请服务器1较佳实施例的示意图。
在本实施例中,服务器1是指产品服务平台,该服务器1可以是服务器、平板电脑、个人电脑、便携计算机以及其它具有运算功能的电子设备。
该服务器1包括:存储器11、处理器12及网络接口13。其中,网络接口13可选地可以包括标准的有线接口、无线接口(如WI-FI接口)。
存储器11至少包括一种类型的可读存储介质。所述至少一种类型的可读存储介质可为如闪存、硬盘、多媒体卡、卡型存储器等的非易失性存储介质。在一些实施例中,所述存储器11可以是所述服务器1的内部存储单元,例如该服务器1的硬盘。在另一些实施例中,所述存储器11也可以是所述服务器1的外部存储单元,例如所述服务器1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。在本实施例中,所述存储器11不仅可以用于存储安装于所述服务器1的应用软件及各类数据,例如股指预测程序10及训练好的双向长短期记忆网络模型等。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其它数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行股指预测程序10的计算机程序代码、执行双向长短期记忆网络模型的训练等。
图2仅示出了具有组件11-13以及股指预测程序10的服务器1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该服务器1还可以包括显示器,显示器可以称为显示屏或显示单元。在一些实施例中显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。显示器用于显示在服务器1中处理的信息以及用于显示可视化的工作界面,例如显示各个任务当前的执行状态。
可选地,该服务器1还可以包括用户接口,用户接口可以包括输入单元 比如键盘(Keyboard)、语音输出装置比如音响、耳机等,可选地用户接口还可以包括标准的有线接口、无线接口。
可选地,该服务器1还包括触摸传感器。所述触摸传感器所提供的供用户进行触摸操作的区域称为触控区域。此外,这里所述的触摸传感器可以为电阻式触摸传感器、电容式触摸传感器等。而且,所述触摸传感器不仅包括接触式的触摸传感器,也可包括接近式的触摸传感器等。此外,所述触摸传感器可以为单个传感器,也可以为例如阵列布置的多个传感器。用户可以通过触摸所述触控区域启动股指预测程序10。
此外,该电子装置1的显示器的面积可以与所述触摸传感器的面积相同,也可以不同。可选地,将显示器与所述触摸传感器层叠设置,以形成触摸显示屏。该装置基于触摸显示屏侦测用户触发的触控操作。
该服务器1还可以包括射频(Radio Frequency,RF)电路、传感器和音频电路等等,在此不再赘述。
如图2所示,是图1中股指预测程序10较佳实施例的模块示意图。本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。
在本实施例中,股指预测程序10包括:样本采集模块110、提取模块120、处理模块130、计算模块140、权重确定模块150及预测模块160,结合图3中程序模块的应用环境示意图,所述模块110-160所实现的功能或操作步骤如下:
样本采集模块110,用于从数据平台,如金融数据和分析工具服务商(Wind)、彭博(Bloomberg)等,提取沪深300指数2个月内每段时间序列所有时间点的指数因子及对应的收益率,并根据预设规则选取n个指数因子映射成一个n维向量x
i,i>0且i为整数。其中,解释沪深300指数的常见指数因子有以下13种,包括:中债国债到期收益率:10年-中债企业债到期收益率(AAA):10年、风险溢价、股息率、慢速KD指标(SlowKD)、平滑异同移动平均线直方图(Moving Average Convergence and Divergence Histogram,MACD Histogram)、布林线指标(Bollinger Bands)、移动平均线-相对强弱指标(MA of RSI(14)[m=22])、4-period MA of 4week MA of modified OBV-(MA4*4)、CR指标、大小盘换手率比值、RSRS指标、溢价率、主动买入额。所述预设规 则包括:分析用户的需求,根据用户需求确定用户意图,并根据预设的意图与指数因子的对应关系,选取对应的指数因子。所述用户意图是指用户希望综合指标所反映的结果,包括希望综合指标所反映的结果是时间序列的指数走势或时间点的具体的收益率。所述收益率是指日收益率,即以一天为时间间隔的相对收益。所述日收益率的计算公式为:第n日的收益率=(第n+1日收盘价-第n日收盘价)/第n日收盘价。
进一步地,在指数因子特征提取前,还需要先判断每段时间序列的长度是否超过预设值,若时间序列的长度超过预设值,则以预设方式对时间序列进行截取,得到长度合适的时间序列。所述预设方式可以是指以步长为t(t=2,3,……)进行截取数据。假设,预设值为30,对于长度超过30个时间单位的时间序列,可能会造成梯度爆炸或梯度消失,待分析的时间序列为50个时间单位,采用步长为2的采样方法对序列进行重构,将时间序列长度归为25个时间单位。
提取模块120,用于提取样本数据中每段时间序列所有时间点的n维向量x
i,作为双向长短期记忆网络模型第一层的输入。例如,提取样本数据中每段时间序列的每日的n个指数因子及对应的收益率,根据n个指数因子构成n维向量,将n维向量和对应的收益率进行数据划分为训练集及验证集,将训练集中是n维向量输入到双向长短期记忆网络进行训练。
处理模块130,用于在双向长短期记忆网络模型的第二层,根据某段时间序列的某个时间点的n维向量x
i及前一个时间点的n维向量x
i-1的隐藏层状态向量h
i-1计算该时间点的n维向量x
i的第一隐藏层状态向量h
i,并根据该时间点的n维向量x
i及后一个时间点的n维向量x
i+1的隐藏层状态向量h
i+1计算该时间点n维向量x
i的第二隐藏层状态向量h
i’,将第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行平均处理,得到该段时间序列中每个时间点n维向量的综合隐藏层状态向量。以此类推,算出时间段上所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T
i。
在另一个实施例中,还可以将该段时间序列中每个时间点n维向量的第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行拼接处理,得到每个时间点n维向量的综合隐藏层状态向量T
i。例如,将4月份每一日的n维向量的 第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行拼接处理,得到每一日的综合隐藏层状态向量。
计算模块140,用于在双向长短期记忆网络模型的第三层,根据每段时间序列的每个时间点的n维向量的综合隐藏层状态向量T
i,利用预设的指标计算公式计算每段时间序列的综合解释性指标S。其中,所述预设的指标计算公式为:S=a
1T
1+a
2T
2+a
3T
3+…+a
kT
k,其中,T
1、T
2、……、T
k分别代表每个时间点n维向量的综合隐藏层状态向量,a
1、a
2、……、a
k分别代表T
1、T
2、……、T
k的权重。
权重确定模块150,用于在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播(Back Propagation,BP)算法,得到各个权重a
i。例如,根据沪深300指数各个月份的综合解释性指标S及每日的收益率,利用BP算法确定各个权重a
i。其中,所述BP算法的表达式为:
其中,所述a′
k代表更新后的第k个权重,a
k代表更新前的第k个权重,η代表学习速率,0.1<η<3,
代表整体误差E对a
k的偏导值。具体地,整体误差E=(S-S′)^2,S代表综合解释性指标预测值,即上述指标计算公式计算得到的综合解释性指标,S′代表综合解释性指标的真实值,即由每日的收益率得到的综合解释性指标。进一步地,当输出的综合解释性指标为2维,即综合解释性指标为S
1和S
2时,E=0.5(S
1-S′
1)^2+0.5(S
2-S′
2)^2。对E求a
k的偏导乘以学习速率,得到偏置值,a
k减去偏置值得到a
k的更新值a′
k。持续循环训练,直到偏置值
达到预设值,模型为最优模型,输出最终的各个权重值。
预测模块160,用于接收待分析的时间序列,提取出时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标。例如,需要解释2018年5月指数走势时,可以选取前几个月的逐日数据,提取每日的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该5月的指数走势。
如图3所示,是本申请基于指数特征提取的股指预测方法较佳实施例的流程图。
下面以沪深300指数为例,但不仅限于沪深300指数,对本申请加以阐述。在本实施例中,处理器12执行存储器11中存储的股指预测程序10的计算机程序时实现基于指数特征提取的股指预测方法包括:步骤S10-步骤S60,其中,步骤S10为样本数据的采集步骤,步骤S20-50为双向长短期记忆网络模型的训练步骤,如图4所示,是本申请双向长短期记忆网络模型的示意图,步骤S60为股指趋势的预测步骤。
步骤S10,样本采集模块110从数据平台,如金融数据和分析工具服务商(Wind)、彭博(Bloomberg)等,提取沪深300指数2个月内每段时间序列所有时间点的指数因子及对应的收益率,并根据预设规则选取n个指数因子映射成一个n维向量x
i,i>0且i为整数。其中,解释沪深300指数的常见指数因子有以下13种,包括:中债国债到期收益率:10年-中债企业债到期收益率(AAA):10年、风险溢价、股息率、慢速KD指标(SlowKD)、平滑异同移动平均线直方图(Moving Average Convergence and Divergence Histogram,MACD Histogram)、布林线指标(Bollinger Bands)、移动平均线-相对强弱指标(MA of RSI(14)[m=22])、4-period MA of 4week MA of modified OBV-(MA4*4)、CR指标、大小盘换手率比值、RSRS指标、溢价率、主动买入额。所述预设规则包括:分析用户的需求,根据用户需求确定用户意图,并根据预设的意图与指数因子的对应关系,选取对应的指数因子。所述用户意图是指用户希望综合指标所反映的结果,包括希望综合指标所反映的结果是时间序列的指数走势或时间点的具体的收益率。例如,当用户希望从宏观基本角度对沪深300走势进行刻画时,可以选取专注于宏观基本角度的5个指数因子,包括:中债国债到期收益率:10年-中债企业债到期收益率(AAA):10年、风险溢价、股息率、溢价率及主动买入额,构成一个5维的向量。将各个时间点的n维向量x
i及其对应的收益率组成待训练的样本数据。所述收益率是指日收益率,即以一天为时间间隔的相对收益。所述日收益率的计算公式为:第n日的收益率=(第n+1日收盘价-第n日收盘价)/第n日收盘价。
进一步地,在指数因子特征提取前,还需要先判断每段时间序列的长度是否超过预设值,若时间序列的长度超过预设值,则以预设方式对时间序列进行截取,得到长度合适的时间序列。所述预设方式可以是指以步长为t(t=2,3,……)进行截取数据。假设,预设值为30,对于长度超过30个时间 单位,如30天,的时间序列,可能会造成梯度爆炸或梯度消失,待分析的时间序列为50个时间单位,采用步长为2的采样方法对序列进行重构,将时间序列长度归为25个时间单位。
步骤S20,提取模块120提取样本数据中每段时间序列所有时间点的n维向量x
i,作为双向长短期记忆网络模型第一层的输入。例如,提取样本数据中每段时间序列的每日的n个指数因子及对应的收益率,根据n个指数因子构成n维向量,将n维向量和对应的收益率进行数据划分为训练集及验证集,将训练集中是n维向量输入到双向长短期记忆网络进行训练。
步骤S30,在双向长短期记忆网络模型的第二层,处理模块130根据某段时间序列的某个时间点的n维向量x
i及前一个时间点的n维向量x
i-1的隐藏层状态向量h
i-1计算该时间点的n维向量x
i的第一隐藏层状态向量h
i,并根据该时间点的n维向量x
i及后一个时间点的n维向量x
i+1的隐藏层状态向量h
i+1计算该时间点n维向量x
i的第二隐藏层状态向量h
i’,将第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行平均处理,得到该段时间序列中每个时间点n维向量的综合隐藏层状态向量。以此类推,算出时间段上所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T
i。例如,根据沪深300指数4月15日的n维向量x
i和4月14日的n维向量x
i-1的隐藏层状态向量h
i-1计算15日的n维向量x
i的第一隐藏层状态向量h
i,并根据沪深300指数4月15日的n维向量x
i和4月16日的n维向量x
i-1的隐藏层状态向量h
i+1计算该日的n维向量x
i的第二隐藏层状态向量h
i’,将4月15日的第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行平均处理,得到4月15日的综合隐藏层状态向量。以此类推,算出时序中所有时间点的综合隐藏层状态向量,得到4月份的特征向量T
i。
在另一个实施例中,还可以将该段时间序列中每个时间点n维向量的第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行拼接处理,得到每个时间点n维向量的综合隐藏层状态向量T
i。例如,将4月份每一日的n维向量的第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行拼接处理,得到每一日的综合隐藏层状态向量。
步骤S40,在双向长短期记忆网络模型的第三层,计算模块140根据每段时间序列的特征向量T
i,利用预设的指标计算公式计算下一段时间序列的综合 解释性指标S。其中,所述预设的指标计算公式为:S=a
1T
1+a
2T
2+a
3T
3+…+a
kT
k,其中,T
1、T
2、……、T
k分别代表每个时间点n维向量的综合隐藏层状态向量,a
1、a
2、……、a
k分别代表T
1、T
2、……、T
k的权重。例如,将1-4月份的特征向量T
1-T
4输入预设的指标计算公式,得到5月份的综合解释性指标S。
步骤S50,在双向长短期记忆网络模型的最后一层,权重确定模块150将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入BP算法,得到各个权重a
i。例如,根据沪深300指数各个月份的综合解释性指标S及每日的收益率,利用BP算法确定各个权重a
i。其中,所述BP算法的表达式为:
其中,所述a′
k代表更新后的第k个权重,a
k代表更新前的第k个权重,η代表学习速率,0.1<η<3,
代表整体误差E对a
k的偏导值。具体地,整体误差E=(S-S′)^2,S代表综合解释性指标预测值,即上述指标计算公式计算得到的综合解释性指标,S′代表综合解释性指标的真实值,即由每日的收益率得到的综合解释性指标。进一步地,当输出的综合解释性指标为2维,即综合解释性指标为S
1和S
2时,E=0.5(S
1-S′
1)^2+0.5(S
2-S′
2)^2。对E求a
k的偏导乘以学习速率,得到偏置值,a
k减去偏置值得到a
k的更新值a′
k。持续循环训练,直到偏置值
达到预设值,模型为最优模型,输出最终的各个权重值。
步骤S60,预测模块160接收待分析的时间序列,提取出时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标。例如,需要解释2018年5月指数走势时,可以选取前几个月的逐日数据,提取每日的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该5月的指数走势。
上述实施例提出的基于指数特征提取的股指预测方法,通过提取每段时间序列所有时间点的指数因子及对应的收益率,并选取n个指数因子构成n维向量x
i。之后,该方法将n维向量xi及收益率代入双向长短期记忆网络模型中训练,得到完整的模型。最后,该方法提取待分析的时间序列的n维向量,输入到模型中,得到该时间序列的综合解释性指标,从而避免梯度消失和梯度爆炸,准确的分析股指的走势。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质中包括股指预测程序10,所述股指预测程序10被处理器执行时实现如下操作:
样本采集步骤:提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量x
i,i>0且i为整数,将各个时间点的n维向量x
i及其对应的收益率组成待训练的样本数据;
提取步骤:提取样本数据中每段时间序列的所有时间点的n维向量x
i,作为双向长短期记忆网络模型第一层的输入;
处理步骤:在双向长短期记忆网络模型的第二层,根据某段时间序列的某个时间点的n维向量x
i及前一个时间点的n维向量x
i-1的隐藏层状态向量h
i-1计算该时间点的n维向量x
i的第一隐藏层状态向量h
i,并根据该时间点的n维向量x
i及后一个时间点的n维向量x
i+1的隐藏层状态向量h
i+1计算该时间点n维向量x
i的第二隐藏层状态向量h
i’,将第一隐藏层状态向量h
i和第二隐藏层状态向量h
i’进行平均处理,得到该时间点的综合隐藏层状态向量,直至算出所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T
i;
计算步骤:在双向长短期记忆网络模型的第三层,根据每段时间序列的特征向量T
i,利用预设的指标计算公式计算下一段时间序列的综合解释性指标S;
权重确定步骤:在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播算法,得到各段时间序列的权重a
i;
预测步骤:接收待分析的时间序列,提取该段时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标S’。
优选地,所述预设规则包括:
分析用户的需求,根据用户需求确定用户意图;及
根据预设的意图与指数因子的对应关系,选取对应的指数因子。
优选地,所述预设的指标计算公式为:
S=a
1T
1+a
2T
2+a
3T
3+…+a
kT
k
其中,T
1、T
2、……、T
k分别代表每段时间序列的特征向量,a
1、a
2、……、a
k分别代表T
1、T
2、……、T
k的权重。
优选地,所述反向传播算法的公式为:
优选地,该方法还包括:
判断预设数量的时间序列的长度是否超过预设值,若时间序列的长度超过预设值,则以预设方式对时间序列进行截取,得到长度合适的时间序列。
本申请之计算机可读存储介质的具体实施方式与上述基于指数特征提取的股指预测方法的具体实施方式大致相同,在此不再赘述。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种基于指数特征提取的股指预测方法,应用于服务器,其特征在于,所述方法包括:样本采集步骤:提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量x i,i>0且i为整数,将各个时间点的n维向量x i及其对应的收益率组成待训练的样本数据;提取步骤:提取样本数据中每段时间序列的所有时间点的n维向量x i,作为双向长短期记忆网络模型第一层的输入;处理步骤:在双向长短期记忆网络模型的第二层,根据某段时间序列的某个时间点的n维向量x i及前一个时间点的n维向量x i-1的隐藏层状态向量h i-1计算该时间点的n维向量x i的第一隐藏层状态向量h i,并根据该时间点的n维向量x i及后一个时间点的n维向量x i+1的隐藏层状态向量h i+1计算该时间点n维向量x i的第二隐藏层状态向量h i’,将第一隐藏层状态向量h i和第二隐藏层状态向量h i’进行平均处理,得到该时间点的综合隐藏层状态向量,直至算出所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T i;计算步骤:在双向长短期记忆网络模型的第三层,根据每段时间序列的特征向量T i,利用预设的指标计算公式计算下一段时间序列的综合解释性指标S;权重确定步骤:在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播算法,得到各段时间序列的权重a i;预测步骤:接收待分析的时间序列,提取该段时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标S。
- 根据权利要求1所述的基于指数特征提取的股指预测方法,其特征在于,所述预设规则包括:分析用户的需求,根据用户需求确定用户意图;及根据预设的意图与指数因子的对应关系,选取对应的指数因子。
- 根据权利要求1所述的基于指数特征提取的股指预测方法,其特征在 于,所述预设的指标计算公式为:S=a 1T 1+a 2T 2+a 3T 3+…+a kT k其中,T 1、T 2、……、T k分别代表每段时间序列的特征向量,a 1、a 2、……、a k分别代表T 1、T 2、……、T k的权重。
- 根据权利要求1所述的基于指数特征提取的股指预测方法,其特征在于,该方法还包括:判断预设数量的时间序列的长度是否超过预设值,若时间序列的长度超过预设值,则以预设方式对时间序列进行截取,得到长度合适的时间序列。
- 根据权利要求5所述的基于指数特征提取的股指预测方法,其特征在于,所述预设方式可以是指以步长为t,t为整数且t>1,进行截取数据。
- 根据权利要求1所述的基于指数特征提取的股指预测方法,其特征在于,所述收益率可以是指日收益率,所述日收益率的计算公式为:第n日的收益率=(第n+1日收盘价-第n日收盘价)/第n日收盘价其中,n为整数且n>0。
- 一种服务器,其特征在于,所述服务器包括:存储器、处理器及显示器,所述存储器上存储有股指预测程序,所述股指预测程序被所述处理器执行,可实现如下步骤:样本采集步骤:提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量x i,i>0且i为整数,将各个时间点的n维向量x i及其对应的收益率组成待训练的样本数据;提取步骤:提取样本数据中每段时间序列的所有时间点的n维向量x i,作为双向长短期记忆网络模型第一层的输入;处理步骤:在双向长短期记忆网络模型的第二层,根据某段时间序列的某个时间点的n维向量x i及前一个时间点的n维向量x i-1的隐藏层状态向量h i-1计算该时间点的n维向量x i的第一隐藏层状态向量h i,并根据该时间点的n维向量 x i及后一个时间点的n维向量x i+1的隐藏层状态向量h i+1计算该时间点n维向量x i的第二隐藏层状态向量h i’,将第一隐藏层状态向量h i和第二隐藏层状态向量h i’进行平均处理,得到该时间点的综合隐藏层状态向量,直至算出所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T i;计算步骤:在双向长短期记忆网络模型的第三层,根据每段时间序列的特征向量T i,利用预设的指标计算公式计算下一段时间序列的综合解释性指标S;权重确定步骤:在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播算法,得到各段时间序列的权重a i;预测步骤:接收待分析的时间序列,提取该段时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综合解释性指标S。
- 根据权利要求8所述的服务器,其特征在于,所述预设规则包括:分析用户的需求,根据用户需求确定用户意图;及根据预设的意图与指数因子的对应关系,选取对应的指数因子。
- 根据权利要求8所述的服务器,其特征在于,所述预设的指标计算公式为:S=a 1T 1+a 2T 2+a 3T 3+…+a kT k其中,T 1、T 2、……、T k分别代表每段时间序列的特征向量,a 1、a 2、……、a k分别代表T 1、T 2、……、T k的权重。
- 根据权利要求8所述的服务器,其特征在于,所述股指预测程序被所述处理器执行时,还包括步骤:判断预设数量的时间序列的长度是否超过预设值,若时间序列的长度超 过预设值,则以预设方式对时间序列进行截取,得到长度合适的时间序列。
- 根据权利要求12所述的服务器,其特征在于,所述预设方式可以是指以步长为t,t为整数且t>1,进行截取数据。
- 根据权利要求8所述的服务器,其特征在于,所述收益率可以是指日收益率,所述日收益率的计算公式为:第n日的收益率=(第n+1日收盘价-第n日收盘价)/第n日收盘价其中,n为整数且n>0。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中包括股指预测程序,所述股指预测程序被处理器执行时,可实现如下步骤:样本采集步骤:提取预设数量的时间序列中所有时间点的指数因子及对应的收益率,根据预设规则选取n个指数因子构成一个n维向量x i,i>0且i为整数,将各个时间点的n维向量x i及其对应的收益率组成待训练的样本数据;提取步骤:提取样本数据中每段时间序列的所有时间点的n维向量x i,作为双向长短期记忆网络模型第一层的输入;处理步骤:在双向长短期记忆网络模型的第二层,根据某段时间序列的某个时间点的n维向量x i及前一个时间点的n维向量x i-1的隐藏层状态向量h i-1计算该时间点的n维向量x i的第一隐藏层状态向量h i,并根据该时间点的n维向量x i及后一个时间点的n维向量x i+1的隐藏层状态向量h i+1计算该时间点n维向量x i的第二隐藏层状态向量h i’,将第一隐藏层状态向量h i和第二隐藏层状态向量h i’进行平均处理,得到该时间点的综合隐藏层状态向量,直至算出所有时间点的综合隐藏层状态向量,再根据每段时间序列的所有时间点的综合隐藏层状态向量得到每段时间序列的特征向量T i;计算步骤:在双向长短期记忆网络模型的第三层,根据每段时间序列的特征向量T i,利用预设的指标计算公式计算下一段时间序列的综合解释性指标S;权重确定步骤:在双向长短期记忆网络模型的最后一层,将每段时间序列的综合解释性指标S及该段时间序列对应的所有收益率代入反向传播算法,得到各段时间序列的权重a i;预测步骤:接收待分析的时间序列,提取该段时间序列中所有时间点的n维向量,输入到训练好的双向长短期记忆网络模型中,得到该时间序列的综 合解释性指标S。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述预设规则包括:分析用户的需求,根据用户需求确定用户意图;及根据预设的意图与指数因子的对应关系,选取对应的指数因子。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述预设的指标计算公式为:S=a 1T 1+a 2T 2+a 3T 3+…+a kT k其中,T 1、T 2、……、T k分别代表每段时间序列的特征向量,a 1、a 2、……、a k分别代表T 1、T 2、……、T k的权重。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述股指预测程序被所述处理器执行时,还包括步骤:判断预设数量的时间序列的长度是否超过预设值,若时间序列的长度超过预设值,则以预设方式对时间序列进行截取,得到长度合适的时间序列。
- 根据权利要求19所述的计算机可读存储介质,其特征在于,所述预设方式可以是指以步长为t,t为整数且t>1,进行截取数据。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810694893.2A CN108985501B (zh) | 2018-06-29 | 2018-06-29 | 基于指数特征提取的股指预测方法、服务器及存储介质 |
| CN201810694893.2 | 2018-06-29 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020000715A1 true WO2020000715A1 (zh) | 2020-01-02 |
Family
ID=64538978
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/107484 Ceased WO2020000715A1 (zh) | 2018-06-29 | 2018-09-26 | 基于指数特征提取的股指预测方法、服务器及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108985501B (zh) |
| WO (1) | WO2020000715A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112749845A (zh) * | 2021-01-13 | 2021-05-04 | 中国工商银行股份有限公司 | 模型训练方法、资源数据预测方法、装置和计算设备 |
| CN112817832A (zh) * | 2021-01-19 | 2021-05-18 | 网易(杭州)网络有限公司 | 游戏服务器的健康状态获取方法、装置、设备及存储介质 |
| CN115081702A (zh) * | 2022-06-14 | 2022-09-20 | 国网信息通信产业集团有限公司 | 一种具有可解释特性的电力负荷预测方法、系统及终端机 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112598526A (zh) * | 2021-03-04 | 2021-04-02 | 蚂蚁智信(杭州)信息技术有限公司 | 资产数据的处理方法及装置 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105787582A (zh) * | 2015-12-24 | 2016-07-20 | 清华大学 | 股票风险预测方法和装置 |
| US20170032243A1 (en) * | 2015-07-27 | 2017-02-02 | Google Inc. | Analyzing health events using recurrent neural networks |
| CN106952161A (zh) * | 2017-03-31 | 2017-07-14 | 洪志令 | 一种基于长短期记忆深度学习网络的股票近期走势预测方法 |
| CN107832897A (zh) * | 2017-11-30 | 2018-03-23 | 浙江工业大学 | 一种基于深度学习的股票市场预测方法 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10325205B2 (en) * | 2014-06-09 | 2019-06-18 | Cognitive Scale, Inc. | Cognitive information processing system environment |
| US9639807B2 (en) * | 2014-06-10 | 2017-05-02 | Jose Oriol Lopez Berengueres | Method and system for forecasting future events |
| CN107798604A (zh) * | 2017-09-28 | 2018-03-13 | 平安科技(深圳)有限公司 | 基于机器学习的择时入股方法及终端设备 |
| CN107943847B (zh) * | 2017-11-02 | 2019-05-17 | 平安科技(深圳)有限公司 | 企业关系提取方法、装置及存储介质 |
-
2018
- 2018-06-29 CN CN201810694893.2A patent/CN108985501B/zh active Active
- 2018-09-26 WO PCT/CN2018/107484 patent/WO2020000715A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170032243A1 (en) * | 2015-07-27 | 2017-02-02 | Google Inc. | Analyzing health events using recurrent neural networks |
| CN105787582A (zh) * | 2015-12-24 | 2016-07-20 | 清华大学 | 股票风险预测方法和装置 |
| CN106952161A (zh) * | 2017-03-31 | 2017-07-14 | 洪志令 | 一种基于长短期记忆深度学习网络的股票近期走势预测方法 |
| CN107832897A (zh) * | 2017-11-30 | 2018-03-23 | 浙江工业大学 | 一种基于深度学习的股票市场预测方法 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112749845A (zh) * | 2021-01-13 | 2021-05-04 | 中国工商银行股份有限公司 | 模型训练方法、资源数据预测方法、装置和计算设备 |
| CN112817832A (zh) * | 2021-01-19 | 2021-05-18 | 网易(杭州)网络有限公司 | 游戏服务器的健康状态获取方法、装置、设备及存储介质 |
| CN115081702A (zh) * | 2022-06-14 | 2022-09-20 | 国网信息通信产业集团有限公司 | 一种具有可解释特性的电力负荷预测方法、系统及终端机 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108985501B (zh) | 2022-04-29 |
| CN108985501A (zh) | 2018-12-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111782943B (zh) | 基于历史数据记录的信息推荐方法、装置、设备及介质 | |
| US10958748B2 (en) | Resource push method and apparatus | |
| WO2020140633A1 (zh) | 文本主题提取方法、装置、电子设备及存储介质 | |
| CN108833458B (zh) | 一种应用推荐方法、装置、介质及设备 | |
| US20110282861A1 (en) | Extracting higher-order knowledge from structured data | |
| US9344507B2 (en) | Method of processing web access information and server implementing same | |
| WO2018120424A1 (zh) | 基于位置服务的人群分类方法、装置、设备和存储介质 | |
| WO2019120019A1 (zh) | 用户性别预测方法、装置、存储介质及电子设备 | |
| CN110297973B (zh) | 一种基于深度学习的数据推荐方法、装置及终端设备 | |
| WO2020000715A1 (zh) | 基于指数特征提取的股指预测方法、服务器及存储介质 | |
| CN113095408A (zh) | 风险的确定方法、装置和服务器 | |
| WO2018120425A1 (zh) | 个人财产状态评估方法、装置、设备和存储介质 | |
| CN106503224B (zh) | 一种根据关键词推荐应用的方法及装置 | |
| CN113538070B (zh) | 用户生命价值周期检测方法、装置和计算机设备 | |
| WO2017206376A1 (zh) | 搜索方法、装置及非易失性计算机存储介质 | |
| US20200356562A1 (en) | Cross-asset data modeling in multi-asset databases | |
| WO2018171288A1 (zh) | 给信息流标注标签的方法、装置、终端设备及存储介质 | |
| CN114741489A (zh) | 文档检索方法、装置、存储介质以及电子设备 | |
| CN113065025A (zh) | 视频查重方法、装置、设备及存储介质 | |
| CN110889038A (zh) | 人脉数据的生成方法、装置、计算机设备及存储介质 | |
| WO2025180348A1 (zh) | 大型语言模型的训练数据集筛选 | |
| KR20220150081A (ko) | 장소 추천 방법 및 장치 | |
| CN116340864B (zh) | 一种模型漂移检测方法、装置、设备及其存储介质 | |
| WO2021047376A1 (zh) | 数据处理方法、数据处理装置及相关设备 | |
| CN119166763A (zh) | 基于人工智能的查询处理方法、装置、计算机设备及介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18923900 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18923900 Country of ref document: EP Kind code of ref document: A1 |





