Public Environment Emotion Prediction Model Using LSTM Network

: Public environmental sentiment has always played an important role in public social sentiment and has a certain degree of inﬂuence. Adopting a reasonable and e ﬀ ective public environmental sentiment prediction method for the government’s public attention in environmental management, promulgation of local policies, and hosting characteristics activities has important guiding signiﬁcance. By using VAR (vector autoregressive), the public environmental sentiment level prediction is regarded as a time series prediction problem. This paper studies the development of a mobile “impression ecology” platform to collect time spans in ﬁve cities in Lanzhou for one year. In addition, a parameter optimization algorithm, WOA (Whale Optimization Algorithm), is introduced on the basis of the prediction method. It is expected to predict the public environmental sentiment more accurately while predicting the atmospheric environment. This paper compares the decision performance of LSTM (Long Short-Term Memory) and RNN (Recurrent Neural Network) models on the public environment emotional level through experiments, and uses a variety of error assessment methods to quantitatively analyze the prediction results, verifying the LSTM’s performance in prediction performance and level decision-making e ﬀ ectiveness and robustness.


Introduction
The atmospheric environment is the natural space in which human beings live, and it is also the physical space in which human production and life directly interact [1]. While the atmospheric environment has improved in recent years, its real situation still worries us [2][3][4][5]. While resolving this kind of problem, we also found that the "environmental panic" [6] problem caused by the atmospheric pollution problem is becoming more and more serious [7][8][9]. For example, when there is smog, the public shows a negative attitude towards work and life and reduces going out. The public has different "emotions" to the environment because of various "situations" of the environment. This environmental mood is formed by public subjective consciousness and interferes with our thinking and behaviors [10]. It can also affect our social emotions. However, the implementation of some government policies and the organization of events have not received the expected good results due to the impact of public environmental sentiments [11][12][13][14][15]. Therefore, public environmental sentiment prediction is of great significance. This article will carry out a deep research over whether the public environmental emotion can be predicted, and how we should capture and collect the public environmental emotion [16]. Can public environmental sentiments be predicted? If they can be predicted, how will we predict them? In the study of this paper, we put forward the hypothesis that we believe that the relationship between atmospheric environmental factors and public environmental emotions can be used to predict the paves the way for the construction of a public environmental sentiment prediction model. In this paper, the LSTM neural network model and RNN neural network model will be used to predict the public environmental sentiment, and the "public environmental sentiment prediction model" will be determined by referring to the prediction accuracy and error analysis between the two models.

Data Materials
In the era of big data, the emergence of pervasive computing has greatly enriched and enhanced researchers' access to data and ability. Social perception computing is the product of the integration of social computing and pervasive computing, which is driven by the demand of social computing and the development of pervasive computing technology. Social perception computing can obtain large-scale, objective, real-time and continuous information about human social behaviors and interactions through large-scale and multiple kinds of sensing devices, such as universal sensors (RFID, motion sensors, audio and video sensors, etc.), smart phones (GPS, call records, SMS), combined with email, web (DBLP, forums, social networking sites, blogs, wikis), etc. The continuous and dynamic field data provide a solid foundation for the study of human behavior understanding and interaction rule understanding. In addition to analysis and understanding, social perception computing also emphasizes providing intelligent assistance and support for human behavior and interaction from three levels: Individual, group and society.
The public's perception and understanding of the change of regional ecological environment will directly determine the public's satisfaction with the quality of the ecological environment, the enthusiasm to participate in environmental protection, environmental behavior and environmental awareness, and make a positive response to the government's environmental management policies. Group intelligence perception is based on the perception mode of a human based perception unit (device), which forms a perception network through people's existing mobile devices, and publishes the perception task to individuals or groups in the network to complete, so as to help professionals or the public to collect data, analyze information and share knowledge. Compared with the general way of perception, a large number of sensors need to be arranged in advance. Swarm intelligence perception uses the idea of crowdsourcing to assign tasks to the public with mobile devices, and the public upload their own perception data of mobile device use, playing the role of sensors, thus saving a large amount of costs. Swarm intelligence sensing has many advantages, such as flexible deployment, heterogeneous multi-source sensing data, wide and uniform coverage, high expansion and multi-function. It provides a new mode of sensing environment, collecting data and providing information services for data sensing, and has been focused on in the aspect of ecological environment sensing.

