Search

CN-121981830-A - Stock price rolling prediction method with error feedback alternate optimization

CN121981830ACN 121981830 ACN121981830 ACN 121981830ACN-121981830-A

Abstract

The invention discloses a stock price rolling prediction method with error feedback alternating optimization, and belongs to the technical field of computer data processing and artificial intelligence time sequence prediction. S1, dividing a sliding window, namely inputting stock price data The method comprises the steps of (1) dividing the data into a plurality of continuous sliding windows according to a mode of training data, verification data and test data, setting the total length and the sliding step length of the windows, calculating the number of the windows according to the total length and the length of the windows, S2 preprocessing the windows, namely extracting the data of each window, and obtaining stabilized data through ADF (automatic frequency filter) verification and stabilization after differential processing. Breaks through the limitation of unidirectional information transmission of the traditional mixed model, and injects the prediction error of LSTM as exogenous correction term into ARIMA model through reverse coupling to form information closed loop of linear and nonlinear branches. The design effectively relieves the inflection point of stock price, error accumulation and systematic hysteresis in the severe fluctuation stage.

Inventors

  • LIU GAOFENG

Assignees

  • 乐山师范学院

Dates

Publication Date
20260505
Application Date
20260203

Claims (9)

  1. 1. The stock price rolling prediction method for error feedback alternate optimization is characterized by comprising the following steps of: s1, sliding window segmentation, namely inputting stock price data Dividing the model into a plurality of continuous sliding windows according to the modes of training data, verification data and test data, setting the total length of the windows and the sliding step length, and calculating the number of the windows according to the total length of the data and the length of the windows; S2, window preprocessing, namely extracting data of each window, and verifying stability through ADF (automatic frequency correction) inspection after differential processing to obtain stabilized data; s3, initializing ARIMA, namely determining the optimal order of an ARIMA model based on an information criterion, and estimating parameters by adopting a maximum likelihood estimation method to obtain a one-step predicted value and an initial predicted error; s4, forward coupling, namely constructing an LSTM input sequence containing a stabilized data history window, an ARIMA residual history window and auxiliary features, and inputting the LSTM input sequence into a network to obtain a one-step predicted value and a predicted error; s5, reverse coupling, namely constructing a reverse coupling characteristic containing the history window and the LSTM prediction error, injecting an ARIMA model for reconstruction, and obtaining a corrected prediction value and a feedback error; S6, defining a joint loss function of weighted summation of two branch errors, fixing one model parameter to update the other model parameter, including feedback weight containing ARIMA, and realizing alternative optimization; S7, convergence judgment, namely repeating the steps S3-S6 until the difference value before and after the joint loss function is smaller than a convergence threshold or reaches an iteration upper limit, and storing the optimal ARIMA and LSTM parameters; S8, fusion prediction, namely determining fusion weights by adopting a one-dimensional golden section method based on verification section data, and outputting two weighted fusion model predicted values serving as test sections; s9, judging the sliding window, namely outputting all predicted values if the window is the last window, otherwise, returning the sliding window to the step S2 and repeatedly executing; S10, outputting a stock price predicted value.
  2. 2. The method for rolling stock price prediction based on error feedback alternative optimization as set forth in claim 1, wherein in step S2, current window data is proposed for data in the sliding window: Wherein T is the data length, W is the sliding window size, R is the number of windows for the current window data; differential processing, ADF test, until the data is stable: Wherein, the For the data after the differential processing, Is the differential order.
  3. 3. The method for rolling stock price prediction based on error feedback alternative optimization as set forth in claim 2, wherein in step S3, the difference processed data is processed Order selection, determining optimal order with AIC ARIMA parameter estimation, using maximum likelihood estimation MLE: ARIMA model prediction: Wherein, the For the prediction value of the ARIMA model, Calculating ARIMA prediction error: Wherein, the Initial prediction error for ARIMA.
  4. 4. The method for rolling stock price prediction based on error feedback alternative optimization of claim 3, wherein in step S4, the current window data is: (1) (2) Forward coupled input feature construction: Wherein, the As an input feature of the forward coupling, In order to receive the disc price history window, A history window for ARIMA residual errors; is an auxiliary characteristic, namely the fluctuation rate and the volume of traffic; LSTM prediction: Wherein, the Is an LSTM predicted value; LSTM loss function MSE: Is an LSTM loss function; Calculating LSTM prediction error: Wherein, the Is LSTM prediction error.
  5. 5. The method for rolling stock price prediction based on error feedback alternative optimization of claim 4, wherein in step S5, based on LSTM error in current window, reverse coupled input features are constructed: Wherein, the As an input feature of the reverse coupling, Adding an LSTM residual feedback term to reconstruct an ARIMA model: Wherein the method comprises the steps of Using maximum likelihood estimation parameters Calculating feedback ARIMA model errors:
  6. 6. the method for rolling stock price prediction based on error feedback alternative optimization of claim 5, wherein in step S6, joint mixing loss function is defined as follows: Wherein, equal weight is taken Is a joint mixing loss function; joint loss update ARIMA and feedback parameters: fix LSTM parameters to update ARIMA parameters: Wherein, the For ARIMA parameters to be updated LSTM itself loses updated LSTM parameters: Fixing ARIMA parameters to update LSTM parameters:
  7. 7. The method for rolling stock price prediction based on error feedback alternative optimization as set forth in claim 6, wherein in the step S7, the steps S3 to S5 are repeated until convergence, and the convergence criterion is as follows: Wherein, the Is the convergence threshold. After the internal training of the current window is completed, recording and storing the optimal parameters of the current window, namely ARIMA parameters to be updated LSTM parameters
  8. 8. The method for rolling stock price prediction based on error feedback alternative optimization as set forth in claim 7, wherein in step S8, the next time point is predicted Wherein, the Determination of stock price for fusion prediction using one-dimensional golden section Is a weight value of (a).
  9. 9. The method for rolling stock price prediction based on error feedback alternate optimization as set forth in claim 8, wherein in step S9, it is determined whether the current window is the last window, if yes, the process goes to step S10, and the stock price predicted value is outputted If not, the process goes to step S1.

