Financial time series prediction method and related device
By combining the integrated method of multi-layer embedded bidirectional long and short-term memory network and large models, the problem that the existing technology cannot effectively utilize heterogeneous financial data is solved, and higher prediction accuracy and stability are achieved.
Patent Information
- Application Number
- CN202510035893.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-22
AI Technical Summary
The existing financial time series prediction scheme cannot effectively utilize heterogeneous financial data, resulting in poor accuracy and stability of prediction results.
The multi-layer embedded bidirectional long and short-term memory network (ME-BiLSTM) and large-scale models are used to integrate multi-source heterogeneous data through a multi-layer embedding mechanism, and the self-attention mechanism of the large-scale model is used to capture complex patterns to improve prediction accuracy.
The effective use of heterogeneous financial data is achieved, the accuracy and stability of financial time series prediction results are improved, and the possible risk of overfitting that a single model is reduced.
Smart Images

Figure CN119863319A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a financial time series prediction method and related devices. Background Art
[0002] With the continuous development of the global financial market, market volatility is increasing. How to accurately predict the trend of the financial market has become an important issue in the financial field. At present, the trend of the financial market is mostly predicted through financial time series prediction. Financial time series prediction is to make reasonable inferences about the development of future financial data based on the historical laws and changing trends of financial data.
[0003] With the development of big data and artificial intelligence technology, the sources of financial data are becoming increasingly diversified. Financial data from different sources differ in time, space, and scale. Effectively utilizing these heterogeneous financial data is of great significance to the accuracy and stability of financial time series forecasting results. However, the existing financial time series forecasting solutions cannot effectively utilize heterogeneous financial data, resulting in poor accuracy and stability of financial time series forecasting results.
[0004] Therefore, how to provide a financial time series prediction method to effectively utilize heterogeneous financial data and thereby improve the accuracy and stability of financial time series prediction results has become a technical problem that needs to be urgently solved by those skilled in the art. Summary of the invention
[0005] In view of the above problems, this application provides a financial time series prediction method and related devices to achieve the purpose of effectively utilizing heterogeneous financial data and thus improving the accuracy and stability of financial time series prediction results. The specific scheme is as follows:
[0006] The first aspect of the present application provides a financial time series prediction method, comprising:
[0007] Acquiring original financial data, wherein the original financial data includes historical data of the financial time series to be predicted and relevant reference data of the financial time series to be predicted;
[0008] Preprocessing the original financial data to obtain preprocessed financial data;
[0009] Extracting features and unifying dimensions of the preprocessed financial data to obtain multi-dimensional financial data features;
[0010] The multi-dimensional financial data features are input into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted. The financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model.
[0011] In a possible implementation, the preprocessing of the original financial data includes:
[0012] At least one of unifying the frequency of the original financial data, unifying the dimension of the original financial data, processing the abnormal values of the original financial data, and processing the missing values of the original financial data.
[0013] In a possible implementation, the extracting features and unifying the dimensions of the preprocessed financial data to obtain multi-dimensional financial data features includes:
[0014] Inputting each preprocessed financial data into a feature extraction model to obtain a plurality of financial data features, wherein the plurality of financial data features include but are not limited to basic statistical features, periodic features, market sentiment features, and spatial features;
[0015] The multiple financial data features are reduced in dimension to a preset dimension to obtain multi-dimensional financial data features.
[0016] In a possible implementation, inputting the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted includes:
[0017] Inputting the multi-dimensional financial data feature into the multi-layer embedded bidirectional long short-term memory network to obtain a first financial data feature;
[0018] Inputting the multi-dimensional financial data feature into the large model to obtain a second financial data feature;
[0019] fusing the first financial data feature and the second financial data feature to obtain a fused financial data feature;
[0020] The fused financial data features are used to obtain a prediction result of the financial time series to be predicted.
[0021] In a possible implementation, obtaining the prediction result of the to-be-predicted financial time series by using the fused financial data features includes:
[0022] Inputting the fused financial data features into the multi-layer embedded bidirectional long short-term memory network to obtain a first prediction result of the financial time series to be predicted;
[0023] Inputting the fused financial data features into the large model to obtain a second prediction result of the financial time series to be predicted;
[0024] The first prediction result of the financial time series to be predicted and the second prediction result of the financial time series to be predicted are merged to obtain the prediction result of the financial time series to be predicted.
[0025] In a possible implementation, the training process of the financial time series prediction model includes:
[0026] Constructing a financial data feature sample set, wherein the financial data feature sample set includes a plurality of financial data feature samples; each financial data feature sample corresponds to a financial time series sample and a related reference data sample;
[0027] The financial data feature sample set is used to train, verify and optimize the financial time series prediction model to obtain a trained financial time series prediction model.
[0028] A second aspect of the present application provides a financial time series prediction device, comprising:
[0029] An acquisition unit, configured to acquire original financial data, wherein the original financial data includes historical data of a financial time series to be predicted and relevant reference data of the financial time series to be predicted;
[0030] A preprocessing unit, used to preprocess the original financial data to obtain preprocessed financial data;
[0031] A feature processing unit, used to extract features and unify dimensions of the preprocessed financial data to obtain multi-dimensional financial data features;
[0032] The prediction unit is used to input the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted. The financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model.
[0033] In a possible implementation, the preprocessing unit is specifically used to:
[0034] At least one of unifying the frequency of the original financial data, unifying the dimension of the original financial data, processing the abnormal values of the original financial data, and processing the missing values of the original financial data.
[0035] In a possible implementation, the feature processing unit is specifically used to:
[0036] Inputting each preprocessed financial data into a feature extraction model to obtain a plurality of financial data features, wherein the plurality of financial data features include but are not limited to basic statistical features, periodic features, market sentiment features, and spatial features;
[0037] The multiple financial data features are reduced in dimension to a preset dimension to obtain multi-dimensional financial data features.
[0038] In a possible implementation, the prediction unit includes:
[0039] A first financial data feature determination unit, configured to input the multi-dimensional financial data feature into the multi-layer embedded bidirectional long short-term memory network to obtain a first financial data feature;
[0040] A second financial data feature determination unit, configured to input the multi-dimensional financial data feature into the large model to obtain a second financial data feature;
[0041] a feature fusion unit, configured to fuse the first financial data feature and the second financial data feature to obtain a fused financial data feature;
[0042] The prediction result determination unit is used to obtain the prediction result of the financial time series to be predicted by using the fused financial data features.
[0043] In a possible implementation, the prediction result determination unit is specifically configured to:
[0044] Inputting the fused financial data features into the multi-layer embedded bidirectional long short-term memory network to obtain a first prediction result of the financial time series to be predicted;
[0045] Inputting the fused financial data features into the large model to obtain a second prediction result of the financial time series to be predicted;
[0046] The first prediction result of the financial time series to be predicted and the second prediction result of the financial time series to be predicted are merged to obtain the prediction result of the financial time series to be predicted.
[0047] In a possible implementation, the device further includes: a financial time series prediction model training unit, wherein the financial time series prediction model training unit is specifically configured to:
[0048] Constructing a financial data feature sample set, wherein the financial data feature sample set includes a plurality of financial data feature samples; each financial data feature sample corresponds to a financial time series sample and a related reference data sample;
[0049] The financial data feature sample set is used to train, verify and optimize the financial time series prediction model to obtain a trained financial time series prediction model.
[0050] The third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the financial time series prediction method of the above-mentioned first aspect or any implementation method of the first aspect.
[0051] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0052] The memory is used to store computer programs;
[0053] The processor is used to execute the computer program so that the electronic device can implement the financial time series prediction method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0054] A fifth aspect of the present application provides a computer-readable storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the financial time series prediction method of the above-mentioned first aspect or any implementation of the first aspect.
[0055] By means of the above technical scheme, the present application provides a financial time series prediction method and related devices. After obtaining the original financial data including the historical data of the financial time series to be predicted and the relevant reference data of the financial time series to be predicted, the original financial data is preprocessed to obtain the preprocessed financial data; and the preprocessed financial data is subjected to feature extraction and dimension unification to obtain multi-dimensional financial data features; finally, the multi-dimensional financial data features are input into the trained financial time series prediction model to obtain the prediction results of the financial time series to be predicted. In this scheme, the financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model, which can have both learning ability and accurate time series analysis ability, can effectively reduce the overfitting risk that may exist in a single model, and make full use of the advantages of both, so that it can achieve effective use of heterogeneous financial data, thereby improving the accuracy and stability of the financial time series prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0057] Figure 1 A flowchart of a financial time series prediction method provided in an embodiment of the present application;
[0058] Figure 2A schematic diagram of the structure of a financial time series prediction device provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0061] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0062] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0063] A time series is a sequence of values of a variable measured in chronological order over a certain period of time. For example, if the variable is a stock price, then its change over time is a time series; similarly, if the variable is the stock return rate, then its change over time is also a time series. Time series analysis is to use statistical methods to analyze the past of this sequence, so as to model the changing characteristics of the variable and predict the future. Time series analysis has a wide range of applications in many fields such as engineering, economics, meteorology, and finance.
[0064] With the continuous development of the global financial market, market volatility is increasing. How to accurately predict the trend of the financial market has become an important issue in the financial field. At present, the trend of the financial market is mostly predicted through financial time series prediction. Financial time series prediction is to make reasonable inferences about the development of future financial data based on the historical laws and changing trends of financial data.
[0065] With the development of big data and artificial intelligence technology, the sources of financial data are becoming increasingly diversified, including historical price data, economic indicators, market sentiment data, etc. Financial data from different sources differ in time, space, and scale. The effective use of these heterogeneous financial data is of great significance to the accuracy and stability of financial time series forecasting results.
[0066] Existing financial time series forecasting solutions can be mainly implemented based on the following types of models:
[0067] Traditional statistical models: such as ARIMA (AutoRegressive Integrated Moving Average) and GARCH (Generalized Autoregressive ConditionalHeteroskedasticity). These models are based on linear assumptions and are suitable for processing relatively simple time series data. They have certain limitations when processing nonlinear and complex financial time series data. These models perform well in a stable market environment, but their prediction accuracy and applicability are limited when faced with sudden market events.
[0068] Machine learning models: such as support vector machines (SVM), random forests, and gradient boosting trees (XGBoost). These models improve prediction capabilities by capturing nonlinear features in the data. However, these models usually rely on manual feature engineering, have difficulty automatically adapting to changes in large-scale heterogeneous data, and are less able to handle temporal dependencies in time series.
[0069] Deep learning models: such as Gated Recurrent Unit (GRU), Recurrent Neural Network (RNN) and its variants such as Long Short-Term Memory (LSTM). These models capture long-term and short-term dependencies in time series through gating mechanisms, and perform better than traditional statistical models and machine learning models. However, these models have limitations when processing multi-source heterogeneous data, making it difficult to effectively integrate data features from different sources, and the computing resource requirements for model training and inference are high.
[0070] Large models: such as Transformer, GPT, etc. These models capture complex patterns in data through self-attention mechanisms and demonstrate strong predictive capabilities. However, large models usually require high computing resources, and lack specialized optimization of time series features when processing time series data, making them difficult to directly integrate with traditional deep learning models.
[0071] It can be seen that the existing financial time series prediction schemes are unable to effectively utilize heterogeneous financial data due to various reasons (such as the difficulty in achieving effective integration when processing multi-source data, resulting in the loss or redundancy of feature information; or the limited ability to process complex patterns and multi-scale features in the data; or the high requirements for computing resources), resulting in poor accuracy and stability of financial time series prediction results.
[0072] In order to solve the above problems, an embodiment of the present application provides a financial time series prediction method. Compared with the current financial time series prediction scheme, the financial time series prediction method innovatively combines the advantages of a multi-layer embedded bidirectional long short-term memory network (ME-BiLSTM) and a large model. Through the multi-layer embedding mechanism, the model can effectively fuse multi-source heterogeneous data and fully capture their potential time series characteristics, overcoming the limitations of traditional deep learning models in multi-source data processing, and making full use of the large model's capabilities in feature extraction and pattern recognition. Through the integration of the multi-layer embedding mechanism with the large model, it can improve the accuracy and stability of the prediction results while efficiently utilizing computing resources, providing strong support for the prediction and decision-making of the financial market.
[0073] The financial time series prediction method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0074] Reference Figure 1 , Figure 1 A flowchart of a financial time series prediction method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, a financial time series prediction method provided by an embodiment of the present application may include the following steps, which are described in detail below.
[0075] S101: Acquire original financial data, where the original financial data includes historical data of a financial time series to be predicted and relevant reference data of the financial time series to be predicted;
[0076] In the present application, the original financial data is multi-source heterogeneous data, including historical data of the financial time series to be predicted (e.g., the price increase and decrease data of a certain stock before November 30, 2024) and relevant reference data of the financial time series to be predicted, wherein the relevant reference data of the financial time series to be predicted includes but is not limited to macroeconomic indicators, market sentiment indicators, industry data, heat maps, market volatility maps, etc.
[0077] S102: preprocessing the original financial data to obtain preprocessed financial data;
[0078] In the process of financial time series forecasting, the quality of financial data is the key to ensuring the accuracy and stability of financial time series forecasting results. Considering that financial data from different sources differ in time, space, and scale, the original financial data may also have some quality problems. Therefore, in this application, the original financial data needs to be preprocessed to ensure the quality of the financial data.
[0079] S103: extracting features and unifying dimensions of the preprocessed financial data to obtain multi-dimensional financial data features;
[0080] In the process of financial time series forecasting, the effectiveness of financial data features is also the key to ensuring the accuracy and stability of financial time series forecasting results. Considering that financial data from different sources differ in time, space, and scale, in this application, it is necessary to extract features from the original financial data and unify its dimensions to ensure the effectiveness of the financial data features.
[0081] S104: Input the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted, wherein the financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model.
[0082] Long short-term memory network (LSTM) is a variant of recurrent neural network (RNN) that can process and predict time series data. It is widely used because it can effectively capture long-term dependencies. Compared with traditional RNN, LSTM solves the gradient vanishing and explosion problems in long sequence training by introducing gating mechanisms (including input gate, forget gate and output gate). However, traditional LSTM can only process sequence data in one direction, that is, from the past to the future.
[0083] Bidirectional LSTM (BiLSTM) can simultaneously learn the temporal characteristics of data from both the forward and backward directions of the sequence and capture more contextual information, which is particularly important for trend prediction in financial data because future trends are often affected by historical data in both directions.
[0084] In order to further enhance the model's ability to capture complex features, in this application, a multi-layer embedding (ME) mechanism is introduced on the basis of BiLSTM to obtain a multi-layer embedded bidirectional long short-term memory network ME-BiLSTM model. Compared with traditional LSTM or Bi-LSTM, the ME-BiLSTM model significantly improves its performance on complex time series data by introducing a multi-layer embedding mechanism and bidirectional processing capabilities. Especially in financial time series prediction, data often has multi-scale and multi-dimensional features, and the ME-BiLSTM model can fully explore the potential correlations of these features, thereby achieving more accurate predictions.
[0085] Specifically, the ME-BiLSTM model embeds feature information from multiple sources and scales into different hidden layers by adding multiple embedding layers at different levels of the BiLSTM network. Each embedding layer corresponds to features of different scales, ensuring that the model can capture richer spatiotemporal relationships at different levels. This design allows the model to better integrate these features when processing multi-dimensional financial data features, thereby improving the accuracy and robustness of predictions.
[0086] The large model performs well in processing large data sets and complex pattern recognition, and its powerful self-attention mechanism can effectively capture long-distance dependencies and complex features. Therefore, after completing the construction of the ME-BiLSTM model, in order to further improve the prediction accuracy and generalization ability of the financial time series prediction model, this application also introduces a large model (such as Transformer or GPT, etc.) and integrates it with the ME-BiLSTM model.
[0087] In order to integrate the big model with the ME-BiLSTM model, in this application, the big model is first adaptively adjusted so that it can process financial time series data. Specifically, in this application, the input layer of the big model is transformed so that it can receive multi-dimensional financial data features, and the output layer of the big model is adjusted so that it can directly predict the future value of the financial time series.
[0088] Integrating the large model with the ME-BiLSTM model can fully utilize the advantages of both in feature extraction and time series modeling. The introduction of the large model enables the financial time series prediction model to learn from a wider range of data sets and feature spaces, thereby achieving higher prediction accuracy. At the same time, the time series feature capture capability of the ME-BiLSTM model ensures that the prediction results are highly adaptable to time series data.
[0089] The financial time series prediction model obtained by integrating the large model with the ME-BiLSTM model can have both learning ability and accurate time series analysis ability. Using this financial time series prediction model, the overfitting risk that may exist in a single model can be effectively reduced, and the advantages of both can be fully utilized. Therefore, it can effectively utilize heterogeneous financial data, thereby improving the accuracy and stability of financial time series prediction results.
[0090] It should be noted that this financial time series prediction model, which is integrated by a multi-layer embedded bidirectional long short-term memory network and a large model, is not only suitable for financial time series prediction, but can also be extended to other fields that need to process complex time series data.
[0091] In a possible implementation, the preprocessing of the original financial data includes:
[0092] At least one of unifying the frequency of the original financial data, unifying the dimension of the original financial data, processing the abnormal values of the original financial data, and processing the missing values of the original financial data.
[0093] Specifically, time alignment and interpolation methods can be used to ensure that financial data from different sources can correspond in the time dimension to solve the problem of inconsistent frequencies of financial data from different sources. Normalization and standardization techniques can be applied to convert different dimensions of financial data from different sources into a unified dimension to solve the problem of inconsistent dimensions of financial data from different sources. In financial data, there are often outliers and missing values. These data may be caused by market fluctuations, data collection errors or extreme events. If these data are used without processing, they may cause deviations in model training. Therefore, in this application, anomaly detection techniques based on statistical methods, such as the triple standard deviation method, IQR (interquartile range), etc., can be used to identify and process outliers. For missing values, according to the causes and contextual information, mean filling, interpolation or more complex multiple interpolation methods are used for processing.
[0094] In a possible implementation, the extracting features and unifying the dimensions of the preprocessed financial data to obtain multi-dimensional financial data features includes:
[0095] Input each preprocessed financial data into a feature extraction model to obtain multiple financial data features, wherein the multiple financial data features include but are not limited to basic statistical features, periodic features, market sentiment features and spatial features; reduce the multiple financial data features to a preset dimension to obtain multidimensional financial data features.
[0096] In this application, some basic statistical features, such as moving average, volatility, price momentum, etc., can be constructed based on economic theory and financial market experience. These features can directly reflect the historical behavior patterns of the financial market; in order to capture trends and periodicity in time series data, time series feature extraction methods, such as Fourier transform, empirical mode decomposition (EMD), etc., can be introduced to extract periodic components in the data; for text data, such as market news or social media sentiment data, in this application, natural language processing (NLP) technology can be used to construct features that reflect market sentiment using word embedding and sentiment analysis; convolutional neural networks (CNNs) are used to extract features from image data (such as heat maps or market volatility maps) to extract spatial features.
[0097] In the present application, the dimensions of multiple financial data features obtained by extracting features from the preprocessed financial data are different. In order to effectively fuse the features between heterogeneous data, in the present application, an autoencoder (Autoencoder) or a variational autoencoder (VAE) can be used to reduce the dimensions of multiple financial data features to a latent space to ensure that the correlation between the multiple financial data features is retained.
[0098] In another embodiment of the present application, a specific implementation method of inputting the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted is described, and the method may include the following steps:
[0099] S201: Inputting the multi-dimensional financial data feature into the multi-layer embedded bidirectional long short-term memory network to obtain a first financial data feature;
[0100] First, the multi-dimensional financial data features are input into the embedding layer, and the features processed by the embedding layer are input into the bidirectional LSTM unit. The bidirectional LSTM unit processes data in both forward and backward directions, and passes the output to the next layer at each time step. For each layer of LSTM units, its input includes not only the output of the previous layer, but also the different scale features extracted by the multi-layer embedding layer, so that comprehensive processing of information can be performed at multiple levels. Finally, the output of the bidirectional LSTM unit is the first financial data feature.
[0101] S202: Inputting the multi-dimensional financial data feature into the large model to obtain a second financial data feature;
[0102] In the present application, the second financial data feature may be a feature output by a specific layer of the large model.
[0103] S203: Fusing the first financial data feature and the second financial data feature to obtain a fused financial data feature;
[0104] In the present application, a weighted feature fusion technique may be used to assign different weights to the first financial data features and the second financial data from different models to give full play to their respective advantages. This feature fusion method can significantly improve the accuracy and stability of prediction.
[0105] S204: Obtain a prediction result of the financial time series to be predicted by utilizing the fused financial data features.
[0106] In a possible implementation, the step of obtaining a prediction result of the financial time series to be predicted by using the fused financial data features includes the following steps:
[0107] S2041: Inputting the fused financial data features into the multi-layer embedded bidirectional long short-term memory network to obtain a first prediction result of the financial time series to be predicted;
[0108] In the present application, the fused financial data features are passed through the fully connected layer and activation function in the multi-layer embedded bidirectional long short-term memory network to generate the first prediction result of the financial time series to be predicted.
[0109] S2042: Inputting the fused financial data features into the large model to obtain a second prediction result of the financial time series to be predicted;
[0110] In the present application, the fused financial data features are processed by the structure after the specific layer of the large model to obtain the second prediction result of the financial time series to be predicted;
[0111] S2043: Fusing the first prediction result of the financial time series to be predicted and the second prediction result of the financial time series to be predicted to obtain a prediction result of the financial time series to be predicted.
[0112] In this application, the fusion strategy can adopt two methods: model averaging and weighted voting. Model averaging refers to averaging the prediction results of different models to smooth the prediction error; weighted voting gives different weights to each model according to its performance on the validation set to generate the final prediction result.
[0113] In the present application, by fusing the first prediction result of the financial time series to be predicted and the second prediction result of the financial time series to be predicted, the reliability of the prediction result can be further improved.
[0114] In this application, the training process of the financial time series prediction model is also described in detail, including:
[0115] Construct a financial data feature sample set, wherein the financial data feature sample set includes multiple financial data feature samples; each financial data feature sample corresponds to a financial time series sample and a related reference data sample; and use the financial data feature sample set to train, verify and optimize the financial time series prediction model to obtain a trained financial time series prediction model.
[0116] In the present application, the method for determining each financial data feature sample can refer to the specific implementation method of preprocessing the original financial data to obtain the preprocessed financial data and extracting features and unifying dimensions of the preprocessed financial data to obtain multi-dimensional financial data features, which will not be described in detail here.
[0117] In the training phase of the ME-BiLSTM model, the backpropagation through time (BPTT) algorithm can be used in this application to optimize the ME-BiLSTM model. In order to avoid overfitting, regularization techniques (such as Dropout and L2 regularization) are used. In this application, the model can also be hyperparameter tuned, including learning rate, dimension of embedding layer, number of LSTM layers, etc., to ensure that the model can converge stably and achieve optimal performance during the training process. In addition, batch normalization technology is used to further improve the training speed and prediction accuracy of the model.
[0118] In order to improve the training efficiency of the large model, in this application, a pre-training plus fine-tuning strategy can be adopted, that is, first pre-train the large model with a large-scale financial data set, and then fine-tune it on a specific prediction task to improve the generalization ability of the model. In this application, the multi-task learning ability of the large model can be used to combine financial time series prediction with other related tasks (such as economic indicator prediction, industry trend analysis, etc.), and the learning efficiency and prediction accuracy of the large model can be improved by sharing model parameters.
[0119] After completing the training of the large model and ME-BiLSTM, model validation and optimization become key steps to ensure the accuracy and stability of the prediction results of the financial time series prediction model. Model validation and optimization are not only to test the accuracy of the prediction results, but also to ensure the robustness, computational efficiency and scalability of the model in practical applications.
[0120] In this application, in order to comprehensively evaluate the performance of the financial time series forecasting model, a variety of validation methods can be used, including cross-validation, time rolling validation, and external validation set testing.
[0121] Cross-validation is mainly used to evaluate the generalization ability of a model. By dividing the data set into multiple subsets and alternating between training and validation, the model can be effectively prevented from overfitting to specific data.
[0122] Time rolling validation is to simulate the online prediction scenarios in actual applications. In time rolling validation, the time range of the training set can be gradually expanded, and the prediction accuracy of the model can be verified at each step to ensure the performance of the model in real-time data processing.
[0123] For external validation set testing, data sets from different time periods or market environments can be selected to test the adaptability and robustness of the model under different market conditions. During the validation process, a variety of performance evaluation indicators can be used to measure the prediction effect of the model. The main indicators include mean square error (MSE), mean absolute error (MAE), determination coefficient (R²), etc. MSE and MAE measure the deviation between the predicted value and the actual value respectively. The former is more sensitive to large deviations, while the latter can provide a more intuitive average error level. The determination coefficient R² is used to evaluate the degree to which the model's explanatory variables explain the target variable. In model validation, these indicators characterize the overall performance of the model, and can also discover the weaknesses of the model in specific situations, providing guidance for subsequent optimization.
[0124] According to the verification results, the model can be optimized in many aspects.
[0125] First, in terms of model structure optimization, the model's hyperparameters can be tuned. Specifically, methods such as Grid Search and Random Search can be used to find the best combination of parameters such as embedding layer dimension, number of LSTM units, and learning rate.
[0126] Secondly, model pruning technology can be used to reduce redundant parameters and the number of network layers to reduce model complexity and improve computing efficiency. In this process, special attention can be paid to the model's inference speed and resource consumption to ensure that the model can run efficiently in a practical environment with limited resources. In order to prevent the model from overfitting, a variety of regularization techniques can be introduced. For example, L2 regularization limits the excessive growth of model parameters by adding a weight decay term to the loss function, thereby improving the generalization ability of the model. In addition, Dropout technology can be used to randomly discard some neurons during model training to prevent the network from over-relying on specific features. The application of these regularization techniques effectively reduces the overfitting of the model in the training set and improves the performance of the model on unseen data.
[0127] In order to further ensure the stability of the model after integration, stress testing and robustness evaluation can also be performed. Under different market volatility environments, extreme market events (such as financial crises or sudden market shocks) are simulated to observe the model's response and recovery capabilities. By analyzing the model output results, it is verified that the integration of the large model and ME-BiLSTM can still maintain high prediction accuracy and stability under extreme conditions. This shows that the integrated model not only performs well in normal market environments, but also has strong robustness when dealing with abnormal events.
[0128] Finally, the interpretability of the model is also studied. Although deep learning models are often considered "black boxes", feature importance analysis and visualization of the attention mechanism can reveal the key features that the model relies on when making predictions. This not only enhances the transparency of the model, but also provides strong explanatory support for practical applications.
[0129] A financial time series prediction method provided by an embodiment of the present application is introduced above, and a device for executing the above financial time series prediction method will be introduced below.
[0130] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a financial time series prediction device provided in an embodiment of the present application. Figure 2 As shown, the financial time series prediction device comprises:
[0131] An acquisition unit 11 is used to acquire original financial data, wherein the original financial data includes historical data of the financial time series to be predicted and relevant reference data of the financial time series to be predicted;
[0132] A preprocessing unit 12, configured to preprocess the original financial data to obtain preprocessed financial data;
[0133] A feature processing unit 13 is used to extract features and unify dimensions of the pre-processed financial data to obtain multi-dimensional financial data features;
[0134] The prediction unit 14 is used to input the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted. The financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model.
[0135] In a possible implementation, the preprocessing unit is specifically used to:
[0136] At least one of unifying the frequency of the original financial data, unifying the dimension of the original financial data, processing the abnormal values of the original financial data, and processing the missing values of the original financial data.
[0137] In a possible implementation, the feature processing unit is specifically used to:
[0138] Inputting each preprocessed financial data into a feature extraction model to obtain a plurality of financial data features, wherein the plurality of financial data features include but are not limited to basic statistical features, periodic features, market sentiment features, and spatial features;
[0139] The multiple financial data features are reduced in dimension to a preset dimension to obtain multi-dimensional financial data features.
[0140] In a possible implementation, the prediction unit includes:
[0141] A first financial data feature determination unit, configured to input the multi-dimensional financial data feature into the multi-layer embedded bidirectional long short-term memory network to obtain a first financial data feature;
[0142] A second financial data feature determination unit, configured to input the multi-dimensional financial data feature into the large model to obtain a second financial data feature;
[0143] a feature fusion unit, configured to fuse the first financial data feature and the second financial data feature to obtain a fused financial data feature;
[0144] The prediction result determination unit is used to obtain the prediction result of the financial time series to be predicted by using the fused financial data features.
[0145] In a possible implementation, the prediction result determination unit is specifically configured to:
[0146] Inputting the fused financial data features into the multi-layer embedded bidirectional long short-term memory network to obtain a first prediction result of the financial time series to be predicted;
[0147] Inputting the fused financial data features into the large model to obtain a second prediction result of the financial time series to be predicted;
[0148] The first prediction result of the financial time series to be predicted and the second prediction result of the financial time series to be predicted are merged to obtain the prediction result of the financial time series to be predicted.
[0149] In a possible implementation, the device further includes: a financial time series prediction model training unit, wherein the financial time series prediction model training unit is specifically configured to:
[0150] Constructing a financial data feature sample set, wherein the financial data feature sample set includes a plurality of financial data feature samples; each financial data feature sample corresponds to a financial time series sample and a related reference data sample;
[0151] The financial data feature sample set is used to train, verify and optimize the financial time series prediction model to obtain a trained financial time series prediction model.
[0152] The present application also provides an electronic device in an embodiment. Figure 3As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0153] like Figure 3 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0154] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0155] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the financial time series prediction methods provided in the embodiments of the present application.
[0156] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any financial time series prediction method provided in the embodiment of the present application.
[0157] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0158] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0159] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0160] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A financial time series prediction method, characterized in that: include: Acquiring original financial data, wherein the original financial data includes historical data of the financial time series to be predicted and relevant reference data of the financial time series to be predicted; Preprocessing the original financial data to obtain preprocessed financial data; Extracting features and unifying dimensions of the preprocessed financial data to obtain multi-dimensional financial data features; The multi-dimensional financial data features are input into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted. The financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model.
2. The method according to claim 1, characterized in that The preprocessing of the original financial data includes: At least one of unifying the frequency of the original financial data, unifying the dimension of the original financial data, processing the abnormal values of the original financial data, and processing the missing values of the original financial data.
3. The method according to claim 1 or 2, characterized in that: The extracting features and unifying the dimensions of the pre-processed financial data to obtain multi-dimensional financial data features includes: Inputting each preprocessed financial data into a feature extraction model to obtain a plurality of financial data features, wherein the plurality of financial data features include but are not limited to basic statistical features, periodic features, market sentiment features, and spatial features; The multiple financial data features are reduced in dimension to a preset dimension to obtain multi-dimensional financial data features.
4. The method according to claim 1, characterized in that: The step of inputting the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted includes: Inputting the multi-dimensional financial data feature into the multi-layer embedded bidirectional long short-term memory network to obtain a first financial data feature; Inputting the multi-dimensional financial data feature into the large model to obtain a second financial data feature; fusing the first financial data feature and the second financial data feature to obtain a fused financial data feature; The fused financial data features are used to obtain a prediction result of the financial time series to be predicted.
5. The method according to claim 4, characterized in that The step of obtaining the prediction result of the financial time series to be predicted by utilizing the fused financial data features includes: Inputting the fused financial data features into the multi-layer embedded bidirectional long short-term memory network to obtain a first prediction result of the financial time series to be predicted; Inputting the fused financial data features into the large model to obtain a second prediction result of the financial time series to be predicted; The first prediction result of the financial time series to be predicted and the second prediction result of the financial time series to be predicted are merged to obtain the prediction result of the financial time series to be predicted.
6. The method according to claim 4, characterized in that The training process of the financial time series prediction model includes: Constructing a financial data feature sample set, wherein the financial data feature sample set includes a plurality of financial data feature samples; each financial data feature sample corresponds to a financial time series sample and a related reference data sample; The financial data feature sample set is used to train, verify and optimize the financial time series prediction model to obtain a trained financial time series prediction model.
7. A financial time series prediction device, characterized in that: include: An acquisition unit, configured to acquire original financial data, wherein the original financial data includes historical data of a financial time series to be predicted and relevant reference data of the financial time series to be predicted; A preprocessing unit, used to preprocess the original financial data to obtain preprocessed financial data; A feature processing unit, used to extract features and unify dimensions of the preprocessed financial data to obtain multi-dimensional financial data features; The prediction unit is used to input the multi-dimensional financial data features into a trained financial time series prediction model to obtain a prediction result of the financial time series to be predicted. The financial time series prediction model is obtained by integrating a multi-layer embedded bidirectional long short-term memory network model and a large model.
8. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the financial time series prediction method as claimed in any one of claims 1 to 6.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the financial time series prediction method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the financial time series prediction method as described in any one of claims 1 to 6.
Citation Information
Cited By
Automobile risk control time sequence prediction method based on large model technology
CN120807128A