Multi-factor analysis system and method suitable for stock market and medium

By designing a multi-factor analysis system suitable for the stock market, the existing tools failed to fully consider the market particularity and low data processing efficiency, and achieved efficient, flexible and scalable multi-factor analysis to adapt to the rapidly changing market environment.

CN119398929AInactive Publication Date: 2025-02-07SHANGHAI GREAT WISDOM
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510000481.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-02-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing multi-factor analysis tools fail to fully consider the particularity of the stock market, resulting in a lack of targeted factor design, low data processing efficiency, and difficulty in adapting to the rapidly changing market environment.

Method used

A multi-factor analysis system suitable for the stock market is designed, including data integration module, factor analysis module and backtest module. The system uses a built-in factor library and distributed computing architecture to perform factor analysis and dynamic adjustments to meet the specific needs of the stock market.

Benefits of technology

The practicality and calculation rate of the multi-factor analysis system in the stock market is improved, the factor design can be dynamically adjusted to adapt to market changes, and the efficiency and accuracy of quantitative investment analysis is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398929A_ABST
    Figure CN119398929A_ABST
Patent Text Reader

Abstract

The invention provides a multi-factor analysis system and method suitable for stock markets and a medium, and the system comprises a data integration module which obtains original financial data, and carries out the preprocessing of the original financial data; the factor analysis module is used for performing factor analysis on the preprocessed financial data through a built-in factor library and a factor calculation engine to obtain an analysis result; the factor analysis comprises single factor analysis, multi-factor analysis and attribution analysis; the factor library is dynamically set based on stock markets; and the factor calculation adopts a distributed calculation architecture. According to the system, the factor library and the factor calculation engines are set according to stock market rules, the practicability of the analysis system in the stock market is improved, the factor calculation engines are set in parallel, the calculation rate is greatly increased, factor design is dynamically adjusted according to market conditions, and it is guaranteed that the multi-factor analysis system can adapt to the rapidly-changing market conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial data fusion, and in particular to a multi-factor analysis system, method and medium suitable for the stock market. Background Art

[0002] With the development of financial markets, multi-factor analysis plays an increasingly important role in quantitative investment. However, existing multi-factor analysis tools often lack in-depth consideration of the characteristics of specific stock markets and are difficult to meet the specific needs of investors. In addition, the efficiency of data integration, factor calculation and risk management needs to be improved. The main problems of the analysis tools currently on the market are as follows: Existing analysis tools have the following problems: 1. They do not fully consider the particularities of specific stock markets, such as price limits, suspensions and other trading rules. 2. Factor design lacks specificity and it is difficult to capture the unique characteristics of specific stock markets. 3. Data processing and calculation efficiency are low, making it difficult to meet the needs of large-scale factor analysis. 4. There is a lack of dynamic adjustment mechanism, making it difficult to adapt to the rapidly changing market environment. Summary of the invention

[0003] In view of the defects in the prior art, the object of the present invention is to provide a multi-factor analysis system and method suitable for the stock market.

[0004] A multi-factor analysis system applicable to the stock market provided by the present invention comprises: Data integration module: obtains original financial data and pre-processes the original financial data; Factor analysis module: Through the built-in factor library and factor calculation engine, factor analysis is performed on the pre-processed financial data to obtain analysis results; The factor analysis includes single factor analysis, multi-factor analysis and attribution analysis; the factor library is dynamically set based on the stock market; and the factor calculation adopts a distributed computing architecture.

[0005] Preferably, the built-in factor library includes: valuation factors, growth factors, quality factors, momentum factors, risk factors, trading factors and custom factors; Select factors that are in line with the current stock market from the factor library to obtain an optimized factor library, and use the optimized factor library to perform factor analysis; The momentum factor includes a price momentum factor and a trading volume momentum factor; the price momentum factor and the trading volume momentum factor are parameterized according to the price and trading volume restrictions imposed by the stock market price limits; The factor calculation engine adopts a distributed computing framework and uses parallel computing when calculating factors.

[0006] Preferably, the multi-factor analysis is implemented by constructing a multi-factor analysis model; the construction of the multi-factor model includes: Step S3.1: Use the regression model to screen factors associated with the analysis results from the factor library; Step S3.2: Generate multiple factor combinations from the screened factors, screen out the factor combination with the highest performance, and use the XGBoost algorithm to build a nonlinear multi-factor model for the combination; Step S3.3: Use the Shapley value method to analyze the factor contribution of the selected factor combinations; Step S3.4: Based on the Shapley values ​​of the factors, dynamically adjust the factor weights using a rolling window.

[0007] Preferably, the step S3.1 comprises: Step S3.1.1: Obtain all associated factor data and target variables to obtain a data set, and preprocess the data set; Step S3.1.2: Divide the data set into training set and test set in chronological order; Step S3.1.3: Set up the Lasso model, fit the Lasso model using the test set, calculate the correlation coefficients of the factors using the fitted Lasso model, compress the coefficients of unimportant factors to 0, and predict the selected factors on the test set to evaluate the model performance; Step S3.1.4: Run the Lasso model multiple times and count the frequency of each factor correlation coefficient being non-zero; Step S3.1.5: Set a threshold according to the frequency at which the factor is selected, retain the factors that exceed the threshold, and obtain the factors associated with the analysis results.

[0008] Preferably, in step S3.2, the factor combination screening method adopts any one of the following schemes: Solution 1: Start with an empty model and add a factor with the highest correlation coefficient with the target variable each time. Repeat this process until the model performance is no longer significantly improved or the preset number of factors is reached. Solution 2: Start with a model that includes all factors, and remove the factors that contribute the least to the model one at a time. Repeat this process until the model performance begins to decline significantly or the preset number of factors is reached. Solution 3: Encode each factor combination as a "chromosome", generate new factor combinations through crossover and mutation operations, evaluate each combination using the fitness function, iterate and optimize, and finally select the factor combination with the highest fitness; Solution 4: Build multiple sub-models, each using a different combination of factors, integrate the prediction results of the sub-models by voting, averaging, or stacking, and select the factor combination with the best integration effect; Solution 5: Calculate the AIC or BIC of the model corresponding to each factor combination, and select the model with the smallest AIC or BIC; Solution 6: Repeat the factor selection process on a subsample of the data, count the frequency with which each factor is selected, and select factor combinations whose frequency exceeds a certain threshold.

[0009] Preferably, the step S3.3 comprises: Step S3.3.1: Determine all possible feature combinations. For n factors, there are 2 n Different combinations of factors; Step S3.3.2: For each factor i and each factor combination S, calculate the marginal contribution of factor i to S; Step S3.3.3: Calculate the contribution Shapley value of each factor:

[0010] Where: N is the set of all features, S is the subset that does not contain feature i, n is the total number of features, and f(S) represents the output value of the model when given the feature set S; Step S3.3.4: Calculate the Shapley value of the contribution of the factors in the feature combination by using an approximate algorithm; Step S3.3.5: Calculate the mean absolute Shapley value for each feature.

[0011] Preferably, the step S3.4 comprises: Step S3.4.1: Set initial parameters, including the size of the rolling window, the update frequency, the initial factor set and the initial weight; wherein the initial factor set is the factor set obtained in step S3.2; and the initial weight is the Shapley value of each factor; Step S3.4.2: Collect historical data of all relevant factors and target variables, and train the model using the data within the initial rolling window; Step S3.4.3: Dynamically select part of the factor data and the target variable according to the rolling window to train the regression model and calculate the weight of the factor; Step S3.4.4: Adjust the multifactor analysis model according to the new factor weights.

[0012] Preferably, it also includes a backtesting module: the backtesting module obtains the backtesting period, stock selection strategy and position adjustment frequency input by the user, and outputs financial backtesting results based on the transaction costs, price limits and suspension rules of the stock market, including the yield curve, transaction record table and position change chart, as well as output performance evaluation indicators, including: annualized rate of return, maximum drawdown rate, Sharpe ratio and information ratio.

[0013] A multi-factor analysis method applicable to the stock market provided by the present invention comprises: Step A1: Obtaining original financial data online through the API module and preprocessing the original financial data; Step A2: Perform factor analysis on the preprocessed financial data through the built-in factor library and factor calculation engine; the factor analysis includes single factor analysis, multi-factor analysis and attribution analysis; the factor library is dynamically set based on the stock market; the factor calculation adopts a distributed computing architecture.

[0014] According to a computer-readable storage medium storing a computer program provided by the present invention, when the computer program is executed by a processor, the steps of the multi-factor analysis method applicable to the stock market are implemented.

[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The factor library and factor calculation engine set up according to the stock market rules of the present invention improve the practicality of the analysis system in the stock market. The factor calculation engine adopts a parallel setting, which greatly improves the calculation rate. The factor design is dynamically adjusted according to the market situation, ensuring that the multi-factor analysis system can adapt to the rapidly changing market situation.

[0016] 2. The multi-factor analysis system disclosed in the present invention is efficient, comprehensive, flexible and scalable. By integrating multi-source data, realizing efficient factor calculation and analysis, providing a backtesting module that takes into account the characteristics of A-shares, and comprehensive risk management functions, this system can significantly improve the efficiency and accuracy of quantitative investment analysis.

[0017] 3. The multi-factor model disclosed in the present invention better adapts to the rapid changes in the stock market, captures market rotation and style conversion, and maintains the stability and reliability of the model. This method not only takes into account data-driven objective analysis, but also incorporates a deep understanding of the particularity of the stock market, and can provide investors with more intelligent and adaptable decision support. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1It is the overall architecture diagram of the system in the present invention; Figure 2 It is a flow chart of the data integration and preprocessing module in the present invention; Figure 3 It is a working principle diagram of the factor calculation engine in the present invention; Figure 4 A flowchart for constructing a multi-factor model in the present invention; Figure 5 This is a schematic diagram of the interface of the backtest module in the present invention; Figure 6 is a workflow diagram of the risk management module in the present invention; Figure 7 This is an example diagram of the visualization module in the present invention. DETAILED DESCRIPTION

[0019] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0020] The present invention discloses a multi-factor analysis system suitable for the stock market, referring to Figure 1 As shown, it includes: a data integration module, a factor library and a calculation engine, a factor analysis module, a backtesting module, a risk management module and a visualization module; the original financial data is obtained online through the data integration module, and the original financial data is preprocessed; the corresponding factors are selected from the factor library, and the processed data is subjected to factor analysis, including single factor analysis and multi-factor analysis, etc., financial backtesting is performed through the backtesting module, and the risks in the decision-making are predicted through the risk management module, and finally the factor analysis results and backtesting data are output to the visualization management module.

[0021] Data integration module: obtain various original financial data and pre-process the original financial data.

[0022] Specifically, refer to Figure 2 As shown in the figure, the data integration module obtains various data from authorized data providers through API interfaces, including market data, financial data, company information, news information, macro data and other multi-source data, such as daily K-line, minute K-line, financial statement data, company announcements, etc. The original financial data is pre-processed, including cleaning and standardization, and then stored in the system database after processing.

[0023] In terms of data sources, we optimized data connection with domestic financial data providers, improved the relevance of data to the domestic stock market, and developed a natural language processing module for Chinese announcements and news to extract text factors.

[0024] In a specific implementation, the preprocessing process of the raw data includes: Step S1.1: Obtain raw financial data through the RESTful API interface.

[0025] Step S1.2: Use Python’s pandas library to clean the data and detect and process outliers, including processing missing values ​​and deleting duplicate data.

[0026] Step S1.3: Use the Zscore method to normalize the data.

[0027] Step S1.4: Use MinMax scaling method to normalize the data.

[0028] Step S1.5: Store the processed data into the PostgreSQL database.

[0029] Factor library and calculation engine: Through the built-in factor library and factor calculation engine, factor analysis is performed on the pre-processed financial data to obtain analysis results.

[0030] The built-in factor library contains the following categories of factors: Valuation factors: including price-to-earnings ratio (PE), price-to-book ratio (PB), price-to-sales ratio (PS), etc. Growth factors: including revenue growth rate, net profit growth rate, etc.; Quality factors: including return on equity (ROE), return on assets (ROA), asset turnover, etc.; Momentum factor: price momentum and volume momentum taking into account price limits; Risk factors: including volatility, Beta, etc.

[0031] Reference Figure 3 As shown in the figure, the built-in factor calculation engine uses the Apache Spark distributed computing framework to achieve efficient factor parallel calculation.

[0032] The factor library in the present invention is specially optimized for a specific stock market, so that the analysis results can more accurately capture the unique characteristics and investment opportunities of the specific stock market, and provide more effective decision support for investors. This embodiment takes the A-share market as an example, and specifically optimizes the design of the factor library according to the characteristics of the A-share market. The specific optimization method is as follows: In the design of the factor library, equity structure factors, market sentiment factors and policy sensitivity factors were designed; the equity structure factor takes into account the impact of the proportion of state-owned shares and legal person shares unique to the A-share market, as well as the type of actual controller on company performance; the market sentiment factor integrates A-share unique market sentiment indicators such as margin trading data and northbound capital flows; the policy sensitivity factor reflects the company's sensitivity to China's unique industrial policies and regulatory changes.