Data Sources of Public Environment Emotion
This paper studies the early development of the data service platform "impression ecology" app. In the early stage of project development, the platform data collection mechanism and data collection mode are designed, and the relevant researchers of environmental science and environmental psychology are contacted for cooperation and exchange. In the early stage of public environmental sentiment data, the user's direct scoring mode is adopted. However, considering that this mode will influence or interfere with the intuitive environmental factors due to the user's objective factors (such as gender, age, physical health, nature of work, etc.), another scheme design of data collection will be carried out.
After a comprehensive consideration of the above issues, this study decided to develop a calculation model, through which to calculate and quantify the public environmental sentiment of platform users. First of all, in the early stage of model design, researchers of environmental science and environmental psychology discussed the design of environmental perception words for the platform. These perception words refer to the human body's intuitive feeling (vision, smell, touch, hearing, Sustainability 2020, 12, 1665 4 of 16 collective sense), as well as the systematic study of "body cognition", and a total of 27 perception words were designed, shown as Table 1. After the design of perception words, the platform test stage is carried out, and the environment-friendly volunteers are recruited for the perception calculation model to collect the early data (in this part, only through the "impression ecology" platform, volunteers are required to select the perception words and score the environment at that time). The time span of the test stage is one year. The platform collected environmental perception data of volunteers, including perception words and scoring data of different environmental conditions in four seasons, which is called "public environmental satisfaction". The data are shown in Table 2. In this paper, we use these experimental data to construct the "perception model" with the idea of multi model fusion. The test results show that the accuracy of the public environmental satisfaction calculated by the calculation model is high; the research can add the calculation model to the platform to collect the data of "public environmental satisfaction" for the study of public environmental sentiment prediction. In Table 1, the value range of SATISFACTION is 0-100. We will subdivide this value later and divide it into different levels of public environmental sentiment. LABEL is the perceived word of design. Its main function is to calculate public environmental perception satisfaction. The "impression ecology" app was officially launched and operated for one year. Through the platform, thousands of users in Lanzhou collected "public environmental satisfaction" data, with a total of 35,505 time series data, covering the period from 1 October 2016 to 30 September 2017. According to the comprehensive analysis, there are different ages, genders, education levels and occupations among the users who submit the data. This study considers that the data is representative, and can be used to divide the emotional level of "public environmental satisfaction" and generate the public environmental emotional data needed by this study.

Level of Public Environment Emotion
In this study, after obtaining "public environmental satisfaction", the next work will grade the satisfaction with reference to the AQI index (currently widely used in the international air environment Sustainability 2020, 12, 1665 5 of 16 quality assessment system). This study intends to divide "public environmental satisfaction" into six grades. First of all, we grade "public environmental satisfaction" without considering the time factor when we use the preliminary experimental data. Secondly, the user's "satisfaction" score is used to measure the tendency degree of environmental emotions. The Wilson interval method is used to grade, and Bayesian average method is used to modify the grade.
The Wilson's interval method is used to divide the level of environmental emotion. The calculation method is based on binomial distribution. The results are related to the environmental emotion tendency at all levels and the frequency of each emotion tendency. At the beginning of the hypothesis, there are only two options of "feeling good" and "feeling bad" to make it conform to binomial distribution, and according to the confidence level, the result is obtained, and is shown in Formula (1).
where S max is the maximum score, p min is the lower limit of Wilson interval, p is the favorable rate (usually the average value/total score), n is the total number of evaluations, K is the statistics constant (representing the statistics of Z at a certain confidence level).
In the modification of the Wilson interval method, the Bayesian average method is used. Strictly speaking, it is not a scoring model, but a balance model. Its core idea is to provide a compensation value so that it will not produce an unreliable rating due to a small number of scores, but reduce the proportion of the compensation value under a large number of scoring data, and finally make the public environmental sentiment rating more accurate and reliable with the increase of the "public environmental perception satisfaction". The level results are shown in Table 3. The key codes (shown as Table 4) to achieve the classification of public environmental emotions are as follows:

