Urban emission capacity and carbon emission capacity prediction method based on least square method and medium

By constructing the optimal ARIMA(p,d,q) model and least squares method to fit the linear equation, the problem of low prediction accuracy of urban pollution and carbon emissions is solved, and a strong systematic prediction method is realized, which is environmentally friendly. Policy development provides strong support.

CN119443359APending Publication Date: 2025-02-14STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411423696.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art has problems of low accuracy and lack of systematicity in the prediction of urban pollution and carbon emissions, which are difficult to meet actual needs.

Method used

Using the least squares method, the optimal ARIMA (p,d,q) model is constructed by obtaining the time series data of urban GDP, predicting GDP, and using the fitted linear equation to calculate the prediction results of pollution and carbon emissions. .

Benefits of technology

It realizes accurate prediction of urban pollution and carbon emissions, improves the systematicity and operability of the predictions, provides strong support for relevant decisions, and helps formulate effective environmental protection policies and measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443359A_ABST
    Figure CN119443359A_ABST
Patent Text Reader

Abstract

The invention relates to an urban emission capacity and carbon emission capacity prediction method based on a least square method and a medium. The method comprises the following steps: acquiring urban GDP time sequence data; the city GDP time sequence data are input into a pre-constructed optimal ARIMA (p, d, q) model for prediction, a city GDP prediction result is output, and p, d and q represent an autoregression term number, a moving average term number and a difference frequency respectively; based on the urban GDP prediction result, a fitting linear equation between the emission capacity and the GDP and a fitting linear equation between the carbon emission capacity and the GDP are calculated respectively, an urban emission capacity prediction result and an urban carbon emission capacity prediction result are obtained respectively, and fitting is conducted on the fitting linear equations through a least square method. Compared with the prior art, the method has the advantages of improving the prediction accuracy of the emission capacity and the carbon emission capacity and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of environmental data prediction, and in particular to a method and medium for predicting urban sewage and carbon emissions based on a least squares method. Background Art

[0002] Responding to climate change and maintaining a good ecological environment are the inherent requirements of sustainable development, and are the most universal welfare of the people and the fundamental basis for the sustainable development of people and society. The requirement of synergistic efficiency of pollution reduction and carbon reduction has made cities one of the key focus areas, and it is necessary to organize and carry out pilot projects for collaborative innovation in pollution reduction and carbon reduction, aiming to achieve the dual benefits of pollution reduction and carbon reduction through systematic and coordinated measures.

[0003] With the rapid economic development and the acceleration of urbanization, environmental pollution and carbon emissions are becoming increasingly serious, posing a challenge to sustainable development. Many cities are facing tremendous pressure to reduce pollution and carbon emissions. Therefore, accurately predicting urban pollution and carbon emissions is of great significance for formulating effective environmental protection policies and measures. At present, most of the research on carbon emission prediction is to predict a certain entity or a certain system. There are few macro predictions of urban carbon emissions, and few simultaneous predictions of urban pollution and carbon emissions.

[0004] In summary, there are some limitations in the prediction methods for urban pollution and carbon emissions, such as low prediction accuracy and lack of systematicity. Therefore, a more accurate and effective prediction method is needed to meet actual needs. Summary of the invention

[0005] The purpose of the present invention is to provide a method and medium for predicting urban pollution emissions and carbon emissions based on the least squares method to achieve accurate prediction of urban pollution emissions and carbon emissions.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] A method for predicting urban pollution and carbon emissions based on the least squares method comprises the following steps:

[0008] Get city GDP time series data;

[0009] Input the city GDP time series data into the pre-built optimal ARIMA (p, d, q) model for prediction, and output the city GDP prediction result, where p, d, and q represent the number of autoregressive terms, the number of moving average terms, and the number of differences, respectively;

[0010] Based on the city GDP prediction results, the fitting linear equations between pollution emissions and GDP and the fitting linear equations between carbon emissions and GDP are calculated respectively to obtain the city pollution emissions prediction results and the city carbon emissions prediction results respectively, wherein the fitting linear equations are fitted using the least squares method.

[0011] Furthermore, the steps of constructing the optimal ARIMA (p, d, q) model include:

[0012] Obtain the city's historical GDP time series data, conduct a stability test, and determine the d value;

[0013] Based on the d value, combined with the autocorrelation function and the partial autocorrelation function, a p value and a q value are determined;

