Stock Forecasting Model FS-LSTM Based on the 5G Internet of Things

This paper analyzed the development of data mining and the development of the fifth generation (5G) for the Internet of Things (IoT) and uses a deep learning method for stock forecasting. In order to solve the problems such as low accuracy and training complexity caused by complicated data in stock model forecasting, we proposed a forecasting method based on the feature selection (FS) and Long Short-Term Memory (LSTM) algorithm to predict the closing price of stock. Considering its future potential application, this paper takes 4 stock data from the Shenzhen Component Index as an example and constructs the feature set for prediction based on 17 technical indexes which are commonly used in stock market. The optimal feature set is decided via FS to reduce the dimension of data and the training complexity. The LSTM algorithm is used to forecast closing price of stock. The empirical results show that compared with the LSTM model, the FS-LSTM combination model improves the accuracy of prediction and reduces the error between the real value and the forecast value in stock price prediction.


Introduction
The wide application of information technology gives rise to the increase in data flow and the number of intelligent terminals. As a result, the fifth-generation (5G) mobile services come into being. According to global telecom operators, 5G communication technology will be officially commercialized around 2020 [1]. Owing to the fast transmission network, the emergence of the 5G network will promote the innovation and development of the Internet of Things (IoT) technology. The 5G network is identified as a core contributing factor in meeting the growing needs for the future IoT services, including high data rate, multiple-device attachment, and low delay service [2]. As 5G mobile communication network technology can provide users with sufficient network communication, it can greatly improve the network communication speed and quality, making the network data transmission changes more reliable.
With its great adaptability, IoT technology can be applied to different scenarios, such as construction domain [3], smart cities environments [4], smart communities [5], and other areas of society, bringing much convenience for people. The utility of IoT technology requires massive information connection and high-speed network communication. The emergence of the 5G network can promote the innovation and development of IoT technology. 5G has the advantages of fast data convey rate, strong robustness, wide transmission range, and good security [6]. Thus, the application of 5G wireless systems can effectively improve the communication quality of the IoT, making the IoT technology more powerful. 5G is the basic access technology for IoT utilization [7]. What is more, the use of 5G communication network infrastructure can also reduce the cost of IoT construction and investment, consequently improving the efficiency of IoT construction. The integration of the 5G mobile communication network and IoT enables the IoT to make full use of the advantages of the 5G mobile communication network and enhance its own advantages.
With the increasing exploitation of the IoT, the advantages of big data technology have gradually become prominent. Big data involves many key technologies, including collection, storage, management, analysis, and mining. Big data usually relate to the use of predictive analytics, patral behavior research, or some other sophisticated data analysis tool, which can extract the valuable information from the massive data. 5G networks deal with big data at low cost. Besides, characteristics of 5G include low latency, high reliability, easy-to-update data, region spread, and improved mobile broadband [8]. The era of big data has aroused widespread interest in in-depth learning in different research fields. The deep integration with AI, cloud computing, big data, and deep learning is one of the important development directions of 5G.
Our contributions in this paper can be highlighted as follows: (1) The development trend of 5G, IoT, and data mining and the influence of deep learning on data mining technology of IoT are analyzed (2) A stock trend prediction method based on the feature selection (FS) and Long Short-Term Memory (LSTM) prediction model FS-LSTM to predict stock prices are put forth. First, we use the Tushare financial data package to obtain stock data. Then, the optimal feature set is selected to reduce the dimensionality of data. After that, the stock price is forecasted and the forecasting results are analyzed (3) The application of 5G and IoT in stock forecasting is analyzed in aspects of data storage, efficiency, and processing speed This paper falls into 6 parts. Section 2 describes some basic relevant algorithms related to the proposed idea. In Section 3, we illustrated in detail the design and implementation of the proposed prediction algorithm. The application of 5G and IoT in stock forecasting is analyzed in Section 4. Section 5 discusses the experimental results of our proposed FS-LSTM. Section 6 is the summary of the whole paper.