Sources of Atmospheric Environment Data
The atmospheric environment data in this study corresponds to the public environmental sentiment data in time series and has the same time span, with a total of 35,505. The air pollutants in the air environment data include six main pollutant indexes (PM 2.5 , PM 10 , SO 2 , NO 2 , O 3 , CO), which are from the hourly air pollutant concentration data of five state-controlled city stations in Lanzhou, while the Sustainability 2020, 12, 1665 6 of 16 meteorological data (temperature, humidity, pressure, wind speed) are from China Weather Network, which collects the hourly meteorological data of five major urban areas in Lanzhou; this is shown in Table 5. The data source of atmospheric environment is real and reliable, but a small part of the data is missing. Considering that the difference between the data before and after the data collection is not big, this paper uses hot deck imputation to supplement the missing data nearby.

Methods of VAR and LSTM, RNN
The vector autoregression (VAR) model is established to analyze the relationship between public environmental sentiment and atmospheric environment. The VAR model is extended from the AR model. The VAR model is compared with the traditional econometric method. It can be found that the basis of this model is not economic theory, but a form of multi-party alliance. According to the characteristics of the atmospheric environment in Lanzhou City, the following factors are selected: PM 2.5 , PM 10 , temperature (TMP), humidity (HUM) as the indicators of public environmental sentiment.
The LSTM network solves the problem that RNN will produce a gradient explosion when processing long time series prediction. This is mainly because each neuron of the LSTM network adds a memory unit to judge whether the information is useful or not, which is suitable for processing and predicting important events with relatively long intervals and delays in time series. Three control gates are placed in the memory unit of LSTM; they are called input gate, forgetting gate and output gate. When a message enters the network of LSTM, it can be judged whether it is useful according to the rules. Only the information conforming to the algorithm authentication will be left, and the inconsistent information will be forgotten through the forgetting gate.

Construction of VAR Model
The VAR model can be used to predict the interconnected time series system, and also to analyze the dynamic impact of some random disturbances on variable systems, and then explain the impact of these disturbances on economic variables. The VAR model is shown in Formula (2): where y t is k-dimensional endogenous variable; A p is coefficient k × k matrix to be estimated; the independent and identical distribution ε t is subject to expectation 0 and variance (where variance is covariance matrix of k-dimensional vector) ε t , which can be correlated in the same period, but usually not with its own lag value or the variable on the right side of the equation; p is lag term.

VAR Model Calculation Process
In order to ensure the validity of the VAR model, the ADF test (unit root test) is used to test the data stability and it can be proven that the existence of the unit root process in the sequence is not stable, which will cause false regression in the regression analysis. The ADF tests whether there are unit roots in the time series studied. If there is a unit root in the time series, it indicates that the time series is not a stationary one; if there is no unit root in the time series, it indicates that the time series is a stationary one. Once the time series is non-stationary, but insists on using the VAR analysis method, Sustainability 2020, 12, 1665 7 of 16 it will affect the effectiveness of the analysis results. Take lnSatisfaction, lnPM 2.5 , lnPM 10 , lnTMP and lnHUM as test variables to conduct the stability test, so as to judge whether each time series is a stable variable. The test results are shown in Table 6. It can be seen from Table 2 that the ADF of time series of lnSatisfaction, lnPM 2.5 , lnPM 10 , lnTMP and lnHUM at 5% and 10% significant levels are all lower than the critical value; that is to say, all pass the test and are stable time series, which can be modeled by vector autoregression model.
In order to ensure that the residual sequence obeys the white noise, the optimal lag period is determined by the Schwartz criterion (AIC) and the (AC) information minimum criterion. The lag period judgment results of the VAR model are shown in Table 7. Furthermore, AR characteristic polynomials are used for the stability test. According to the optimal lag number of 4, the AR inverse root graph of the VAR (4) model stability test is obtained (as shown in Figure 1). It can be seen from Figure 1 that the inverse roots of AR characteristic polynomials are all in the unit circle. In the long run, the system model formed between public environmental satisfaction and other factors is stable, which indicates that the VAR (4) model can be used for subsequent research. Furthermore, AR characteristic polynomials are used for the stability test. According to the optimal lag number of 4, the AR inverse root graph of the VAR (4) model stability test is obtained (as shown in Figure 1). It can be seen from Figure 1 that the inverse roots of AR characteristic polynomials are all in the unit circle. In the long run, the system model formed between public environmental satisfaction and other factors is stable, which indicates that the VAR (4) model can be used for subsequent research. It can be seen from Table 2 that the optimal lag period of LR, FPE, AIC and HQ is 4, but the lag period of one index with the minimum value is different from other indexes; that is, the optimal lag period of the SC index is 3. Considering the validity of the VAR model and the integrity of information, the optimal lag time of the VAR model is determined to be 4, and VAR (4) is finally established.

