CN114511140A - Prediction method and device for quantized transaction factors - Google Patents

Prediction method and device for quantized transaction factors Download PDF

Info

Publication number
CN114511140A
CN114511140A CN202210074883.5A CN202210074883A CN114511140A CN 114511140 A CN114511140 A CN 114511140A CN 202210074883 A CN202210074883 A CN 202210074883A CN 114511140 A CN114511140 A CN 114511140A
Authority
CN
China
Prior art keywords
data
target
model
groups
training
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
CN202210074883.5A
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.)
Everbright Technology Co ltd
Original Assignee
Everbright Technology Co ltd
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 Everbright Technology Co ltd filed Critical Everbright Technology Co ltd
Priority to CN202210074883.5A priority Critical patent/CN114511140A/en
Publication of CN114511140A publication Critical patent/CN114511140A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • 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"

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Technology Law (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Game Theory and Decision Science (AREA)
  • Evolutionary Biology (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Biomedical Technology (AREA)
  • Tourism & Hospitality (AREA)
  • Bioinformatics & Cheminformatics (AREA)

Abstract

The invention provides a prediction method and a prediction device for a quantized transaction factor, wherein the method comprises the following steps: inputting the acquired data to be tested into a pre-trained target generation countermeasure network GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model; selecting three groups of data to be tested with low correlation from the multiple groups of simulated data to be tested; inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target TCN model, so that the problems that the prediction of the quantitative transaction factor in the related technology does not support parallel operation and the prediction result is not accurate enough can be solved, and the simulation data is generated by using a GAN network, so that the sample size is increased, the diversity of samples is improved, and the prediction is more reasonable; by applying the TCN model, multivariable parallel prediction with multiple time steps can be realized, and the prediction accuracy is improved.

Description

Prediction method and device for quantized transaction factors
Technical Field
The invention relates to the field of data processing, in particular to a prediction method and a prediction device for a quantized transaction factor.
Background
The monte carlo method is used to model the probability of different outcomes in a process that cannot be easily predicted due to intervention of random variables, helping to explain the impact of risk and uncertainty in the prediction and prediction models. The basis of the monte carlo simulation involves assigning multiple values to uncertain variables to obtain multiple results, and then averaging the results to obtain estimated values. Usually, a large number of calculation steps and a large sample are needed for prediction estimation to achieve improvement in accuracy, and the requirement on calculation cost is high. It is necessary that the preconditions assume that the probability distribution, i.e. the random numbers, satisfies a certain rule. Such a priori assumptions are less realistic in the financial market, thus introducing errors into the prediction.
The Long-Term dependence problem in the recurrent neural network is solved by a Long-Term Memory network (LSTM); the LSTM is generally better than a time recurrent neural network and a hidden Markov model, and has certain long-term memory capability; as a nonlinear model, LSTM can be used as a complex nonlinear unit to construct larger deep neural networks. But the method does not support parallel, when multi-step time prediction is carried out, one-step and one-step prediction is needed, the predicted value is used as a new output to predict the next step, and the training speed is slow. Although long-term dependence is solved to a certain extent, the problem of gradient explosion and gradient disappearance cannot be eliminated once the time sequence is too long.
Aiming at the problems that the prediction of the quantitative transaction factors in the related technology does not support parallel and the prediction result is not accurate enough, no solution is provided.
Disclosure of Invention
The embodiment of the invention provides a method and a device for predicting a quantified transaction factor, which are used for at least solving the problems that the prediction of the quantified transaction factor in the related technology does not support parallel operation and the prediction result is not accurate enough.
According to an embodiment of the present invention, there is provided a prediction method of a quantized transaction factor, including:
inputting the acquired data to be tested into a pre-trained target generation countermeasure Network (GAN) model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
and inputting the three groups of data to be tested into a pre-trained target time sequence Convolutional network (TCN) model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target TCN model.
Optionally, before inputting the acquired data to be tested into a pre-trained target GAN model to obtain multiple sets of simulated data to be tested output by the target GAN model, the method further includes:
training an original GAN model based on real data training to obtain the trained target GAN model;
simulating a plurality of groups of simulation training data through the target GAN model, and selecting three groups of training data from the plurality of groups of simulation training data;
and taking the three groups of training data as three channels of class image data, and training an original TCN model to obtain the trained target TCN model.
Optionally, training an original TCN model by using the three sets of training data as three channels of class image data, and obtaining the trained target TCN model includes:
and taking the three groups of training data as three channels of class image data, and training an original TCN model by using the three groups of training data and quantized transaction factors actually corresponding to the three groups of training data to obtain the target TCN model, wherein the three groups of training data are input into the original TCN model, and the quantized transaction factors corresponding to the three groups of training data and the quantized transaction factors actually corresponding to the three groups of training data output by the target TCN model meet a preset function.
Optionally, training an original GAN model based on real data training, and obtaining the trained target GAN model includes:
initializing parameters of a generator and parameters of an arbiter of the original GAN model, wherein the original GAN model comprises the generator and the arbiter;
sampling m samples from real data, and training an original generator by using the m samples to obtain a trained target generator, wherein the m samples are input to the original generator, and the difference between m generated samples corresponding to the m samples output by the target generator and the m samples meets a first preset condition;
obtaining m generation samples by the target generator;
training an original discriminator according to the m samples and the m generated samples to obtain a trained target discriminator, wherein the m samples and the m generated samples are input to the original discriminator, discrimination results of the m generated samples and discrimination results of the m samples output by the target discriminator meet a second preset condition, and the target GAN model comprises the target generator and the target discriminator.
Optionally, after training an original TCN model by using the three sets of training data as three channels of class image data to obtain the trained target TCN model, the method further includes:
acquiring test data;
inputting the test data into the target GAN model to obtain a plurality of groups of simulation test data output by the target GAN model;
selecting three groups of test data from the multiple groups of simulation test data;
inputting the three groups of test data into the target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the test data output by the target TCN model;
and verifying the target TCN model according to the prediction result of the test data.
Optionally, the verifying the target TCN model according to the predicted result of the test data comprises:
judging whether the prediction result of the test data reaches a preset reference line or not;
if the judgment result is yes, determining that the target TCN model meets the preset requirement;
and under the condition that the judgment result is negative, determining that the target TCN model does not meet the preset requirement.
According to another embodiment of the present invention, there is also provided a prediction apparatus for quantifying a trading factor, including:
the first input module is used for inputting the acquired data to be tested into a pre-trained target GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
the first selection module is used for selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
and the prediction module is used for inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of the quantitative transaction factor corresponding to the data to be tested and output by the target TCN model.
Optionally, the apparatus further comprises:
the first training module is used for training an original GAN model based on real data training to obtain the trained target GAN model;
the simulation module is used for simulating a plurality of groups of simulation training data through the target GAN model and selecting three groups of training data from the plurality of groups of simulation training data;
and the second training module is used for training the original TCN model by taking the three groups of training data as three channels of the class image data to obtain the trained target TCN model.
Optionally, the second training module is further configured to:
and taking the three groups of training data as three channels of class image data, and training an original TCN model by using the three groups of training data and quantized transaction factors actually corresponding to the three groups of training data to obtain the target TCN model, wherein the three groups of training data are input into the original TCN model, and the quantized transaction factors corresponding to the three groups of training data and the quantized transaction factors actually corresponding to the three groups of training data output by the target TCN model meet a preset function.
Optionally, the first training module comprises:
an initialization module, configured to initialize parameters of a generator and parameters of a discriminator of the original GAN model, where the original GAN model includes the generator and the discriminator;
the first training submodule is used for sampling m samples from real data, training an original generator by using the m samples to obtain a trained target generator, wherein the m samples are input into the original generator, and the difference value between m generated samples corresponding to the m samples output by the target generator and the m samples meets a first preset condition;
an obtaining sub-module for obtaining m generated samples by the target generator;
and the second training submodule is used for training an original discriminator according to the m samples and the m generated samples to obtain a trained target discriminator, wherein the m samples and the m generated samples are input to the original discriminator, discrimination results of the m generated samples and discrimination results of the m samples output by the target discriminator meet a second preset condition, and the target GAN model comprises the target generator and the target discriminator.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring test data;
the second input module is used for inputting the test data into the target GAN model to obtain a plurality of groups of simulation test data output by the target GAN model;
the selection module is used for selecting three groups of test data from the multiple groups of simulation test data;
the third input module is used for inputting the three groups of test data into the target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the test data output by the target TCN model;
and the verification module is used for verifying the target TCN model according to the prediction result of the test data.
Optionally, the verification module comprises:
the judgment submodule is used for judging whether the prediction result of the test data reaches a preset reference line or not;
the first determining submodule is used for determining that the target TCN model meets the preset requirement under the condition that the judgment result is yes;
and the second determining submodule is used for determining that the target TCN model does not meet the preset requirement under the condition that the judgment result is negative.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the acquired data to be tested is input into a pre-trained target GAN model, and a plurality of groups of simulated data to be tested output by the target GAN model are obtained; selecting three groups of data to be tested with low correlation from the multiple groups of simulation data to be tested; inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target TCN model, so that the problems that the prediction of the quantitative transaction factor in the related technology does not support parallel prediction and the prediction result is not accurate enough can be solved, and the simulation data is generated by using a GAN network, so that the sample size is increased, the diversity of samples is improved, and the prediction is more reasonable; the historical data of the quantified transaction is regarded as the similar image data, multivariable parallel prediction with multiple time steps can be realized by using the excellent performance of the TCN model on the time sequence data prediction, and the prediction accuracy is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a mobile terminal of a prediction method of a quantized transaction factor according to an embodiment of the present invention;
FIG. 2 is a flow chart of a prediction method for quantifying trading factors, according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a GAN model according to an embodiment of the present invention;
FIG. 4 is a first diagram of a TCN model according to an embodiment of the invention;
FIG. 5 is a second schematic diagram of a TCN model according to an embodiment of the invention;
FIG. 6 is a third schematic diagram of a TCN model according to an embodiment of the invention;
fig. 7 is a block diagram of a prediction apparatus quantifying a trading factor according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the prediction method for quantifying a transaction factor according to an embodiment of the present invention, and as shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the prediction method for quantifying the transaction factor in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for predicting a quantified transaction factor operating in the above mobile terminal or network architecture is provided, and fig. 2 is a flowchart of the method for predicting a quantified transaction factor according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, inputting the acquired data to be tested into a pre-trained target GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
the GAN network in embodiments of the invention is a generative modeling network model in machine learning to automatically discover and learn laws or patterns in the input data, thereby making the model available to generate or output new examples that may be extracted from the original dataset.
Step S204, selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
step S206, inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target TCN model.
The time sequence Neural Network TCN in the embodiment of the invention is a special one-dimensional Convolutional Neural Network, and compared with the traditional one-dimensional Convolutional Neural Network (CNN for short), the time sequence Neural Network TCN increases the hyperparameter of the expansion coefficient to improve the receptive field; the model structure is added with the layer jump link and the causal convolution of the residual convolution, and the model has excellent performance in the prediction of time sequence data. The quantitative trading factor refers to an effective factor influencing a trading strategy in the quantitative trading market.
Through the steps S202 to S206, the problems that the prediction of the quantified transaction factors in the related technology does not support parallel operation and the prediction result is not accurate enough can be solved, simulation data are generated by using a GAN network, the sample size is increased, the diversity of samples is improved, and the prediction is more reasonable; the historical data of the quantified transaction is regarded as the similar image data, multivariable parallel prediction with multiple time steps can be realized by using the excellent performance of the TCN model on the time sequence data prediction, and the prediction accuracy is improved.
In an optional embodiment, before the step S202, training an original GAN model based on real data training to obtain the trained target GAN model; simulating a plurality of groups of simulation training data through the target GAN model, and selecting three groups of training data from the plurality of groups of simulation training data; and taking the three groups of training data as three channels of class image data, and training an original TCN model to obtain the trained target TCN model.
Optionally, training an original TCN model by using the three sets of training data as three channels of class image data, and obtaining the trained target TCN model includes:
and taking the three groups of training data as three channels of class image data, and training an original TCN model by using the three groups of training data and quantized transaction factors actually corresponding to the three groups of training data to obtain the target TCN model, wherein the three groups of training data are input into the original TCN model, and the quantized transaction factors corresponding to the three groups of training data and the quantized transaction factors actually corresponding to the three groups of training data output by the target TCN model meet a preset function.
Optionally, training an original GAN model based on real data training, and obtaining the trained target GAN model includes:
initializing parameters of a generator and parameters of an arbiter of the original GAN model, wherein the original GAN model comprises the generator and the arbiter;
sampling m samples from real data, and training an original generator by using the m samples to obtain a trained target generator, wherein the m samples are input to the original generator, and the difference between m generated samples corresponding to the m samples output by the target generator and the m samples meets a first preset condition;
obtaining m generation samples by the target generator;
training an original discriminator according to the m samples and the m generated samples to obtain a trained target discriminator, wherein the m samples and the m generated samples are input to the original discriminator, discrimination results of the m generated samples and discrimination results of the m samples output by the target discriminator meet a second preset condition, and the target GAN model comprises the target generator and the target discriminator.
Optionally, after training an original TCN model by using the three sets of training data as three channels of class image data to obtain the trained target TCN model, the method further includes:
acquiring test data;
inputting the test data into the target GAN model to obtain a plurality of groups of simulation test data output by the target GAN model;
selecting three groups of test data from the multiple groups of simulation test data;
inputting the three groups of test data into the target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the test data output by the target TCN model;
and verifying the target TCN model according to the prediction result of the test data.
Optionally, the verifying the target TCN model according to the predicted result of the test data comprises:
judging whether the prediction result of the test data reaches a preset reference line or not;
if the judgment result is yes, determining that the target TCN model meets the preset requirement;
and under the condition that the judgment result is negative, determining that the target TCN model does not meet the preset requirement.
The embodiment of the invention generates simulation data based on the GAN network and predicts multivariable multi-time step by combining the TCN model, and more simulation historical data can be generated by adopting the GAN network. Compared with Monte Carlo simulation, the GAN does not need to carry out distribution hypothesis on randomness, the result is obtained by mutual game of the generator and the discriminator, the data are closer to reality, a plurality of data sets also increase data dimensionality for later TCN model prediction, and the data dimensionality is increased from a single channel to three channels; the TCN model prediction is a special one-dimensional convolution network model, and particularly indicates that the one-dimensional convolution does not mean that the data dimension is one-dimensional, but the sliding direction of a convolution kernel is only one-dimensional, and training data received by the TCN is three-dimensional in the prediction problem.
The main structure of GAN includes a Generator g (Generator) and a discriminator d (discriminator), fig. 3 is a schematic diagram of a GAN model according to an embodiment of the present invention, and as shown in fig. 3, a model is first defined as a Generator (green part in the Generator diagram, which may be any model, as long as a vector is input and a "image-like" three-dimensional data is output, for example, a deconvolution network model used in this technology).
A classifier is defined as a Discriminator (the red part in the Discriminator graph, the model selection can be various, and the convolution network model adopted by the invention) for discriminating whether the classifier is true or false, namely whether the classifier is from the data set or generated in the generator, the classifier is input as three-dimensional data of a 'class image', and the classifier is output as a discrimination label. Training of the TCM model includes:
step1, initializing parameters of a discriminator D and parameters of a generator G
And 2, sampling m samples from the real samples, sampling m noise samples from the noise vector set, and obtaining m generated samples through a generator. A fixed generator G for training a discriminator D to discriminate a true sample from a generated sample as accurately as possible, and to discriminate a correct sample from a generated sample as large as possible
Step3, after the discriminator is updated circularly for multiple times, the parameters of the generator are updated once by using a smaller learning rate, the generator is trained to reduce the difference between the generated sample and the real sample as much as possible, and the method is equivalent to making the discriminator judge wrong as much as possible
After a number of update iterations, the final ideal case is for the discriminator to be unable to discriminate whether the sample is coming from the output of the generator or the true output. That is, the final sample discrimination probabilities are all 0.5, and finally, historical data of 'different states' are generated through the trained GAN network model simulation and are used as a training data set of a subsequent TCN model.
TCN model, compare traditional convolutional neural network, TCN model has added a lot of new model structures, specifically has: the super-parameter adds an expansion coefficient to increase the size of the receptive field; causal convolution is used to reflect the time sequence of data, and prior information is avoided for prediction; residual volume block, special volume block with expansion coefficient and residual concatenation.
Fig. 4 is a schematic diagram of a TCN model according to an embodiment of the present invention, i.e., fig. 4, the expansion factor is selected as a constant as the expansion coefficient (integer) b, which allows the expansion factor d of a specific layer to be calculated as a function of the number i of layers below it, i.e., d ═ bi. The following figure shows a network of input data length 10, data kernel size 3 and coefficient of expansion 2, which results in full coverage of 3 expanded convolutional layers (complementary set with diagonal 0 in the figure):
FIG. 5 is a second diagram of a TCN model according to an embodiment of the invention, wherein for a causal convolution as shown in FIG. 5, an element in the output sequence can only depend on elements in the input sequence that precede it. In the model, zero padding needs to be applied in order to ensure that the output tensor has the same length as the input tensor. A causal convolution will be ensured if zero padding is applied only on the left side of the input tensor.
The residual block, the output of the two convolutional layers will be added to the input of the residual block, producing the input of the next block. The input and output channel widths are the same, i.e. the number of convolution kernels, for all internal blocks of the network, i.e. all internal blocks except the first and last ones. Since the first convolutional layer of the first residual block and the second convolutional layer of the last residual block may have different input and output channel widths, it may be necessary to adjust the width of the residual tensor, which is done by 1 × 1 convolution.
This change affects the calculation of the minimum number of layers required for complete coverage. Now it has to be considered how many residual blocks are needed to achieve full coverage of the receiving domain. Adding a residual block in the TCN increases the receptive field width twice as much as adding a basic causal layer because it contains two such layers, fig. 6 is a diagram three of the TCN model according to an embodiment of the invention, as shown in fig. 6. Thus, the total size r of the perceptual field of a TCN with b as the dilation base, the kernel size k where k ≧ b, and the number of residual blocks n can be calculated as:
Figure BDA0003483488040000121
this ensures that the minimum number of residual blocks n is the full historical coverage of the input length l:
Figure BDA0003483488040000122
in order for TCN to be not just an overly complex linear regression model, it is necessary to add an activation function on top of the convolutional layer to introduce non-linearity, the ReLU activation being added to the residual block after both convolutional layers. To normalize the input of the hidden layer (which counteracts the problem of gradient bursts), Weight normalization (Weight norm) is applied to each convolutional layer.
To prevent overfitting, regularization is introduced by dropout after each convolution layer of each residual block.
The specific implementation steps from data to prediction are as follows:
step 1: and training by using the existing real data to obtain a generator and an arbiter.
Step 2: and simulating a plurality of groups of simulation data by using a generator, and selecting three groups of data with low correlation as a training set of a subsequent TCN model.
Step 3: the three groups of data are respectively used as three channels of 'image-like' data and three channels of red, green and blue of the image-like data, and a TCN model is obtained through training, so that multi-time-step prediction is achieved.
Step 4: a reasonable and complete evaluation system is established, the prediction result can be visually judged, the preset reference line which is reached by prediction is considered as effective prediction, and the prediction result is output.
Data flow specification from collection (generation) to process computation to model prediction:
the original data used by the invention is the volume price data of securities, taking a stock market as an example, namely OHLCV (opening price, highest price, lowest price, closing price and trading volume), the volume price data is slightly different according to different stock markets, but the purpose is to calculate various quantitative indexes, such as average line index, MACD index, trend index and the like, after the time sequence index data is obtained, the index to be predicted is selected for model training according to the difference of prediction tasks. The model receives time series data of corresponding indexes, for example, the time series data of the previous 10 days is used as input, the value of the next 1 day is used as a label (or the time series data of the next n days and multiple time steps can be changed by different requirements of a prediction task), the model is obtained through training, when the model result is verified, the time series value of the same time period is input, the numerical value of the multiple time steps is output, in the last example, new verification data of the previous 10 days is input, and the model predicts and outputs the numerical value of the next day.
The embodiment of the invention supports the prediction of different parallel time steps and is trained more quickly. Compared with the LSTM-based model in which each hidden state depends on the hidden state of the previous step, the hidden states must be calculated one by one from front to back, and each time, only one step is carried out. The TCN has no such constraint, and the input sequence is processed in parallel, so that the training speed is higher, and meanwhile, the larger error caused by using the prediction data with errors to iteratively predict a more distant time point later is avoided.
In model prediction, the following sources of errors may occur in the model: deviations due to the complexity of the model not expressing the underlying data; variance due to the model being overly sensitive to the limited data required to train it.
The error is the difference between the predicted value and the true value, the error is used for measuring the accuracy of the predicted result, the deviation is used for measuring the accuracy of the predicted result, the error is based on the true value as the standard, the deviation is based on the average value of multiple predicted results as the standard, and the smaller the deviation is, the closer the value predicted by the model is to the actual value is.
Variance is the mean of the sum of the squares of the differences between each data and its mean, and represents the degree of deviation, and when the data distribution is more dispersive, the variance is larger, meaning that the predicted value is not stable enough, and can represent to some extent how much the model of the embodiment of the present invention will change for any given sample.
The embodiment of the invention regards the quantitative transaction data as a thinking mode of 'image-like' data, utilizes the GAN network to simulate and generate the simulation data of the financial market, and reduces the prior assumption on randomness, thereby reducing the influence of uncertain market fluctuation on prediction. The TCN model is utilized to realize parallel multivariable and multistep time prediction, different data generated by the GAN are used as different channels, and the prediction accuracy is improved.
According to another embodiment of the present invention, there is further provided a prediction apparatus for quantifying a trading factor, and fig. 7 is a block diagram of the prediction apparatus for quantifying the trading factor according to the embodiment of the present invention, as shown in fig. 7, including:
the first input module 72 is configured to input the acquired data to be tested into a pre-trained target GAN model, so as to obtain multiple sets of simulated data to be tested output by the target GAN model;
a first selecting module 74, configured to select three sets of data to be tested from the multiple sets of simulation data to be tested;
and the prediction module 76 is configured to input the three groups of data to be tested into a pre-trained target TCN model, so as to obtain a prediction result of a quantized transaction factor corresponding to the data to be tested, which is output by the target TCN model.
Optionally, the apparatus further comprises:
the first training module is used for training an original GAN model based on real data training to obtain the trained target GAN model;
the simulation module is used for simulating a plurality of groups of simulation training data through the target GAN model and selecting three groups of training data from the plurality of groups of simulation training data;
and the second training module is used for training the original TCN model by taking the three groups of training data as three channels of the class image data to obtain the trained target TCN model.
Optionally, the second training module is further configured to:
and taking the three groups of training data as three channels of class image data, and training an original TCN model by using the three groups of training data and quantized transaction factors actually corresponding to the three groups of training data to obtain the target TCN model, wherein the three groups of training data are input into the original TCN model, and the quantized transaction factors corresponding to the three groups of training data and the quantized transaction factors actually corresponding to the three groups of training data output by the target TCN model meet a preset function.
Optionally, the first training module comprises:
an initialization module, configured to initialize parameters of a generator and parameters of a discriminator of the original GAN model, where the original GAN model includes the generator and the discriminator;
the first training submodule is used for sampling m samples from real data, training an original generator by using the m samples to obtain a trained target generator, wherein the m samples are input into the original generator, and the difference value between m generated samples corresponding to the m samples output by the target generator and the m samples meets a first preset condition;
an obtaining sub-module for obtaining m generated samples by the target generator;
and the second training submodule is used for training an original discriminator according to the m samples and the m generated samples to obtain a trained target discriminator, wherein the m samples and the m generated samples are input to the original discriminator, discrimination results of the m generated samples and discrimination results of the m samples output by the target discriminator meet a second preset condition, and the target GAN model comprises the target generator and the target discriminator.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring test data;
the second input module is used for inputting the test data into the target GAN model to obtain a plurality of groups of simulation test data output by the target GAN model;
the selection module is used for selecting three groups of test data from the multiple groups of simulation test data;
the third input module is used for inputting the three groups of test data into the target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the test data output by the target TCN model;
and the verification module is used for verifying the target TCN model according to the prediction result of the test data.
Optionally, the verification module comprises:
the judgment submodule is used for judging whether the prediction result of the test data reaches a preset reference line or not;
the first determining submodule is used for determining that the target TCN model meets the preset requirement under the condition that the judgment result is yes;
and the second determining submodule is used for determining that the target TCN model does not meet the preset requirement under the condition that the judgment result is negative.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, inputting the acquired data to be tested into a pre-trained target GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
s2, selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
and S3, inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target TCN model.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, inputting the acquired data to be tested into a pre-trained target GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
s2, selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
and S3, inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target TCN model.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A predictive method of quantifying a transaction factor, comprising:
inputting the acquired data to be tested into a pre-trained target generation countermeasure network GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the data to be tested and output by the target time sequence neural network TCN model.
2. The method of claim 1, wherein before inputting the acquired data to be tested into a pre-trained target GAN model to obtain multiple sets of simulated data to be tested output by the target GAN model, the method further comprises:
training an original GAN model based on real data training to obtain the trained target GAN model;
simulating a plurality of groups of simulation training data through the target GAN model, and selecting three groups of training data from the plurality of groups of simulation training data;
and taking the three groups of training data as three channels of class image data, and training an original TCN model to obtain the trained target TCN model.
3. The method of claim 2, wherein training an original TCN model using the three sets of training data as three channels of image-like data to obtain the trained target TCN model comprises:
and taking the three groups of training data as three channels of class image data, and training an original TCN model by using the three groups of training data and quantized transaction factors actually corresponding to the three groups of training data to obtain the target TCN model, wherein the three groups of training data are input into the original TCN model, and the quantized transaction factors corresponding to the three groups of training data and the quantized transaction factors actually corresponding to the three groups of training data output by the target TCN model meet a preset function.
4. The method of claim 2, wherein training an original GAN model based on real data training to obtain the trained target GAN model comprises:
initializing parameters of a generator and parameters of an arbiter of the original GAN model, wherein the original GAN model comprises the generator and the arbiter;
sampling m samples from real data, and training an original generator by using the m samples to obtain a trained target generator, wherein the m samples are input to the original generator, and the difference between m generated samples corresponding to the m samples output by the target generator and the m samples meets a first preset condition;
obtaining m generation samples by the target generator;
training an original discriminator according to the m samples and the m generated samples to obtain a trained target discriminator, wherein the m samples and the m generated samples are input to the original discriminator, discrimination results of the m generated samples and discrimination results of the m samples output by the target discriminator meet a second preset condition, and the target GAN model comprises the target generator and the target discriminator.
5. The method of any of claims 2 to 4, wherein after training an original TCN model with the three sets of training data as three channels of class image data to obtain the trained target TCN model, the method further comprises:
acquiring test data;
inputting the test data into the target GAN model to obtain a plurality of groups of simulation test data output by the target GAN model;
selecting three groups of test data from the multiple groups of simulation test data;
inputting the three groups of test data into the target TCN model to obtain a prediction result of a quantitative transaction factor corresponding to the test data output by the target TCN model;
and verifying the target TCN model according to the prediction result of the test data.
6. The method of claim 5, wherein validating the target TCN model based on the predicted outcome of the test data comprises:
judging whether the prediction result of the test data reaches a preset reference line or not;
if the judgment result is yes, determining that the target TCN model meets the preset requirement;
and under the condition that the judgment result is negative, determining that the target TCN model does not meet the preset requirement.
7. A predictive device for quantifying a transaction factor, comprising:
the first input module is used for inputting the acquired data to be tested into a pre-trained target GAN model to obtain a plurality of groups of simulated data to be tested output by the target GAN model;
the first selection module is used for selecting three groups of data to be tested from the multiple groups of simulation data to be tested;
and the prediction module is used for inputting the three groups of data to be tested into a pre-trained target TCN model to obtain a prediction result of the quantitative transaction factor corresponding to the data to be tested and output by the target TCN model.
8. The apparatus of claim 7, further comprising:
the first training module is used for training an original GAN model based on real data training to obtain the trained target GAN model;
the simulation module is used for simulating a plurality of groups of simulation training data through the target GAN model and selecting three groups of training data from the plurality of groups of simulation training data;
and the second training module is used for training the original TCN model by taking the three groups of training data as three channels of the class image data to obtain the trained target TCN model.
9. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method of any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202210074883.5A 2022-01-21 2022-01-21 Prediction method and device for quantized transaction factors Pending CN114511140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210074883.5A CN114511140A (en) 2022-01-21 2022-01-21 Prediction method and device for quantized transaction factors

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210074883.5A CN114511140A (en) 2022-01-21 2022-01-21 Prediction method and device for quantized transaction factors

Publications (1)

Publication Number Publication Date
CN114511140A true CN114511140A (en) 2022-05-17

Family

ID=81550714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210074883.5A Pending CN114511140A (en) 2022-01-21 2022-01-21 Prediction method and device for quantized transaction factors

Country Status (1)

Country Link
CN (1) CN114511140A (en)

Similar Documents

Publication Publication Date Title
CN111444952B (en) Sample recognition model generation method, device, computer equipment and storage medium
US10853554B2 (en) Systems and methods for determining a configuration for a microarchitecture
CN111148118A (en) Flow prediction and carrier turn-off method and system based on time sequence
US20200065441A1 (en) Analysis apparatus using learned model and method therefor
US11734606B2 (en) Method for predicting operational effectiveness
CN111008898B (en) Method and apparatus for evaluating model interpretation tools
CN114330863A (en) Time series prediction processing method, device, storage medium and electronic device
CN106776925A (en) A kind of Forecasting Methodology of mobile terminal user's sex, server and system
CN111494964A (en) Virtual article recommendation method, model training method, device and storage medium
CN111310918B (en) Data processing method, device, computer equipment and storage medium
CN115391561A (en) Method and device for processing graph network data set, electronic equipment, program and medium
Haasdonk et al. A new certified hierarchical and adaptive RB-ML-ROM surrogate model for parametrized PDEs
CN116684330A (en) Traffic prediction method, device, equipment and storage medium based on artificial intelligence
CN116340839A (en) Algorithm selecting method and device based on ant lion algorithm
CN115081613A (en) Method and device for generating deep learning model, electronic equipment and storage medium
CN109255389B (en) Equipment evaluation method, device, equipment and readable storage medium
Bortolussi et al. Learning model checking and the kernel trick for signal temporal logic on stochastic processes
CN116737334A (en) Task scheduling and data set label updating method and device and electronic equipment
EP3908956A1 (en) System and method for performing simulations of uncertain future events
US20210103807A1 (en) Computer implemented method and system for running inference queries with a generative model
CN114511140A (en) Prediction method and device for quantized transaction factors
WO2022215559A1 (en) Hybrid model creation method, hybrid model creation device, and program
CN110909146A (en) Label pushing model training method, device and equipment for pushing question-back labels
EP4080789A1 (en) Enhanced uncertainty management for optical communication systems
CN111026661B (en) Comprehensive testing method and system for software usability

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