[0033] In terms of adaptation of trading mechanisms, the T+1 trading restriction of A-shares is taken into account in the factor calculation and backtesting modules, and the impact of price limits on factor calculation and trading strategies is increased; in view of the frequent suspension of A-shares, data filling and factor adjustment mechanisms are developed.

[0034] In terms of financial data processing, in order to adapt to the A-share quarterly financial report disclosure system, a rolling financial factor calculation method was designed, and localized adjustments were made to financial ratios and indicators.

[0035] In terms of market classification, we have designed differentiated factor weight systems for different sectors, such as the main board, the Science and Technology Innovation Board, and the ChiNext Board. For companies listed on both A-shares and H-shares, we have developed cross-market linkage factors.

[0036] In terms of high-frequency data utilization, the unique call auction mechanism of A-shares was used to construct a pre-market forecasting factor. Based on the order book characteristics of the A-share stock market, a short-term factor reflecting the market microstructure was designed.

[0037] In terms of industry classification standards, the China Securities Regulatory Commission or Shenwan Industry Classification Standards are adopted to ensure the accuracy of industry factors. An industry rotation factor based on China's industrial policy orientation is constructed.

[0038] In terms of macroeconomic linkage, we integrated macroeconomic factors that reflect the characteristics of China's economic cycle, such as PMI and social financing scale, and designed a sensitivity factor to measure companies' response to the monetary policy of the People's Bank of China.

[0039] In the treatment of new stocks and special stocks, the design takes into account the characteristics of frequent listing and large fluctuations of new A-shares, and designs corresponding factor adjustment mechanisms. Special risk factors are designed for special treatment (ST) and delisting risk warning (*ST) stocks. Taking into account the characteristics of frequent listing and large fluctuations of new A-shares, a corresponding factor adjustment mechanism is designed.

[0040] In a specific implementation, the unique characteristics of the A-share market are fully considered for the momentum factor, including the impact of price limits on prices and trading volumes. The momentum factors for the A-share market include: price momentum factor, trading volume momentum factor, and comprehensive momentum factor.

[0041] Price Momentum Factor: Price limit adjustment: When a stock hits the price limit, we consider the unfilled order volume to estimate the potential price movement. For example, for a stock that has been hitting the price limit continuously, we estimate the potential momentum beyond the price limit based on the buy order volume on the price limit board.

[0042] Continuous price limit processing; consider the number of consecutive price limit days and daily limit time to more accurately reflect price momentum. For stocks that resume trading after a long suspension, estimate the potential price changes during the suspension period to maintain the continuity of the momentum factor.

[0043] Price momentum smoothing: Considering the high volatility of A-shares, we use an adaptive time window to calculate price momentum and dynamically adjust weights under different market conditions.

[0044] Volume Momentum Factor: Volume adjustment for price limits: When calculating volume momentum, we take into account the special circumstances of price limits. For example, for price limit down stocks, we consider the accumulation of sell orders to estimate the potential selling pressure.

[0045] Consider turnover rate limits; the A-share stock market has a daily turnover rate limit of no more than 30%. This limit will be taken into account when calculating volume momentum to avoid overestimating the momentum of high turnover rate stocks.

[0046] Differentiation between large and small-cap stocks: Considering the high volatility of small-cap stocks in the A-share market, we use different volume momentum calculation methods for large and small-cap stocks. For small-cap stocks, we increase the sensitivity to abnormally large volumes to capture possible information leaks or major events.

[0047] Composite Momentum Factor: Price-volume linkage; a combined momentum factor of price and volume was developed, with special consideration given to the common "rising price and volume" and "divergence between price and volume" phenomena in A-shares.

[0048] Market sentiment integration: Integrate A-share-specific market sentiment indicators such as northbound capital flows and margin trading data into the momentum factor to improve the factor's predictive power.

[0049] Sector rotation adaptation; considering the obvious sector rotation characteristics of the A-share stock market, we designed a combination factor that considers industry momentum to capture the opportunities brought by industry rotation.

[0050] Users can customize factors through the graphical interface or Python API. The steps to implement custom factors include: Step S2.1: Define the factor calculation formula.

[0051] Step S2.2: Select the required data input.

[0052] Step S2.3: Set the factor update frequency.

[0053] Step S2.4: The system automatically generates factor calculation code and deploys it to the computing engine.

[0054] Factor analysis module: Through the built-in factor library and factor calculation engine, factor analysis is performed on the pre-processed financial data to obtain analysis results. Factor analysis includes: single factor analysis, multi-factor analysis and attribution analysis.

[0055] Single factor analysis includes IC analysis, return analysis and turnover rate analysis.

[0056] Multi-factor analysis obtains a multi-factor model through factor screening and combination optimization. The multi-factor model is used for analysis. Specifically, refer to Figure 4 As shown in Figure 2, the generation method of the multi-factor model includes: Step S3.1: Use Lasso regression for preliminary factor screening; Select the most relevant and effective factors from a large number of possible factors to avoid redundancy and invalid information. And find the optimal factor combination to achieve the greatest explanatory power and predictive ability with the minimum number of factors.

[0057] Step S3.2: Use XGBoost algorithm to build a nonlinear multi-factor model.

[0058] The factors screened by the Lasso model are combined to generate multiple factor combinations. The model that best meets the requirements is screened through factor combinations, and the XGBoost algorithm is used to construct a nonlinear multi-factor model for the combination. Step S3.3: Use the Shapley value method to perform factor contribution analysis; Step S3.4: Dynamic factor weight adjustment based on rolling window: By dynamically adjusting the factor weights, the model can adapt to different market stages and styles.

[0059] In a specific implementation, the process of using Lasso regression to perform preliminary factor screening in step S3.1 is as follows: Step S3.1.1: Data preparation: Collect all possible factor data and target variables (such as stock returns), and preprocess the data, including handling missing values, standardization / normalization, etc.

[0060] Step S3.1.2: Divide the data set into training set and test set: Divide the data set into training set and test set in chronological order, usually using the earlier data as the training set. The data set here includes factor data and target variables.

[0061] Step S3.1.3: Set up the Lasso model: Use cross validation to select the optimal regularization parameter λ. This process can be automated using tools such as scikit-learn's LassoCV class.

[0062] Step S3.1.4: Train Lasso model: Fit the Lasso model using the training set data.