The Integration Development of 5G, IoT, and Deep
Learning. 5G is aimed at providing super ultralow delay technological schemes as well as fiber-like access data transmission speed, to connect over 100 billion facilities and deliver accordant experience across multiplex scenarios with improved capability and spend efficiency [9]. 5G mobile communication technology improves customer experience and system safety of communication technology, so it has been widely used in all walks of life [10]. A 5G-enabled IoT is devised to convey both 5G and IoT information and at the same time to reduce the whole IoT power consumption while maintaining 5G and IoT transmission rates steady [11]. 5G-enabled emotion-aware linked healthcare big data was designed. The proposed method will greatly promote 5G-based individualized and corresponding emotion-aware medical services [12]. With the development and popularization of 5G technology and IoT, new data mining algorithms were boosted [13]. Big data, IoT, and 5G are closely related to each other, for big data stems from the application of IoT technology.
5G will prove to be the mainstay of IoT, providing full links to all "things," surmounting place restrictions on time-space, and bringing about comprehensive, service-customized, and user-centric interconnections [14]. The relationship between 5G, IoT, and deep learning is shown in Figure 1. As shown in Figure 1, the entire system of the IoT constitutes three layers, namely, the perceptual layer, the transport layer, and the application layer. 5G communication provides technical support for network layer transmission. In the big data era, not all massive data are valuable. What is more important is to mine useful data via the deep learning algorithm. Among them, large data analysis methods based on deep learning have been developed more rapidly.
The development of 5G communication technology and IoT enables the application of the neural network and deep learning. IoT is extensively used in various fields, such as intelligent logistics, smart healthcare, pilotless driving, industrial automation, and global positioning system (GPS) data aggregation [15]. Based on 5G communication agreements and data interchange criterion, with the convergence of the IoT and artificial intelligence (AI), the smart network performs much better communicating ability. To build an efficient intrusion detection system over big data, literature [16] proposed a classification algorithm based on data clustering and data reduction. IoT, as an expansion of Internet applications, is in a great stage of development. To cut down the resource expenditure with a reasonable implementation planning, an IoT-based smart energy consumption controlling and energy supervisory method has been proposed by investigating the energy use of a house [17]. Literature [18] designed a refreshing pattern, 5G Intelligent Internet of Things (5G I-IoT), to handle big data and promote communication channels effectively. IoT is a catalyst for the generation of big data because big data originates from the application of IoT. The use of IoT gives birth to large amount of data which contains significant information. The fast development of IoT and big data is owing to 5G communication.

Research on Stock Forecasting.
As an important part of capital market construction, the change of stock market is of extraordinary significance to national macroeconomic development, financial institutions, and individuals. The high instability and nondeterminacy of stock price make it a difficult matter in the domain of finance and data mining. Thus, forecasting stock prices in order to avoid the investment risk to the greatest extent and improve the investment returns becomes the latest research focus.
Traditional forecasting methods have the limitations to balance the randomness and regularity of controlling price changes [19]. In recent years, the artificial neural network (ANN) has achieved remarkable results in the field of artificial intelligence algorithm whose predictive analysis capability has greatly promoted the application of technologies like big data. So stock forecasting methods based on ANN and related technologies have been widely studied, which make up for the shortcomings of traditional forecasting techniques and increase the reliability and accuracy of stock forecasting [20]. Literature [21] implements an LSTM model on time series trend forecasting problems, and the results outperform that of the conventional autoregression models. Moreover, some portfolio models have been applied to stock trend prediction. They all achieved good results. Literature [22] combines price prediction based on historical and real-time data along with news analysis, and LSTM was used for predicting; this approach incorporated into the existing strategies will encourage quant traders to invest and maximize their profit. In literature [23], a deep learning method for stock price prediction was proposed. In this literature, a total of 14 different deep learning models were presented and all stocks in the Standard & Poor's (S&P) BSE-BANKEX index were evaluated.

