{'fraction_non_alphanumeric': 0.022760290556900726, 'fraction_numerical': 0.011138014527845037, 'mean_word_length': 5.183233532934132, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Forecast and Analysis of Volatility Trend of Chinese Stock Market Based on R Language

In the stock market crash in China’s capital market in 2015, the bubble quickly spread from the Internet industry to the entire stock market. It can be seen that the financial system has inherent instability and endogenous vulnerabilities. A small shock may be amplified by the financial system and have a contagious effect, which ultimately has a huge impact on the entire financial system and the entire economy. Therefore, it is possible to accurately predict the trend of China’s stock market volatility, and it is of great significance and reference value for China’s economic development to prevent risks and stabilize the economy in a timely manner. Based on the characteristics of industry index volatility, this paper studies the risk transmission mechanism between industries by examining the main risk source industry, risk transmission intermediary industry, risk conduction characteristics between industries, and the dynamic changes of risk conduction, and finally through R language processing. The data is used to predict the volatility of China’s stock market in the first half of 2018.


Introduction
Some foreign scholars have emphasized the importance of network connectedness analysis in financial research, such as Jackson (2008) and Babus (2016). Relevant empirical research is mainly the risk transmission between banks and financial institutions. Diebold and Yilmaz (2014) study the risk transmission between some US financial institutions through network analysis; Demirer and Diebold (2016) extend the network risk conduction analysis to Between global banks. Diebold and Yilmaz (2009, 2012, 2014) describe risk-conducting frameworks and metrics in a series of papers, emphasizing the measurement of risk-conducting effects based on variance decomposition, measuring the risk-conducting effects with connectedness and conducting with total risk. Effects to describe systemic risks. According to their risk conduction framework, the risk conduction effect can be divided into three levels. The first level is the total risk conduction effect of all elements in the system on the element, and the second level is the total of all elements in the system to all other elements. The third level of risk transmission is the systemic risk, which is the total risk conduction effect.
Demirer and Diebold (2016) used the above risk conduction measurement framework to analyze the global bank risk conduction network, used the LASSO regression method to compress variables to estimate the high-dimensional VAR model, and used network analysis to process the results of high-dimensional variance decomposition. Their research shows that the global bank risk transmission is regional clustering, the financial crisis and the European debt crisis, the systemic risk will rise. This study provides guidance for the empirical approach of this paper.
In terms of existing research results in China, the current research on the characteristics of industry risk transmission is mainly carried out from three perspectives. More common is the impact of a single risk on a certain industry, such as housing price fluctuations, implied guarantees and banking systemic risks (Song Lingfeng, Niu Hongyan, Liu Zhilong, 2018); secondly, the study of cross-regional risk transmission from the spatial dimension, such as the mainland, Dynamic analysis of linkages between Hong Kong and Taiwan stock markets (Wu Wei, Wang Zhi, 2014), regional financial risk accumulation and prevention control (Li Yanbai, Wang Xuelun, 2017); finally, research on risk linkage characteristics between industries . Chen Jianqing et al. (Study on Systematic Financial Risk Spillover among Financial Sectors, 2015) empirically analyzed the systemic risk marginal spillover effects and the total risk spillover effects between financial sectors, and found that systemic financial risk spillovers between financial industries are Positive and asymmetric, focusing on the study of financial risk within the financial industry, domestic scholar Li Xiaobo selected the composite index, business index, public index, industrial index and real estate index, the research results show that between five industries There is a volatility correlation, but the study ignores the impact of other market volatility spillovers, which have more or less impact on the accuracy of the parameters.
Although foreign related papers emphasize the adaptability of network analysis methods to risk transmission mechanism research, the existing literature only studies the risk transmission network between financial institutions, and does not involve the research of high-dimensional risk conduction networks between stock market industries.And there are fewer studies on forecasting the volatility trend of the stock market. However, the relevant research on the risk transmission problem of China's stock market industry has fewer industry variables, and the research focuses on a single industry or several sub-markets and sub-sectors, while ignoring the influence of other industries, resulting in lower accuracy of estimation results; It mainly uses the spillover effect to analyze, and the analysis process is single. It only emphasizes the dynamic change process of the interaction between industries under static analysis and ignores the risk conduction effect. The existing literature has almost no empirical research on the risk transmission of the whole industry in the stock market. One possible reason is the complexity of high-dimensional data processing.
In view of the above situation, this paper mainly uses R language to study the Chinese stock market, and finally predicts the volatility trend of China's stock market in the first half of 2018. The main innovations of this paper are: On the one hand, this paper studies the risk transmission mechanism of all industries in China's stock market through full sample estimation, which makes the accuracy of estimation results greatly improved. On the other hand, this study is not limited to predicting the volatility trend of the final stock market, but also focuses on the dynamic process of risk transmission mechanism.This paper uses the R language combined with static analysis and dynamic analysis to get the predicted results.

Systematic risk trend analysis
The research data in this paper selects all the A shares of the Shanghai Stock Exchange and the Shenzhen Stock Exchange from July 1, 2007 to December 30, 2017 as a research sample, with a total of 8,831,150 data of 3,470 stocks,that is, there are a total of 2,545 data. This paper estimates the total risk-conducting effect, the magnitude of systemic risk. Using 60 days to roll backwards for the rolling sample period, the continuous change of the overall risk conduction effect with time is obtained,as shown in Figure 1. Then we make the timing diagram and decompose the trend of the timing diagram, as shown in Figure 2.
There are two high peak points in the figure, which are March 2008 and August 2015, corresponding to the occurrence of financial crisis and stock market crash. This means that the occurrence of the crisis makes the industry's risk transmission stronger and systemic risk greater. Volatility reflects the degree of stock price change. In a rational market, stock price volatility depends on two factors: future expected return and discount rate. Under the premise that the discount rate remains relatively stable, the future expected return is rooted in new information. Arrived. In an irrational market, speculation can cause irrational fluctuations in stock prices [1] .

Risk conduction effect prediction
In view of the overall risk transmission effect of the stock market mentioned above, this paper selects the ARMA model to predict future trends. The ARMA model is called the autoregressive moving average model. It is a time series analysis model proposed by American statistician GEBox and British statistician GM jenkins in the 1970s [2] .The ARMA model can be divided into AR model, MA model and ARMA model. The ARMA model is a combination of the AR model and the MA model.
The mathematical formula of the AR model is: The mathematical formula of the MA model is: The mathematical formula for the ARMA model is: The ARMA model is often referred to as ARMA(p,q). When p=0, ARMA(0,q)=MA(q); when q=0, ARMA(p,0)=AR(p) [3] .
Judging from the previous timing diagram, this paper considers that the overall risk conduction effect is stable.
Using the autocorrelation plot and the partial autocorrelation plot plotted in R language, we can find that the overall risk conduction effect is tailed by the autocorrelation coefficient, while the partial autocorrelation coefficient is truncated at the first order.

(4)
The final prediction results are as follows:

Conclusion
As can be seen from Figure 5, in the first half of 2018, the volatility of the stock market will show a steady decline, and the actual situation of the Chinese stock market as of now is basically consistent with the forecast results of this paper. Therefore, this paper believes that the above prediction process has certain reference role and utilization value.
Stock market volatility is an important indicator of the stock market's degree of floating. Its existence can promote the development of the stock market to a certain extent. Investors participate in the stock market and certainly hope to make a profit. Only when the stock price fluctuates, will investors attract investors. In order to find opportunities to obtain income, if the stock market does not have volatility, it will not get investors' attention; in addition, the volatility of the stock market also reflects the degree of risk in the stock market, investors always hope to minimize The risk of obtaining the greatest return, then studying the volatility of the stock market can provide a basis for investors to make investment decisions.
From a macro perspective, when policy makers issue new policies, they must estimate in advance how this policy will affect the market. Only by predicting the fluctuations in the stock market in advance can we ensure that the correct and effective development is made. Policy measures to promote the stable development of the stock market.