[0063] Specifically, the fitting process includes: standardizing the training set data to make the scales of each factor consistent, setting the regularization parameter α, and selecting the optimal α value through methods such as cross-validation; constructing the objective function, combining the least squares error term and the L1 regularization term; using algorithms such as the coordinate descent method to iteratively optimize the objective function and obtain the coefficients of each factor. The fitted Lasso model can automatically perform feature selection and compress the coefficients of unimportant factors to 0.

[0064] Step S3.1.5: Factor screening: Lasso will automatically compress the coefficients of unimportant factors to 0.

[0065] Step S3.1.6: Evaluate the screening results: Use the screened factors to make predictions on the test set to evaluate the model performance; indicators such as mean square error (MSE) or R square value can be used for evaluation.

[0066] Step S3.1.7: Stability test: Use methods such as Bootstrap Lasso to assess the stability of factor selection. Run Lasso multiple times and count the frequency with which each factor is selected.

[0067] Step S3.1.8: Setting a threshold: A threshold is set according to the frequency at which the factor is selected, and factors with a frequency exceeding the threshold are retained as preliminary screening results. For example, factors with a selection frequency exceeding 50% are retained.

[0068] Step S3.1.9: Interpretation of results: Analyze the selected factors to understand their impact on the target variable.

[0069] In a specific embodiment, the factor combination screening method in step S3.2 adopts any one of the following schemes: Option 1: Forward stepwise selection method; start with an empty model, add one factor each time that best improves model performance, and repeat this process until model performance no longer improves significantly or reaches the preset number of factors.

[0070] Specifically, model performance needs to be comprehensively evaluated by considering multiple aspects, including: Statistical significance indicators; including: R-squared, adjusted R-squared, F statistic, t statistic. R-squared measures the degree to which the model explains the variability of the target variable, and a higher R-squared indicates a better fit; adjusted R-squared is a version of R² that takes into account model complexity, the F statistic evaluates the significance of the entire model, and the t statistic evaluates the significance of a single factor.

[0071] Forecast accuracy indicators include: mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), and information coefficient (IC). The information coefficient (IC) represents the correlation between the factor value and the future rate of return.

[0072] Investment performance indicators include: Sharpe Ratio, Information Ratio, Maximum Drawdown, and Win Rate. The Sharpe Ratio is calculated as (portfolio return - risk-free rate) / portfolio standard deviation; the Information Ratio is calculated as (portfolio excess return / tracking error); the Maximum Drawdown is calculated as the maximum percentage drop in portfolio value from peak to valley; the Win Rate is calculated as the proportion of the number of correct predictions made by the model to the total number of predictions.

[0073] Stability indicators include: 1. Stability of factor exposure: Calculate the autocorrelation of factor exposure over time; 2. Turnover rate: The degree of change in the portfolio recommended by the model. 3. Time series of t-statistics of factor returns: Observe the persistence of factor significance.

[0074] Cross-validation performance; including: 1. K-fold cross-validation: Divide the data into K parts, and use K-1 parts for training and 1 part for validation in turn. Calculate the average performance index. 2. Time series cross-validation: Use the rolling window method to simulate the actual prediction scenario.

[0075] Specific indicators of multi-factor models; including: 1. Factor contribution: the contribution of each factor to the overall model performance. 2. Correlation between factors: evaluate the independence between factors.

[0076] Robustness testing; including: 1. Out-of-sample testing: evaluating model performance on a completely independent test set. 2. Performance in different market environments: bull market, bear market, volatile market, etc.

[0077] Computational efficiency indicators; including: 1. Computational time: the time required for model training and prediction. 2. Memory usage: the computing resources required to run the model.

[0078] In the forward stepwise selection method, you can choose one or more of the above indicators as the main performance measure. For example, you can use the adjusted R-squared as the main indicator and monitor the information ratio and factor significance at the same time. After each factor is added, if the adjusted R-squared increases significantly (a threshold can be set) and the new factor is statistically significant, then the factor is retained. The specific steps may be as follows: Step 1. Start with an empty model.

[0079] Step 2: For each candidate factor: -Adds a factor to the current model.

[0080] - Calculate the adjusted R-squared, factorial t-statistics, and information ratio for the new model.

[0081] -If the adjusted R-squared improvement exceeds a preset threshold (such as 0.5%) and the factor t statistic is significant (such as |t|>2), the factor is retained.

[0082] Step 3: Select the factor with the greatest performance improvement from all candidate factors and add it to the model.

[0083] Step 4: Repeat steps 2-3 until no factor can significantly improve model performance or the preset number of factors is reached.

[0084] Step 5: Verify the performance of the final model on an independent test set.

[0085] This approach takes into account both statistical significance and actual investment performance, and helps to build a factor model that has both statistical basis and practical application value. At the same time, by monitoring multiple indicators, it is possible to more comprehensively evaluate all aspects of the model and avoid overfitting or selecting biased factor combinations.

[0086] Option 2: Backward stepwise elimination method; starting from a model containing all factors, remove the factors that contribute the least to the model one at a time, and repeat this process until the model performance begins to decline significantly or the preset number of factors is reached.

[0087] Solution 3: Genetic algorithm; encode each factor combination as a "chromosome", generate new factor combinations through operations such as crossover and mutation, use fitness function (such as model performance index) to evaluate each combination, iterate and optimize, and finally select the factor combination with the highest fitness.

[0088] Specifically: Genetic algorithm is a powerful optimization method, especially suitable for complex factor selection problems. Here is an explanation of how to use genetic algorithm for factor combination screening: 1. Encoding: -Represent each factor as a gene.

[0089] -A complete combination of factors is encoded as a "chromosome".

[0090] -For example, for 10 candidate factors, they can be represented by a 10-bit binary string, where 1 represents selected and 0 represents unselected.

[0091] -Chromosome example: [1,0,1,1,0,0,1,0,1,0] means the 1st, 3rd, 4th, 7th, and 9th factors are selected.

[0092] 2. Initialize the population (PopulationInitialization): - Randomly generate a certain number (e.g. 100) of chromosomes to form an initial population.

[0093] - Ensure that the initial population is diverse and covers different factor combinations.

[0094] 3. Fitness Function: -Define a function to evaluate the "fitness" of each chromosome (factor combination).

[0095] -A weighted sum of multiple model performance metrics can be used, for example: Fitness = w1*Adjusted R-squared + w2*Information Ratio - w3*RMSE -Where w1,w2,w3 are weights and can be adjusted based on importance.

[0096] 4. Selection: -Select excellent individuals for reproduction based on fitness.