LSTM (Long Short-Term Memory) Model Construction
Long and short-term memory networks-often referred to as "LSTM"-are special RNNs that It can be seen from Table 2 that the optimal lag period of LR, FPE, AIC and HQ is 4, but the lag period of one index with the minimum value is different from other indexes; that is, the optimal lag period of the SC index is 3. Considering the validity of the VAR model and the integrity of information, the optimal lag time of the VAR model is determined to be 4, and VAR (4) is finally established.

LSTM (Long Short-Term Memory) Model Construction
Long and short-term memory networks-often referred to as "LSTM"-are special RNNs that can learn long-term patterns. They were first proposed by Hochreiter and schmidhuber (1997), and were refined and promoted by many people in later work. They are very well used in all kinds of problems and are now widely used Long term short-term memory networks (LSTM) are extensions of recurrent neural networks, which basically extend their memory. Therefore, it is very suitable to learn from the important experience with a long time lag. The unit of LSTM is used as the building unit of the RNN layer, which is usually called the LSTM network. LSTM enables RNN to remember their input for a long time. This is because the LSTM includes their information in memory, much like the memory of a computer, because the LSTM can read, write, and delete information from memory. This memory can be regarded as a gating unit, which means that the unit decides whether to store or delete information (for example, whether it opens the door), which depends on the importance it gives information. The assignment of importance occurs in the weight, which is also learned by the algorithm. This simply means that it learns which information is important and which is not over time. The structure of LSTM neurons is shown in Figure 2. It can be seen from Table 2 that the optimal lag period of LR, FPE, AIC and HQ is 4, but the lag period of one index with the minimum value is different from other indexes; that is, the optimal lag period of the SC index is 3. Considering the validity of the VAR model and the integrity of information, the optimal lag time of the VAR model is determined to be 4, and VAR (4) is finally established.

LSTM (Long Short-Term Memory) Model Construction
Long and short-term memory networks-often referred to as "LSTM"-are special RNNs that can learn long-term patterns. They were first proposed by Hochreiter and schmidhuber (1997), and were refined and promoted by many people in later work. They are very well used in all kinds of problems and are now widely used Long term short-term memory networks (LSTM) are extensions of recurrent neural networks, which basically extend their memory. Therefore, it is very suitable to learn from the important experience with a long time lag. The unit of LSTM is used as the building unit of the RNN layer, which is usually called the LSTM network. LSTM enables RNN to remember their input for a long time. This is because the LSTM includes their information in memory, much like the memory of a computer, because the LSTM can read, write, and delete information from memory. This memory can be regarded as a gating unit, which means that the unit decides whether to store or delete information (for example, whether it opens the door), which depends on the importance it gives information. The assignment of importance occurs in the weight, which is also learned by the algorithm. This simply means that it learns which information is important and which is not over time. The structure of LSTM neurons is shown in Figure 2. The gates in LSTM are analog, in the form of S-shaped, meaning they range from 0 to 1, and being analog also allows them to propagate backwards. The problem of vanishing gradient can be solved by LSTM because it can keep the gradient steep enough, so the training is relatively short and the accuracy is high. The network structure of LSTM is shown in Figure 3.  The gates in LSTM are analog, in the form of S-shaped, meaning they range from 0 to 1, and being analog also allows them to propagate backwards. The problem of vanishing gradient can be solved by LSTM because it can keep the gradient steep enough, so the training is relatively short and the accuracy is high. The network structure of LSTM is shown in Figure 3. Compared with the traditional cyclic neural network, LSTM is still based on xt and ht−1 to calculate ht, but the internal structure is designed more carefully. Three gates, i.e., input gate it, forgetting gate ft, output gate σt, and an internal memory unit ct are added. The input gate controls how much the new state of the current calculation is updated to the memory unit; the forgetting gate controls how much the information in the previous memory unit is forgotten; the output gate controls how much the current output depends on the current memory unit. In the classical LSTM model, the updated calculation is Formulas (3)-(6) of the t layer.
The calculation formula of the input door is shown in Formula (3): The calculation formula of the forgetting gate is shown in Formula (4): The calculation formula of the output gate is shown in Formula (5): Compared with the traditional cyclic neural network, LSTM is still based on x t and h t−1 to calculate h t , but the internal structure is designed more carefully. Three gates, i.e., input gate i t , forgetting gate f t , output gate σ t , and an internal memory unit c t are added. The input gate controls how much the new state of the current calculation is updated to the memory unit; the forgetting gate controls how much the information in the previous memory unit is forgotten; the output gate controls how much the current output depends on the current memory unit. In the classical LSTM model, the updated calculation is Formulas (3)-(6) of the t layer. The calculation formula of the input door is shown in Formula (3): The calculation formula of the forgetting gate is shown in Formula (4): The calculation formula of the output gate is shown in Formula (5): The calculation formula of the candidate layer is shown in Formula (6): In a trained network, when there is no important information in the input sequence, the value of the forgetting gate of LSTM is close to 1, and the value of the input gate is close to 0. At this time, the past memory will be saved, so as to realize the long-term memory function. When there is important information in the input sequence, LSTM should store it in memory, and the value of the input gate will be close to 1. When the previous memory is no longer important, the value of the input gate is close to 1, and the value of the forgetting gate is close to 0, so the old memory is forgotten and the new important information is remembered. After such a design, the whole network more easily learns the long-term dependence between sequences.