[0014] Based on the d value, p value and q value, multiple ARIMA (p, d, q) models are obtained;

[0015] Compare multiple ARIMA(p,d,q) models and select the optimal ARIMA(p,d,q) model.

[0016] Furthermore, the step of determining the d value comprises:

[0017] Performing differential operations on the time series data respectively to obtain differential sequences;

[0018] The autocorrelation diagram and partial autocorrelation diagram of the difference sequence are plotted to determine the stationarity, and the number of differences is obtained, which is used as the d value.

[0019] Furthermore, the step of comparing multiple ARIMA (p, d, q) models includes:

[0020] Based on the multiple ARIMA (p, d, q) models, the AIC criterion or the BIC criterion is used to perform calculations respectively to obtain multiple AIC values ​​or BIC values;

[0021] The AIC values ​​or BIC values ​​are compared, and the ARIMA (p, d, q) model corresponding to the minimum value is selected as the optimal ARIMA (p, d, q) model.

[0022] Furthermore, the calculation expression of the BIC value is:

[0023] BIC=-2ln(L)+Kln(n)

[0024] Where BIC is the BIC value, L is the maximum likelihood function of the model, K is the number of model parameters, and n is the sample size.

[0025] Furthermore, the step of constructing the optimal ARIMA (p, d, q) model also includes: using a residual test method to test the prediction effect of the optimal ARIMA (p, d, q) model.

[0026] Furthermore, the execution steps of the residual test method include:

[0027] Obtain the city's historical GDP time series data, input it into the optimal ARIMA (p, d, q) model for prediction, and calculate the residual sequence between the prediction result and the corresponding true value;

[0028] The autocorrelation diagram and partial autocorrelation diagram of the residual sequence are drawn to obtain the absolute value and distribution of the autocorrelation coefficient and partial autocorrelation coefficient of the residual sequence, and the prediction effect of the optimal ARIMA (p, d, q) model is obtained.

[0029] Furthermore, the expression of the optimal ARIMA (p, d, q) model is:

[0030]

[0031] Where L is the lag operator, d∈Z, which means the number of differences d is an element in the integer set Z, d>0, φ i (i=1,2,...,p) is the autoregressive coefficient, L I represents the Ith power of the lag operator L, indicating that the corresponding variable is lagged Ith order, X t is the observed value of the time series at time t, q is the number of moving average items, θ i (i=1,2,...,q) is the moving average coefficient, ε t is a white noise sequence, and p is the number of autoregressive terms.

[0032] Furthermore, the step of fitting the straight line equation includes:

[0033] Given a point set {(x i ,y i )1≤i≤N}, set y=ax i +b is the straight line equation to be fitted, and the error index is:

[0034]

[0035] Based on the error index, a and b are derived respectively, and the following is obtained:

[0036]

[0037] Let S x =∑x i , S xy =∑x i yi , S y =∑y i , S xx =∑x i 2 , sorted out:

[0038]

[0039] According to formula (3), we can solve:

[0040]

[0041] Substitute equation (4) into the straight line equation to be fitted:

[0042]

[0043] Transform equation (5) into equation (6) to achieve straight line fitting:

[0044]

[0045] In the formula, x i ∈X is GDP data, y i ∈Y is the amount of pollutants or carbon emissions, X and Y are arrays, N is the number of data points, a and b are linear coefficients, ε is the error index, S x is the sum of the data of x, S xy is the sum of the products of x and y, S y is the sum of the data of y, S xx is the sum of the squares of x.

[0046] The present invention also provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the urban pollution emission and carbon emission prediction method based on the least squares method as described above.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] (1) Based on the time series prediction method, the present invention adopts the optimal ARIMA (p, d, q) model to accurately predict the development trend of urban GDP, and by considering the relationship between urban GDP and urban pollution and carbon emissions, the least squares method is used to fit the linear relationship between GDP results and pollution and carbon emissions, thereby achieving accurate prediction of urban pollution and carbon emissions.

[0049] (2) The present invention uses correlation and partial autocorrelation diagrams to determine the values ​​of p, d, and q of the ARIMA (p, d, q) model, combines multiple model options, and determines the final optimal prediction model by using the AIC / BIC criterion, thereby improving the accuracy of urban GDP prediction.