[0097] - Common methods include: a) Roulette wheel selection: The probability of selection is proportional to the fitness.

[0098] b) Tournament selection: Randomly select several individuals and take the best one.

[0099] 5. Crossover: -Simulate the genetic recombination process of organisms.

[0100] -method: a) Single-point crossover: A crossover point is randomly selected and the genes of the two fathers after that point are exchanged.

[0101] b)Multi-point intersection: Select multiple intersection points.

[0102] c) Uniform crossover: For each gene position, randomly decide which parent the offspring will inherit from.

[0103] 6. Mutation: - Randomly change certain genes to increase population diversity.

[0104] - For example, flipping the 0 / 1 state of some bits with a small probability (like 1%).

[0105] 7. Elitism: -Directly pass a small number of best individuals to the next generation to ensure that the best solution is not lost.

[0106] 8. Iterative optimization: - Repeat steps 4-7 to generate a new generation of population.

[0107] - Typically hundreds or thousands of iterations are performed.

[0108] 9. Termination conditions: -The preset number of iterations is reached.

[0109] - The best fitness does not improve significantly over consecutive generations.

[0110] - The preset time limit is reached.

[0111] 10. Result analysis: -Select the individual with the highest fitness in the final population as the optimal factor combination.

[0112] -Analyze the characteristics of this combination to understand which factors are frequently selected.

[0113] 11. Verification: -Verify the performance of the best combination on an independent test set.

[0114] 12. Parameter tuning: -Parameters such as population size, crossover rate, and mutation rate will affect the performance of the algorithm.

[0115] -These hyperparameters can be optimized using grid search or other methods.

[0116] 13. Constraint processing: - Constraints can be added, such as limiting the number of factors to be selected.

[0117] -Processing method: a) Penalty function: The fitness of individuals that violate the constraints is reduced.

[0118] b) Repair operation: modify the illegal chromosome to a legal state.

[0119] 14. Multi-objective optimization: -If there are multiple objectives that cannot be directly combined (such as rate of return and risk), a multi-objective genetic algorithm can be used.

[0120] -This will produce a sequence of Pareto optimal solutions rather than a single optimal solution.

[0121] 15. Dynamic Adaptation: - Considering the changes in factor effects over time, dynamically adaptive genetic algorithms can be designed.

[0122] - For example, regularly re-evaluate and update the factor pool.

[0123] 16. Ensemble methods: -Not only select a single optimal combination, but also select multiple excellent combinations to form an integrated model.

[0124] -This can improve the stability and robustness of the model.

[0125] 17. Interpretability Analysis: -Analyze the frequency with which factors are selected during the algorithm run.

[0126] -Study the characteristics of different factor combinations and understand why they perform well.

[0127] 18. Computational efficiency optimization: -Use parallel computing to speed up the operation of genetic algorithms.

[0128] -Enable incremental evaluation to avoid repeated calculations.

[0129] In this way, we can effectively find excellent solutions among a large number of possible factor combinations. The advantage of genetic algorithms is that they can handle nonlinear relationships, explore complex solution spaces, and are not prone to falling into local optimality.

[0130] Solution 4: Ensemble learning method; build multiple sub-models, each sub-model uses a different combination of factors, and integrates the prediction results of the sub-models using methods such as voting, averaging, or stacking, and selects the factor combination with the best integration effect.

[0131] Option 5: Information Criterion Method; calculate the AIC (Akaike Information Criterion) or BIC (Bayesian Information Criterion) of the model corresponding to each factor combination, and select the model with the smallest AIC or BIC.

[0132] Option 6: Stability selection; repeat the factor selection process on the data subsample, count the frequency of each factor being selected, and select factor combinations whose frequency exceeds a certain threshold.

[0133] In a specific implementation, when the Shapley value method is used to perform factor contribution analysis in step S3.3, the following steps are performed: Step S3.3.1: Determine all possible feature combinations: For n factors, there are 2 n different factor combinations (including the empty set and the full set).

[0134] Step S3.3.2: For each factor i and each factor combination S (where i is not in S), calculate the change in the model's prediction when factor i is added to S. This is called the marginal contribution of factor i to S.

[0135] Step S3.3.3: The Shapley value is calculated by calculating the weighted average of the marginal contributions of factor i under all factor combinations S. The weight depends on the size of the feature combination S, specifically, based on the number of combinations. , where s is the size of the factor combination S. Calculate the contribution Shapley value of each factor.

[0136]

[0137] Where: N is the set of all features, S is the subset that does not contain feature i, n is the total number of features, and f(S) represents the output value of the model when given the feature set S.

[0138] Step S3.3.4: Since computing all possible feature combinations is computationally very difficult, we usually use approximate methods such as Kernel SHAP, Tree SHAP (for tree models), or Deep SHAP (for deep learning models).

[0139] Step S3.3.5: Factor contribution analysis: Global importance: Calculate the average absolute Shapley value of each feature, which reflects the importance of the feature to the overall prediction. Local importance: For a single prediction sample, the Shapley value directly reflects the contribution of each feature to the prediction.

[0140] Step S3.3.6: Visualization: Summary Plot: shows the global importance of all features. Dependence Plot: shows how the Shapley value of a single feature changes with the feature value. Force Plot: shows the feature contribution of a single prediction.

[0141] Step S3.3.7: Interpret the results: A positive Shapley value indicates that the feature increases the predicted value, while a negative one decreases it. The absolute size of the Shapley value indicates the importance of the feature.

[0142] Step S3.3.8: Stability analysis: The Shapley value can be calculated repeatedly on different subsets of the data to assess the stability of the results.

[0143] Step S3.3.9: Time series considerations: For financial data, it may be necessary to consider the characteristics of time series, such as using a rolling window method to calculate the Shapley value.

[0144] Step S3.3.10: Combine domain knowledge: Combine the Shapley value analysis results with financial domain knowledge to explain the economic meaning of feature importance.

[0145] Through this process, we can get the contribution of each factor to the prediction results, including both the global importance ranking and the specific contribution to a single prediction. The advantage of this method is that it takes into account the interaction between features and can explain nonlinear models.

[0146] In a specific implementation, the adjustment method in step S3.4 is as follows: Step S3.4.1: Set initial parameters: determine the size of the rolling window (e.g., 250 trading days), determine the update frequency (e.g., weekly or monthly), and select the initial factor set and initial weights (which can be based on the previous Lasso regression and Shapley value analysis results).

[0147] Step S3.4.2: Data preparation: Collect historical data of all relevant factors and target variables (such as stock returns), and perform necessary preprocessing on the data (such as handling missing values, standardization, etc.).