RNN (Recurrent Neural Network) Model Construction
The training sample data in the CNN network is IID data (independent and identically distributed data), and the problem to be solved is also a classification problem, a regression problem, or a feature expression problem. However, more data does not meet IID, such as language translation and automatic text generation. They are a sequence problem, including time series and space series. At this time, the RNN network is used. The structure of the RNN is shown in Figure 4. RNN can not only process sequence input, but also get sequence output. The sequence here refers to the sequence of vectors. RNN learns a program; it can also be said to be a state machine, not a function. Taking sequence prediction as an example, the RNN network is introduced below: (1) The input is a time-varying vector sequence x t−2 , x t−1 , x t , x t+1 , x t+2 . (2) Estimated by model at time t as Formula (7): (3) It needs to take the current x as input and the previous hidden layer as input to get the output y.
Sustainability 2020, 12, x FOR PEER REVIEW 10 of 18 the sequence of vectors. RNN learns a program; it can also be said to be a state machine, not a function. Taking sequence prediction as an example, the RNN network is introduced below: (1) The input is a time-varying vector sequence xt−2, xt−1, xt, xt+1, xt+2.
(2) Estimated by model at time t as Formula (7): (3) It needs to take the current x as input and the previous hidden layer as input to get the output y. In the behavior of whale hunting, we can see that it uses the strategy of contracting and encircling and spiraling. In order to simulate the behavior of this colleague, we refer to p. When the value of p is greater than 0.5, the spiral formula strategy is used. When p is less than 0.5, the formula strategy of encircling prey is used. In the process of encircling the sidetracking, it is necessary to  In the behavior of whale hunting, we can see that it uses the strategy of contracting and encircling and spiraling. In order to simulate the behavior of this colleague, we refer to p. When the value of p is greater than 0.5, the spiral formula strategy is used. When p is less than 0.5, the formula strategy of encircling prey is used. In the process of encircling the sidetracking, it is necessary to judge whether the absolute value of vector a is greater than 1 to determine whether the current optimal solution is the one with the minimum use value or the current optimal solution of randomly selecting a seat. It can update the number of iterations plus the location of each search agent so as to constantly update the position of whales, and then calculate the fitness value of each whale according to the time when the whales to be searched are all updated once, and then select the whale with the smallest fitness value as the current "best result" and then update each iteration with different formulas by randomly generating the value of p until the number of iterations is satisfied.
Humpback whales can identify and surround prey. Since the position of the optimal design in the search speed is not known a priori, the WOA algorithm assumes that the current optimal candidate solution is the target prey or close to the optimal solution. After the best search agent is defined, other search agents attempt to update their location to the best search agent. This behavior is represented by Formulas (7) and (8): where t represents the current iteration, A and C are the coefficient vectors, X* is the position vector of the best solution obtained at present, the X vector is the position vector. It is worth mentioning here that if there is a better solution, then X* should be updated in each iteration. Where vectors a and C are calculated as follows Formulas (9) and (10):