[0050] (3) The prediction method of the present invention has the advantages of strong systematicity and operability, and can provide strong support for relevant decision-making. In addition, the present invention conducts a comprehensive analysis of the results of pollution and carbon emissions, which is helpful to formulate targeted environmental protection policies and measures, improve the effect of pollution reduction and carbon reduction, and promote the sustainable development of the city. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0052] Figure 2 ARIMA model solution diagram of the present invention;

[0053] Figure 3 It is the GDP timing diagram after the first-order difference of the present invention;

[0054] Figure 4 It is the GDP timing diagram after the second-order difference of the present invention;

[0055] Figure 5 is the autocorrelation diagram of GDP after second-order difference of the present invention;

[0056] Figure 6 The partial autocorrelation diagram of GDP after the second-order difference of the present invention is

[0057] Figure 7 The residual sequence autocorrelation diagram and partial autocorrelation diagram of the present invention, wherein (a) is an autocorrelation diagram and (b) is a partial autocorrelation diagram;

[0058] Figure 8 This is the city GDP fitting effect of the present invention. DETAILED DESCRIPTION

[0059] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0060] This embodiment provides a method for predicting urban pollution and carbon emissions based on the least squares method. Figure 1 As shown, the method comprises the following steps:

[0061] Step 1: Forecast city GDP based on time series forecasting.

[0062] Draw a time series graph: Draw a time series graph based on the historical data of the city’s GDP, such as Figure 3 and Figure 4 shown.

[0063] Stationarity test: Stationarity test is performed by observing time series graphs, autocorrelation and partial autocorrelation graphs, and ADF unit root test method. From the time series graph of urban GDP, it can be clearly seen that the sequence contains a long-term increasing trend, indicating that the urban GDP data from 2001 to 2023 is a non-stationary time series and needs to be differentiated. After performing first-order and second-order difference operations on the sequence, the autocorrelation graph (ACF) and partial autocorrelation graph (PACF) of the second-order difference sequence are examined through SPSS software to further determine stationarity, such as Figure 5 and Figure 6 As shown in Figure 2, through analysis, the sequence after the second-order difference is stable, and the number of differences can be determined to be d=2.

[0064] Determine the model: This example uses the ARIMA (p, d, q) model for prediction, where p, d, and q represent the number of autoregressive terms, the number of moving average terms, and the number of differences, respectively. Figure 2 As shown, the value of d is determined by the number of differences, and the values ​​of p and q are determined by the autocorrelation function and the deflection function:

[0065] ①Observe the ACF and PACF graphs: After drawing the ACF and PACF graphs of the time series through data analysis software, observe the characteristics of these graphs. If the ACF graph shows that the autocorrelation coefficient gradually decays but does not suddenly truncate to zero (tailing phenomenon), and the PACF graph suddenly truncates to zero after lag p (truncation phenomenon), then the value of p can be preliminarily judged; similarly, if the PACF graph shows a tailing phenomenon, and the ACF graph suddenly truncates to zero after lag q, then the value of q can be preliminarily judged; if both the ACF and PACF graphs are tailing, try different combinations of p and q: Since the specific values ​​of p and q cannot be clearly determined, you can try multiple different combinations of p and q and establish multiple ARIMA (p, d, q) models for testing; if both the ACF and PACF graphs are truncated, there is no obvious autocorrelation in the series itself, and the ARIMA model may not be applicable. ②Establish multiple candidate models based on preliminary judgments: Based on the preliminary judgment of p and q, establish multiple candidates for the ARIMA (p, d, q) model. ③ Use AIC / BIC criteria to determine the best model: Use AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) to evaluate these candidate models. The smaller the AIC and BIC values, the better the model fits the data. By comparing the AIC and BIC values ​​of different models, the model with the smallest AIC / BIC value is selected as the final prediction model. Then use data analysis software to draw residual autocorrelation diagrams and partial autocorrelation diagrams to determine whether the residual sequence of the model is a white noise sequence.

[0066] For the second-order difference time series diagram of urban GDP, the ARIMA (0,2,0) model, ARIMA (0,2,1) model, ARIMA (1,2,0) model, and ARIMA (1,2,1) model are established based on the ACF diagram and the PACF diagram, and the optimal model is determined according to the AIC criterion / BIC criterion. According to the BIC criterion, the smaller the BIC value, the better the model fits the data. By comparing the BIC values ​​of different models, ARIMA (0,2,1) is determined to be the optimal model for predicting urban GDP. The specific comparison is shown in Table 1.

