Cross-cycle sparse financial time series volatility prediction model method based on deep learning
By adopting deep learning technology and sparse long time series prediction framework in the financial time series volatility prediction model, integrating multiple influencing factors will solve the shortcomings of existing models in capturing market sentiment and volatility interaction relationships, and achieving higher prediction accuracy and stability.
Patent Information
- Application Number
- CN202411775419.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-25
AI Technical Summary
The existing financial time series volatility prediction model has shortcomings in capturing market sentiment, macroeconomic factors and interactive relationships between different volatility types, and it is difficult to effectively extract long-term dependence and multi-scale periodic patterns.
A cross-cycle sparse financial time series volatility prediction model based on deep learning is adopted, and market sentiment indicators, macroeconomic data and market participant behavior data are integrated through multi-factor input models, and a sparse long time series prediction framework and Transformer model are used, combined with a joint attention mechanism, and the model is optimized to improve prediction accuracy.
It improves the accuracy and stability of volatility prediction, can better capture the nonlinear relationship between complex market dynamics and different volatility types, and enhances the interpretability and adaptability of the model.
Smart Images

Figure CN119693141A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of financial time series volatility prediction, and specifically relates to a cross-period sparse financial time series volatility prediction model method based on deep learning. Background Art
[0002] The volatility of financial asset prices has always been one of the core factors in risk measurement, financial derivatives pricing and asset allocation. How to accurately predict the realized volatility (RV) has become one of the hot issues in academia and industry. Financial time series data fluctuates violently, and there are many factors that affect its amplitude. Financial time series data has the characteristics of large noise, easy variance, volatility aggregation, long memory, etc. There are many uncertain factors that affect its changes. Traditional analysis and prediction methods have long been unable to cope with it. With the innovation and development of big data technology, deep learning algorithms have the advantages of fewer restrictions and stronger feature extraction. Therefore, it is of great significance to develop deep learning technology for the application of volatility prediction analysis in financial time series.
[0003] There are many algorithms for predicting volatility in financial time series, such as the GARCH model based on conditional abnormal variance, the cyclical deep learning model related to time series, reinforcement learning, etc. The data used in the current research algorithm mainly uses the RV calculated from financial time series data. Commonly used financial time series data include: high-frequency trading data, yield series, intraday data, and daily frequency data. However, there is a certain gap between single trading data and the real market environment, such as the impact of market sentiment and macroeconomic factors in the real market and the impact of heterogeneous market participants. Although single financial time series data can provide basic information on market fluctuations, it cannot fully capture complex market dynamics. How to combine multivariate data such as market sentiment, macroeconomic indicators, microstructure information, and trading strategy behavior to better reflect the multidimensional volatility in the real market environment is a challenge for current volatility prediction models.
[0004] Although significant progress has been made in recent years in predictive models for a single volatility, research on the relationship between different types of volatility is still relatively scarce. Historical volatility, implied volatility, realized volatility, and conditional volatility not only reflect different sources of market information, but also have complex dynamic interactions. These relationships change over time in different market scenarios, reflecting differences in market sentiment, expectations, and actual volatility. Therefore, studying the mutual influence between these volatilities is of great significance to improving the accuracy of risk management and asset pricing. Future models need to be able to integrate this multivariate information and capture the nonlinear and dynamic dependencies between different types of volatility. This is the difficulty and gap in the current field of volatility forecasting.
[0005] A major challenge in long time series forecasting (LTSF) is how to effectively extract long-term dependencies and cyclical patterns from data. Traditional time series models, such as ARIMA and GARCH, can capture short-term trends and seasonal fluctuations, but have limited ability to handle complex dependencies in long time series. This is because as the time span increases, multiple patterns in the series (such as short-term fluctuations, cyclical changes, and long-term trends) are intertwined, increasing the difficulty of modeling. Although existing deep learning models (such as LSTM and GRU) perform well in extracting long-term dependencies, they still face the problem of insufficient capture of cyclical and multi-scale dependencies. In particular, complex cyclical laws often span multiple time scales, and existing models have difficulty in adequately modeling these laws. Most current research focuses on short-term forecasting and ignores the unique challenges of long time series, which suggests that developing models that can effectively extract time dependencies and cyclical patterns over long time scales is an important research direction in the future.
[0006] In summary, the current volatility prediction technology of financial time series in stock market scenarios has the following limitations: 1) It does not fully consider the factors that affect real market fluctuations, especially the impact of factors such as market sentiment, macroeconomic environment, and behavior of market participants; 2) It ignores the interaction between different volatility types; 3) Existing time series models are insufficient in extracting long-term dependencies and multi-scale periodicity information. Summary of the invention
[0007] In view of the above problems, the purpose of the present invention is to provide a cross-period sparse financial time series volatility prediction model method based on deep learning. The present invention models the volatility of financial time series in the stock market scenario, and establishes a more comprehensive volatility prediction framework through deep learning technology, which improves the accuracy of prediction results and helps investors better measure risks, price financial derivatives and allocate assets.
[0008] In order to achieve the above purpose, the following technical solutions are adopted:
[0009] A cross-period sparse financial time series volatility prediction model method based on deep learning includes the following steps:
[0010] 1) Calculate different volatility in a specific period, collect stock closing price, opening price, highest price, lowest price and order book data through the stock interface, obtain different volatility in a certain period according to the calculation formula, and use the realized volatility RV as the true value of the prediction label. The volatility includes historical volatility, implied volatility, realized volatility and conditional volatility;
[0011] 2) Establish a multi-factor input model. On the basis of traditional time series data, combine market sentiment indicator related data and macroeconomic data, add random disturbances, simulate small market fluctuations, increase data diversity, and split the obtained data set, 70% of the data is used for model calibration and 30% for model verification;
[0012] 3) Establish a prediction model based on the sparse long time series prediction framework and the Transformer model, and establish an optimization model based on the joint attention mechanism;
[0013] 4) Model calibration, using the gradient descent algorithm to determine the optimal model parameters to minimize the difference between the volatility results of the dataset and the volatility results predicted by the model;
[0014] 5) Model validation: Based on the parameter estimates obtained during the calibration process in step 4), the volatility deviation is used to evaluate the performance of the model.
[0015] Furthermore, the calculation formula of the historical volatility in step 1) is as follows:
[0016]
[0017] In the formula, r t represents the logarithmic rate of return at time point t, P t represents the stock price at time point t, It represents the average logarithmic return over a certain period of time, and n is the total number of time points during the observation period;
[0018] The formula for calculating realized volatility is as follows:
[0019]
[0020] Where M t represents the middle price at time point t, and They represent the i-th highest bid and ask prices at time point t, respectively;
[0021] Implied volatility σ Implied The calculation formula of is as follows. Implied volatility is one of the only unknown parameters in the option pricing model and is obtained by reverse deduction:
[0022]
[0023] C=S0N(d1)-Ke -rT N(d2) (8)
[0024] P=Ke -rT N(-d2)-S0N(-d1) (9)
[0025] In the formula, S0 represents the current market price of the stock, K represents the exercise price of the option, r represents the risk-free interest rate, usually the government bond interest rate, T represents the option expiration time, in years, d1 represents the relative relationship between the current price of the underlying asset and the exercise price, and takes into account the impact of the risk-free interest rate and volatility on the option price, d2 is the adjusted value of d1, which represents the probability that the price of the underlying asset is lower than the exercise price when the option expires, thereby affecting the theoretical value of the option, N represents the cumulative distribution function of the standard normal distribution, which converts the variables d1 and d2 into probability values within the range of the standard normal distribution, C represents the market price of the option during the call option period, and p represents the market price of the option during the put option period;
[0026] The conditional volatility is calculated as follows:
[0027] R t =μ+∈ t (10)
[0028] ∈ t =σ t ·z t (11)
[0029]
[0030] In the formula, R t is the rate of return of the asset, μ is the average return of the asset, ∈ t is the error term, z t is an independent and identically distributed random noise, usually assuming that z t ~N(0,1), is the square of the conditional volatility, α0 is the constant term, α1 is the regression coefficient, which represents the impact of the square of the previous period's error on the current period's volatility, and β1 is the regression coefficient, which represents the impact of the previous period's conditional volatility on the current period's volatility.
[0031] Furthermore, the basic operation of combining the market sentiment index related data and macroeconomic data in step 2) is to simulate the market sentiment and macroeconomic conditions, so as to build a more accurate analysis model, wherein the specific operation process of the market sentiment simulation is as follows:
[0032] 1) Obtain VIX historical data through the API provided by Yahoo Finance to reflect market volatility and changes in investor sentiment;
[0033] 2) Obtain capital inflow and outflow data for analyzing capital movements and as a key factor in simulating market sentiment;
[0034] Macroeconomic data is obtained through the Trading Economics API. Specific indicators include: economic growth and production activities, labor market and employment, prices and inflation, consumer and business confidence, government and finance, trade and balance of payments, taxation and fiscal policy, consumption and retail, and financial and monetary policy. Economic growth and production activities include GDP growth rate, annual GDP growth rate, manufacturing PMI, non-manufacturing PMI, service PMI, and industrial production index; labor market and employment include unemployment rate; prices and inflation include inflation rate and monthly inflation rate; consumer and business confidence include consumer confidence index and business confidence index; government and finance include government budget and government debt as a percentage of GDP; trade and balance of payments include trade deficit, current account, and current account as a percentage of GDP; taxation and fiscal policy include corporate tax rate and personal income tax rate; consumption and retail include monthly retail sales; financial and monetary policy includes interest rate and cash reserve ratio.
[0035] Furthermore, random disturbances are added in step 2) to simulate small fluctuations in the market. The specific operation to increase the diversity of data is to use a random disturbance method. When processing low-frequency data, random disturbances are introduced through a Gaussian distribution to reduce the high similarity at different time points:
[0036] η t ~Ν(0,σ 2 )(13)σ is the amplitude of the control disturbance, η t represents the random disturbance or noise at time t, Ν(0,σ 2 ) indicates that the disturbance has a mean of 0 and a variance of σ 2 The normal distribution of .
[0037] Further, the specific operation process of step 3) is as follows:
[0038] 1) Perform a sliding aggregation on the original sequence. Each aggregated data point integrates the information of other points in the surrounding period and weakens the influence of outliers. The details are as follows:
[0039]
[0040] Among them, Conv1D represents one-dimensional convolution, formula (14) is the convolution kernel size, L is the window size, i represents the feature, represents the original data subset of feature i from time t-L+1 to t, Represents a subset of data that has undergone one-dimensional convolution;
[0041] 2) Use simple sample normalization between the input and output of the model. Specifically, subtract the mean of the sequence before it enters the model and then add it back after the model output. Specifically:
[0042]
[0043] in, represents the mean value of the data from time t-L+1 to t, Represents the data subset after removing the mean;
[0044] 1) Assuming that the time series has a known period w and the length of a single window sequence is L, the first step is to downsample the original sequence into w windows of length Then the model with shared parameters is applied to these subsequences for prediction. After the prediction is completed, the length The w subsequences of are upsampled back to a complete prediction sequence of length H. The prediction process is manifested as a sliding prediction with a sparse interval of w, which is completed by a parameter-sharing fully connected layer or any deep learning time series prediction algorithm within a constant period w and is regarded as a sparse sliding prediction model across periods.
[0045] 2) Prediction algorithm design: The Decoder-only Transformer architecture is used to focus on the gradual generation of time series data. The specific design is as follows:
[0046] For the input sequence X = [x1, x2, · · ·, x n ], calculate the self-attention of the sequence as follows:
[0047] Q=XW q K=XW k V=XW v (18)
[0048]
[0049] Among them, Q, K, V are the query, key and value matrices obtained by three different linear transformations of input X, and W q ,W k ,W v is the learnable weight matrix, d k is the dimension of the key, used for scaling operations to ensure gradient stability;
[0050] In time series forecasting, in order to ensure that each time step can only focus on past information, a mask operation is used:
[0051]
[0052] Among them, M is a mask matrix, which is used to set future information to a minimum value, ensuring that the model only focuses on the current and previous time steps at each step;
[0053] Residual connections and layer normalization are usually applied after each self-attention layer:
[0054] Z1=LayerNorm(X+Attention(Q,K,V)) (21)
[0055] After the self-attention layer, the data is passed to the feedforward neural network after layer normalization.
[0056] F(Z1)=ReLU(Z1W1+b1)W2+b2 (22)W1, b1, W2, b2 are learnable weights and biases, ReLU is the activation function;
[0057] Finally, the decoder output is mapped to the target space through a linear layer, which is usually used to generate predictions:
[0058] Output = softmax(F(Z2)) (23)
[0059] Among them, Z2 is the result of the feedforward network output after layer normalization.
[0060] Furthermore, the volatility deviation function in step 5) is specifically designed as follows:
[0061]
[0062] In the formula, C is the number of features, is the data volatility series data from time t+1 to t+H obtained through model prediction, It is the actual data volatility series data from time t+1 to t+H.
[0063] The beneficial effects of the present invention are:
[0064] (1) The present invention adopts a multi-factor input model to integrate market sentiment indicators, macroeconomic data and market participant behavior data to construct a comprehensive feature set, providing rich basic data for volatility prediction, so that the volatility prediction model can better capture the interactive relationship between various influencing factors when dealing with complex market environments, thereby improving the accuracy and stability of predictions.
[0065] (2) The present invention adopts a joint attention mechanism and a sparse cross-period long time series framework to simplify the prediction task by decoupling the periodicity and trend in time series data. This method not only improves the interpretability of the model, but also enhances its adaptability to complex market dynamics.
[0066] (3) The present invention adopts a joint attention mechanism, which enables the model to dynamically capture the mutual influence between the volatility of different financial data, further improving the accuracy of prediction. This interactive modeling capability enables the model to better fit the changes in the actual financial market when analyzing market behavior, providing investors with more accurate volatility predictions. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 The article shows the process of establishing a cross-period sparse financial time series volatility prediction model based on deep learning.
[0068] Figure 2 A flow chart of the cross-cycle sparse prediction framework of the present invention is shown. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings.
[0070] Example 1
[0071] Reference Figure 1 A cross-period sparse financial time series volatility prediction model method based on deep learning includes the following steps:
[0072] S1. According to different factors of stock market changes, data is classified and extracted, stock market data is collected, different volatilities under specific periods are calculated, and realized volatility RV is used as a prediction label. The volatility includes historical volatility, implied volatility, realized volatility and conditional volatility;
[0073] S2. Use random perturbations to alleviate the time alignment problem between data;
[0074] S3. Establish a sparse long time series prediction framework and Transformer model, predict the realized volatility, and establish an optimization model;
[0075] S4. Using a gradient descent algorithm to determine model parameters to minimize the difference between the merging decision of the data set and the merging decision predicted by the model;
[0076] The S1 described in the figure uses the data interface provided by Sina Finance to collect the closing price, opening price, highest price, lowest price and order book data of the stock. Then, the sliding window method and different volatility calculation formulas are used to obtain the realized volatility within a specific period under each window and use it as a prediction label.
[0077] The present invention mainly uses Sina interface, Yahoo Finance, Trading Economics API library and Python's talib library for data extraction, and Python's pandas library for data calculation and processing. A stock is selected, and the real-time order book data of the stock is first collected. Secondly, Yahoo Finance, Trading Economics API library and Python's talib library are used to extract the remaining features.
[0078] After completing the construction of the data set, different volatility calculation methods are used to calculate the different volatility of the stock through the sliding window method as labels.
[0079] The calculation formula of historical volatility in step S1 is as follows:
[0080]
[0081] In the formula, r t represents the logarithmic rate of return at time point t, P t represents the stock price at time point t, It represents the average logarithmic return over a certain period of time, and n is the total number of time points during the observation period;
[0082] The formula for calculating realized volatility is as follows:
[0083]
[0084]
[0085] Where M t represents the middle price at time point t, and They represent the i-th highest bid and ask prices at time point t, respectively;
[0086] Implied volatility σ Implied The calculation formula of is as follows. Implied volatility is one of the only unknown parameters in the option pricing model and is obtained by reverse deduction:
[0087]
[0088] C=S0N(d1)-Ke -rT N(d2) (8)
[0089] P=Ke -rT N(-d2)-S0N(-d1) (9)
[0090] In the formula, S0 represents the current market price of the stock, K represents the exercise price of the option, r represents the risk-free interest rate, usually the government bond interest rate, T represents the option expiration time, in years, d1 represents the relative relationship between the current price of the underlying asset and the exercise price, and takes into account the impact of the risk-free interest rate and volatility on the option price, d2 is the adjusted value of d1, which represents the probability that the price of the underlying asset is lower than the exercise price when the option expires, thereby affecting the theoretical value of the option, N represents the cumulative distribution function of the standard normal distribution, which converts the variables d1 and d2 into probability values within the range of the standard normal distribution, C represents the market price of the option during the call option period, and p represents the market price of the option during the put option period;
[0091] The conditional volatility is calculated as follows:
[0092] R t =μ+∈ t (10)
[0093] ∈ t =σ t ·z t (11)
[0094]
[0095] In the formula, R t is the rate of return of the asset, μ is the average return of the asset, ∈ t is the error term, z t is an independent and identically distributed random noise, usually assuming that z t ~N(0,1), is the square of the conditional volatility, α0 is the constant term, α1 is the regression coefficient, which represents the impact of the square of the previous period's error on the current period's volatility, and β1 is the regression coefficient, which represents the impact of the previous period's conditional volatility on the current period's volatility.
[0096] S2 in the figure uses random perturbations to alleviate the time alignment problem between data. After data extraction and classification, the frequency imbalance problem between different categories of data will affect the final accuracy of the model. The present invention uses a random perturbation method to enhance data and alleviate the data alignment problem. This method uses Gaussian distribution to introduce random perturbations to reduce the high similarity of different categories of data at different time points, thereby aligning different categories of data in the data set.
[0097] The basic operation of combining the market sentiment index related data and macroeconomic data in step S2 is to simulate the market sentiment and macroeconomic conditions, so as to build a more accurate analysis model. The specific operation process of market sentiment simulation is as follows:
[0098] 1) Obtain VIX historical data through the API provided by Yahoo Finance to reflect market volatility and changes in investor sentiment;
[0099] 2) Obtain capital inflow and outflow data for analyzing capital movements and as a key factor in simulating market sentiment;
[0100] Macroeconomic data is obtained through the Trading Economics API. Specific indicators include: economic growth and production activities, labor market and employment, prices and inflation, consumer and business confidence, government and finance, trade and balance of payments, taxation and fiscal policy, consumption and retail, and financial and monetary policy. Economic growth and production activities include GDP growth rate, annual GDP growth rate, manufacturing PMI, non-manufacturing PMI, service PMI, and industrial production index; labor market and employment include unemployment rate; prices and inflation include inflation rate and monthly inflation rate; consumer and business confidence include consumer confidence index and business confidence index; government and finance include government budget and government debt as a percentage of GDP; trade and balance of payments include trade deficit, current account, and current account as a percentage of GDP; taxation and fiscal policy include corporate tax rate and personal income tax rate; consumption and retail include monthly retail sales; financial and monetary policy includes interest rate and cash reserve ratio.
[0101] Add random disturbances to simulate small market fluctuations and increase data diversity. The specific operation is to use the random disturbance method. When processing low-frequency data, a Gaussian distribution is used to introduce random disturbances to reduce the high similarity at different time points:
[0102] η t ~Ν(0,σ 2 )(13)σ is the amplitude of the control disturbance, η t represents the random disturbance or noise at time t, Ν(0,σ 2 ) indicates that the disturbance has a mean of 0 and a variance of σ 2 The normal distribution of .
[0103] The S3 described in the figure establishes a sparse long time series prediction framework and a Transformer model to predict actual volatility and establish an optimization model.
[0104] The specific operation process of step S3 is as follows:
[0105] 1) Perform a sliding aggregation on the original sequence. Each aggregated data point integrates the information of other points in the surrounding period and weakens the influence of outliers. The details are as follows:
[0106]
[0107] Among them, Conv1D represents one-dimensional convolution, formula (14) is the convolution kernel size, L is the window size, i represents the feature, represents the original data subset of feature i from time t-L+1 to t, Represents a subset of data that has undergone one-dimensional convolution;
[0108] 2) Use simple sample normalization between the input and output of the model. Specifically, subtract the mean of the sequence before it enters the model and then add it back after the model output. Specifically:
[0109]
[0110] in, represents the mean value of the data from time t-L+1 to t, Represents the data subset after removing the mean;
[0111] 3) Assuming that the time series has a known period w and the length of a single window sequence is L, the first step is to downsample the original sequence into w windows of length Then the model with shared parameters is applied to these subsequences for prediction. After the prediction is completed, the length The w subsequences of are upsampled back to a complete prediction sequence of length H. The prediction process is manifested as a sliding prediction with a sparse interval of w, which is completed by a parameter-sharing fully connected layer or any deep learning time series prediction algorithm within a constant period w and is regarded as a sparse sliding prediction model across periods.
[0112] 4) Prediction algorithm design: The Decoder-only Transformer architecture is used to focus on the gradual generation of time series data. The specific design is as follows:
[0113] For the input sequence X = [x1, x2, · · ·, x n ], calculate the self-attention of the sequence as follows:
[0114] Q=XW q K=XW k V=XW v (18)
[0115]
[0116] Among them, Q, K, V are the query, key and value matrices obtained by three different linear transformations of input X, and W q ,W k ,W v is the learnable weight matrix, d k is the dimension of the key, used for scaling operations to ensure gradient stability;
[0117] In time series forecasting, in order to ensure that each time step can only focus on past information, a mask operation is used:
[0118]
[0119] Among them, M is a mask matrix, which is used to set future information to a minimum value, ensuring that the model only focuses on the current and previous time steps at each step;
[0120] Residual connections and layer normalization are usually applied after each self-attention layer:
[0121] Z1=LayerNorm(X+Attention(Q,K,V)) (21)
[0122] After the self-attention layer, the data is passed to the feedforward neural network after layer normalization.
[0123] F(Z1)=ReLU(Z1W1+b1)W2+b2 (22)
[0124] W1, b1, W2, b2 are learnable weights and biases, and ReLU is the activation function;
[0125] Finally, the decoder output is mapped to the target space through a linear layer, which is usually used to generate predictions:
[0126] Output = softmax(F(Z2)) (23)
[0127] Among them, Z2 is the result of the feedforward network output after layer normalization.
[0128] As shown in S4 in the figure, a gradient descent algorithm is used to determine the model parameters to minimize the difference between the merging decision of the data set and the merging decision predicted by the model.
[0129] Reference Figure 2 , showing the parameter calibration flow chart of the upper-level game theory decision model of the present invention. In the figure, j represents the number of iterations. First, the initial parameter values are set, including the number of iterations j=0, and the initial values of the calibration parameters lr, batchsize, dropout, and n. The return matrix is calculated according to the different data in the data set, the predicted volatility is calculated, the actual volatility is extracted from the data set, and the error formula err is calculated. According to the current error value, gradient descent is used to optimize the parameters until the error is lower than the set threshold, then the cycle stops and the calibration is completed.
[0130] The volatility deviation function is specifically designed as follows:
[0131]
[0132] In the formula, C is the number of features, is the data volatility series data from time t+1 to t+H obtained through model prediction, It is the actual data volatility series data from time t+1 to t+H.
[0133] The following are the experimental results of volatility prediction of a bank's stock price from June 1, 2023 to December 31, 2023. GARCH is a generalized autoregressive conditional heteroskedasticity model, LSTM is a long short-term memory network, and SparseTransformer is the model of this patent. The specific results are as follows:
[0134] Table 1 Comparison results of volatility deviation of a certain bank
[0135]
[0136] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A cross-period sparse financial time series volatility prediction model method based on deep learning, characterized by: The steps include: 1) Calculate different volatility in a specific period, collect stock closing price, opening price, highest price, lowest price and order book data through the stock interface, obtain different volatility in a certain period according to the calculation formula, and use the realized volatility RV as the true value of the prediction label. The volatility includes historical volatility, implied volatility, realized volatility and conditional volatility; 2) Establish a multi-factor input model. On the basis of traditional time series data, combine market sentiment indicator related data and macroeconomic data, add random disturbances, simulate small market fluctuations, increase data diversity, and split the obtained data set, 70% of the data is used for model calibration and 30% for model verification; 3) Establish a prediction model based on the sparse long time series prediction framework and the Transformer model, and establish an optimization model based on the joint attention mechanism; 4) Model calibration, using the gradient descent algorithm to determine the optimal model parameters to minimize the difference between the volatility results of the dataset and the volatility results predicted by the model; 5) Model validation: Based on the parameter estimates obtained during the calibration process in step 4), the volatility deviation is used to evaluate the performance of the model.
2. A cross-period sparse financial time series volatility prediction model method based on deep learning as claimed in claim 1, characterized in that: The calculation formula for the historical volatility in step 1) is as follows: In the formula, r t represents the logarithmic rate of return at time point t, P t represents the stock price at time point t, It represents the average logarithmic return over a certain period of time, and n is the total number of time points during the observation period; The formula for calculating realized volatility is as follows: Where M t represents the middle price at time point t, and They represent the i-th highest bid and ask prices at time point t, respectively; Implied volatility σ Implied The calculation formula of is as follows. Implied volatility is one of the only unknown parameters in the option pricing model and is obtained by reverse deduction: C=S0N(d1)-Ke -rT N(d2) (8) P=Ke -rT N(-d2)-S0N(-d1) (9) In the formula, S0 represents the current market price of the stock, K represents the exercise price of the option, r represents the risk-free interest rate, usually the government bond interest rate, T represents the option expiration time, in years, d1 represents the relative relationship between the current price of the underlying asset and the exercise price, and takes into account the impact of the risk-free interest rate and volatility on the option price, d2 is the adjusted value of d1, which represents the probability that the price of the underlying asset is lower than the exercise price when the option expires, thereby affecting the theoretical value of the option, N represents the cumulative distribution function of the standard normal distribution, which converts the variables d1 and d2 into probability values within the range of the standard normal distribution, C represents the market price of the option during the call option period, and p represents the market price of the option during the put option period; The conditional volatility is calculated as follows: R t =μ+∈ t (10) ∈ t =σ t ·With t (11) In the formula, R t is the rate of return of the asset, μ is the average return of the asset, ∈ t is the error term, z t is an independent and identically distributed random noise, usually assuming that z t ~N(0,1), is the square of the conditional volatility, α0 is the constant term, α1 is the regression coefficient, which represents the impact of the square of the previous period's error on the current period's volatility, and β1 is the regression coefficient, which represents the impact of the previous period's conditional volatility on the current period's volatility.
3. A cross-period sparse financial time series volatility prediction model method based on deep learning as claimed in claim 1, characterized in that: The basic operation of combining market sentiment index related data and macroeconomic data in step 2) is to simulate market sentiment and macroeconomic conditions, so as to build a more accurate analysis model. The specific operation process of market sentiment simulation is as follows: 1) Obtain VIX historical data through the API provided by Yahoo Finance to reflect market volatility and changes in investor sentiment; 2) Obtain capital inflow and outflow data for analyzing capital movements and as a key factor in simulating market sentiment; Macroeconomic data is obtained through the Trading Economics API. Specific indicators include: economic growth and production activities, labor market and employment, prices and inflation, consumer and business confidence, government and finance, trade and balance of payments, taxation and fiscal policy, consumption and retail, and financial and monetary policy. Economic growth and production activities include GDP growth rate, annual GDP growth rate, manufacturing PMI, non-manufacturing PMI, service PMI, and industrial production index; labor market and employment include unemployment rate; prices and inflation include inflation rate and monthly inflation rate; consumer and business confidence include consumer confidence index and business confidence index; government and finance include government budget and government debt as a percentage of GDP; trade and balance of payments include trade deficit, current account, and current account as a percentage of GDP; taxation and fiscal policy include corporate tax rate and personal income tax rate; consumption and retail include monthly retail sales; financial and monetary policy includes interest rate and cash reserve ratio.
4. A cross-period sparse financial time series volatility prediction model method based on deep learning as claimed in claim 1, characterized in that: In step 2), random disturbances are added to simulate small market fluctuations. The specific operation to increase the diversity of data is to use the random disturbance method. When processing low-frequency data, random disturbances are introduced through a Gaussian distribution to reduce the high similarity at different time points: η t ~Ν(0,σ 2 )(13)σ is the amplitude of the control disturbance, η t represents the random disturbance or noise at time t, Ν(0,σ 2 ) indicates that the disturbance has a mean of 0 and a variance of σ 2 The normal distribution of .
5. A cross-period sparse financial time series volatility prediction model method based on deep learning as claimed in claim 1, characterized in that: The specific operation process of step 3) is as follows: 1) Perform a sliding aggregation on the original sequence. Each aggregated data point integrates the information of other points in the surrounding period and weakens the influence of outliers. The details are as follows: Among them, Conv1D represents one-dimensional convolution, formula (14) is the convolution kernel size, L is the window size, i represents the feature, represents the original data subset of feature i from time t-L+1 to t, Represents a subset of data that has undergone one-dimensional convolution; 2) Use simple sample normalization between the input and output of the model. Specifically, subtract the mean of the sequence before it enters the model and then add it back after the model output. Specifically: in, represents the mean value of the data from time t-L+1 to t, Represents the data subset after removing the mean; 3) Assuming that the time series has a known period w and the length of a single window sequence is L, the first step is to downsample the original sequence into w windows of length Then the model with shared parameters is applied to these subsequences for prediction. After the prediction is completed, the length The w subsequences of are upsampled back to a complete prediction sequence of length H. The prediction process is manifested as a sliding prediction with a sparse interval of w, which is completed by a parameter-sharing fully connected layer or any deep learning time series prediction algorithm within a constant period w and is regarded as a sparse sliding prediction model across periods. 4) Prediction algorithm design: The Decoder-only Transformer architecture is used to focus on the gradual generation of time series data. The specific design is as follows: For the input sequence X = [x1, x2, · · ·, x n ], calculate the self-attention of the sequence as follows: Q=XW q K=XW k V=XW v (18) Among them, Q, K, V are the query, key and value matrices obtained by three different linear transformations of input X, and W q ,W k ,W v is the learnable weight matrix, d k is the dimension of the key, used for scaling operations to ensure gradient stability; In time series forecasting, in order to ensure that each time step can only focus on past information, a mask operation is used: Among them, M is a mask matrix, which is used to set future information to a minimum value, ensuring that the model only focuses on the current and previous time steps at each step; Residual connections and layer normalization are usually applied after each self-attention layer: Z1=LayerNorm(X+Attention(Q,K,V))(21) After the self-attention layer, the data is passed to the feedforward neural network after layer normalization. F(Z1)=ReLU(Z1W1+b1)W2+b2 (22) W1, b1, W2, b2 are learnable weights and biases, and ReLU is the activation function; Finally, the decoder output is mapped to the target space through a linear layer, which is usually used to generate predictions: Output = softmax(F(Z2)) (23) Among them, Z2 is the result of the feedforward network output after layer normalization.
6. A cross-period sparse financial time series volatility prediction model method based on deep learning as claimed in claim 1, characterized in that: The volatility deviation function in step 5) is specifically designed as follows: In the formula, C is the number of features, is the data volatility series data from time t+1 to t+H obtained through model prediction, It is the actual data volatility series data from time t+1 to t+H.