Social economic energy index data processing method based on grey correlation analysis method

Energy consumption trend prediction and correlation analysis are carried out through the gray system method, which solves the problem of insufficient flexibility and accuracy of energy consumption prediction in the existing technology, achieves comprehensive analysis and visual display of multi-dimensional data, and provides decision-makers with information important basis and promotes sustainable development.

CN118536653APending Publication Date: 2024-08-23XI'AN PETROLEUM UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410588160.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing technologies lack flexibility and accuracy in energy consumption forecasting, especially in processing multi-dimensional data and spatial econometric analysis, making it difficult to fully understand the correlation between population, economy and energy consumption.

Method used

Adopt a method based on the gray system, through gray prediction and gray correlation analysis, combined with data preprocessing, level ratio detection, data cleaning and multi-dimensional data processing, to predict energy consumption trends and analyze influencing factors, and use matplotlib to draw correlation diagrams to visually display indicators relation.

Benefits of technology

It improves the accuracy and flexibility of energy consumption forecasting, can process multi-dimensional data, provides more comprehensive and accurate analysis results, provides important basis for decision-makers to formulate effective policies and price control measures, and promotes sustainable development and improvement of resource utilization efficiency. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118536653A
    Figure CN118536653A
Patent Text Reader

Abstract

A social economic energy index prediction and association method based on a grey system comprises the steps of 1, extracting a data set of economy, population and energy consumption, and recording the data set as a sample A; 2, preprocessing the sample A obtained in the step 1 to obtain a sample B; step 3, performing level ratio detection on the sample B obtained in the step 2, if the level ratio detection is passed, establishing a model, otherwise, reprocessing data; 4, performing model data prediction on the sample B subjected to the level ratio detection in the step 3, recording obtained prediction data as a sample C, and calculating an error of the sample C; 5, performing data normalization on the sample C obtained in the step 4 to obtain a sample D; step 6, according to the sample D obtained in the step 5, calculating a correlation degree function and carrying out correlation analysis; step 7, drawing an association graph by using matplotlib, and analyzing a result; according to the method, statistical analysis methods such as grey prediction and a grey correlation method are comprehensively utilized, and future data are predicted and analyzed under the condition that the data size is small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data science analysis, and in particular relates to a prediction and correlation method of social economic energy indicators based on a grey system. Background Art

[0002] Today is an era of big data explosion. With the continuous development and growth of my country, the social development indicators of my country are growing rapidly in the form of exponential growth every year. Economic development and population growth have a profound impact on energy consumption. Especially with the rapid development of urbanization, the demand and consumption of energy are more significant. Therefore, understanding the relationship between economy, population and energy consumption is an important basis for formulating effective policies and strategies.

[0003] In the socio-economic field, population growth and economic development are considered to be the main social variables, and energy consumption is an important result of them. Population growth means the continuous increase in demand for housing, transportation, food and other basic living needs, which leads to a greater demand for energy. Economic development and expansion require more energy to support the development of production and service industries, further increasing the level of energy consumption. Therefore, it is crucial to have a deep understanding of the relationship between population, economy and energy consumption.

[0004] However, current research mainly uses time series analysis methods, but rarely conducts cross-sectional data analysis, and lacks the application of spatial econometric analysis. In an article titled "Spatial Econometric Analysis of China's Provincial Energy Consumption" in the 3rd issue of Volume 18 of "China Population, Resources and Environment" in 2008, researchers used the province as a spatial sample and applied spatial econometric methods to analyze China's provincial energy consumption and its influencing factors from 2002 to 2005. Although the study has made some valuable discoveries, its method still has some shortcomings. In particular, in terms of energy consumption forecasting, the existing methods lack flexibility and accuracy. Summary of the invention

[0005] In order to overcome the defects of the above-mentioned prior art, the purpose of the present invention is to provide a prediction and correlation method for socio-economic energy indicators based on a grey system, which can more comprehensively and accurately predict future energy consumption trends and provide in-depth insights into factors affecting energy consumption by comprehensively using statistical analysis methods such as grey prediction and grey correlation method; in addition, the method can also process multidimensional data, including time, space and other related indicators, to more comprehensively analyze the factors affecting energy consumption; such a comprehensive method and data processing technology can help decision makers better formulate energy consumption policies and price control measures to promote sustainable development and improve resource utilization efficiency, solve the problem of using a small amount of data for prediction, and provide a basis for decision makers.