Stock Prediction Algorithms
3.1. Feature Selection. Machine learning is a process of data processing and model training. Data processing includes fea-ture extraction and feature representation. In model training, there are a set of processes such as training strategy, training model, and algorithm correlation. A good prediction model is closely related to feature selection and feature representation. The method of feature selection is to select a subset from the original feature data set to reduce the number of attributes in the feature data set. The purpose of feature selection is to increase the accuracy of prediction, to design an efficient prediction model, and to have a better understanding and interpretation of the model as well.
Optimal feature subset selection was performed using a correlation coefficient and feature importance ranking. The correlation coefficient is a quantity that studies the degree of linear correlation between variables. It is usually expressed by the letter r, which is shown in where cov ðX, YÞ is the covariance of X and Y, var ½X is the variance of X, and var ½Yis the variance of Y. rðX, YÞ is a quantity that can characterize the degree of a close linear relationship between X and Y. If X and Y are not related, rðX, YÞ = 0. It is generally considered that there is no linear relationship between X and Y. If rðX, YÞ ≤ 1, it is generally considered that there is a linear relationship between X and Y. The closer the value of rðX, YÞ is to 1, the more linear the two variables are. For each pair of highly correlated features, one of them is identified and removed.

LSTM Network.
LSTM is a special type of recurrent neural network (RNN). It solves the problem of gradient explosion and gradient disappearance in the process of longsequence RNN training. When the number of network layers increases, the perception ability of the following nodes to the front nodes becomes weak and the phenomenon that the previous information will be forgotten over time appears. LSTM adds memory units to each neuron unit of the hidden layer on the basis of ordinary RNN, so that the memory information on time series can be controlled. The schematic diagram of memory units of LSTM is shown in Figure 2. C t−1 and h t−1 represent the state of the memory unit at the last moment; C t and h t represent the state of the hidden layer, respectively. Each time the input gate i t , the forget gate f t , and the output gate o t are passed between the units, the memory and forgetting of the previous information and the current information can be controlled.
The calculation formulas of the forget gate f t , the input gate i t , and the output gate o t are defined in

Wireless Communications and Mobile Computing
Among them, σ is the sigmoid activation function, x t is the input at time t, W xf is the weight matrix from the input x to the forget gate f t , W hf is the weight matrix from the hidden layer state to the forgetting gate, and b f is the linear bias of the forgetting gate. W xi is the weight matrix from the input x to the input gate, W hi is the weight matrix from the hidden state to the input gate, and b i is the linear bias of the input gate. W xo is the weight matrix from the input to the output gate, W ho is the weight matrix from the hidden state to the output gate, and b o is the linear bias of the output gate.
The state value of t time memory unit c t consists of two parts: one is the state value of the memory unit at the previous time c t−1 and the other is the input gate waiting for update information c~t, which is controlled by the input gate and the forgetting gate, respectively. The current state of the memory unit c t can be obtained by calculating the following formula: Among them, W xc is the weight matrix from input X to the memory unit, W hc is the weight matrix from the hidden layer to the memory unit, and b c is the linear bias of the memory unit.
Finally, the current state of the hidden layer h t is determined by the state of the output gate o t and the current storage unit c t . The calculation formula is shown in

