Profit analysis method of enterprise financial data based on statistical model and application

Through corporate financial data profit analysis methods based on statistical models, including correlation analysis, multiple linear regression and naive Bayes models, the problem of low efficiency in identifying and auditing financial fraud is solved, and more accurate financial management and risk control are achieved. , improving the transparency and credibility of financial reporting.

CN118674564APending Publication Date: 2024-09-20HUIZHOU UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410412172.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

The existing technology has shortcomings in identifying potential financial fraud risks and improving financial audit efficiency in terms of financial fraud, and it is difficult to effectively control cost risks.

Method used

Profit analysis methods for corporate financial data based on statistical models are adopted, including correlation analysis, partial correlation analysis, multiple linear regression models, factor characteristic analysis, Logistics models and Naive Bayes models. Corporate financial data are analyzed through these models. Identify signs of potential financial fraud and predict profits.

Benefits of technology

It improves the level of financial management and financial review efficiency, can accurately identify financial fraud, provides more refined financial management, helps companies formulate effective risk management strategies, and enhances the transparency and credibility of financial reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674564A
    Figure CN118674564A
Patent Text Reader

Abstract

The invention provides a profit analysis method for enterprise financial data based on a statistical model. The profit analysis method comprises the following steps: S1, correlation analysis and partial correlation analysis; S2, a multiple linear regression model; S3, factor feature analysis; the application discusses the application research of the big data analysis technology in the financial field by applying a machine learning method, facilitates the management and control of the market, and has great social value and use value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of mathematical statistical analysis, and in particular to a profit analysis method and application of enterprise financial data based on a statistical model. Background Art

[0002] With the continuous development of science and technology and the continuous expansion of application scenarios, big data technology has gradually penetrated into various fields, and the financial field is no exception. Financial data refers to a technical means of collecting, organizing and analyzing massive amounts of financial data in the process of financial management and decision-making to discover the laws and valuable information hidden behind the data, thereby providing enterprises with decision-making basis and business optimization solutions. The application background of financial fraud mainly comes from the serious problem of corporate financial fraud. Financial fraud refers to the behavior of enterprises deliberately misleading investors or other stakeholders in financial statements in order to obtain improper benefits. Financial fraud has a serious negative impact on the stability and development of enterprises. Therefore, it is crucial to accurately identify and prevent financial fraud.

[0003] In this context, big data analysis, as a powerful tool, has the characteristics of large scale, fast speed, diversity and high value density. It can discover patterns, trends and anomalies from massive data and provide more accurate and comprehensive information support. Through big data analysis, we can effectively deal with the higher concealment of financial fraud brought about by the expansion of enterprise scale and complexity of operation, more effectively identify financial fraud, and improve the transparency and credibility of financial reports.

[0004] The significance of big data in financial fraud is mainly reflected in the following aspects:

[0005] Improve the transparency and credibility of financial reports: Through big data analysis, companies can collect, organize and analyze financial data more comprehensively, discover the patterns and valuable information hidden behind the data, and improve the transparency and credibility of financial reports. This helps to enhance the trust of investors and other stakeholders in the company and reduce investment risks.

[0006] Identify potential financial fraud risks: Big data analysis can discover potential financial fraud through mining and analysis of massive data. Through pattern recognition and correlation analysis of data, companies can more accurately determine whether there is financial fraud and take appropriate measures to prevent and correct it.

[0007] Improve the efficiency of financial auditing: Big data technology can analyze and process a large amount of data in a relatively short period of time, thus improving the efficiency and accuracy of financial auditing. Compared with traditional sampling auditing, it can more comprehensively review and analyze all data, thus better identifying financial fraud.

[0008] Strengthen risk management: Big data analysis can help companies establish a more complete internal control system and timely discover financial risks and management loopholes through comprehensive monitoring and analysis of financial data. At the same time, big data analysis can also provide companies with more accurate credit risk assessment and early warning, helping them to formulate more effective risk management strategies.

[0009] Promoting innovation in corporate financial management: The application of big data analysis in financial fraud has prompted companies to continuously explore new financial management models and methods, and promote financial management innovation. At the same time, big data analysis can also provide companies with more refined management, helping them to better control their financial situation and improve their financial management level. However, the application of big data in financial fraud in existing technologies still has certain shortcomings, such as the inability to control cost risks. Therefore, how to help companies identify potential financial fraud risks and improve financial audit efficiency is an important issue currently faced by researchers. Summary of the invention

[0010] In view of the above-mentioned deficiencies in the prior art, the present invention provides a profit analysis method and application of enterprise financial data based on a statistical model, which can effectively improve the level of financial management and the efficiency of financial auditing.

[0011] The technical solution adopted by the present invention to solve the above problems is:

[0012] The present invention provides a profit analysis method of enterprise financial data based on a statistical model, comprising the following steps:

[0013] S1: Correlation analysis and partial correlation analysis,

[0014] S2: Multiple linear regression model,