[0148] Step S3.4.3: Initial model training: Train a model (such as a multi-factor model or a machine learning model) using the data within the initial rolling window.

[0149] Step S3.4.4: Rolling window movement: Move the rolling window forward according to the predetermined update frequency.

[0150] Step S3.4.5: Model retraining: Refit the multifactor analysis model using the data within the new rolling window.

[0151] For example, this year's model will typically include recent data, possibly covering part or all of last year, plus older historical data. Ideally, the training data should include different market cycles, and the window length can be adjusted according to market conditions to ensure that the model has "seen" a variety of market environments. Recent data can be given a higher weight to make the model more sensitive to current market conditions. For example, using an exponential weighting approach, the most recent data points have the highest weight and decrease over time.

[0152] In a preferred embodiment, in order to adapt to different market stages, shorter windows may be used for quick adaptation in volatile market stages; longer windows may be used to obtain more historical information in stable periods. Train different models for different market stages (such as high volatility / low volatility, bull / bear market), for example: use market status indicators to select or switch models. In different market stages, certain factors may be more effective, and a dynamic factor selection mechanism is implemented to adjust factor weights based on recent performance. Use online learning algorithms to allow models to be continuously updated as new data arrives, rather than completely retrained. Combine multiple models trained based on different time windows or market stages, and use weighted average or other integration techniques to synthesize the predictions of these models.

[0153] Step S3.4.6: Factor importance assessment: Perform factor importance assessment on the newly trained model. Methods such as Shapley value analysis and feature importance ranking can be used.

[0154] Step S3.4.7: Weight adjustment: Based on the new factor importance assessment results, adjust the factor weights. The following methods can be used: a) Linear adjustment: new weight = old weight * (1-α) + new importance * α, where α is the adjustment rate; b) Exponential smoothing: new weight = old weight * β + new importance * (1-β), where β is the smoothing coefficient; c) Ranking method: directly assign weights according to the new importance ranking.

[0155] Step S3.4.8: Factor screening: Set a threshold, eliminate factors with weights lower than this threshold, and consider introducing new potentially effective factors.

[0156] Step S3.4.9: Model evaluation: Use the adjusted factor weights to evaluate the model performance on the test set (data outside the rolling window). Indicators such as information ratio, Sharpe ratio, etc. can be used.

[0157] Step S3.4.10: Risk control: Monitor the magnitude of changes in factor weights to avoid over-adjustments, set upper and lower limits for weight changes, and ensure portfolio stability.

[0158] Step S3.4.11: Transaction cost considerations: Consider transaction costs when adjusting weights, and make adjustments only when the benefits of the adjustment outweigh the costs.

[0159] Step S3.4.12: Regular review: Regularly (e.g., quarterly) conduct a comprehensive review of the factor pool and adjust the strategy. The entire process may need to be adjusted based on significant changes in the market environment.

[0160] Step S3.4.13: Documentation: Record the reasons, processes, and results of each adjustment for subsequent analysis and optimization.

[0161] Step S3.4.14: Exception handling: Develop a plan to deal with extreme market conditions and how to adjust factor weights in special circumstances.

[0162] Step S3.4.15: Repeat process: Repeat steps S3.4.4-S3.4.14 to continue dynamic adjustments.

[0163] Through this process, we can achieve dynamic adjustment of factor weights, so that investment strategies can adapt to the ever-changing market environment. The advantage of this method is that it can capture the dynamic characteristics of the market and adjust the strategy in a timely manner, while maintaining a certain stability through some constraint mechanisms (such as smoothing coefficients, weight change restrictions, etc.).

[0164] In step S3.1, through strict statistical tests and cross-validation, factors with persistence and stability are screened out to reduce overfitting of historical data. Regularization or other constraints are introduced in the factor combination to balance the complexity and generalization ability of the model. The effectiveness of the factors is re-evaluated regularly, invalid factors are eliminated in time, and emerging effective factors are included. In a preferred embodiment, the constraint methods that can be used for factor combinations include: regularization (Lasso regression), regularization (ridge regression), elastic network (Elastic Net), group Lasso (Group Lasso), time decay regularization, constrained optimization, factor orthogonalization, cross-validation strategy, out-of-sample testing, stability selection (Stability Selection), adaptive Lasso, Bayesian regularization, integrated methods (using a combination of multiple models, such as Bagging or Random Forest), dynamic entry and exit strategies for factors, and multi-period optimization (considering the performance of factors on multiple time scales).

[0165] By combining these constraint methods, we can build a more robust and generalizable factor model, thereby achieving better performance in the financial market. At the same time, this method also helps us better understand the driving factors of the market and provide a more reliable basis for investment decisions.

[0166] In the process of factor screening, select factors with high data quality and strong reliability to reduce model errors caused by data problems. Select factors with low computational complexity and easy to update in real time to improve the operating efficiency of the model. Select factors that can represent different investment styles (such as value, growth, momentum, etc.) to balance different investment styles. Identify factors that may not have obvious effects alone, but have significant effects when combined with other factors. Through machine learning algorithms, discover and utilize nonlinear relationships and interactions between factors, so as to use the synergy between factors to bring additional excess returns. Select factors with clear economic meanings and logical foundations to enhance the interpretability of the model, build a factor combination with a clear structure and logical consistency, and facilitate the understanding and communication of investment decisions. Select factors that can capture different types of risks, such as systemic risk, liquidity risk, etc., and achieve effective control and balance of various risks by optimizing factor weights. Select factors that still have significant excess returns after considering transaction costs, add cost constraints to the factor combination, and balance the factor prediction ability and actual execution costs.

[0167] The attribution analysis uses the improved Barra risk model for performance attribution and risk attribution, taking into account the particularities of the A-share stock market.

[0168] Backtesting module: provides flexible backtesting functions, taking into account the unique trading rules of A-shares.

[0169] Support users to set backtesting cycle, stock selection strategy and position adjustment frequency. The system takes into account A-share-specific rules such as transaction costs, price limits, suspension, etc., and provides performance evaluation indicators including Sharpe ratio and maximum drawdown.

[0170] Reference Figure 5 As shown in the figure, the backtesting module is based on an efficient backtesting engine with vectorized operations; order execution simulation taking into account price limits; a dynamic slippage model that estimates slippage based on trading volume and buy and sell order data; and multi-threaded parallel backtesting that supports large-scale parameter optimization.