VAR Model Analysis Results
Impulse response is an important aspect of the dynamic characteristics of the VAR model system. Based on the VAR (4) model, the generalized impulse response function is used to analyze the impulse response of satisfaction to PM 2.5 , PM 10 , HUM and TPM, to study the short-term dynamic relationship between public environmental satisfaction and them, and select 1-14 lag periods. The results are shown in Figure 5.
From the above analysis, it can be concluded that a positive impact of standard deviation on PM 2.5 and HUM is exerted, and satisfaction shows a negative growth in the early stage. With the passage of time, this impact tends to be stable gradually, indicating that PM 2.5 and HUM have a negative overall impact on satisfaction, and PM 2.5 and HUM need to be reduced to improve satisfaction.
Impulse response is an important aspect of the dynamic characteristics of the VAR model system. Based on the VAR (4) model, the generalized impulse response function is used to analyze the impulse response of satisfaction to PM2.5, PM10, HUM and TPM, to study the short-term dynamic relationship between public environmental satisfaction and them, and select 1-14 lag periods. The results are shown in Figure 5.  From the above analysis, it can be concluded that a positive impact of standard deviation on PM2.5 and HUM is exerted, and satisfaction shows a negative growth in the early stage. With the passage of time, this impact tends to be stable gradually, indicating that PM2.5 and HUM have a negative overall impact on satisfaction, and PM2.5 and HUM need to be reduced to improve satisfaction.
In order to further analyze the impact of PM2.5, PM10, HUM and TMP on satisfaction, select 1-10 lag periods, and decompose the variance of satisfaction based on VAR(4) model. The results are shown in Table 8. It can be seen from Table 4 that satisfaction is only affected by itself in the first lag period. During the investigation period, the influence of PM2.5 and HUM changes on satisfaction is continuously strengthened, and reaches 0.449% and 0.518%, respectively, in the 10th lag period. In general, the changes of PM2.5 and HUM have a greater impact on satisfaction; that is, effective management of PM2.5 and improvement of temperature are conducive to improving public environmental satisfaction.  In order to further analyze the impact of PM 2.5 , PM 10 , HUM and TMP on satisfaction, select 1-10 lag periods, and decompose the variance of satisfaction based on VAR(4) model. The results are shown in Table 8. It can be seen from Table 4 that satisfaction is only affected by itself in the first lag period. During the investigation period, the influence of PM 2.5 and HUM changes on satisfaction is continuously strengthened, and reaches 0.449% and 0.518%, respectively, in the 10th lag period. In general, the changes of PM 2.5 and HUM have a greater impact on satisfaction; that is, effective management of PM 2.5 and improvement of temperature are conducive to improving public environmental satisfaction.