[0067] Table 1 Comparison of BIC values ​​of different models

[0068] Model BIC value ARIMA(0,2,0) 308.978 ARIMA(0,2,1) 304.258 ARIMA(1,2,0) 309.880 ARIMA(1,2,1) 306.388

[0069] Among them, the calculation formula of BIC (Bayesian Information Criterion) is:

[0070] BIC=-2ln(L)+Kln(n)

[0071] Where L represents the maximum likelihood function of the model, K represents the number of model parameters, and n represents the sample size. The smaller the BIC value, the better the model fits the data, the simpler the model, and the more likely it is to be the optimal model.

[0072] Residual test: According to the ARIMA (0,2,1) model, the GDP forecast values ​​of the city from 2001 to 2023 are obtained, and the residual sequence between the predicted value and the true value is calculated. The ACF and PACF diagrams of the residual sequence are drawn using SPSS software, as shown in the figure below: Figure 7 As shown. Figure 7 It can be seen from Figure (a) and Figure (b) that the absolute values ​​of the autocorrelation coefficient and partial autocorrelation coefficient of the residual sequence are both <0.5, and the autocorrelation coefficient and partial autocorrelation coefficient are distributed in the range centered on 0. Therefore, the residual sequence can be considered to be independent of each other and a white noise sequence. This shows that the model has a good prediction effect and can be used to predict the GDP of the city.

[0073] Data forecast: Since the city GDP data listed above are annual data, seasonal factors can be eliminated and seasonal analysis is not necessary. Through the three parameters p, d, and q determined above, and based on the BIC criterion, the optimal model ARIMA (0,2,1) for predicting city GDP is determined. This model is used to perform modeling and forecasting in the SPSS system. The fitting effect is as follows: Figure 8 As shown. Figure 8 It can be seen that the observed and fitted values ​​of the city's GDP from 2001 to 2023 are close, which shows that the fitting effect is good. According to the determined optimal model, the forecast results of the city's GDP from 2024 to 2030 are obtained. The forecast values ​​of the city's GDP from 2024 to 2030 are 4915.187 billion yuan, 5140.141 billion yuan, 5365.095 billion yuan, 5590.049 billion yuan, 5815.002 billion yuan, 6039.956 billion yuan and 6264.910 billion yuan respectively. This shows that the city's GDP will continue to maintain rapid and stable growth in the next five years, and it is expected that the city's GDP will exceed the 6000 billion yuan mark in 2029.

[0074] Step 2: Predict urban pollution and carbon emissions based on the least squares method.

[0075] The basic principle of least squares method: given a set of points {(x i ,y i )1≤i≤N}, it can be assumed is the equation of the straight line to be fitted, and the error index is

[0076]

[0077] Derivatives of a and b respectively:

[0078]

[0079] Let S x =∑xi , S xy =∑x i y i , S y =∑y i , S xx =∑x i 2 , sorted

[0080]

[0081] According to the above formula, we can get

[0082]

[0083] Substituting a and b into the equation of the line is

[0084]

[0085] Convert the above formula into the following form

[0086]

[0087] Urban pollution emission forecast: For the forecast of total atmospheric pollutant emissions, the least squares method is used in Python language to calculate according to the data provided in the document. First, the GDP data and total atmospheric pollutant emission data of the city from 2018 to 2023 are stored in arrays X and Y respectively. Then, the two sets of data are processed and calculated through built-in functions and formulas to obtain the coefficients a and b of the fitting equation. Finally, the fitting straight line equation between total atmospheric pollutant emissions and GDP is obtained as:

[0088] Y 污染物总量 =-1.0937X GDP +67367.57

[0089] Table 2 Forecast of total pollutant emissions in a city from 2024 to 2030

[0090] years Pollutant emissions (unit: tons) Month-on-month speed 2024 13190.50 — 2025 10756.49 -18.45% 2026 8167.24 -24.07% 2027 5654.49 -30.77% 2028 3154.15 -44.22% 2029 666.95 -78.85% 2030 Close to 0 —

[0091] Based on this equation and the city's GDP from 2024 to 2030, we can predict the city's pollutant emissions from 2024 to 2030. The prediction results show that during this period, pollutant emissions will show a certain trend of change as GDP grows. The total amount of pollutant emissions from the city from 2024 to 2030 is shown in Table 2.

