A financial time series generation and market fluctuation prediction method based on statistical constraint generation adversarial network and prediction feedback closed loop
By introducing statistical feature constraints and prediction feedback mechanisms into generative adversarial networks, a closed-loop technical process for generating financial time series and predicting market fluctuations is constructed. This solves the problem of the separation between generated samples and prediction models, achieves collaborative optimization of generated samples and prediction models, and improves the statistical consistency and prediction accuracy of financial time series.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2026-06-05
- Publication Date
- 2026-07-31
AI Technical Summary
Existing methods for generating financial time series data and predicting market volatility are insufficient in maintaining the statistical properties of real financial markets, such as autocorrelation structure, volatility clustering characteristics, and stationarity. Although the generated data may appear to be close to the real samples in terms of surface distribution, their statistical validity is weak. The generation model and the prediction model are disconnected, making it difficult to meet the needs of practical applications.
A closed-loop technical process based on generative adversarial networks and a prediction feedback coupling mechanism is constructed. The distribution of real financial time series is learned through adversarial training. Autocorrelation consistency, volatility consistency and stationarity constraints are introduced to form an information closed loop between the generation and prediction models. The generation model is optimized by using prediction error feedback.
To improve the financial validity of generated samples, enhance the robustness and generalization ability of prediction models, and meet the practical application needs of financial risk management, market volatility early warning, and stress testing.
Smart Images