[0006] In order to achieve the above object, the technical solution adopted by the present invention is:

[0007] A method for predicting and associating socio-economic energy indicators based on a grey system comprises the following steps:

[0008] Step 1: Extract the data set of economy, population, and energy consumption, recorded as sample A;

[0009] Step 2, preprocessing the sample A obtained in step 1 to obtain sample B;

[0010] Step 3, perform level ratio detection on sample B obtained in step 2 to determine whether the data sequence has a stable development trend and whether the level ratio relationship between the data exists; sample B that passes the level ratio detection can be further subjected to grey prediction, on the contrary, if the level ratio detection fails, data cleaning, correction or elimination of outliers, data transformation, and mathematical transformation methods are used to make the data have a stable level ratio relationship;

[0011] Step 4, substitute the sample B detected by the level ratio in step 3 into the grey prediction model for data prediction, record the obtained prediction data as sample C, and calculate its error;

[0012] Step 5, normalize the data of sample C obtained in step 4 to obtain sample D;

[0013] Step 6, according to the sample D obtained in step 5, the correlation function is calculated based on the grey correlation method and correlation analysis is performed;

[0014] Step 7, use matplotlib to draw the correlation diagram and analyze the results.

[0015] The specific process of step 2 is: divide the data set into three parts: economy, population, and energy consumption. Use the numpy library to process missing values ​​and outliers, and then put the processed data sets into three python lists and record them as sample B.

[0016] The specific process of step 3 is: obtain the length of sample B obtained in step 2 and record it as n, calculate the level ratio of each data point through a loop, and determine whether the level ratio is within the specified range. If it meets the requirements, it is marked as 1, otherwise it is 0.

[0017] The specific process of step 4 is:

[0018] Step 4.1, calculate the cumulative generated sequence X1 and initialize the z sequence, and calculate the z sequence according to the cumulative generated sequence;

[0019] Step 4.2, calculate the data matrix B and data vector Y according to the sample B obtained in step 3;

[0020] Step 4.3, calculate a and b in the cumulative generation operator through the least squares function of numpy;

[0021] Step 4.4, initialize the prediction accumulation sequence f_X1, initialize the prediction sequence f_X0, and calculate f_X1 using a and b obtained in step 4.3;

[0022] Step 4.5, calculate the final prediction result f_X0 through f_X1 obtained in step 4.4 and record it as sample C;

[0023] Step 4.6, calculate the residual sequence and the level ratio deviation value sequence to evaluate the prediction results.

[0024] The specific process of step 6 is:

[0025] Step 6.1, calculate the average value of the sample D obtained in step 5, denoted as mean;

[0026] Step 6.2, calculate the difference between each value of sample D obtained in step 5 and the average value, denoted as diff;

[0027] Step 6.3, calculate the correlation coefficient by combining the mean obtained in step 6.1 and the diff obtained in step 6.2;

[0028] Step 6.4, construct the correlation coefficient obtained in step 6.3 into a python list, use the sorted function to sort the list, and then rank the sorted results.

[0029] Compared with the prior art, the advantages of the present invention are:

[0030] 1. In step 3 of the present invention, by performing a level ratio test on the data sequence, it can be determined whether the data has a stable development trend and whether there is a reasonable level ratio relationship between the data. If the prerequisites for grey prediction are not met, the present invention also proposes using data cleaning, correction and other processing methods to make the data meet the requirements of grey prediction. This preprocessing step helps to improve the reliability and accuracy of the prediction model, thereby laying a solid data foundation for subsequent association analysis.

[0031] 2. In step 6 of the present invention, the grey correlation analysis method is used to calculate the correlation function and perform correlation analysis, comprehensively considering the correlation between multiple indicators and comprehensively revealing the influence of each indicator on energy consumption.

[0032] 3. Step 7 of the present invention uses matplotlib to draw a correlation diagram, which intuitively shows the correlation between different indicators, helping decision makers to better understand the analysis results. This provides an important basis for formulating energy consumption policies and price control measures. Therefore, the comprehensive method of the present invention has significant advantages in data processing efficiency, analysis dimension, comprehensive analysis ability and visual display, and provides an innovative solution for energy consumption research and decision support.