[0092] Urban carbon emission forecast: The least square method is also used to calculate the forecast of carbon dioxide emissions. The GDP data and carbon dioxide emission data of the city from 2001 to 2023 are processed. After a series of calculation steps, the fitting straight line equation between carbon dioxide emissions and GDP is obtained as follows:

[0093] Y CO2 =0.1449X GDP +14690.2228

[0094] Based on this equation and the city's GDP from 2024 to 2030, we can predict the city's carbon dioxide emissions from 2024 to 2030. The prediction results show that during this period, carbon dioxide emissions will show a certain trend of change as GDP grows. The city's carbon dioxide emissions forecast from 2024 to 2030 is shown in Table 3.

[0095] Table 3 Forecast of carbon dioxide emissions in a city from 2024 to 2030

[0096] years CO2 emissions Month-on-month speed 2024 21864.49 — 2025 22196.78 1.52% 2026 22529.07 1.49% 2027 22861.36 1.48% 2028 23193.64 1.45% 2029 23525.93 1.43% 2030 23858.22 1.41%

[0097] Analyze the results of pollution and carbon emissions:

[0098] Pollutant emission analysis: including analysis of overall trends, periodic changes and influencing factors. From 2001 to 2030, the total amount of urban air pollutant emissions will show a significant downward trend. The initial air pollutant emissions are relatively high, and as time goes by, the emissions will gradually decrease. Especially in recent years, the pollution reduction effect is more obvious. By 2030, the total amount of air pollutant emissions will be close to 0. From 2001 to 2011, although the total amount of air pollutant emissions fluctuated, the overall downward trend was relatively gentle. In 2011, there was a significant decline. From 2011 to 2016, it continued to decline, but the speed changed. After 2016, the speed of pollution reduction has accelerated significantly. Influencing factors include policy factors, technological progress and public awareness.

[0099] Carbon emission analysis: including analysis of overall trends, phased changes and influencing factors. From 2001 to 2030, the total amount of urban carbon dioxide emissions showed a trend of first rising and then stabilizing and slightly declining. In the early stage, with the development of the economy and the increase in energy consumption, carbon dioxide emissions continued to rise. In recent years, with the strengthening of energy-saving and emission reduction measures, emissions began to show a downward trend. From 2001 to 2010, the total amount of carbon dioxide emissions continued to rise. From 2010 to 2012, the growth rate declined, but still maintained positive growth. In 2012, negative growth occurred, which was the turning point of this stage. From 2012 to 2023, carbon dioxide emissions rose in fluctuations. From 2023 to 2030, it is predicted that carbon dioxide emissions will continue to rise, but the rate of increase will gradually slow down. Influencing factors include economic development, energy structure and technological innovation.

[0100] Coordinated analysis of pollution reduction and carbon reduction: including analysis of effectiveness, economic synergy and future development suggestions. Cities have achieved remarkable results in pollution reduction and carbon reduction. The substantial decline in the total amount of air pollutant emissions shows that the city's efforts in air pollution control have paid off, and the trend of changes in the total amount of carbon dioxide emissions also shows the city's positive actions in addressing climate change. Pollution reduction and carbon reduction actions can promote sustainable economic development. By reducing air pollutant emissions and carbon emissions, it can improve environmental quality, attract more investment and talents, and promote economic development. At the same time, economic development also provides financial and technical support for pollution reduction and carbon reduction, and realizes a virtuous cycle of economic development and environmental protection. In the future, cities should continue to strengthen environmental protection and energy conservation and emission reduction, further promote industrial structure upgrading, increase investment in the research and development of clean energy and environmental protection technologies, and enhance the public's environmental awareness in order to achieve the goal of sustainable development.

[0101] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0102] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0103] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for predicting urban pollution and carbon emissions based on the least squares method, characterized in that: The following steps are involved: Get city GDP time series data; Input the city GDP time series data into the pre-built optimal ARIMA (p, d, q) model for prediction, and output the city GDP prediction result, where p, d, and q represent the number of autoregressive terms, the number of moving average terms, and the number of differences, respectively; Based on the city GDP prediction results, the fitting linear equations between pollution emissions and GDP and the fitting linear equations between carbon emissions and GDP are calculated respectively to obtain the city pollution emissions prediction results and the city carbon emissions prediction results respectively, wherein the fitting linear equations are fitted using the least squares method.