[0171] The functions and implementation methods of the backtest module include: 1. Implementation of A-share-specific trading rules; Price limit restrictions: Set different price limits for ST stocks and ordinary stocks, handle special price limits on the first day of listing and subsequent trading days of new stocks, implement a price limit relational database, and support fast query. Suspension processing: Establish a suspension information database to record the start and end time and reasons for the suspension; handle special trading situations on the first day of resumption of trading; the valuation of holdings during the suspension period uses the closing price of the most recent trading day. Ex-rights and ex-dividends: Implement the pre-rights / post-rights price calculation logic; handle company behaviors such as bonus shares, transfers, and dividends; establish an ex-rights and ex-dividends database to support query.

[0172] 2. Order execution simulation; T+1 trading rules: maintain the pool of stocks that can be traded on the same day, implement the trading restriction inspection mechanism, and handle the trading restriction exemption under special circumstances. Minimum trading unit: implement 100-share integer multiple transactions, handle the special circumstances of zero-share transactions, and the mechanism for handling the capital tail difference. Transaction mechanism: simulate the collective auction process, implement continuous auction matching, and handle large-scale transactions.

[0173] 3. Slippage model; Dynamic slippage: Calculate slippage based on volume ratio, consider buy and sell order depth data, and implement liquidity prediction model. Transaction scale: Large order split execution strategy, capacity estimation based on historical transaction volume, market impact cost model.

[0174] 4. Cost model; Transaction costs: Consider commissions, stamp duties, and transfer fees, achieve minimum handling fee limits, and support fee settings for different brokerage firms. Other costs: dividend income tax, margin trading costs, and capital occupation costs.

[0175] 5. Performance optimization; Calculation optimization: Use vectorized operations to replace loops; Implement data preloading mechanism; Optimize memory usage efficiency. Parallel processing: Multi-process parameter optimization, distributed backtesting support, task queue management.

[0176] 6. Risk control; position restrictions: maximum holding ratio of a single stock, industry concentration control, and overall position management; trading restrictions: intraday trading volume restrictions, turnover rate control, and trading frequency management.

[0177] 7. Result analysis; Return indicators: annualized rate of return, excess return, win rate and profit-loss ratio; Risk indicators: Sharpe ratio, maximum drawdown, volatility analysis; A-share characteristic indicators: relative benchmark performance, industry exposure, style factor analysis; 8. Data management; data storage: historical market data, fundamental data, factor data; data verification: data integrity check, outlier processing, data consistency verification; The key points of specific adjustments for A shares are as follows: 1. Adaptation of trading system: - Implement differentiated price fluctuation limits for the Science and Technology Innovation Board and the Growth Enterprise Market, - Deal with trading restrictions in the early stages of new stock listings, and - Adapt to changes brought about by the registration system reform.

[0178] 2. Risk prevention and control: Implement trading restrictions on stocks on the risk warning board, handle special rules during the delisting consolidation period, and support valuation adjustments during stock suspension and resumption periods.

[0179] 3. Market mechanism: Adapt to the investor suitability requirements of the Science and Technology Innovation Board and the Growth Enterprise Market, implement the business rules for transfer and financing, and deal with the impact of the lifting of restrictions on restricted shares.

[0180] 4. Trading rules: Implement differentiated trading rules among sectors, handle block trades and after-hours fixed-price trades, and support margin trading and securities lending business rules.

[0181] 5. Information disclosure: Deal with the impact of information disclosure during temporary suspension, implement impact assessment of major event announcements, and support the impact of performance forecasts on transactions.

[0182] These implementation methods and adjustments ensure that the backtesting system can truly reflect the characteristics of the A-share market, provide reliable backtesting results, and provide effective support for investment decisions.

[0183] Risk management module: conduct portfolio risk analysis and risk warning.

[0184] Use VaR (Value at Risk) and CVaR (Conditional Value at Risk) methods to analyze portfolio risk and set risk thresholds for real-time monitoring and early warning. Figure 6 As shown, the risk management module uses the historical simulation method to calculate VaR, taking into account extreme market conditions; uses the Monte Carlo simulation method to calculate CvaR; sets multi-level risk warning thresholds and notifies users via email and SMS; and provides risk exposure analysis and stress testing functions.

[0185] The workflow of the risk management module includes: Step S4.1: Obtain data to be tested for risk.

[0186] Step S4.2: Identify risk factors and calculate risk metrics for the data to be tested, and set risk limits.

[0187] Step S4.3: Monitor the data to be tested in real time. If the risk exceeds the limit, issue an early warning, implement risk mitigation measures, and adjust positions.

[0188] Step S4.4: Generate risk report and output value visualization module.

[0189] Visualization module: display analysis results, generate custom reports, refer to Figure 7 As shown: Using D3.js and ECharts visualization library, factor analysis results, backtesting results, etc. are displayed in chart form. Specific functions include: Step S6.1: Interactive factor correlation heatmap.

[0190] Step S6.2: Timing diagram of dynamically updated factor IC value.

[0191] Step S6.3: Display of multi-dimensional backtesting results, including yield curve, turnover rate, position distribution, etc.

[0192] Step S6.4: Customize the dashboard and support drag-and-drop layout.

[0193] Step S6.5: Support user-defined report templates to generate analysis reports in PDF format.

[0194] API interface: supports docking with other systems.

[0195] The API interface provides RESTful API, supports mainstream programming languages ​​such as Python and Java, and is easy to connect with other quantitative trading systems. The main interfaces include: Step S7.1: Data acquisition interface: provides historical market conditions, financial data and other inquiries.

[0196] Step S7.2: Factor calculation interface: supports batch factor calculation requests.

[0197] Step S7.3: Backtesting interface: provides strategy backtesting and parameter optimization functions.

[0198] Step S7.4: Risk analysis interface: supports portfolio risk indicator calculation.

[0199] All API interfaces implement strict security and permission control measures, including but not limited to: -Use HTTPS to encrypt transmission; - Implemented OAuth 2.0 authentication; -Set access frequency limits; - Logging and exception monitoring.

[0200] The system also has a flexible plug-in architecture that supports the easy addition of new data sources, factors, and analysis models. It mainly includes: (1) Data source plug-in: By implementing a standardized data interface, new data providers can be easily integrated.

[0201] (2) Factor plug-in: Users can define new factors through Python scripts, and the system will automatically integrate them into the factor library.

[0202] (3) Analysis model plug-in: supports users to customize new analysis models and backtesting strategies.

[0203] The present invention also provides a multi-factor analysis method applicable to the stock market. The multi-factor analysis method applicable to the stock market can be realized by executing the module functions of the multi-factor analysis system applicable to the stock market, that is, those skilled in the art can understand the multi-factor analysis method applicable to the stock market as a preferred implementation of the multi-factor analysis system applicable to the stock market.