[0015] S3: Factor characteristic analysis,

[0016] S4: Logistics model,

[0017] S5: Naive Bayes model.

[0018] Further, step S1 includes S11 correlation analysis and S12 partial correlation analysis,

[0019] The S11 correlation analysis includes correlation analysis models and formulas. Assuming there are two variables X and Y, we can use the Pearson product-moment correlation coefficient to measure the correlation between them. The calculation formula of the Pearson product-moment correlation coefficient is as follows:

[0020]

[0021] Among them, n represents the number of samples, Σ represents the summation symbol, and X and Y represent the observed values ​​of the two variables respectively.

[0022] Furthermore, the correlation coefficient ranges from -1 to 1. When r is a positive number, it indicates that there is a positive correlation between the variables; when r is a negative number, it indicates that there is a negative correlation between the variables; when r is 0, it indicates that there is no linear relationship between the variables. Generally speaking, the closer |r| is to 1, the stronger the linear relationship between the variables.

[0023] Furthermore, the partial correlation analysis in step S12 is specifically as follows:

[0024] Suppose there are three variables X, Y and Z, and we want to study the partial correlation between X and Y while controlling the influence of Z. We can use the calculation formula of the partial correlation coefficient to measure the relationship between them. The calculation formula of the partial correlation coefficient is as follows:

[0025]

[0026] Among them, r_XY represents the simple correlation coefficient between X and Y, r_XZ represents the simple correlation coefficient between X and Z, and r_YZ represents the simple correlation coefficient between Y and Z. By comparing and adjusting the simple correlation coefficient between X and Y with the correlation coefficients between X and Z and Y and Z, we can get the partial correlation coefficient r_XY.Z of X and Y after controlling the influence of Z.

[0027] Furthermore, the value range of the partial correlation coefficient is between -1 and 1. When r_XY.Z is a positive number, it means that after controlling the influence of Z, there is a positive correlation between X and Y; when r_XY.Z is a negative number, it means that after controlling the influence of Z, there is a negative correlation between X and Y; when r_XY.Z is 0, it means that after controlling the influence of Z, there is no linear relationship between X and Y. Generally speaking, the closer |r_XY.Z| is to 1, the stronger the linear relationship between X and Y is after controlling the influence of other variables.

[0028] Furthermore, the multiple linear regression model in step S2 is as follows:

[0029] The general form of a multiple linear regression model is:

[0030] y=β0+β1x1+β2x2+...+β n ·x n +ε

[0031] Among them, y is the dependent variable, x1,x2,...,x n are the independent variables, β0,β1,...,β n is the model parameter to be estimated, ε is the error term, and the formula for the multiple linear regression model is:

[0032] β=(X'X)-1 X'y

[0033] Among them, X is the design matrix of independent variables, y is the vector of dependent variables, and β is the vector of model parameters to be estimated. In the multiple linear regression model, we use the least squares method to estimate the model parameters. This method finds the best fitting model parameters by minimizing the sum of squares of the residuals between the predicted values ​​and the actual values.

[0034] Furthermore, step S3 factor feature analysis includes the following steps:

[0035] Y1: Factor characteristic analysis structure, including the following steps:

[0036] Y11: Finding potential factor structures: By observing the correlations between variables, we can find some potential factor structures that may represent some commonality or essential characteristics in the data.

[0037] Y12: Dimensionality reduction: By projecting variables onto fewer dimensions, we can simplify the complexity of the data and make it easier to understand and analyze the data.

[0038] Y13: Explain the relationship between variables: Factor feature analysis can help us understand the relationship between variables and find out which variables have similar behaviors or trends;

[0039] Y2: Model and formula for factor characteristic analysis

[0040] The model of factor characteristic analysis can be expressed as:

[0041] X=AF+ε

[0042] Among them, X is the matrix of observation data (each row represents an observation and each column represents a variable), A is the factor loading matrix (each row represents a factor and each column represents a variable), F is the matrix of latent factors (each row represents a factor and each column represents an observation), ε is the error term, assuming that we have a data set X with n observations and p variables, and we hope to extract m latent factors F from it. Then, we can use the following formula to calculate the factor loading matrix A:

[0043] A=(X'X) -1 X'Y

[0044] Where X' is the transposed matrix of X and Y is the vector of dependent variables.

[0045] Furthermore, the logistics model or naive Bayes model in step S4 is as follows:

[0046] Assuming we have a sample set and the feature vector of each sample is X, the model of Logistics regression can be expressed as:

[0047]

[0048] Among them, w is the weight vector and b is the bias term.

[0049] For Logistic regression, we usually use the log-likelihood loss function, which is formulated as:

[0050]

[0051] Where N is the number of samples, y_i is the true label of the sample (0 or 1), and h(x_i) is the probability value predicted by the model.

[0052] Furthermore, the naive Bayes model in step S5 is specifically as follows:

[0053] Assuming we have a sample set, the feature vector of each sample is X, and the class label is y (assuming there are two categories, y = 0 or 1), then the naive Bayes model can be expressed as:

[0054]

[0055]

[0056] Among them, w0,b0 and w1,b1 are the weights and bias terms of category 0 and category 1 respectively.

[0057] For the Naive Bayes classifier, we usually use the log-likelihood loss function, which is formulated as:

[0058]

[0059] Where N is the number of samples, y_i is the true label of the sample (0 or 1), and P(y_i|x_i) is the probability value predicted by the model.

[0060] The invention discloses a profit analysis method of enterprise financial data based on statistical model and its application in profit analysis of financial data.

[0061] The beneficial effects are:

[0062] This application uses machine learning methods to discuss the application research of big data analysis technology in the financial field. By constructing models such as multivariate linear regression, naive Bayes, and factor feature analysis, a case study is conducted on the prediction of corporate operating profits and the mining of financial fraud identification features. By analyzing the company's past operating performance, it can measure the current financial situation and predict future development trends, which plays an important role in the company's external investment, loan, credit sales and other decisions. Economic management departments can understand the operating status of the industry through corporate financial data analysis, and then rationally allocate resources, scientifically regulate economic operations, and promote high-quality economic development. Using factor feature analysis to mine the potential characteristics of financial fraud, and using binary classification methods such as naive Bayes to help economic management departments detect companies that may have financial fraud, facilitate market control, and have great social value and use value. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 This is a graph of the top five companies in terms of profit margins extracted using the head() method in this embodiment;

[0064] Figure 2 This is a comparison chart of the profit margins of enterprises ranked first in the profit subcategory of the industry in 2019 in this embodiment;

[0065] Figure 3 It is the core code diagram in this embodiment;

[0066] Figure 4 This is the total operating cost analysis chart of enterprise "T1" in 2019 in this embodiment;

[0067] Figure 5 This is the business situation analysis chart of enterprise "T1" in 2019 in this embodiment;

[0068] Figure 6 It is a heat map of the five indicators and the total profit in this embodiment;

[0069] Figure 7 This is the package diagram required for importing Step 1 in this embodiment;

[0070] Figure 8 This is the diagram of the program package for selecting data for training the model in Step 2 of this embodiment;

[0071] Fig. 9 It is Step 2 in this embodiment and draws a scatter plot of total profit and five indicators respectively;

[0072] Fig.10 It is the program code for dividing the data in step 2 in this embodiment;

[0073] Fig.11It is the verification code of the model in Step 4 of this embodiment;

[0074] Fig.12 It is a curve diagram between the predicted value and the true value of the model tested in Step 4 of this embodiment;

[0075] Fig.13 It is the code for calculating the mean square error, root mean square error and R square of the model in Step 5 of this embodiment to test the rationality and accuracy of the model;

[0076] Fig.14 This is the code for predicting the total profits of the enterprises in the test.csv file using this model in Step 5 of this embodiment;

[0077] Fig.15 This is another part of the code in Step 5 of this embodiment, which uses this model to predict the total profit of the enterprises in the test.csv file;

[0078] Fig.16 This is a characteristic diagram of the key factors of no financial fraud in this embodiment;

[0079] Fig.17 is a characteristic diagram of key factors of financial fraud in this embodiment;

[0080] Fig.18 It is a program diagram of using the dataframe table for filtering data in this embodiment;

[0081] Fig.19 is a diagram of the calculation process of dividing the data set and the model in this embodiment;

[0082] Fig. 20 It is a procedure diagram for testing the model in this embodiment. DETAILED DESCRIPTION

[0083] The following specifically describes the embodiments of the present invention in conjunction with the accompanying drawings, which are only for reference and illustration and do not constitute a limitation on the scope of patent protection of the present invention.

[0084] The present invention provides a profit analysis method of enterprise financial data based on a statistical model, comprising the following steps:

[0085] S1: Correlation analysis and partial correlation analysis,

[0086] S2: Multiple linear regression model,

[0087] S3: Factor characteristic analysis,

[0088] S4: Logistics model,

[0089] S5: Naive Bayes model.

[0090] In this embodiment, step S1 includes S11 correlation analysis and S12 partial correlation analysis.

[0091] The S11 correlation analysis includes correlation analysis models and formulas. Assuming there are two variables X and Y, we can use the Pearson product-moment correlation coefficient to measure the correlation between them. The calculation formula of the Pearson product-moment correlation coefficient is as follows:

[0092]

[0093] Among them, n represents the number of samples, Σ represents the summation symbol, and X and Y represent the observed values ​​of the two variables respectively.

[0094] In this embodiment, the value range of the correlation coefficient is between -1 and 1. When r is a positive number, it indicates that there is a positive correlation between the variables; when r is a negative number, it indicates that there is a negative correlation between the variables; when r is 0, it indicates that there is no linear relationship between the variables. Generally speaking, the closer |r| is to 1, the stronger the linear relationship between the variables.

[0095] In this embodiment, the partial correlation analysis in step S12 is specifically as follows:

[0096] Suppose there are three variables X, Y and Z, and we want to study the partial correlation between X and Y while controlling the influence of Z. We can use the calculation formula of the partial correlation coefficient to measure the relationship between them. The calculation formula of the partial correlation coefficient is as follows:

[0097]

[0098] Among them, r_XY represents the simple correlation coefficient between X and Y, r_XZ represents the simple correlation coefficient between X and Z, and r_YZ represents the simple correlation coefficient between Y and Z. By comparing and adjusting the simple correlation coefficient between X and Y with the correlation coefficients between X and Z and Y and Z, we can get the partial correlation coefficient r_XY.Z of X and Y after controlling the influence of Z.

[0099] In this embodiment, the value range of the partial correlation coefficient is between -1 and 1. When r_XY.Z is a positive number, it means that after controlling the influence of Z, there is a positive correlation between X and Y; when r_XY.Z is a negative number, it means that after controlling the influence of Z, there is a negative correlation between X and Y; when r_XY.Z is 0, it means that after controlling the influence of Z, there is no linear relationship between X and Y. Generally speaking, the closer |r_XY.Z| is to 1, the stronger the linear relationship between X and Y is after controlling the influence of other variables.

[0100] In this embodiment, the multiple linear regression model in step S2 is specifically as follows:

[0101] The general form of a multiple linear regression model is:

[0102] y=β0+β1x1+β2x2+...+β n ·x n +ε

[0103] Among them, y is the dependent variable, x1,x2,...,x n are the independent variables, β0,β1,...,β n is the model parameter to be estimated, ε is the error term, and the formula for the multiple linear regression model is:

[0104] β=(X'X) -1 X'y

[0105] Among them, X is the design matrix of independent variables, y is the vector of dependent variables, and β is the vector of model parameters to be estimated. In the multiple linear regression model, we use the least squares method to estimate the model parameters. This method finds the best fitting model parameters by minimizing the sum of squares of the residuals between the predicted values ​​and the actual values.

[0106] In this embodiment, step S3 factor feature analysis includes the following steps:

[0107] Y1: Factor characteristic analysis structure, including the following steps:

[0108] Y11: Finding potential factor structures: By observing the correlations between variables, we can find some potential factor structures that may represent some commonality or essential characteristics in the data.

[0109] Y12: Dimensionality reduction: By projecting variables onto fewer dimensions, we can simplify the complexity of the data and make it easier to understand and analyze the data.

[0110] Y13: Explain the relationship between variables: Factor feature analysis can help us understand the relationship between variables and find out which variables have similar behaviors or trends;

[0111] Y2: Model and formula for factor characteristic analysis

[0112] The model of factor characteristic analysis can be expressed as:

[0113] X=AF+ε

[0114] Among them, X is the matrix of observation data (each row represents an observation and each column represents a variable), A is the factor loading matrix (each row represents a factor and each column represents a variable), F is the matrix of latent factors (each row represents a factor and each column represents an observation), ε is the error term, assuming that we have a data set X with n observations and p variables, and we hope to extract m latent factors F from it. Then, we can use the following formula to calculate the factor loading matrix A:

[0115] A=(X'X) -1 X'Y

[0116] Where X' is the transposed matrix of X and Y is the vector of dependent variables.

[0117] In this embodiment, the logistics model or the naive Bayes model in step S4 is as follows:

[0118] Assuming we have a sample set and the feature vector of each sample is X, the model of Logistics regression can be expressed as:

[0119]

[0120] Among them, w is the weight vector and b is the bias term.

[0121] For Logistic regression, we usually use the log-likelihood loss function, which is formulated as:

[0122]

[0123] Where N is the number of samples, y_i is the true label of the sample (0 or 1), and h(x_i) is the probability value predicted by the model.

[0124] In this embodiment, the naive Bayes model in step S5 is specifically as follows:

[0125] Assuming we have a sample set, the feature vector of each sample is X, and the class label is y (assuming there are two categories, y = 0 or 1), then the naive Bayes model can be expressed as:

[0126]

[0127]

[0128] Among them, w0,b0 and w1,b1 are the weights and bias terms of category 0 and category 1 respectively.

[0129] For the Naive Bayes classifier, we usually use the log-likelihood loss function, which is formulated as:

[0130]

[0131] Where N is the number of samples, y_i is the true label of the sample (0 or 1), and P(y_i|x_i) is the probability value predicted by the model.

[0132] This embodiment further illustrates the application of a profit analysis method of enterprise financial data based on a statistical model in financial data profit analysis by combining specific cases.

[0133] 1. Data sources and data processing

[0134] Do data processing. Read the "LR.csv" file, extract the columns corresponding to Table 1 in the table, and filter out the data with the value of "A" in the field "Typrep"; read the "LR_1.csv", "ZCFZ.csv", and "Stk_ind.csv" files, and extract the data with the fields "A002000000" and "A001000000" in "ZCFZ.csv" based on "Stkcd", "Accper", and "Typrep"; extract the data with the fields "Indnme" and "Nindnme" in "Stk_ind.csv" based on the field "Stkcd"; delete the data columns with 70% or more null values ​​in the "LR_2.csv" file; delete the rows with null values ​​in the "LR_3.csv" file; insert the "profit rate" and "asset-liability ratio" columns in the "LR_5.csv" file, and calculate the corresponding profit rate and asset-liability ratio.

[0135] 2. Financial data indicator analysis and visualization

[0136] 2.1 Comparative analysis of industry operating profits

[0137] First, we filter out the data of each industry category in September 2019, and use the pivot_table() function to calculate the mean of the total profit of each category. The data obtained is as follows:

[0138] Table 1 Average total profits of major categories in September 2019

[0139] Industry Categories Average total profit Utilities 438038015.4 Business 570711976.6 industry 574116825.5 real estate 2229091658 comprehensive 306786737.8 finance 946748730.7

[0140] As shown in the table above, the average total profit of the real estate category is the largest, the average total profit of the comprehensive category is the smallest, and the average total profits of other categories are not much different.

[0141] Analyze the profit changes of major industries from January 2018 to September 2019, select data from seven quarters from January 2018 to September 2019, and calculate the average profit margin of major categories in each quarter through the pivot_table() function. The relevant code and data are as follows:

[0142] Table 2 Average profit margins of major categories in the first quarter of 2018

[0143] Indnme First quarter of 2018 Utilities 0.123877979 Business 0.05999748 industry 0.098394448 real estate 0.13854648 comprehensive 0.042385817 finance 0.212397378

[0144] The above line chart shows the changes in profits of major industries in each quarter. In general, the average profit margins of comprehensive industries in each quarter are generally low, while the average profit margins of financial industries in each quarter are relatively large. Other major industries fluctuate less, while financial industries fluctuate more, with a large fluctuation from the fourth quarter of 2018 to the first quarter of 2019.

[0145] 2.2 Industry Enterprise Revenue Analysis

[0146] Read "LR_new.csv" and, based on the results of Task 2.1, determine the industry category with the highest average operating profit margin in September 2019, and draw the "Industry Enterprise Revenue Analysis" chart related to the industry category according to the requirements of Table 5. Each chart must be presented and analyzed in the report.

[0147] Table 3 Industry and enterprise revenue analysis

[0148]

[0149] According to the results of Task 2.1, the industry category with the highest average operating profit margin in September 2019 was determined to be "Finance".

[0150] 2.2.1 Comparison of profit margins of various categories in the industry in 2019

[0151] First, the month and year of the "Accper" field are extracted by the dt.month and dt.year methods, and then the relevant data of the financial industry in September 2019 are filtered out. It is known that the difference between the first-ranked subcategory "Securities and Futures Industry" and the second-ranked subcategory "Other Financial Industry" in the profit margin of the financial industry in 2019 is not very large, but compared with the third-ranked subcategory "Banking Industry", the profit margin gap between the two is very obvious.

[0152] 2.2.2 Comparison of profit margins of enterprises ranked first in the profit margin sub-category of the industry in 2019

[0153] Through Task 2.2.1, we know that the subcategory with the highest profit margin in the financial industry is "Securities and Futures Industry". So first filter out the data rows with the subcategory "Securities and Futures Industry" in September 2019, then sort the data set in descending order by profit margin using the sort_values() method, and use the head() method to extract the top 5 companies in terms of profit margin. The results are as follows: Figure 1 As shown:

[0154] (The "Stkcd" field indicates "Securities Code". Securities codes are unique and can represent corresponding enterprises.) The enterprise with the highest profit margin in this subcategory is recorded as "T1", the enterprise with the second highest profit margin in this subcategory is recorded as "T2", and so on. The securities code corresponding to the enterprise with the highest profit margin in the financial industry in 2019 is "300059". The bar chart drawn with the above data is as follows: Figure 1 As shown: By observing the above bar chart, we can see that in 2019, the profit margin of the financial industry ranked first is not much different from that of the second and third ranked companies, and the gap with the fourth and fifth ranked companies is slightly obvious.

[0155] 2.2.3 Analysis of total operating costs of “T1” enterprises in 2019

[0156] From Task 2.2.2, we know that the stock code of the company "T1" with the highest profit margin in the financial industry in 2019 is "300059", which can be used to filter out the operating costs, business taxes and surcharges, sales expenses, administrative expenses, and financial expenses of the company "T1" in its financial statements in September 2019. Its core codes are as follows: Figure 3 As shown in the figure, by filtering the obtained data, the pie chart is drawn as follows Figure 4 As shown:

[0157] 4.2.2.4 Analysis of the business performance of “T1” enterprises in 2019

[0158] First, we screened out the total operating revenue, total operating cost, profit margin, and debt-to-asset ratio of enterprise "T1" in March, June, and September 2019. By processing the obtained data, we drew a bar chart as follows: Figure 5 As shown in the above bar-line combination chart, the total operating income of enterprise "T1" in 2019 is on the rise, indicating that the enterprise is in good operating condition. Although the total operating cost of the enterprise is also on the rise, the increase is not large, so its profit margin is steadily increasing. The asset-liability ratio of the enterprise is on the decline, and the decline from March to September is more obvious.

[0159] 3. Corporate profit forecasting and identification of financial fraud

[0160] 3.1 Correlation between various indicators and total profit

[0161] First, use the pandas library to read the "financial_data.csv" file, then use the multivariate correlation coefficient to calculate the correlation coefficient between each indicator and the total profit. According to the size of the correlation coefficient between LRZE and each indicator, select the 5 indicators with the highest correlation. The main indicators and their meanings in the financial_data.csv file are as follows:

[0162] Table 4 Index names and field meanings in the financial_data.csv file

[0163] Field Name meaning Field Name meaning LDBL Current Ratio BYZGR Interest coverage ratio ZGar Debt-to-asset ratio ZZL Inventory turnover ZBCL Return on assets ZLJ Inventory to current assets ratio QZQ Long-term return on capital YYMLL Operating gross margin YSL Taxable rate YSZKZZL Accounts receivable turnover YY Operating income YY Operating costs YYSJJF Business taxes and surcharges JZJ Asset impairment losses LRZE Total Profit FLAG Whether the fraud was committed in that year

[0164] Step 1: Read the data and filter out the data column where the indicator is located

[0165] Step 2: Use df.corr() in the pandas library to calculate the correlation coefficient between each indicator

[0166] The correlation coefficients of LRZE and other indicators are as follows:

[0167] Table 5 Correlation coefficients of LRZE and other indicators

[0168]

[0169]

[0170] Step 3: Based on the calculation results of step 2, select the five indicators with the highest correlation with total profit LRZE as shown in the following table

[0171] Table 6 Index correlation table

[0172] index YY YW YY YYSJJF JZJ Meaning of indicators Operating income Business Expenses Operating costs Business taxes and surcharges Asset impairment losses Correlation coefficient with LRZE 0.782726 0.772832 0.737736 0.565440 0.238524

[0173] The heat map of the above five indicators and total profit is as follows: Figure 6 As shown,

[0174] It can be seen from the heat map that the total profit is highly correlated with operating income, business expenses and operating costs.

[0175] 3.2 Multivariate linear regression model predicts the total profit of enterprises

[0176] The five indicators with the highest correlation with total profit are: operating income, business expenses, operating costs, business taxes and surcharges, and asset impairment losses. There are five factors involved here. Therefore, a multiple linear regression model is used.

[0177] Solution of the model

[0178] Step 1: Import the required packages such as Figure 7 Shown

[0179] Step 2: Filter out the data for model training and draw scatter plots of total profit and five indicators. Figure 8-9 Shown

[0180] Step 3: Divide the data in step 2, the first 80% of the data is used to train the model, and the last 20% of the data is used to test the model. The correlation coefficient of the regression equation is obtained as Fig.10 Shown

[0181] Step 4: Test the model and draw a curve between the predicted value and the true value. The code is as follows Figure 11-12 As shown in the figure, it can be seen that the predicted value curve and the true value curve are highly consistent, which reflects the accuracy of the model. The rationality of the model is further tested with statistical indicators.

[0182] Step 5: Calculate the mean square error, root mean square error and R-square test model rationality and accuracy. Fig.13 shown.

[0183] From the above figure, we can see that the mean square error of the model is the mean square error (MSE), the root mean square error (RMSE) and the adjusted R-squared value. The R value is 0.9189, indicating that the model is highly accurate.

[0184] Step 5 tests the model and verifies its feasibility. Therefore, this model is used to predict the total profit of the enterprises in the test.csv file.

[0185] First, import the test.csv file and filter out the data of 5 indicators. Then, use the model to predict and get the predicted value of the total profit of the enterprise as shown in the following table: Fig.14 and 15 As shown,

[0186] Table 7 Predicted values ​​of total profits of enterprises in the test.csv file

[0187] TICKER_SYMBOL LRZE 4953174 402199930.5752 4961537 334312631.3632 4962538 107200937.9747 4968740 118011332.7882 4973917 37343336.6701 4978589 340703523.6075 4978721 71387424.3424 4986535 79738156.9231 4990739 230538365.2368 4990942 50202072.7394

[0188] 3.3 Factor feature analysis and naive Bayes model analysis of financial data fraud

[0189] The "FLAG" field in the financial_data.csv file is used to identify financial data fraud ("1" indicates financial fraud). The key factors affecting FLAG are current ratio, debt-to-asset ratio, inventory turnover, return on assets, and accounts receivable turnover. These five key factors are used to analyze financial_data.csv and mine the identification features of financial fraud. The naive Bayes model is used to analyze the relationship between FLAG and the five key factors.

[0190] According to the analysis of commonly used financial indicators, when a company's liquidity rate is high enough, it can ensure that it has sufficient current assets to repay short-term debts. When the company's debt-to-asset ratio is maintained at a reasonable level, it can become a lever to measure the company's finances, while highly unusual changes in the debt-to-asset ratio may become a sign of financial fraud. Under normal circumstances, the return on assets should be maintained at a reasonable level, and the inventory turnover rate and accounts receivable turnover rate can be at a high level. A high inventory turnover rate and accounts receivable turnover rate indicate that the company can effectively manage inventory and quickly collect accounts receivable, while an excessively high or low inventory turnover rate and accounts receivable turnover rate may be an exaggeration or underestimation of the inventory value in order to manipulate profits.

[0191] The following figure is a visualization of the key factor characteristic diagram of whether there is financial fraud or not. Figure 16-17 As shown, Fig.16 No financial fraud key factor characteristic diagram

[0192] Fig.17 Financial fraud key factor characteristic diagram

[0193] As can be seen from the above figure, the key factor characteristics when there is no financial fraud are characterized by a high inventory turnover rate, a slightly high current ratio, and reasonable levels of debt-to-asset ratio, return on assets, and accounts receivable turnover. This shows that the company can ensure that there are sufficient current assets to repay short-term debts and can effectively manage inventory. The key factor characteristics when there is financial fraud are characterized by a highly unusual debt-to-asset ratio, a slightly high current ratio, and low inventory turnover, return on assets, and accounts receivable turnover.

[0194] Therefore, the key factors that indicate a company has committed financial fraud are: a highly unusual debt-to-asset ratio, and low or unreasonable inventory turnover, return on assets, and accounts receivable turnover.

[0195] Model solution:

[0196] Step 1: Import the packages required by the model and filter out the main data from the financial_data.csv file for model training and model testing.

[0197] The model mainly uses the python packages pandas, sklearn.model_selection, sklearn.naive_bayes and sklearn.metrics. The multi-layer indexing function of the dataframe table is used to filter data. Fig.18 As shown,

[0198] 75% of the selected data is used to train the model, and the remaining 25% is used to test the model. Fig.19 As shown,

[0199] The model is tested to obtain a test value. The test value is compared with the true value to obtain a model test accuracy of 99.636%. The specific method is as follows Fig. 20 As shown,

[0200] Prediction value calculation

[0201] The model is used to analyze the financial data of the five companies in the financial_data_new.csc file, and the only company suspected of financial fraud is identified, whose stock code is 4897311. The FLAG values ​​of the five companies are shown in the table below.

[0202] The method for solving the predicted value is the same as that for model testing, so the description will not be repeated.

[0203] The FLAG values ​​of the financial data of the five companies in the financial_data_new.xlsx file are as follows

[0204] Table 8 FLAG value table of 5 enterprise financial data

[0205] TICKER_SYMBOL FLAG 4992858 0 4993201 0 4998808 0 4897311 1 4999709 0

[0206] This application uses machine learning methods to discuss the application research of big data analysis technology in the financial field. By constructing models such as multivariate linear regression, naive Bayes, and factor feature analysis, a case study is conducted on the prediction of corporate operating profits and the mining of financial fraud identification features. By analyzing the company's past operating performance, it can measure the current financial situation and predict future development trends, which plays an important role in the company's external investment, loan, credit sales and other decisions. Economic management departments can understand the operating status of the industry through corporate financial data analysis, and then rationally allocate resources, scientifically regulate economic operations, and promote high-quality economic development. Using factor feature analysis to mine the potential characteristics of financial fraud, and using binary classification methods such as naive Bayes to help economic management departments detect companies that may have financial fraud, facilitate market control, and have great social value and use value.

[0207] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A profit analysis method for enterprise financial data based on statistical models, characterized in that: The steps include: S1: Correlation analysis and partial correlation analysis, S2: Multiple linear regression model, S3: Factor characteristic analysis, S4: Logistics model, S5: Naive Bayes model.

2. The profit analysis method of enterprise financial data based on statistical model according to claim 1, characterized in that: Step S1 includes S11 correlation analysis and S12 partial correlation analysis, The S11 correlation analysis includes correlation analysis models and formulas. Assuming there are two variables X and Y, we can use the Pearson product-moment correlation coefficient to measure the correlation between them. The calculation formula of the Pearson product-moment correlation coefficient is as follows: Among them, n represents the number of samples, Σ represents the summation symbol, and X and Y represent the observed values ​​of the two variables respectively.

3. The profit analysis method and application of enterprise financial data based on statistical model according to claim 2, characterized in that: The correlation coefficient ranges from -1 to 1. When r is a positive number, it indicates that there is a positive correlation between the variables; when r is a negative number, it indicates that there is a negative correlation between the variables; when r is 0, it indicates that there is no linear relationship between the variables. Generally speaking, the closer |r| is to 1, the stronger the linear relationship between the variables.

4. The profit analysis method of enterprise financial data based on statistical model according to claim 2, characterized in that: The partial correlation analysis in step S12 is specifically as follows: Suppose there are three variables X, Y and Z, and we want to study the partial correlation between X and Y while controlling the influence of Z. We can use the calculation formula of the partial correlation coefficient to measure the relationship between them. The calculation formula of the partial correlation coefficient is as follows: Among them, r_XY represents the simple correlation coefficient between X and Y, r_XZ represents the simple correlation coefficient between X and Z, and r_YZ represents the simple correlation coefficient between Y and Z. By comparing and adjusting the simple correlation coefficient between X and Y with the correlation coefficients between X and Z and Y and Z, we can get the partial correlation coefficient r_XY.Z of X and Y after controlling the influence of Z.

5. The profit analysis method of enterprise financial data based on statistical model according to claim 4 is characterized by: The value range of the partial correlation coefficient is between -1 and 1. When r_XY.Z is a positive number, it means that after controlling the influence of Z, there is a positive correlation between X and Y; when r_XY.Z is a negative number, it means that after controlling the influence of Z, there is a negative correlation between X and Y; when r_XY.Z is 0, it means that after controlling the influence of Z, there is no linear relationship between X and Y. Generally speaking, the closer |r_XY.Z| is to 1, the stronger the linear relationship between X and Y is after controlling the influence of other variables.

6. The profit analysis method of enterprise financial data based on statistical model according to claim 1, characterized in that: The multiple linear regression model in step S2 is as follows: The general form of a multiple linear regression model is: y=β0+β1x1+β2x2+...+β n ·x n +e Among them, y is the dependent variable, x1,x2,...,x n are the independent variables, β0,β1,...,β n is the model parameter to be estimated, ε is the error term, and the formula for the multiple linear regression model is: β=(X'X) -1 X'y Among them, X is the design matrix of independent variables, y is the vector of dependent variables, and β is the vector of model parameters to be estimated. In the multiple linear regression model, we use the least squares method to estimate the model parameters. This method finds the best fitting model parameters by minimizing the sum of squares of the residuals between the predicted values ​​and the actual values.

7. The profit analysis method of enterprise financial data based on statistical model according to claim 1, characterized in that: Step S3 Factor feature analysis includes the following steps: Y1: Factor characteristic analysis structure, including the following steps: Y11: Finding potential factor structures: By observing the correlations between variables, we can find some potential factor structures that may represent some commonality or essential characteristics in the data. Y12: Dimensionality reduction: By projecting variables onto fewer dimensions, we can simplify the complexity of the data and make it easier to understand and analyze the data. Y13: Explain the relationship between variables: Factor feature analysis can help us understand the relationship between variables and find out which variables have similar behaviors or trends; Y2: Model and formula for factor characteristic analysis The model of factor characteristic analysis can be expressed as: X=AF+ε Among them, X is the matrix of observation data (each row represents an observation and each column represents a variable), A is the factor loading matrix (each row represents a factor and each column represents a variable), F is the matrix of latent factors (each row represents a factor and each column represents an observation), ε is the error term, assuming that we have a data set X with n observations and p variables, and we hope to extract m latent factors F from it. Then, we can use the following formula to calculate the factor loading matrix A: A=(X'X) -1 X'Y Where X' is the transposed matrix of X and Y is the vector of dependent variables.

8. The profit analysis method of enterprise financial data based on statistical model according to claim 1 is characterized in that: Step S4 Logistics model or Naive Bayes model is as follows: Assuming we have a sample set and the feature vector of each sample is X, the model of Logistics regression can be expressed as: Among them, w is the weight vector and b is the bias term. For Logistic regression, we usually use the log-likelihood loss function, which is formulated as: Where N is the number of samples, y_i is the true label of the sample (0 or 1), and h(x_i) is the probability value predicted by the model.

9. The profit analysis method of enterprise financial data based on statistical model according to claim 1, characterized in that: Step S5 Naive Bayes model is as follows: Assuming we have a sample set, the feature vector of each sample is X, and the class label is y (assuming there are two categories, y = 0 or 1), then the naive Bayes model can be expressed as: Among them, w0,b0 and w1,b1 are the weights and bias terms of category 0 and category 1 respectively. For the Naive Bayes classifier, we usually use the log-likelihood loss function, which is formulated as: Where N is the number of samples, y_i is the true label of the sample (0 or 1), and P(y_i|x_i) is the probability value predicted by the model.

10. Application of the profit analysis method of enterprise financial data based on statistical model according to any one of claims 1 to 9 in financial data profit analysis.

Citation Information

Cited By

  • Data analysis method and device based on artificial intelligence, computer equipment and medium

    CN119558998A