2. A method for predicting urban pollution and carbon emissions based on the least squares method according to claim 1, characterized in that: The steps of constructing the optimal ARIMA (p, d, q) model include: Obtain the city's historical GDP time series data, conduct a stability test, and determine the d value; Based on the d value, combined with the autocorrelation function and the partial autocorrelation function, a p value and a q value are determined; Based on the d value, p value and q value, multiple ARIMA (p, d, q) models are obtained; Compare multiple ARIMA(p,d,q) models and select the optimal ARIMA(p,d,q) model.

3. The method for predicting urban pollution and carbon emissions based on the least squares method according to claim 2 is characterized in that: The step of determining the d value comprises: Performing differential operations on the time series data respectively to obtain differential sequences; The autocorrelation diagram and partial autocorrelation diagram of the difference sequence are plotted to determine the stationarity, and the number of differences is obtained, which is used as the d value.

4. The method for predicting urban pollution and carbon emissions based on the least squares method according to claim 2 is characterized in that: The step of comparing multiple ARIMA (p, d, q) models includes: Based on the multiple ARIMA (p, d, q) models, the AIC criterion or the BIC criterion is used to perform calculations respectively to obtain multiple AIC values ​​or BIC values; The AIC values ​​or BIC values ​​are compared, and the ARIMA (p, d, q) model corresponding to the minimum value is selected as the optimal ARIMA (p, d, q) model.

5. A method for predicting urban pollution and carbon emissions based on the least squares method according to claim 4, characterized in that: The calculation expression of the BIC value is: BIC=-2ln(L)+Kln(n) Where BIC is the BIC value, L is the maximum likelihood function of the model, K is the number of model parameters, and n is the sample size.

6. A method for predicting urban pollution and carbon emissions based on the least squares method according to claim 2, characterized in that: The step of constructing the optimal ARIMA (p, d, q) model also includes: using a residual test method to test the prediction effect of the optimal ARIMA (p, d, q) model.

7. A method for predicting urban pollution and carbon emissions based on the least squares method according to claim 6, characterized in that: The execution steps of the residual test method include: Obtain the city's historical GDP time series data, input it into the optimal ARIMA (p, d, q) model for prediction, and calculate the residual sequence between the prediction result and the corresponding true value; The autocorrelation diagram and partial autocorrelation diagram of the residual sequence are drawn to obtain the absolute value and distribution of the autocorrelation coefficient and partial autocorrelation coefficient of the residual sequence, and the prediction effect of the optimal ARIMA (p, d, q) model is obtained.

8. The method for predicting urban pollution and carbon emissions based on the least squares method according to claim 1, characterized in that: The expression of the optimal ARIMA (p, d, q) model is: Where L is the lag operator, d∈Z, which means the number of differences d is an element in the integer set Z, d>0, φ i (i=1,2,...,p) is the autoregressive coefficient, L I represents the Ith power of the lag operator L, indicating that the corresponding variable is lagged Ith order, X t is the observed value of the time series at time t, q is the number of moving average items, θ i (i=1,2,...,q) is the moving average coefficient, ε t is a white noise sequence, and p is the number of autoregressive terms.

9. The method for predicting urban pollution and carbon emissions based on the least squares method according to claim 1, characterized in that: The fitting step of the straight line equation includes: Given a point set {(x i ,y i )1≤i≤N}, set y=ax i +b is the straight line equation to be fitted, and the error index is: Based on the error index, a and b are derived respectively, and the following is obtained: Let S x =∑x i , S xy =∑x i y i , S y =∑y i , Arranged: According to formula (3), we can solve: Substitute equation (4) into the straight line equation to be fitted: Transform equation (5) into equation (6) to achieve straight line fitting: In the formula, x i ∈X is GDP data, y i ∈Y is the amount of pollutants or carbon emissions, X and Y are arrays, N is the number of data points, a and b are linear coefficients, ε is the error index, S x is the sum of the data of x, S xy is the sum of the products of x and y, S y is the sum of the data of y, S xx is the sum of the squares of x.

10. A computer-readable storage medium, characterized in that: It includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing the urban pollution emission and carbon emission prediction method based on the least squares method as described in any one of claims 1-9.