[0204] A multi-factor analysis method applicable to the stock market, comprising: Step A1: Obtaining original financial data online through the API module and preprocessing the original financial data; Step A2: Perform factor analysis on the original financial data through the built-in factor library and factor calculation engine; including single factor analysis, multi-factor analysis and attribution analysis; the factor library and factor calculation engine are set based on the stock market; Step A3: Obtain the analysis results of the factor analysis module and generate an analysis report.

[0205] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0206] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A multi-factor analysis system suitable for the stock market, characterized in that: include: Data integration module: obtains original financial data and pre-processes the original financial data; Factor analysis module: Through the built-in factor library and factor calculation engine, factor analysis is performed on the pre-processed financial data to obtain analysis results; The factor analysis includes single factor analysis, multi-factor analysis and attribution analysis; The factor library is dynamically set based on the stock market; the factor calculation adopts a distributed computing architecture.

2. The multi-factor analysis system applicable to the stock market according to claim 1, characterized in that: The built-in factor library includes: valuation factors, growth factors, quality factors, momentum factors, risk factors, trading factors and custom factors; Select factors that are in line with the current stock market from the factor library to obtain an optimized factor library, and use the optimized factor library to perform factor analysis; The momentum factor includes a price momentum factor and a trading volume momentum factor; the price momentum factor and the trading volume momentum factor are parameterized according to the price and trading volume restrictions imposed by the stock market price limits; The factor calculation engine adopts a distributed computing framework and uses parallel computing when calculating factors.

3. The multi-factor analysis system applicable to the stock market according to claim 1, characterized in that: The multi-factor analysis is implemented by constructing a multi-factor analysis model; the construction of the multi-factor model includes: Step S3.1: Use the regression model to screen factors associated with the analysis results from the factor library; Step S3.2: Generate multiple factor combinations from the screened factors, screen out the factor combination with the highest performance, and use the XGBoost algorithm to build a nonlinear multi-factor model for the combination; Step S3.3: Use the Shapley value method to analyze the factor contribution of the selected factor combinations; Step S3.4: Based on the Shapley values ​​of the factors, dynamically adjust the factor weights using a rolling window.

4. The multi-factor analysis system applicable to the stock market according to claim 3 is characterized in that: The step S3.1 comprises: Step S3.1.1: Obtain all associated factor data and target variables to obtain a data set, and preprocess the data set; Step S3.1.2: Divide the data set into training set and test set in chronological order; Step S3.1.3: Set up the Lasso model, fit the Lasso model using the test set, calculate the correlation coefficients of the factors using the fitted Lasso model, compress the coefficients of unimportant factors to 0, and predict the selected factors on the test set to evaluate the model performance; Step S3.1.4: Run the Lasso model multiple times and count the frequency of each factor correlation coefficient being non-zero; Step S3.1.5: Set a threshold according to the frequency at which the factor is selected, retain the factors that exceed the threshold, and obtain the factors associated with the analysis results.

5. The multi-factor analysis system applicable to the stock market according to claim 3 is characterized in that: In step S3.2, the factor combination screening method adopts any one of the following schemes: Solution 1: Start with an empty model and add a factor with the highest correlation coefficient with the target variable each time. Repeat this process until the model performance is no longer significantly improved or the preset number of factors is reached. Solution 2: Start with a model that includes all factors, and remove the factors that contribute the least to the model one at a time. Repeat this process until the model performance begins to decline significantly or the preset number of factors is reached. Solution 3: Encode each factor combination as a "chromosome", generate new factor combinations through crossover and mutation operations, evaluate each combination using the fitness function, iterate and optimize, and select the factor combination with the highest fitness; Solution 4: Build multiple sub-models, each using a different combination of factors, integrate the prediction results of the sub-models using voting, averaging or stacking methods, and select the factor combination with the best integration effect; Solution 5: Calculate the AIC or BIC of the model corresponding to each factor combination, and select the model with the smallest AIC or BIC; Solution 6: Repeat the factor selection process on a subsample of the data, count the frequency with which each factor is selected, and select factor combinations whose frequency exceeds a certain threshold.

6. The multi-factor analysis system applicable to the stock market according to claim 3, characterized in that: The step S3.3 comprises: Step S3.3.1: Determine all possible feature combinations. For n factors, there are 2 n Different combinations of factors; Step S3.3.2: For each factor i and each factor combination S, calculate the marginal contribution of factor i to S; Step S3.3.3: Calculate the contribution Shapley value of each factor: Where: N is the set of all features, S is the subset that does not contain feature i, n is the total number of features, and f(S) represents the output value of the model when given the feature set S; Step S3.3.4: Calculate the Shapley value of the contribution of the factors in the feature combination by using an approximate algorithm; Step S3.3.5: Calculate the mean absolute Shapley value for each feature.

7. The multi-factor analysis system applicable to the stock market according to claim 3, characterized in that: The step S3.4 comprises: Step S3.4.1: Set initial parameters, including the size of the rolling window, the update frequency, the initial factor set and the initial weight; wherein the initial factor set is the factor set obtained in step S3.2; and the initial weight is the Shapley value of each factor; Step S3.4.2: Collect historical data of all relevant factors and target variables, and train the model using the data within the initial rolling window; Step S3.4.3: Dynamically select part of the factor data and the target variable according to the rolling window to train the regression model and calculate the weight of the factor; Step S3.4.4: Adjust the multifactor analysis model according to the new factor weights.

8. The multi-factor analysis system applicable to the stock market according to claim 1, characterized in that: It also includes a backtesting module: the backtesting module obtains the backtesting period, stock selection strategy and position adjustment frequency input by the user, and outputs financial backtesting results based on the transaction costs, price limits and suspension rules of the stock market, including the yield curve, transaction record table and position change chart, as well as output performance evaluation indicators, including: annualized rate of return, maximum drawdown rate, Sharpe ratio and information ratio.

9. A multi-factor analysis method suitable for the stock market, characterized in that: include: Step A1: Obtaining original financial data online through the API module and preprocessing the original financial data; Step A2: Perform factor analysis on the pre-processed financial data through the built-in factor library and factor calculation engine; the factor analysis includes single factor analysis, multi-factor analysis and attribution analysis; The factor library is dynamically set based on the stock market; the factor calculation adopts a distributed computing architecture.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the multi-factor analysis method applicable to the stock market described in claim 9 are implemented.

Citation Information

Cited By

  • Product recommendation method, system and device based on artificial intelligence

    CN120355496A