LSTM Model Analysis Results
The WOA algorithm based on the inverse learning algorithm is used to optimize the parameter C and kernel width δ of the LSTM neural network, thereby improving the prediction accuracy of the model. In the WOA algorithm, the initial population is generated randomly. The initial population is not evenly distributed in the solution space, which leads to low convergence accuracy and slow convergence speed of the algorithm. By using the above-mentioned LSTM neural network and RNN neural network model, 2800 pieces of data from 4 October 2016 to 14 May 2017 in Lanzhou and Beijing were analyzed. The goodness of fit of LSTM neural network model was 0.6648, and the goodness of fit of RNN neural network model was 0.6192, which was ideal; the results of these prediction models are shown in Figures 6 and 7. The prediction accuracy of the LSTM neural network model is 78.7%, while that of the RNN neural network model is 70.1%. The average relative errors of the LSTM neural network model and the RNN neural network model are 9.81% and 13.67% respectively, as shown in Figures 8 and 9. When collecting the data of the test set, a group of users' application data of a certain day are extracted. Fifty-seven sample data are collected as the data of the test set by this method, and the atmospheric environment data predicted on that day is taken as the prediction feature.
C and kernel width δ of the LSTM neural network, thereby improving the prediction accuracy of the model. In the WOA algorithm, the initial population is generated randomly. The initial population is not evenly distributed in the solution space, which leads to low convergence accuracy and slow convergence speed of the algorithm. By using the above-mentioned LSTM neural network and RNN neural network model, 2800 pieces of data from 4 October 2016 to 14 May 2017 in Lanzhou and Beijing were analyzed. The goodness of fit of LSTM neural network model was 0.6648, and the goodness of fit of RNN neural network model was 0.6192, which was ideal; the results of these prediction models are shown in Figures 6 and 7. The prediction accuracy of the LSTM neural network model is 78.7%, while that of the RNN neural network model is 70.1%. The average relative errors of the LSTM neural network model and the RNN neural network model are 9.81% and 13.67% respectively, as shown in Figures 8  and 9. When collecting the data of the test set, a group of users' application data of a certain day are extracted. Fifty-seven sample data are collected as the data of the test set by this method, and the atmospheric environment data predicted on that day is taken as the prediction feature.   model. In the WOA algorithm, the initial population is generated randomly. The initial population is not evenly distributed in the solution space, which leads to low convergence accuracy and slow convergence speed of the algorithm. By using the above-mentioned LSTM neural network and RNN neural network model, 2800 pieces of data from 4 October 2016 to 14 May 2017 in Lanzhou and Beijing were analyzed. The goodness of fit of LSTM neural network model was 0.6648, and the goodness of fit of RNN neural network model was 0.6192, which was ideal; the results of these prediction models are shown in Figures 6 and 7. The prediction accuracy of the LSTM neural network model is 78.7%, while that of the RNN neural network model is 70.1%. The average relative errors of the LSTM neural network model and the RNN neural network model are 9.81% and 13.67% respectively, as shown in Figures 8  and 9. When collecting the data of the test set, a group of users' application data of a certain day are extracted. Fifty-seven sample data are collected as the data of the test set by this method, and the atmospheric environment data predicted on that day is taken as the prediction feature.

Discussion
Through the establishment of the VAR (4) model and the stability test of the model, we can see that although satisfaction, PM2.5, PM10, HUM and TMP are affected by various factors of themselves and the outside world, their system is a stable system. Granger causality test of lnSatisfaction based on VAR (4) shows that there is no Granger causality between TMP and satisfaction; that is, the change of TMP will not cause the change of public environmental satisfaction. The results of generalized impulse response function analysis show that PM2.5 and HUM have a negative effect on satisfaction, the increase of PM2.5 and HUM will reduce the public environmental satisfaction and the increase of PM2.5 and HUM needs to reduce PM2.5 and HUM.
The data collected through the "impression ecology" platform has a time span of one year and a total of 35,539 pieces of data. After VAR model construction, there are the unit root test, stability test, Granger causality test, generalized impulse response function analysis and variance decomposition analysis. Granger causality analysis shows that: (1) The test results reject the original hypothesis that lnPM2.5, lnPM10 and lnHUM are not Granger causes of lnSatisfaction, and show that the size of lnPM2.5, lnPM10 and lnHUM can provide effective information for predicting public environmental emotions, so the improvement of public environmental satisfaction can be started from these aspects; (2) the test structure accepts that lnTMP is not lnSatisfaction. The original hypothesis of action's Granger cause shows that TMP has no Granger cause, although it is related to satisfaction, so improving TMP is not the key to improving public environmental satisfaction.
According to the prediction chart and the relative error chart of prediction results, the accuracy of the LSTM neural network prediction results is 78.7%, which has a high reference value for the prediction results of a batch of data with a given influence factor. The maximum value of relative error of prediction results is 0.232, and the minimum value of relative error is 0, which shows that after the fitting of the LSTM neural network prediction model, individual test data can be accurately predicted. From the prediction results of the RNN neural network, for the prediction accuracy of 72.1%, it also has a high reference value for the prediction results of a batch of data, but its accuracy is 6.6% lower than that of the LSTM neural network. From its relative error, the maximum relative error of the RNN neural network prediction model is 0.303, and the minimum is only close to 0.303 Zero, without accurate prediction of individual data. Therefore, by comparing the accuracy and relative error of the two neural network models, the accuracy of the LSTM neural network is higher