Application of 5G and IoT in Stock Forecasting
IoT technology has penetrated into people's production and life. With IoT technology, different types of data are exchanged and communicated through sensor nodes. Under the continuous development of IoT technology, IoT-based stock forecasting will become a new trend. It proves that it is feasible to mine useful information from stock historical data for stock prediction. The combination of 5G and IoT will promote the rapid development of stock forecasting industry. The application of 5G and IoT in stock forecasting is mainly reflected in the following aspects: (1) In order to carry out data mining, data must be stored first. Unlike previous data storage methods, IoT stores scattered data in different network nodes to form virtual storage. Distributed storage makes it possible to exchange and share data between different regions and networks (2) With the development of IoT, traditional methods will be replaced for it is hard to meet the requirements of data management and processing. Owing to the characteristics of intuition, concreteness, and easy application when judging the trend of stock market, technical indicators are widely used in stock market forecasting and analysis. Different technical indicators have their own scope of application and constraints. In the process of stock trend feature representation, a single technical index cannot guarantee the comprehensiveness and accuracy of the feature representation. Therefore, selecting several representative and easy-to-quantify technical indicators can improve the complementarity of data and the accuracy of feature representation. This paper constructs a feature set for forecasting based on 17 technical indicators (MA, CCI, ADX, RSI, ROC, AROONOSC, MOM, ATR, OSC, OBV, BOP, ULTOSC, MFI, ATR, K%, BETA, and CR) commonly used in stock market. These indicators comprehensively reflect the information of stock trend change and can include most of the influencing factors of stock trend forecasting. The final optimal feature subset is MA, RSI, CCI, K%, and CR, which can summarize most where n denotes n day and C n denotes the sum of n day closing prices. U p t is the increase of the first day compared with the previous day. D w t is the decline of the first day compared with the previous day. M t is the average of the highest, lowest, and closing prices. H t and L t indicate the highest and lowest price of t day, respectively. The selected data are used to construct the feature set. As the calculation methods of each index are different, the feature set constructed according to the technical index presents different range of values, of which the range varies greatly. The huge quantity difference will lead to the complexity of parameter optimization of the algorithm model, making it easy to overfit, which will have a negative impact on the final prediction results. Therefore, this paper uses formula (7) to normalize the feature quantities and convert each dimension feature component to ½−1, 1.
In the formula, v d min is the minimum value of the d -dimensional eigenvalue and v d max is the maximum value of the d-dimensional eigenvalue.

Stock Price Forecast.
In order to test the effectiveness of the proposed method, the optimal feature subset is taken as input variable, the input time span is 30 days, and the opening price of the day is taken as output variable. The model consists of four layers: one LSTM layer and three dense layers. When training the LSTM model, dropout parameters and regular terms are added to avoid overfitting. The stock price of the test set is predicted by the trained model, and the traditional LSTM prediction model was compared. Mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) were used as evaluation indexes to evaluate the validity of the model. The formulas for calculating the three evaluation indexes are shown in Among them, Y i andŶ i represent the true value and the predicted value, respectively.
The predicted results of these four stocks are shown in Figures 3-6, and the error analysis is shown in Tables 1 and    From Figures 3-6, it can be seen that the model can accurately predict the overall trend of four stock prices with different market capitalization scales. The predicted value of the FS-LSTM model is closer to the real value, indicating a better overall fitting effect. As can be seen from Tables 1 and 2, the prediction error of the FS-LSTM model is smaller compared with that of the traditional LSTM model. Comparatively, the prediction effect of the Shenzhen Component Index is the best which is attributed to the small stock price volatility. Using this model, the overall trend of stocks with different market values can also be accurately predicted, proving that the model can not only predict the stock price but also reliably predict the stock price of different scales, demonstrating its generalization and reliability. The application of the FS-LSTM model in stock forecasting can fully analyze the original data of stock and improve the forecasting accuracy of stock price. The experiment shows that the combination model has obvious advantages in dealing with data with many indexes and complex noise.

Conclusion
Firstly, this paper analyzes the impact of 5G development on the IoT. The integration of 5G, IoT, and deep learning is a new development trend. 5G and IoT have many advantages in stock forecasting. Then, this paper presents a FS-LSTM combination model based on feature selection and LSTM prediction for stock trend prediction. The optimal feature subset for stock trend prediction is obtained through feature selection. The prediction effect of the optimal feature subset is verified by the test set. The experimental results show that the forecasting model proposed in this paper is superior to the traditional LSTM forecasting model in terms of forecasting effect. Using this method, the best feature subset for forecasting can be found and the impact of redundant information on stock trend forecasting can be reduced. As a result, the accuracy of forecasting is improved. Finally, the application of 5G and IoT in stock forecasting is analyzed.
Stock market is a complex and dynamic system. The shortcoming of this work is that this paper is only based on technical indicators and does not consider other factors. The future work involves including newly developed computing models. The future work also involves minimizing computation time of FS-LSTM. It is concluded that 5G, IoT, and stock forecasting will be more closely linked in the future.

Data Availability
The research data used to support the findings of this study have been deposited in the Tushare repository (http://tushare.org/).