[0033] In summary, the present invention uses a combination of grey prediction and grey correlation analysis methods to improve efficiency and flexibility. Compared with traditional time series analysis methods, the present invention can accurately predict future energy consumption trends, even with less data, and provide important basis for decision-makers. At the same time, the present invention can process multi-dimensional data, including time, space and other relevant socio-economic indicators, making the analysis of factors affecting energy consumption more comprehensive and accurate. This flexibility helps decision makers better understand the correlation between energy consumption and socio-economic indicators. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a flowchart of the overall process of the present invention.

[0035] Figure 2 The present invention predicts the changing trend chart of population, GDP and energy consumption from 2020 to 2060. DETAILED DESCRIPTION

[0036] The present invention is described in detail below through the accompanying drawings and specific implementation methods.

[0037] Reference Figure 1 , a prediction and correlation method of socio-economic energy indicators based on grey system, including the following steps:

[0038] Step 1: Extract the data set of economy, population, and energy consumption, recorded as sample A. These data can be obtained from official statistics, research reports or other reliable sources. In this embodiment, the economic, population and energy consumption data of a city in the past ten years are used as sample A. In order to ensure the reliability and representativeness of the data, special attention is paid to the selection of data sources and the time span of the data set. For example, the selected economic data include but are not limited to GDP, industrial added value, etc., the population data covers the total population, population growth rate, etc., and the energy consumption includes the consumption of various energy sources such as electricity, oil and natural gas.

[0039] Step 2: Preprocess sample A obtained in step 1 to obtain sample B. The key to preprocessing is to ensure the accuracy and consistency of the data, which includes processing missing values ​​and outliers in the data, and putting the processed data into three Python lists and uniformly recording them as sample B. The purpose of this step is to clean the data and make it available for subsequent modeling and prediction. In this embodiment, the function of the numpy library is used to process missing values ​​and outliers. For example, for missing values, interpolation or mean value replacement methods are used; for outliers, methods based on standard deviation or quartiles are used for identification and processing.

[0040] Step 3: Perform a level ratio test on sample B obtained in step 2. If it passes, a model is established, otherwise the data is reprocessed. Level ratio detection is to calculate the level ratio value of each data point and compare it with the preset range. If it meets the requirements, the data point is considered to be usable for modeling and prediction, otherwise the data needs to be reprocessed. In this embodiment, the range of the level ratio value is set to (0,1), and a loop is used to calculate the level ratio value of each data point. This step is the key to the establishment of the grey model, because the rationality of the level ratio directly affects the stability of the model and the prediction accuracy.

[0041] Step 4: Substitute the sample B detected by the level ratio in step 3 into the gray prediction model for data prediction, record the obtained predicted data as sample C, and calculate its error. In this embodiment, the data matrix B and data vector Y are first calculated according to sample B. Then, the coefficients a and b in the cumulative generation operator are calculated using the least squares function of numpy. Next, the predicted cumulative generation sequence f_X1 and the predicted sequence f_X0 are calculated using these coefficients, and the final prediction result f_X0 is calculated as sample C. Finally, the residual sequence and the level ratio deviation value sequence are calculated to evaluate the accuracy and reliability of the prediction results. For example, the calculation of the residual sequence can reveal the difference between the predicted value and the actual value, while the level ratio deviation value sequence helps to understand the performance of the model at different data points.

[0042] Step 5: Normalize the data of sample C obtained in step 4 to obtain sample D. The purpose of data normalization is to unify data of different scales for subsequent association analysis. In this embodiment, the maximum-minimum normalization method is used to normalize the data of sample C. This step is critical because it ensures that different indicators can be compared on the same scale, making the association analysis more accurate and effective.

[0043] Step 6: Based on the sample D obtained in step 5, calculate the correlation function and perform correlation analysis. The correlation function is used to measure the degree of correlation between the data points in sample D, and the correlation analysis classifies and identifies the correlation between the data points based on the result of the correlation function. First, the mean value mean of sample D and the difference diff between each value and the mean value are calculated, and then the correlation coefficient is calculated by combining mean and diff. Next, the correlation coefficient is constructed as a Python list and the list is sorted using the sorted function. Finally, the sorted results are graded and used as the result of the correlation analysis. For example, you can analyze the combination of indicators with high correlation to understand which economic, population or energy consumption indicators have a closer mutual influence.