Description

Stock price rolling prediction method with error feedback alternate optimization Technical Field The invention relates to the technical field of computer data processing and artificial intelligence time sequence prediction, in particular to a stock price rolling prediction method with error feedback alternate optimization. Background Stock price prediction is an important fundamental task to quantify investment, risk management and market supervision. Along with the progress of information technology and the acceleration of financial globalization, the stock market trading frequency is continuously improved, the participation subject is more diversified, and the price forming mechanism is simultaneously under the combined action of multiple factors such as macroscopic policies, industrial period, company basic surface, market emotion and the like, and has the characteristics of obvious nonlinearity, strong noise, sudden jump and the like. The method has the advantages that future price levels or short-term trends are predicted more accurately, fund allocation efficiency is improved, decision uncertainty is reduced, risk early warning and pressure testing capability is enhanced, and reliable data support is provided for institutions to develop bin management, hedging arrangement and mobility management. Meanwhile, the supervision department can also identify abnormal fluctuation and potential systematic risks based on the prediction result and the scene analysis, so that the market operation stability is maintained. Therefore, under the scene of daily frequency or even higher frequency, a prediction method which can be updated in a rolling way, has a certain interpretability and has stable generalization capability is constructed, and sustainable deployment is realized in a real transaction calendar, so that the method has important engineering value and practical significance. The existing research mainly comprises three categories, namely a statistical time sequence model represented by AR, ARMA, ARIMA, GARCH and the like, which can better describe short-term linear dependence and fluctuation aggregation, but usually depends on stationarity assumption and relatively fixed structure setting, response lag and systematic deviation are easy to occur when structure mutation, strong nonlinearity and noise disturbance are obvious, a machine learning and deep learning method, such as SVM, random forest, RNN, GRU, LSTM, CNN, attention model and the like, has the capability of extracting nonlinear relation and long-range dependence from multidimensional features, is easier to fit under the conditions of financial sequence distribution drift, fluctuation peak and sample noise enhancement, is sensitive to training/verification division, super-parameters and data preprocessing flow, and a mixed model, which is common practice of firstly extracting a linear part or residual error by ARIMA, then fitting nonlinear remainder by LSTM and outputting prediction, or carrying out weighted fusion on the results of the two, and evaluating in a rolling window or stepping back test. Although the method has a certain progress, three aspects of the method still generally have the problems that in real rolling deployment, information interaction is mostly unidirectional transmission (for example, linear residual information is only input into a nonlinear branch), the linear branch lacks error feedback correction from the nonlinear branch and is prone to error accumulation and deviation amplification in inflection points and severe fluctuation stages, the linear branch and the nonlinear branch are prone to independent training under different objective functions and updating mechanisms and lack uniform constraint and coordinated updating, parameter drift and target inconsistency are prone to occur in the rolling iteration process, prediction stability is reduced, and third, a multi-model output fusion strategy usually adopts fixed weight or offline parameter adjustment, and is difficult to adaptively adjust based on verification information along with market state changes, and robustness is poor in different fluctuation and structure stages. Disclosure of Invention The invention aims to provide a stock price rolling prediction method with error feedback alternating optimization, which can solve the problems of insufficient robustness caused by error accumulation, parameter drift caused by independent training of linear and nonlinear branches and prediction stability reduction due to information interaction unidirectional, and lack of market state self-adaptive adjustment of a multi-model output fusion strategy in the prior art. According to one aspect of the invention, the technical scheme is that the stock price rolling prediction method with error feedback alternating optimization specifically comprises the following steps: s1, sliding window segmentation, namely inputting stock price data Dividing the model into a plurality of conti