Figure CN122492359A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of financial data modeling and artificial intelligence technology, and in particular relates to a method for generating financial time series and predicting market fluctuations based on statistically constrained generative adversarial networks and predictive feedback loops. Background Technology
[0002] Financial market time series data exhibit significant nonlinearity, nonstationarity, volatility clustering, and heavy-tailed distribution characteristics. Traditional statistical models, such as autoregressive integral moving average models, conditional heteroscedasticity models, and their extensions, while capable of characterizing linear dependencies or local volatility to some extent, generally rely on strong distributional and parametric assumptions, making them ineffective in representing the complex dynamic coupling relationships present in real financial markets. Especially when sample size is limited, market structure undergoes abrupt changes, or extreme events occur frequently, traditional models are prone to insufficient fitting ability, decreased prediction accuracy, and weak generalization ability.
[0003] With the development of deep learning technology, recurrent neural networks, long short-term memory networks, and attention mechanisms have been gradually introduced into financial time series forecasting tasks, showing certain advantages in characterizing nonlinear relationships and learning long-sequence dependencies. However, such forecasting models are usually trained on real historical data. When the training data is limited in scale, the sample distribution is skewed, or there are insufficient tail events, they are still prone to problems such as overfitting, insufficient robustness, and weak ability to identify extreme fluctuations.
[0004] In recent years, generative adversarial networks (GANs) have been applied to financial time series generation tasks, attempting to generate high-fidelity synthetic samples by learning the distribution of real time series, thereby expanding the scale of training data and improving the performance of downstream prediction models. However, existing technologies generally suffer from the following shortcomings: First, most GANs focus on adversarial fitting at the distribution level, lacking explicit constraints on the autocorrelation structure, volatility clustering characteristics, and stationarity properties unique to financial time series. This results in generated samples that, while numerically close to real data, still exhibit biases in a financial statistical sense. Second, existing methods typically construct and train the generation model and the prediction model independently. The goal of generating synthetic samples is not directly optimized for prediction performance, making it difficult for the generation model to proactively adjust its generation strategy based on the error performance of the prediction task. Third, in practical engineering deployments, existing methods rarely provide a complete closed-loop technical solution from data input, feature construction, generation training, enhancement fusion, prediction output to online updates, resulting in insufficient engineering feasibility and widespread application value.
[0005] Furthermore, while existing methods can utilize generative adversarial networks (GANs) for financial time series prediction or generation, and the quality of generated samples can be evaluated using some statistical indicators, their focus is usually limited to whether the generated samples closely approximate the true distribution, or whether the prediction model can directly output price prediction results. Existing methods lack a technical solution that unifies financial statistical feature constraints, consistency checks of generated sample distributions, construction of enhanced training datasets, prediction error feedback, and generator rolling updates into a single closed-loop framework. In particular, they lack mechanisms for limiting the scope of the prediction feedback term and controlling the stability of the closed-loop update.
[0006] Therefore, there is an urgent need to propose a technical solution that can organically integrate generative adversarial network training, statistical feature constraints, enhanced sample fusion, and market fluctuation prediction for financial time series scenarios, and achieve dynamic correction of the generative model through prediction error feedback, so as to improve the financial effectiveness of the generated samples, the robustness of the prediction model, and the executability of the entire system in real financial scenarios. Summary of the Invention
[0007] To address the following problems in existing financial time series generation and market volatility prediction methods: First, the generated samples are insufficient in preserving the statistical attributes of the real financial market, such as autocorrelation structure, volatility clustering characteristics, and stationarity, resulting in generated data that, while superficially similar to the real samples, has weak financial statistical effectiveness. Second, existing generation models and downstream prediction models are often disconnected, with generated data used only as passively enhanced samples, unable to perform reverse correction of the generation process according to the needs of the prediction task. Third, the models have weak prediction robustness and generalization ability in non-stationary, high-noise, and high-volatility market environments, making it difficult to meet the practical application needs of financial risk management, market volatility early warning, and stress testing. This invention provides a financial time series data generation and market volatility prediction method based on a generative adversarial network and prediction feedback coupling mechanism. It aims to construct a closed-loop technical process of "data processing—feature construction—adversarial generation—statistical correction—enhanced fusion—prediction output—feedback optimization" to achieve collaborative optimization between the generation model and the prediction model.
[0008] This invention uses a computer system to structure raw time-series data from financial markets. It unifies and organizes multi-source information such as prices, yields, trading volumes, volatility, and technical indicators, handles outliers, repairs missing values, and constructs sliding windows to form multi-dimensional input feature samples suitable for sequence modeling. Based on this, a conditional generative adversarial network (GAN) is constructed using historical feature sequences and random noise vectors. Through adversarial training between the generator and discriminator, the network learns the data distribution of real financial time series. A preferred approach is to employ a Wasserstein training mechanism with gradient penalties to improve the stability of the training process and mitigate pattern collapse.
[0009] Furthermore, to ensure that the generated samples not only closely approximate the real samples in terms of overall distribution but also maintain consistency with real data in terms of the dynamic statistical structure unique to financial time series, this invention introduces a statistical feature constraint mechanism during the generative adversarial training process. This statistical feature constraint mechanism includes autocorrelation consistency constraints, volatility consistency constraints, and a stationarity penalty term. Specifically, the autocorrelation consistency constraint controls the deviation between the generated sequence and the real sequence in terms of time-series dependency structure; the volatility consistency constraint maintains financial characteristics such as return volatility, volatility clustering, and risk diffusion; and the stationarity penalty term suppresses abnormal drifts or unstable fluctuations in the generated sequence that significantly violate the basic statistical laws of financial time series, thereby improving the financial effectiveness and usability of the generated samples.
[0010] After the generated samples are formed, this invention enhances and fuses the synthetic financial time series samples with the real financial time series samples according to a preset ratio to construct an enhanced training dataset, and trains a market volatility prediction model based on this enhanced training dataset. The market volatility prediction model can be used to predict prices, returns, volatility, or risk status at one or more future points in time. Its specific implementation can employ long short-term memory networks or other neural network structures suitable for time series prediction. Because the training samples simultaneously contain real market information and synthetic samples that conform to financial statistical laws, this prediction model exhibits higher stability, generalization ability, and predictive robustness under conditions of small sample size, noise disturbances, and extreme market volatility.
[0011] Unlike existing technologies that treat the generative and predictive models independently, this invention further constructs a prediction error feedback mechanism. Specifically, a feedback loss term is constructed based on the error between the prediction model's output and the actual observations. This feedback loss term is then introduced into the generator's parameter update process. This allows the generator to dynamically adjust the generated distribution in subsequent training rounds or rolling updates, aiming not only to counteract the fit to the true distribution but also to improve prediction task performance. Through this feedback mechanism, an information loop is formed between the generative and predictive models, enabling the direction of synthetic sample generation to be continuously corrected based on downstream prediction performance, thereby achieving "data generation optimized for prediction tasks."
[0012] The final output of this invention includes synthetic financial time series samples, market volatility prediction results for one or more future time points, risk scores, error statistics, and visualization analysis results. It can be deployed as an online service module through standardized interfaces and applied to scenarios such as financial risk management, asset pricing, market volatility early warning, quantitative investment analysis, scenario simulation, and stress testing.
[0013] Compared with existing technologies, this invention has at least the following beneficial effects: First, by introducing autocorrelation constraints, volatility constraints, and stationarity penalty terms during generative adversarial training, the generated samples are made closer to real financial time series in terms of statistical structure, significantly improving the financial effectiveness of the generated data. Second, by constructing an enhanced fusion mechanism between real and generated samples, the scale of training samples is effectively expanded, improving the robustness and generalization ability of the prediction model in complex market environments. Third, by introducing a prediction error feedback mechanism, the information transmission link between the generative and prediction models is opened up, expanding the generator's update objective from simple distribution fitting to a dual objective of "distribution fitting + prediction gain," thereby enhancing the overall system performance. Fourth, this invention forms an integrated technical solution from data processing, generative training, statistical correction, enhanced prediction, feedback optimization to result output and online deployment, possessing clear engineering feasibility and industrial application value.
[0014] The technical solution described in this invention relies on computer equipment, storage media, and program modules to read, process, model, predict, and optimize financial time series data. It is a technical processing method for specific data objects and specific application scenarios, rather than a simple mathematical rule or abstract algorithm.
[0015] The specific plan is as follows:
[0016] A method for generating financial time series data and predicting market volatility based on statistically constrained generative adversarial networks and predictive feedback loops includes the following steps:
[0017] Step S1: Read and clean the time series data of the financial market, and perform standardization, missing value processing, outlier correction and standardization processing on the original price series, trading volume series and related technical indicator data. Construct a multi-dimensional feature series including price, yield, trading volume, volatility and technical indicators, and form input samples based on the sliding time window.
[0018] Step S2: Construct a conditional generative adversarial network based on historical feature sequences and random noise vectors. Generate synthetic financial time series samples through a generator, distinguish real samples from generated samples through a discriminator, and use Wasserstein distance combined with gradient penalty mechanism to achieve stable training of the adversarial network.
[0019] Step S3: In the process of generative adversarial training, a statistical feature constraint mechanism is introduced, which includes autocorrelation consistency constraint, volatility consistency constraint and stationarity penalty term, so as to improve the consistency between the generated samples and real financial time series in terms of time series dependency structure, volatility clustering characteristics and statistical stability.
[0020] Step S4: Merge the generated samples with the real samples according to a preset ratio to construct an enhanced training dataset, so as to expand the original samples and supplement the representation of complex market states.
[0021] Step S5: Construct a market volatility prediction model based on the enhanced training dataset to predict prices, returns, volatility, or risk status at one or more future points in time, and output the corresponding prediction results;
[0022] Step S6: Construct a feedback loss term based on the error between the predicted result and the true value, and apply the feedback loss term to the generator parameter update process, so that the generator can be dynamically corrected in the subsequent training or rolling update in a direction that is more conducive to the prediction task, thereby forming a closed-loop optimization mechanism for generation and prediction.
[0023] Step S7: Deploy the result output, interpretation and analysis and interface service module to output synthetic financial time series, market volatility prediction results, risk scores, error statistics indicators and visualization analysis results, and support online prediction, rolling updates and service calls.
[0024] Furthermore, in step S1, the logarithmic return of the financial asset price series is defined by the following formula:
[0025] ,
[0026] in, For assets at any time The price The logarithmic return is the return at the corresponding time point; the logarithmic return is used to characterize the relative change between two adjacent time points and serves as the basic input for subsequent volatility estimation, statistical constraint construction, and predictive modeling.
[0027] Furthermore, in step S1, the sliding window sample is defined as follows:
[0028] ,
[0029] ,
[0030] in, For a moment The multidimensional feature vectors, For window length, To predict the step size, For the input sample, For the prediction target.
[0031] Furthermore, in step S1, the multidimensional feature vector includes price features, return features, trading volume features, volatility features, and technical indicator features, defined as follows:
[0032] ,
[0033] in, For price characteristics, As a characteristic of the rate of return, As a characteristic of trading volume, , and These represent the relative strength index, the moving average of differences index, and the mean true volatility index, respectively. The multidimensional feature vector, concatenated with the sliding window samples, serves as the common input to both the generator and the prediction model.
[0034] Further, in step S2, the generator receives the historical input sequence and a random noise vector, and outputs a synthetic financial time series, which is defined as follows:
[0035] ,
[0036] in, This represents the generator mapping function. It is a random noise vector. For generator parameters, The synthesized sample output by the generator.
[0037] Furthermore, in step S2, the discriminator distinguishes between real samples and generated samples, and its output is defined as follows:
[0038] ,
[0039] in, This represents the sample sequence input to the discriminator, and the sample sequence can be real samples. Or generate samples , The discriminator parameters are used to characterize the confidence level that the input sequence comes from the true distribution.
[0040] Furthermore, in step S2, the adversarial objective of the generative adversarial network adopts a Wasserstein GAN with gradient penalty, and the loss function is defined as follows:
[0041] ,
[0042] in, , This represents the gradient penalty coefficient. This loss function is used to ensure the stability of the training process and mitigate the mode collapse problem.
[0043] Furthermore, in step S2, the parameter update uses the Adam optimizer, and its update rules are as follows:
[0044] ,
[0045] ,
[0046] ,
[0047] in, For learning rate, and These are the first and second moment attenuation coefficients. This represents the current gradient. Preferably, the discriminator updates the number of steps. Furthermore, spectral normalization or weight pruning is applied to the discriminator weights to enhance training stability.
[0048] Furthermore, in step S3, the autocorrelation consistency constraint is defined as follows:
[0049] ,
[0050] in, Indicates the true sequence at the th order. The autocorrelation coefficient under 1 / 2 lag, Indicates the generated sequence at the th The autocorrelation coefficient under 1 / 2 lag, This is the preset maximum lag order. This constraint is used to ensure that the generated sequence maintains the same time dependency structure as the real sequence.
[0051] Furthermore, in step S3, the volatility consistency constraint is defined as follows:
[0052] ,
[0053] in, and The real sequence and the generated sequence are respectively at time... The volatility estimate is obtained. Preferably, the volatility is calculated using a sliding window standard deviation or the ATR index. This constraint is used to maintain consistency in volatility clustering of the generated sequences.
[0054] Furthermore, in step S3, the stationarity constraint is implemented through a penalty term constructed based on the stationarity test results, which is used to suppress the generated samples from deviating significantly from the statistical properties of the real market during the adversarial training process.
[0055] Furthermore, in step S3, the joint optimization objective of the generator is defined as follows:
[0056] ,
[0057] in, To counteract the loss, As a stability penalty item, , and These are the weight parameters for each constraint term.
[0058] Furthermore, in step S4, the augmented training dataset is obtained by weighted fusion of real data and generated data:
[0059] ,
[0060] in, For the real sample set, To generate a sample set, To integrate weights, the proportion of generated samples can be dynamically adjusted based on the validation residuals to enhance training intensity in difficult areas.
[0061] Furthermore, in step S5, the market volatility prediction model includes a long short-term memory network with an attention mechanism, and the memory units are updated as follows:
[0062] ,
[0063] ,
[0064] in, , and Let represent the activation vectors of the forget gate, input gate, and output gate, respectively. For the unit state, It is in a hidden state.
[0065] Furthermore, in step S5, the attention weights are defined as follows:
[0066] , ,
[0067] in, For attention weights, To score attention, This is a context representation used to generate the final prediction result.
[0068] Furthermore, in step S5, the target is predicted to be the future. The loss function is a weighted multi-step prediction loss, which measures the fluctuations or price increments of each step. To suppress overfitting, Dropout regularization is applied to the hidden layers of the prediction model, and an early stopping strategy based on validation set metrics is used to trigger training termination.
[0069] Furthermore, in step S6, the feedback loss term is defined as follows:
[0070] ,
[0071] in, For the true value, The predicted value is the sum of the feedback loss term and the generator loss function.
[0072] ,
[0073] in, These are the feedback weighting coefficients. The feedback term only affects the generator parameter updates and does not directly participate in the prediction model parameter updates.
[0074] Furthermore, in step S7, the method of the present invention is deployed in a modular microservice structure, including at least: a data processing module, a feature construction module, a generative adversarial training module, a statistical constraint module, a data augmentation module, a market volatility prediction module, a feedback optimization module, an interpretation and display module, and a prediction service interface module; the modules interact with each other through standardized interfaces, support RESTful API format request returns, and output synthetic financial time series, volatility prediction results, risk scores, and interpretive analysis results.
[0075] The beneficial effects of this invention include:
[0076] (1) It can maintain the unique autocorrelation structure and volatility clustering characteristics of the financial market during the generation of time series, and improve the statistical consistency of the generated samples;
[0077] (2) It can improve the stability and robustness of the prediction model in small sample and high noise environments by fusing generated data with real data;
[0078] (3) It can achieve collaborative optimization between the generative model and the predictive model through the prediction error feedback mechanism, thereby improving the accuracy of market fluctuation prediction;
[0079] (4) It can provide a complete technical solution that is deployable, explainable and applicable to financial risk warning and regulatory scenarios. Attached Figure Description
[0080] Figure 1 This is a flowchart illustrating the overall process of the financial time series data generation and market volatility prediction method based on generative adversarial networks and a predictive feedback coupling mechanism. The flowchart shows the overall process from inputting raw financial time series data, preprocessing, feature construction, generative adversarial training, statistical constraint correction, construction of enhanced training datasets, to market volatility prediction and feedback optimization.
[0081] Figure 2The diagram shows the overall architecture of the conditional generative adversarial network of this invention. It illustrates the structure of the generator that inputs historical feature sequences and random noise vectors to generate synthetic financial time series, and the discriminator that inputs real samples and generated samples together. The discriminator is then jointly trained using Wasserstein loss, gradient penalty term, and reconstruction loss.
[0082] Figure 3 The invention provides a closed-loop diagram of the generator-prediction joint optimization, which illustrates the closed-loop optimization process in which the generator outputs synthetic samples, the synthetic samples and real samples constitute an enhanced training dataset, the prediction model outputs market fluctuation prediction results, and the generator is updated based on the prediction error.
[0083] Figure 4 This is a comparison chart of the predicted and actual values of the model of the present invention on a representative financial index. This chart is used to demonstrate the trend-following ability of the method of the present invention in the task of market volatility prediction. The actual value curve and the predicted value curve maintain a high degree of consistency within the main trend range.
[0084] Figure 5 This is a loss convergence graph during the training process of the model of the present invention. The graph shows the convergence process of the discriminator loss, generator loss and reconstruction loss as the training rounds change, which is used to illustrate the stability of the method of the present invention during the training process.
[0085] Figure 6 This is a performance index comparison chart between the method of the present invention and the comparative method. The chart shows the differences between the model of the present invention and the baseline method in terms of directional accuracy, Sharpe ratio, and annualized return, which is used to illustrate the improvement effect of the present invention in prediction performance and risk-return characteristics. Detailed Implementation
[0086] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.
[0087] As shown in the figure, this invention provides a method for generating financial time series data and predicting market volatility based on statistically constrained generative adversarial networks and predictive feedback loops, comprising the following steps:
[0088] S1. Data Loading & Preprocessing
[0089] This step aims to standardize the input data format, remove outlier data, construct standardized input variables, and form a sliding window sample suitable for generative adversarial training and market volatility prediction, laying the foundation for subsequent generative and predictive model building.
[0090] Step S1.1: Data Reading and Time Field Standardization
[0091] In the data preprocessing stage, this invention first reads time-series data from the financial market. The preferred data format is a standardized CSV file, a database table, or structured data returned through a financial data interface. Each record contains at least a time field, an asset identifier field, and market indicator fields such as price and volume. The time field identifies the corresponding trading day or time, the asset identifier uniquely identifies a financial asset, and the remaining fields represent the price, volume, and related market variables at the corresponding time point.
[0092] To ensure the temporal consistency and validity of samples in subsequent time series modeling, this invention first performs unified format identification and standardization processing on the time field, converting the original time string into a parsable standard timestamp format. If any abnormal records are found to contain null values, illegal dates, or unparseable formats in the time field, they are identified as invalid records and removed during the preprocessing stage.
[0093] Through the above steps, the system establishes a structured time series dataset with time as the main axis and financial assets as the objects, laying a data foundation for subsequent yield calculation, statistical constraint construction, and predictive modeling.
[0094] Step S1.2: Calculation of price series returns
[0095] In this invention, based on the time series of financial asset prices Calculate the logarithmic return over continuous time. This indicator measures the relative change of an asset between two adjacent points in time, and is defined as follows:
[0096] ,
[0097] in, Indicates the time of a financial asset The price at that time This indicates the price of the asset at the previous point in time. This indicates that the asset is at time [time]. Logarithmic return.
[0098] The calculation of logarithmic returns helps transform price changes into standardized risk inputs, making time series more comparable and stable in statistical modeling. This indicator is not only suitable for volatility estimation and distribution fitting, but can also serve as an important input variable for generative and predictive models. In practice, logarithmic returns are calculated at the asset level in chronological order, and this transformation is uniformly applied to all price variables.
[0099] Step S1.3: Remove invalid observations and outliers
[0100] It should be noted that in actual financial market data, some price data may contain outliers less than or equal to zero, such as due to trading halts, erroneous quotes, distortions caused by stock splits or dividends, or missing data sources. Such price data lacks economic meaning and cannot be used for efficient calculation of logarithmic returns because the logarithmic function is undefined in the non-positive domain. Therefore, this invention pre-screens all price variables before calculating the return. If the price value at a certain point in time satisfies… If a record is not found to be valid, it is considered an invalid observation and removed from the return calculation sample. This removal rule applies to all assets and all time points to ensure that the final return series used for modeling originates from valid observations with positive prices. Furthermore, for extreme but still valid observations, this invention does not directly delete them, but rather identifies and marks them using robust statistics, ATR indicators, or quantile truncation rules to preserve tail volatility characteristics in financial markets.
[0101] Step S1.4: Data Normalization
[0102] To eliminate the influence of differences in measurement units between different indicators and ensure that all variables participate in model training and analysis under a unified numerical scale, this invention employs standardization and normalization methods to process the original input data. Specifically, for variables that approximately follow a normal distribution, the Z-score standardization method is used, with the following formula:
[0103] ,
[0104] in, Represents the original variable. The sample mean. Let be the sample standard deviation. For variables that need to be uniformly mapped to a fixed interval, the Min-Max normalization method is used, and its formula is as follows:
[0105] ,
[0106] in, and These represent the minimum and maximum values of the original variable in the sample, respectively.
[0107] In the implementation of this invention, the most suitable standardization method is selected for different types of features such as price, yield, trading volume and technical indicators, so as to improve the numerical stability in the process of generative adversarial training and predictive modeling.
[0108] Step S1.5: Handling Missing Values
[0109] In actual financial data processing, some indicators may have missing values, such as no transactions at certain time points, failure to calculate certain types of indicators, or incomplete data collection. To improve sample completeness, this invention introduces a consistent imputation strategy based on nearest-neighbor observations.
[0110] For short missing segments, forward padding, backward padding, or linear interpolation are preferred methods. For certain high-dimensional feature missing segments, alternative methods can also be used. The nearest neighbor method is used for interpolation. Let the original feature matrix be... For sample units with missing values Its interpolation value is defined as:
[0111] ,
[0112] in, Indicates the most similarity in all other dimensions The nearest samples in the th The observed values for each feature. Furthermore, variables with a missing proportion exceeding a preset threshold are preferably removed directly to prevent severely missing features from interfering with the modeling process.
[0113] Step S1.6: Sliding window sample construction
[0114] To enable the model to learn the dynamic evolution features in the time series, this invention employs a sliding window approach to construct the input sequence. Let the window length be... Then at the point in time The constructed input sample is defined as:
[0115] ,
[0116] in, Indicates time A multi-dimensional feature vector is constructed at each time step. Correspondingly, the prediction target can be set as the price, return, or volatility value at one or more future time points. Input-output pairs corresponding to each time step are extracted sequentially using a sliding window method to form a training sample set shared by the subsequent generative and predictive models.
[0117] S2. Generative Adversarial Network Construction and Synthetic Sequence Generation
[0118] This step aims to construct a conditional generative adversarial network consisting of a generator and a discriminator to generate synthetic samples with real financial time series statistical characteristics, providing support for subsequent data augmentation and market volatility prediction.
[0119] Step S2.1: Construction of multidimensional input features
[0120] Based on the time-series data processed in step S1, this invention constructs a multi-dimensional input feature vector comprising price, yield, trading volume, and technical indicators. Preferably, it is defined as follows:
[0121] ,
[0122] in, For price characteristics, As a characteristic of the rate of return, As a characteristic of trading volume, , and These represent the Relative Strength Index (RSI), Moving Average Convergence Divergence (MAD), and Mean True Range (MTAR), respectively.
[0123] The aforementioned feature vectors are concatenated along the time dimension to form a multi-channel time series tensor, which serves as the input basis for the generator and discriminator.
[0124] Step S2.2: Generator Construction
[0125] In this invention, a generator is used to learn the latent distribution of real financial time series and generate synthetic financial time series based on historical input samples and random noise vectors. The generator output is defined as follows:
[0126] ,
[0127] in, For historical input sequences, It is a random noise vector. For generator parameters, This is a synthetic financial time series.
[0128] The random noise vector Follows a Gaussian distribution The noise vector and historical feature sequence are used together as input to the generator, enabling the generator to simulate the uncertainty and distributional perturbations in the future path of the financial market. In terms of network structure, the generator can adopt temporal convolutional structure, recurrent neural network structure, bidirectional long short-term memory network structure, or attention mechanism enhancement structure to simultaneously capture local patterns and long-term dependencies.
[0129] Step S2.3: Discriminator Construction
[0130] The discriminator receives real and generated samples and outputs a score indicating their realism, enabling adversarial training. The discriminator output is defined as follows:
[0131] ,
[0132] in, This refers to the sample sequence input to the discriminator, which can be either a real sequence or a true sequence. It can also be a sequence generation. , These are the parameters for the discriminator.
[0133] The discriminator can be a one-dimensional convolutional network, a recurrent neural network, a bidirectional long short-term memory network, or a combination of the above structures to enhance its ability to identify differences in temporal features.
[0134] Step S2.4: Wasserstein adversarial loss and gradient penalty
[0135] To improve training stability and alleviate the gradient vanishing and mode collapse problems that easily occur during traditional GAN training, this invention adopts a Wasserstein loss function with gradient penalty, which is defined as follows:
[0136] ,
[0137] in, , This represents the gradient penalty coefficient.
[0138] The gradient penalty term is used to make the discriminator satisfy the approximate 1-Lipschitz continuity condition, thereby improving the stability of adversarial training.
[0139] Step S2.5: Parameter Update Mechanism
[0140] In this invention, the generator and discriminator parameters are preferably updated using the Adam optimizer, and the update method is as follows:
[0141] ,
[0142] ,
[0143] ,
[0144] in, For learning rate, and These are the first and second moment attenuation coefficients. This represents the current gradient. The discriminator updates its algorithm more or less each time, to enhance its discriminative ability; and learning rate decay, gradient pruning, or spectral normalization mechanisms can be introduced to further improve training stability.
[0145] S3. Statistical Constraint and Generator Calibration
[0146] This step aims to introduce constraints based on the statistical characteristics of financial time series during the generative adversarial training process, so that the generated samples not only closely approximate the real samples in terms of numerical distribution, but also better conform to the behavioral patterns of the real financial market in terms of autocorrelation structure, volatility clustering characteristics, and statistical properties.
[0147] Step S3.1: Autocorrelation Consistency Constraint
[0148] To maintain consistency between the generated sequence and the real sequence in terms of time dependency structure, this invention introduces an autocorrelation consistency constraint, defined as follows:
[0149] ,
[0150] in, Indicates the true sequence at the th order. The autocorrelation coefficient under 1 / 2 lag, Indicates the generated sequence at the th The autocorrelation coefficient under 1 / 2 lag, This is a preset maximum lag order. This constraint ensures that the generator maintains, as much as possible, the time dependency pattern between the generated sequence and the real sequence during the optimization process.
[0151] Step S3.2: Volatility Consistency Constraint
[0152] Financial time series typically exhibit significant volatility clustering. To ensure that the generated series retains this characteristic, this invention introduces a volatility consistency constraint, defined as follows:
[0153] ,
[0154] in, and Represent the actual sequence and the generated sequence at time points, respectively. The volatility estimate is calculated using a sliding window standard deviation, ATR indicator, or conditional heteroscedasticity estimation method. This constraint ensures that the generated sample maintains consistency with the real sample in terms of volatility trends.
[0155] Step S3.3: Stability Penalty Term
[0156] In addition to autocorrelation and volatility constraints, this invention further introduces a penalty term based on the stationarity test results to prevent the generated samples from deviating significantly from the statistical properties of real financial time series. When the stationarity test result of the generated samples exceeds a preset threshold, an additional penalty is applied to the generator loss function, thereby constraining the generated samples to maintain consistency with the real samples in long-term statistical properties.
[0157] Step S3.4: Generator Joint Loss Function
[0158] Considering the above constraints, this invention defines the generator optimization objective as:
[0159] ,
[0160] in, To counteract the loss, As a stability penalty item, , and These are the weight parameters for each constraint term. Through the aforementioned joint loss function, the generator simultaneously optimizes for two objectives during adversarial training: distribution fitting and preservation of the financial statistical structure.
[0161] S4. Augmented Dataset Construction
[0162] This step aims to fuse the generated samples after training with real samples to form an enhanced training dataset, which is used to improve the training performance of the market volatility prediction model in environments with small samples, high noise, and complex volatility.
[0163] Step S4.1: Generate sample output
[0164] After completing the generative adversarial training in steps S2 and S3, the trained generator is used to generate corresponding synthetic financial time series samples for each historical input window. The generated samples maintain the main distribution characteristics of the real samples while increasing the diversity and coverage of the training samples.
[0165] Step S4.2: Fusion of real samples and generated samples
[0166] The augmented training dataset is defined as follows:
[0167] ,
[0168] in, Represents the set of real samples. This indicates the generation of a sample set. To achieve weight fusion, the proportion of generated samples can be dynamically adjusted based on the performance of the validation set, so as to balance the gain of generated samples with the stability of real samples.
[0169] Step S4.3: Distribution Consistency Test
[0170] Before or after fusing the generated samples with the real samples, this invention preferably performs a statistical distribution consistency test on both. The test methods may include mean-variance comparison, autocorrelation structure comparison, quantile comparison, or KS test, to ensure that the generated samples do not significantly distort the distribution of the real samples. Through the above consistency verification, the effectiveness of the augmented training dataset in subsequent predictive model training can be further improved.
[0171] S5. Market Volatility Prediction and Output
[0172] This step aims to build a market volatility prediction model based on an enhanced training dataset, predict prices, returns, or volatility at one or more future points in time, and output standardized prediction results.
[0173] Step S5.1: Construction of Prediction Model Input
[0174] The enhanced training dataset constructed in step S4 is used as the input to the prediction model. Each sample is still represented as a multi-dimensional feature sequence of historical time periods in the form of a sliding window, and the corresponding future target value is used as the supervision label.
[0175] Step S5.2: Prediction Model Construction
[0176] In this invention, the market volatility prediction model preferably employs a recurrent neural network, a long short-term memory network, or a time-series prediction model with an attention mechanism. The prediction results are defined as follows:
[0177] ,
[0178] in, Represents the predictive model. Indicates the input sample sequence. This represents a predicted value. Accordingly, the predicted target can be the price, price increment, return, or volatility at one or more future points in time.
[0179] Step S5.3: Update the sequential memory unit
[0180] When the prediction model uses a Long Short-Term Memory (LSTM) network, its memory unit update process is as follows:
[0181] ,
[0182] ,
[0183] in, , and These are the activation vectors for the forget gate, input gate, and output gate, respectively. This represents the current cell state. It is currently hidden.
[0184] Step S5.4: Attention Mechanism Output
[0185] When the prediction model further incorporates an attention mechanism, the attention weights are defined as follows:
[0186] , ,
[0187] in, For attention weights, To score attention, This is a time-hidden state. This is a context representation. The context representation is used to generate the final prediction result.
[0188] Step S5.5: Output the results
[0189] This step outputs market volatility predictions for one or more future time points. These predictions may include price forecasts, return forecasts, volatility forecasts, error statistics, and visualizations of the prediction results. The corresponding prediction results also output the model version number, sample batch identifier, and prediction confidence information for the specific time point, facilitating subsequent system deployment, result backtesting, and strategy evaluation.
[0190] S6. Prediction Error Feedback Mechanism and Closed-loop Optimization
[0191] This step aims to feed the prediction results output by the market volatility prediction model back into the generative model training process. This ensures that the generator's parameter updates not only serve to improve adversarial distribution fitting but also further enhance prediction performance, thus forming a closed-loop collaborative optimization mechanism between generation and prediction. Unlike existing methods that merely use the generative model as a static data augmentation tool, this invention explicitly embeds the prediction error into the generator's loss function, gradually adjusting the distribution of generated samples in a direction more favorable to downstream prediction tasks, thereby improving the overall robustness and prediction accuracy of the model.
[0192] Step S6.1: Definition of Prediction Error and Construction of Feedback Loss
[0193] In this invention, the market fluctuation prediction result obtained in step S5 is used as the basis. Compared with the actual target value The deviation between the two values is used to construct a feedback loss term, which measures the output error of the prediction model in the current period. The feedback loss term is preferably defined as follows:
[0194] ,
[0195] in, Indicates at time The true target value, Indicates at time The predicted value output by the prediction model, This represents the feedback loss term corresponding to the prediction error.
[0196] It should be noted that the actual target value This could be a price, price increment, return, or volatility at a future point in time, or it could be a set of target vectors in a multi-step prediction task. Correspondingly, when the prediction target is a multi-step output, the feedback loss term can be obtained by weighted summation of the errors at each step. In this way, the system can transform prediction bias into a loss signal that can participate in generator optimization.
[0197] Step S6.2: Fusion of feedback loss and generator joint objective function
[0198] After obtaining the feedback loss term, this invention further combines the feedback loss term with the generator joint loss function in step S3 to form a closed-loop optimization objective function. The closed-loop optimization objective is defined as follows:
[0199] ,
[0200] in, This represents the generator's original joint loss function, which consists of adversarial loss, autocorrelation consistency constraint, volatility consistency constraint, and stationarity penalty term. This represents the predicted feedback loss term. This represents the weight coefficient corresponding to the feedback loss term. Through the above closed-loop objective function, the generator, when updating its parameters, not only needs to approximate the true sample distribution as closely as possible, but also needs to generate synthetic samples that help reduce prediction errors, thus forming a dynamic optimization path of "generation serving prediction".
[0201] Step S6.3: Limiting the scope of feedback items
[0202] To avoid target conflicts between the prediction model and the generator model during training, or to prevent instability in the prediction model training due to gradient mixing, this invention limits the scope of the feedback term. Specifically, the feedback loss term only affects the generator parameter update and does not directly participate in the prediction model parameter update. In other words, the prediction model is still trained using its own supervised loss, and the prediction error signal generated by this prediction model is only used to guide the generator to adjust the sample generation direction in the next training round.
[0203] This constraint method has the following advantages: First, it can maintain the stability of the prediction model training process and avoid parameter drift caused by the introduction of additional feedback terms; Second, it can enable the generator to take on the function of actively adapting to the prediction task, while the prediction model still maintains the function of passively learning and enhancing samples; Third, it can enhance the interpretability and module independence of the entire system, which is convenient for subsequent deployment, replacement and maintenance.
[0204] Step S6.4: Rolling Update Mechanism
[0205] In a preferred embodiment of the present invention, the feedback closed-loop optimization is performed using a rolling update method. That is, in the current training cycle, samples are first generated based on the existing generator to form an enhanced training dataset and a prediction model is trained. Then, a feedback loss term is calculated based on the prediction error, and the generator parameters are updated using the feedback loss term. In the next training cycle or the next rolling window cycle, synthetic samples are regenerated based on the updated generator, and the enhanced training and prediction output process is repeated.
[0206] Through this rolling update method, the generator can continuously adjust its generation strategy according to changes in market conditions at different time windows, gradually adapting to non-stationary structural changes and distribution drift in the financial market. Preferably, the rolling update cycle can be set on a daily, weekly, monthly, or quarterly basis, and can be adjusted according to the frequency of financial data and business needs.
[0207] Step S6.5: Stability control during closed-loop optimization process
[0208] Since closed-loop optimization introduces prediction error into the generator's update target, an overly strong feedback term may occur during training, causing the generator to deviate from the true distribution fitting target. Therefore, this invention introduces the following stability control mechanism:
[0209] (1) When the feedback loss item When the value increases significantly over several consecutive training rounds, it is preferable to reduce the feedback weight coefficient. ;
[0210] (2) When the distribution consistency test results between generated samples and real samples deteriorate significantly, it is preferable to reduce the proportion of generated samples or temporarily freeze the update of feedback items;
[0211] (3) When the error of the prediction model on the validation set enters the stable convergence interval, it is preferable to gradually reduce the weight of the feedback loss so that the generator returns more to the distribution preservation objective.
[0212] Through the above-mentioned stability control strategy, the present invention can maintain the effectiveness of the feedback mechanism and prevent the training process from becoming unstable due to closed-loop updates.
[0213] Step S6.6: Closed-loop optimization output results
[0214] The output of this step includes: updated generator parameters, feedback weight adjustment results, prediction error sequence in each round of rolling updates, comparison of prediction performance before and after closed-loop optimization, and model version information corresponding to the closed-loop update. These results can serve as important bases for subsequent system deployment, performance evaluation, and audit backtracking.
[0215] S7. System Deployment, Service Interface and Output Logic
[0216] This step aims to deploy the integrated modeling process formed by the aforementioned modules as an executable system service, enabling online inference, batch prediction, result display, interpretation and analysis, and system operation and maintenance. This allows the invention to be directly applied to practical business scenarios such as financial risk management, asset pricing, market volatility early warning, and strategy support.
[0217] Step S7.1: Modular System Architecture Construction
[0218] To achieve efficient execution and scalable application of the method of this invention, a modular microservice architecture is preferably adopted for system deployment. The overall system includes at least the following functional modules:
[0219] (1) Data processing module, used to perform raw financial time series data reading, cleaning, yield calculation, standardization processing and sliding window sample construction;
[0220] (2) Feature construction module, used to generate multi-dimensional input features such as price, yield, trading volume and technical indicators;
[0221] (3) Generate an adversarial training module, which is used to train the generator and discriminator and output synthetic financial time series samples;
[0222] (4) Statistical constraint module, used to calculate autocorrelation consistency constraint, volatility consistency constraint and stationarity penalty term;
[0223] (5) Data augmentation module, used to merge generated samples with real samples according to preset rules to form an augmented training dataset;
[0224] (6) Market volatility prediction module, used to train the prediction model and output the prediction results of future market volatility;
[0225] (7) Feedback optimization module, used to construct feedback loss terms based on prediction error and update generator parameters;
[0226] (8) Explanation and display module, used to output visualization charts, error statistics indicators and auxiliary analysis results of the prediction results;
[0227] (9) Prediction service interface module, which provides a standardized calling interface to external systems.
[0228] The modules described above can be deployed independently according to their functions, or they can be combined and deployed according to business needs. Through modular design, the method of this invention is easy to reuse and expand in different financial business systems.
[0229] Step S7.2: Service Interface Definition and Data Interaction Method
[0230] In this invention, data interaction between system modules is preferably achieved through standardized interfaces. Furthermore, the entire system can provide prediction service interfaces externally via a RESTful API, supporting data input and output in JSON, CSV, or database streaming formats. The system exposes the following interface capabilities:
[0231] (1) Raw time series upload interface;
[0232] (2) Model training trigger interface;
[0233] (3) Prediction task execution interface;
[0234] (4) Result query interface;
[0235] (5) Model version and log backtracking interface.
[0236] In practice, external callers can access a financial asset in the most recent... The multidimensional feature tensors within each time step are uploaded to the prediction service interface. The system then automatically completes sample preprocessing, generates sample fusion, predicts market fluctuations, and returns the results. The returned results include at least the predicted values for one or more future time points, prediction confidence information, error statistics, and the version number of the currently invoked model.
[0237] Step S7.3: Result Output Format and Content
[0238] To enhance the system's applicability in financial transactions, this invention standardizes the output design. The system output includes:
[0239] (1) Synthetic financial time series samples;
[0240] (2) Predictions of price, yield, or volatility at one or more future points in time;
[0241] (3) Statistical indicators of prediction error, including mean square error, mean absolute error, direction accuracy or Sharpe ratio, etc.
[0242] (4) Comparison of model performance before and after sample augmentation;
[0243] (5) Changes in prediction results before and after closed-loop feedback optimization;
[0244] (6) Visual analysis charts, including prediction trend charts, error curve charts, volatility trajectory charts and sample distribution comparison charts.
[0245] Furthermore, the output results may also include a prediction timestamp, model version number, training batch identifier, parameter hash value, and log index number to facilitate system operation and maintenance, result backtracking, and audit verification.
[0246] Step S7.4: Online Inference and Batch Scheduling Mechanism
[0247] This invention supports both online single-inference mode and periodic batch scheduling mode.
[0248] In online inference mode, the system outputs prediction results in real time based on the latest uploaded sliding window samples, which is suitable for scenarios such as high-frequency market monitoring and short-cycle asset volatility early warning.
[0249] In batch scheduling mode, the system automatically executes the following process according to a preset time frequency (e.g., daily, weekly, monthly, or quarterly):
[0250] Original data update → Sample preprocessing → Sample generation → Enhanced training set construction → Predictive model training / fine-tuning → Result output and database entry.
[0251] This model is suitable for scenarios such as low-to-medium frequency market analysis, risk management, and regulatory reporting.
[0252] Step S7.5: Anomaly Monitoring and Self-Healing Mechanism
[0253] To improve system stability and maintainability, this invention further introduces anomaly monitoring and self-healing logic. When the system detects the following situations, it can automatically trigger the corresponding protection strategy:
[0254] (1) The generator loss and discriminator loss are out of balance for a long time;
[0255] (2) The statistical consistency test between the generated sample and the real sample deteriorated significantly;
[0256] (3) The error of the prediction model on the validation set continues to rise;
[0257] (4) The feedback loss term is abnormally amplified, causing the generator training to deviate from the stable range.
[0258] Correspondingly, the system can automatically perform the following self-healing operations: reduce the learning rate; reduce the feedback weight coefficient; reduce the proportion of generated samples; revert to the baseline prediction mode based solely on real samples; freeze the current best model and roll back to the previous stable version.
[0259] Through the aforementioned self-healing mechanism, the availability and stability of the system of the present invention can be significantly improved in real deployment environments.
[0260] Step S7.6: Deploy the business applications of the system output results.
[0261] The deployment results of this invention can directly serve the following business scenarios: First, in the financial risk management scenario, it can be used to identify future periods of abnormal volatility and provide risk warnings; second, in the asset pricing scenario, it can be used to assist in estimating future return and volatility paths; third, in the asset allocation scenario, it can be used to assist in judging market conditions and optimizing trading decisions; fourth, in the stress testing and scenario analysis scenario, it can be used to generate diverse financial time series samples and observe the sensitivity of prediction results to different sample paths.
[0262] Through the above system deployment logic, this invention extends the generation modeling, fluctuation prediction and feedback optimization from a single algorithm process to a complete executable service system, thereby improving the engineering implementation capability of the technical solution.
[0263] The following embodiments are all based on the technical solutions of the present invention and are used to further illustrate the application of the present invention in actual financial time series data scenarios, but do not constitute a limitation on the scope of protection of the present invention.
[0264] Example 1: Market Fluctuation Prediction Process Based on Daily Stock Index Data
[0265] In this embodiment, daily price data of a major stock index in the A-share market is selected as the research object, with the sample period covering multiple complete years. First, the daily opening price, highest price, lowest price, closing price, and trading volume data of the index are read, and the time format is standardized to remove abnormal records. Then, the logarithmic return is calculated based on the price series, and further technical indicators such as RSI, MACD, and ATR are calculated. An input sample is constructed based on a sliding window with a window length of 30, and the return for the next trading day is used as the prediction target.
[0266] Next, a conditional generative adversarial network (GAN) is constructed. The generator receives a historical multidimensional feature tensor and a Gaussian random noise vector of dimension 100, and outputs a synthetic financial time series with the same length as the input. The discriminator scores the authenticity of both real and generated samples. During training, Wasserstein adversarial loss, autocorrelation consistency constraints, and volatility consistency constraints are introduced. After training, the generated samples and real samples are merged in a 3:7 ratio to form an enhanced training dataset.
[0267] Then, a long short-term memory network prediction model with an attention mechanism is trained based on the enhanced training dataset, outputting the return prediction result for the next trading day, and constructing a feedback loss term based on the error between the actual value and the predicted value. Finally, this feedback loss term is applied to the generator update, enabling the generator to output synthetic samples that are more conducive to the prediction task in the next round of training. Through repeated rolling training and updates, the final market volatility prediction result, prediction error statistics, and performance comparison results of the model before and after enhancement are obtained.
[0268] This embodiment demonstrates that the method of the present invention can improve the stability and prediction accuracy of the market volatility prediction model in real financial time series scenarios while maintaining the consistency of the generated sample financial statistics.
[0269] Example 2: Closed-loop optimization forecasting process based on high-volatility assets
[0270] In this embodiment, time series of financial assets with high volatility are selected as the research object, such as growth style indices, commodity futures main contracts, or high-volatility stock portfolios. Because these asset time series exhibit more pronounced leptokurtic (fat-peak) and heavy-tailed (fat-tailed) characteristics and volatility clustering, the advantages of the closed-loop optimization mechanism of this invention are more readily apparent.
[0271] Specifically, firstly, multi-dimensional input features are constructed based on the original price and volume sequences, and the scale is standardized using a standardization method. Secondly, a generative adversarial network with statistical constraints is constructed, and the weight of volatility consistency constraints is enhanced during training to ensure that the generated samples can better preserve the volatility clustering characteristics in the real market. Subsequently, the generated samples are fused with real samples and input into the market volatility prediction model to predict the volatility path at multiple future time points.
[0272] After the prediction results are output, a feedback loss term is constructed based on the multi-step prediction errors, and this feedback loss term is used to update the generator parameters. Through multiple rounds of closed-loop rolling updates, the generator can gradually adapt to the prediction task requirements in a high-volatility market environment. Finally, the system outputs the multi-step volatility prediction results for high-volatility assets, error curves, comparison results of prediction performance before and after sample augmentation, and model convergence status before and after closed-loop feedback optimization.
[0273] This embodiment demonstrates that, for financial time series with more volatile and complex distributions, the method of the present invention can still maintain good generation stability and predictive adaptability.
[0274] Example 3: System Deployment Example
[0275] In this embodiment, the method of the present invention is deployed as a modular microservice system and applied to a market volatility prediction service platform for financial institutions. Specifically, the system consists of a data processing module, a feature construction module, a generative adversarial training module, a statistical constraint module, a data augmentation module, a market volatility prediction module, a feedback optimization module, and a visualization module as its core components. The modules communicate with each other through RESTful API interfaces.
[0276] In periodic scheduling mode, the system automatically acquires the latest market data at fixed times each day and performs data preprocessing, sample generation and updates, enhanced training dataset construction, prediction model inference, and result storage. In online inference mode, external business systems can upload multi-dimensional feature samples from the most recent n time steps to the prediction service interface in real time. The system returns market fluctuation prediction results and confidence information for one or more future time points within milliseconds or seconds.
[0277] The system simultaneously supports outputting prediction trend charts, error statistics charts, volatility trajectory charts, and comparison charts of the distribution of generated samples and real samples to help users understand the prediction results and the sample augmentation effect. Furthermore, the system records the model version number, parameter configuration, and log information for each prediction call, facilitating subsequent result backtracking and model governance.
[0278] This embodiment demonstrates that the method of the present invention can not only be executed in an offline research environment, but also form a deployable, callable, and maintainable service capability in a real business system.
[0279] The above embodiments are merely typical illustrative methods of the present invention, and the scope of protection of the present invention is not limited thereto. All equivalent substitutions and improvements under the concept of the present invention should fall within the scope of protection. It should be emphasized that for those skilled in the art, if equivalent substitutions, combinations, adjustments, or detailed optimizations are made to the steps, parameters, model structure, or deployment methods of the present invention without departing from the basic principles of the present invention, they should also be considered to fall within the scope of protection of the present invention.
Claims
1. A method for generating financial time series data and predicting market volatility based on statistically constrained generative adversarial networks and predictive feedback loops, characterized in that, Includes the following steps: S1, acquire financial time series data, and perform time field standardization, missing value handling, outlier handling and standardization processing on the financial time series data, and construct input sample sequences based on sliding time windows; S2, construct a multidimensional feature tensor based on the input sample sequence. The multidimensional feature tensor includes at least price features, return features, trading volume features, volatility features, and technical indicator features. Input the multidimensional feature tensor and a random noise vector into the generator. S3, Construct a conditional generative adversarial network model, which includes a generator and a discriminator. The generator is used to generate synthetic financial time series based on historical input samples and random noise vectors. The discriminator is used to distinguish between real financial time series and synthetic financial time series, and is trained adversarially based on Wasserstein adversarial loss with gradient penalty. S4, during the generator training process, a financial statistical feature constraint mechanism is introduced, which includes autocorrelation consistency constraint, volatility consistency constraint and stationarity penalty term, so that the synthetic financial time series is consistent with the real financial time series in terms of time dependence structure, volatility clustering characteristics and long-term statistical stability. S5, Perform a distribution consistency test on the synthetic financial time series, and determine whether to merge the synthetic financial time series with the real financial time series based on the test results to form an enhanced training dataset; S6. Train the market volatility prediction model based on the enhanced training dataset and output the prediction results of price, return, volatility or risk status at one or more future time points. S7. Based on the error between the prediction result and the actual observation, a prediction feedback loss term is constructed and introduced into the generator parameter update process. The prediction feedback loss term only acts on the generator parameter update and does not directly participate in the market fluctuation prediction model parameter update. S8 repeatedly executes synthetic sample generation, augmented training, market fluctuation prediction, and generator feedback update based on a rolling time window. When the feedback loss is abnormally amplified, the consistency of the generated sample distribution deteriorates, or the prediction error continues to rise, a stability control strategy is triggered to form a closed-loop optimization mechanism between the generation model and the prediction model.
2. The method according to claim 1, characterized in that, The sliding time window construction method described in step S1 is as follows: , , in, For a moment The multidimensional feature vectors, For window length, To predict the step size, For the input sample, For the prediction target.
3. The method according to claim 1, characterized in that, The multidimensional feature tensor mentioned in step S2 includes price features, return features, trading volume features, volatility features, and technical indicator features, where the logarithmic return is defined as: , in, For assets at any time The price Indicates the first The price of time This represents the logarithmic return at the corresponding time point.
4. The method according to claim 1, characterized in that, The output of the generator in step S3 is defined as follows: , in, The generated sequence is a random noise vector, and its length is the same as the input sequence length.
5. The method according to claim 1, characterized in that, In step S3, the generative adversarial network uses the Wasserstein loss function with gradient penalty, which is expressed as follows: , in, Represents a real financial time series sample. This represents a synthetic financial time series sample generated by the generator. This represents the output of the discriminator, where , This represents the gradient penalty coefficient.
6. The method according to claim 1, characterized in that, The generator joint loss function corresponding to the financial statistical feature constraint mechanism described in step S4 is: , in, To counteract the loss, This represents the autocorrelation consistency loss term. Represents the volatility consistency loss term As a stability penalty item, , and These are the weight parameters for each constraint term.
7. The method according to claim 1, characterized in that, The distribution consistency test mentioned in step S5 includes one or more of the following: mean-variance test, autocorrelation structure test, quantile test, KS test, and volatility clustering test. When the test results do not meet the preset threshold, reduce the proportion of synthetic financial time series in the augmented training dataset, or stop including the corresponding synthetic financial time series in the augmented training dataset.
8. The method according to claim 1, characterized in that, The augmented training dataset mentioned in step S5 is obtained by weighted fusion of the real sample set and the synthetic sample set: , in, For the real sample set, To generate a sample set, The fusion weights are dynamically adjusted based on the validation set prediction residuals, the consistency test results of the generated sample distribution, or the proportion of highly volatile samples.
9. The method according to claim 1, characterized in that, The market volatility prediction model mentioned in step S6 includes one or more of the following: recurrent neural network, long short-term memory network, gated recurrent unit network, temporal convolutional network, or time series prediction model with attention mechanism.
10. The method according to claim 1, characterized in that, The prediction feedback loss term mentioned in step S7 is: , in, Represents the actual observed value. This represents the predicted value output by the market volatility prediction model; the combination of the prediction feedback loss term and the generator loss function is: , in, As a feedback weighting coefficient, the feedback term only affects the generator parameter update and does not directly participate in the prediction model parameter update.
11. The method according to claim 1, characterized in that, The stability control strategy described in step S8 includes: reducing the feedback weight coefficient when the prediction feedback loss term increases continuously; reducing the proportion of synthetic samples when the distribution consistency test results between generated samples and real samples deteriorate; and freezing feedback updates or rolling back to the previous stable model version when the error of the market volatility prediction model validation set continues to rise.
12. The method according to claim 1, characterized in that, The method is implemented through a modular system, which includes a data processing module, a feature construction module, a generative adversarial training module, a statistical constraint module, a distribution consistency test module, a data augmentation module, a market fluctuation prediction module, a feedback optimization module, a stability control module, an interpretation and display module, and a prediction service interface module.