[0044] Step 7: Use matplotlib to draw a correlation diagram and analyze the results. In this embodiment, the matplotlib library is used to draw a correlation diagram. First, the data points of sample D are used as points in the scatter plot, and based on the results of the correlation analysis, these points are distinguished by color according to the correlation level. Then, the function of matplotlib is used to beautify the graph, such as adding titles, axis labels, and legends. Finally, the correlation diagram is analyzed to observe the distribution of data points with different correlation levels, and to conduct an in-depth exploration of the relationship between socio-economic energy indicators. For example, Figure 2 As shown, it reveals the close correlation between economic growth and energy consumption, or the potential impact of population changes on economic indicators.

[0045] Through the above steps, the implementation process of the prediction and correlation method of socio-economic energy indicators based on the grey system has been described in more detail, which not only provides an effective methodological framework, but also provides useful reference and help for research and practice in the field of socio-economic energy.

Claims

1. A prediction and correlation method of socio-economic energy indicators based on grey system, It is characterized in that The following steps are involved: Step 1: Extract the data set of economy, population, and energy consumption, recorded as sample A; Step 2, preprocessing the sample A obtained in step 1 to obtain sample B; Step 3, perform level ratio detection on sample B obtained in step 2 to determine whether the data sequence has a stable development trend and whether the level ratio relationship between the data exists; sample B that passes the level ratio detection can be further subjected to grey prediction, on the contrary, if the level ratio detection fails, data cleaning, correction or elimination of outliers, data transformation, and mathematical transformation methods are used to make the data have a stable level ratio relationship; Step 4, substitute the sample B detected by the level ratio in step 3 into the grey prediction model for data prediction, record the obtained prediction data as sample C, and calculate its error; Step 5, normalize the data of sample C obtained in step 4 to obtain sample D; Step 6, according to the sample D obtained in step 5, the correlation function is calculated based on the grey correlation method and correlation analysis is performed; Step 7, use matplotlib to draw the correlation diagram and analyze the results.

2. According to claim 1, a method for predicting and associating socio-economic energy indicators based on a grey system, It is characterized in that The specific process of step 2 is: The data set is divided into three parts: economy, population, and energy consumption. The missing values ​​and outliers are processed using the numpy library. The processed data sets are then put into three python lists and collectively recorded as sample B.

3. According to the prediction and correlation method of social economic energy indicators based on grey system in claim 1, It is characterized in that The specific process of step 3 is: The length of sample B obtained in step 2 is recorded as n. The level ratio of each data point is calculated through a loop, and it is determined whether the level ratio is within the specified range. If it meets the requirements, it is marked as 1, otherwise it is 0.

4. According to claim 1, a method for predicting and associating socio-economic energy indicators based on a grey system, It is characterized in that The specific process of step 4 is: Step 4.1, calculate the cumulative generated sequence X1 and initialize the z sequence, and calculate the z sequence according to the cumulative generated sequence; Step 4.2, calculate the data matrix B and data vector Y according to the sample B obtained in step 3; Step 4.3, calculate a and b in the cumulative generation operator through the least squares function of numpy; Step 4.4, initialize the prediction accumulation sequence f_X1, initialize the prediction sequence f_X0, and calculate f_X1 using a and b obtained in step 4.3; Step 4.5, calculate the final prediction result f_X0 through f_X1 obtained in 4.4 and record it as sample C; Step 4.6, calculate the residual sequence and the level ratio deviation value sequence to evaluate the prediction results.

5. The method for predicting and associating socio-economic energy indicators based on a grey system according to claim 1, It is characterized in that The specific process of step 6 is: Step 6.1, calculate the average value of the sample D obtained in step 5, denoted as mean; Step 6.2, calculate the difference between each value of sample D obtained in step 5 and the average value, denoted as diff; Step 6.3, calculate the correlation coefficient by combining the mean obtained in step 6.1 and the diff obtained in step 6.2; Step 6.4, construct the correlation coefficient obtained in step 6.3 into a python list, use the sorted function to sort the list, and then rank the sorted results.