Discussion
Through the establishment of the VAR (4) model and the stability test of the model, we can see that although satisfaction, PM 2.5 , PM 10 , HUM and TMP are affected by various factors of themselves and the outside world, their system is a stable system. Granger causality test of lnSatisfaction based on VAR (4) shows that there is no Granger causality between TMP and satisfaction; that is, the change of TMP will not cause the change of public environmental satisfaction. The results of generalized impulse response function analysis show that PM 2.5 and HUM have a negative effect on satisfaction, the increase of PM 2.5 and HUM will reduce the public environmental satisfaction and the increase of PM 2.5 and HUM needs to reduce PM 2.5 and HUM.
The data collected through the "impression ecology" platform has a time span of one year and a total of 35,539 pieces of data. After VAR model construction, there are the unit root test, stability test, Granger causality test, generalized impulse response function analysis and variance decomposition analysis. Granger causality analysis shows that: (1) The test results reject the original hypothesis that lnPM 2.5 , lnPM 10 and lnHUM are not Granger causes of lnSatisfaction, and show that the size of lnPM 2.5 , lnPM 10 and lnHUM can provide effective information for predicting public environmental emotions, so the improvement of public environmental satisfaction can be started from these aspects; (2) the test structure accepts that lnTMP is not lnSatisfaction. The original hypothesis of action's Granger cause shows that TMP has no Granger cause, although it is related to satisfaction, so improving TMP is not the key to improving public environmental satisfaction.
According to the prediction chart and the relative error chart of prediction results, the accuracy of the LSTM neural network prediction results is 78.7%, which has a high reference value for the prediction results of a batch of data with a given influence factor. The maximum value of relative error of prediction results is 0.232, and the minimum value of relative error is 0, which shows that after the fitting of the LSTM neural network prediction model, individual test data can be accurately predicted. From the prediction results of the RNN neural network, for the prediction accuracy of 72.1%, it also has a high reference value for the prediction results of a batch of data, but its accuracy is 6.6% lower than that of the LSTM neural network. From its relative error, the maximum relative error of the RNN neural network prediction model is 0.303, and the minimum is only close to 0.303 Zero, without accurate prediction of individual data. Therefore, by comparing the accuracy and relative error of the two neural network models, the accuracy of the LSTM neural network is higher than the RNN neural network, and the relative error between the real value and the predicted value is smaller.

Conclusions
Through the fitting of the VAR model to time series, the conclusion is as follows: (1) Considering the validity of the VAR model and the integrity of information, the optimal lag time of the VAR model is 4. (2) With a positive impact on PM 2.5 and HUM, satisfaction showed a negative growth in the early stage. With the passage of time, the impact gradually stabilized, indicating that PM 2.5 and HUM had a negative overall impact on satisfaction, and PM 2.5 and HUM need to be reduced to improve satisfaction. (3) The effect of PM 2.5 and HUM changes on satisfaction strengthens, and reaches 0.449% and 0.518%, respectively, in the 10th lag period. In general, the changes of PM 2.5 and HUM have a greater impact on satisfaction; that is, effective management of PM 2.5 and improvement of temperature are conducive to improving public environmental satisfaction.
After the establishment of the LSTM neural network and the RNN neural network model, the following conclusions are drawn from the prediction of public environmental sentiment level. The conclusions are as follows: (1) Finally, from the two prediction results, the LSTM neural network has higher accuracy and smaller relative error than the RNN neural network, which makes it more persuasive and representative for the user's emotion perception prediction of the environment in this study. If more recent data of the residential areas are fitted with the LSTM neural network, then according to the local atmosphere of the day environmental prediction can determine the level of local residents' emotional perception, and the accuracy of the prediction results is high, which has a certain reference value. (2) At present, the pollutants in the physical environment we live in are complex, and the psychological environment around us will change accordingly. In this study, PM 2.5 and HUM, which are analyzed by VAR model in the early stage of the study, are used to predict the level of unknown public environmental emotions. Aiming at the research of user emotion perception, the expansion speed of radial basis function of the LSTM neural network is used in this study. Parameters such as number of neurons and training times are not necessarily optimal. If we can find the optimal parameter setting of the LSTM neural network under the public sentiment perception, the accuracy is expected to exceed 80%, so the fitted data model will provide more reference value for the sentiment level prediction data.