The Dynamic Relationship between Stock Market and Macroeconomy at Sectoral Level: Evidence from Chinese and US Stock Market

Sino-Danish College, University of Chinese Academy of Sciences, Beijing 100049, China Key Laboratory of Big Data Mining and Knowledge Management, Chinese Academy of Sciences, Beijing 100190, China Research Center on Fictitious Economy & Data Science, Chinese Academy of Sciences, Beijing 100190, China School of Economics and Management, University of Chinese Academy of Sciences, Beijing 100190, China


Introduction
Since Schumpeter [1] proposed the role of the financial market in promoting productivity and economic growth, a large number of works have attempted to study the causal relationship between financial market and macroeconomic development. It is well recognized that the financial market plays an important role in resource allocation and risk management for an economic system. Because the financial market contains many submarkets, and it is difficult to find a single proxy to measure the whole financial market, most scholars only focus on one sector. In terms of the relationship with the macroeconomy, the stock market is the subsector that economists are most interested in. For example, Atje and Jovanovich [2], Abugri [3], and Bahmani-Oskoose and Saha [4] found that the movement of stock markets is closely related to the real economy. Meanwhile, many practical cases have also revealed the comovement of the stock market and macroeconomy. For example, the outbreak of the subprime mortgage crisis in 2008 quickly led to the recession of the real economy. Motivated by this observation, some previous studies have explored the role of stock market volatility on macroeconomic forecasting [5][6][7], but most of them focus on the US stock market and macroeconomics [8][9][10]. It is also worth noting that the stock market of developing countries has deviated from the direction of economic growth for a long time. In particular, Chinese financial markets, as the biggest emerging market in the world, have surged rapidly during the past decades, but real cases also showed that there remains great volatility in the markets over the years. For example, the SSEC index dropped from 5955 points in October 2007 to 1800 points in October 2008 while China's GDP growth rate remained around 9 percent at the same time. Although some literature has also studied the relationship between China's stock market and macroeconomy [11,12], few studies concentrated on a country-on-country analysis, especially the comparison between China and the USA. Also, many researchers only apply market composite indexes like S&P 500, DAX, and SSEC [13][14][15] to analyze the connection between stock returns and macroeconomic variables but ignore the fact that the impact of stock price shocks may vary among different industries. As to the selected methods, the most frequently used approaches are conventional econometric models, such as the Granger causality test, cointegration model, and vector autoregressive model [16][17][18]. ese models usually cannot capture the dynamic changes of the correlation between two time series, thus failing to investigate the complex nonlinear relationships between stock market and macroeconomic fluctuation. erefore, the motivation of this paper is to examine how far can Chinese stock market become a barometer of macroeconomy and what the differences with the mature market like those in the USA. Combining with a lead-lag analysis, this paper will take the sector asymmetric perspective to study the dynamic relationship between stock markets and macroeconomic variables in the USA and China and further provide insights for the analysis of the current problems of the Chinese stock market. We contribute to the existing literature in three ways. First, we adopt a novel nonparametric method to study the dynamic leadlag relationship between stock market and macroeconomy, while earlier literatures limited their methodology to classical econometric models. Second, we focus on how macroeconomic indicators in different sectors respond to the corresponding stock indices, while a large body of studies have been exploring the linkage between stock market between macroeconomic variables from a more comprehensive perspective. ird, we make a comparative analysis of the relationship between stock markets and macroeconomy and examine whether the leading role of sector indices is different in the USA and China, while most previous studies are limited to a single country. e remaining sections of this paper are organized as follows: related literatures are reviewed in Section 2; Section 3 introduces the methods and data used in this paper; Section 4 shows and explains the results obtained in our research; Section 5 is the conclusion and discussion.

Literature Review
From a theoretical standpoint, arbitrage pricing theory [19], which took asset returns as a linear function of different variables including macroeconomic factors, effectively demonstrates the general rationale of their relationship. For instance, macroeconomic fundamentals may influence stock return through the change of economic activities, the interest rate, and public expenses [20]. Hence, the volatility of stock prices also has an impact on macroeconomic factors. Consumers and enterprises may increase their spending or investment due to the rise of stock prices, thus promoting the growth of the macroeconomy. e APT has laid a foundation for a variety of follow-up works [21][22][23] proving a significant relationship between stock returns and macroeconomic variables. However, the conclusions drawn from real cases and empirical studies have shown that the stock market cannot always reflect all information available when the stock is kind of speculative; the irrational buying or selling of investors will further aggravate the degree of the market deviation, thus leading to greater deviation from the macroeconomy [24,25]. Compared with traditional asset pricing theory, behavioral finance theory which assumes that investors are common people affected by sentiment like overconfidence, herd instinct, and self-attribution can better explain the deviation between the stock market and macroeconomy [26]. erefore, stock price changes are fundamentally driven by both macroeconomic variables and sentiment factors. Based on the theories of behavioral finance, a host of literatures have established many measures of investor sentiment based on both survey data and secondary data [27,28]. For example, Shi et al. [29] used text mining methods to extract investor sentiment from a stock forum.
eir findings suggested that the intensities of sentiment contagion in different industries are different and an upward macroeconomic environment will promote investor's optimism of the stock market. Unlike studies on macroeconomic factors which are linked to developed countries, the literature on investor behavior is more found for emerging countries [30,31]. It is possible because developing countries usually have higher scores on average in uncertainty avoidance, masculinity, individualism, and power distance, which means that investors' sentiment in these markets has a stronger impact than that in developed markets [32]. Furthermore, Corredor et al. [33] investigated the effect of investor sentiment on stock prices in three emerging markets and found that investor sentiment plays a key role in the price formation of stocks in these markets and its impact is stronger than that in developed stock markets.
Over the past years, the linkages between financial markets and macroeconomy have attracted the interest of many scholars. Various views on their relationships are proposed from different perspectives. e Efficient Market Hypothesis (EMH) [34] assumed that all information available is contained in stock prices, so the past information such as macroeconomic indicators cannot be used in predicting the future stock prices. However, a large number of follow-up studies based on the APT framework provide empirical evidence for the role of macroeconomy in stock price movements. Most of them aim to reveal the bidirectional causal relationship between macroeconomic variables and stock market changes, while few literatures show the lead-lag relationship between stock prices and the real economy. e pioneering work by Fischer and Merton [35] proposed the fact that the stock market can be a leading indicator for the macroeconomic environment, but other studies such as Stock and Watson [36] considered the stock market as a lagging indicator. Since the conclusions drawn from the earlier research are ambiguous, lots of researchers have applied various methods on different macroeconomic indexes or different data frequencies to study the relationship between stock markets and macroeconomics in different countries. For the selection of macroeconomic indicators, the variables studied cover money supply [37], GDP [38], CPI and PPI [39], interest rate [40], and industrial production growth [41]. It is noteworthy that only a small subset of works focus on sectoral macroeconomic indicators. Also, relevant studies have also been proved to apply to different data frequencies. For example, Sadorsky [42] took daily and monthly data to examine the macroeconomic factors of US technology stock price conditional volatilities and found that conditional volatilities measured by daily stock data show more robustness than conditional volatilities measured by monthly data. Auzairy et al. [43] conducted related research on weekly data and found that macroeconomic variables can significantly influence the performances of stock markets. Nkoro and Uko [44] used annual data to study the ability of macroeconomic indicators of forecasting stock returns. As mentioned above, most articles center on the US stock market and macroeconomics, but there is also some literature examining the relationship between stock price changes and the macroeconomy in G20, BRICS, ASEAN-5, and other countries [45][46][47][48]. Only a few studies explore the country differences of this relationship in the case of US and Chinese markets [49], and there is little literature on the country differences of lead-lag relationship.
At present, there is no consensus on the conclusions drawn from the existing literature; one of the reasons is the diversity of research methods. Most of the early methodologies adopted the Granger causality test, which fails to include uncontrollable variables, to study the static relationship between stock markets and the real economy [50]. erefore, the linear models like the vector autoregression with no assumption of endogeneity or exogeneity of variables were proposed to analyze the correlation between a set of macroeconomic variables and stock prices, but this cannot be applied to nonstationary data [51]. Following with the earlier research, the development of cointegration analysis allows linear regressions using nonstationary time series and can be applied to examine the long-term comovement among the variables [52]. Meanwhile, vector error correction model is capable of checking the short-term causality as well as the adjustment process toward long-term equilibrium [53]. However, many studies pointed out that the main limitation of these classical linear models is that they hold normality and homoscedasticity to the research data and fail to reflect the dynamic process of the relationships [54]. More recent empirical works start to investigate the dynamic cross-correlation and the nonlinear dependence between financial markets and other related factors. Arango et al. [55] introduced some evidence of the nonlinear and inverse relationship between the share prices and the interest rate. Su [56] applied the nonparametric ranking tests and the threshold error correction model to check the nonlinear long-run relationship between stock markets and the real estate sector of western European countries. Borjigin et al. [57] used the linear Granger causality test models as well as nonlinear ones to explore the nonlinear and dynamic causal relationships between stock prices and macroeconomy and found that the nonlinear dynamic Granger causality is much stronger than linear Granger causality.
Similarly, only a handful of the extant literature takes the sectoral differences in the relationship between the stock market and macroeconomy into consideration. Aylward and Glen [58] tested the links between macroeconomic variables and stock prices for developed and emerging markets and discovered a significant causality between macroeconomic fundamentals and stock prices for developed and emerging markets, but the significance of this relationship is different. Hess [59] analyzed the impact of the macroeconomic shock on different sector indices by using VECM model. He found that different sectors have different sensitivity to macroeconomic changes. Yartey [60] studied the correlation between economic growth and stock returns in a panel of emerging and advanced countries. e results indicated that this correlation in emerging countries is weaker than that in developed countries. However, the literature studying sectoral differences of the stock-macroeconomy nexus is based on classical econometric methods and usually chooses a representative set of macroeconomic variables rather than sector-specific macroeconomic indicators, which cannot capture the dynamic environmental changes of different industries.
To summarize, the above investigation of the related literature has indicated that there is a gap in the extant works. Few studies focused on investigating the relationship between sector indices and macroeconomic variables, especially the lead-lag structure between sector stock prices and the corresponding macroeconomic variables. It should be noted that most of the existing studies regarding the leadlag relationship between the stock market and macroeconomy are limited to the analysis based on one market, but the comparative studies can provide insight of the differences at the national level. In addition, works applying nontraditional methods to test this kind of lead-lag relationships are still insufficient. To the best of knowledge, none of the studies have employed the novel nonparametric method, the thermal optimal path (TOP), to test the dynamic time evolution of the lead-lag linkage between stock indices and the corresponding macroeconomic indicators from the sectoral perspective. Since the TOP model is nonparametric and is not restricted by assumptions and has been successfully utilized in some correlation studies of financial data at different frequencies [61][62][63], we apply the method into the following detection of the dynamic lead-lag dependence between sector indices and macroeconomic variables. To fill the above research gap, this paper will apply the TOP to examine the lead-lag relationships between different sector indices and macroeconomy on the cases of the USA and China.

Description of the ermal Optimal Path (TOP) Method.
e thermal optimal path (TOP) method which was first explored by Sornette and Zhou [64] is a novel technique to study the time-varying lead-lag configuration between a pair Complexity of time series. Specially, previous and recent studies have proved that this TOP method does not require the stationarity and normality of time series [65,66]. e working principle is explained as follows.
A matrix E X,Y of the distance between a pair of standardized time series X and Y is firstly defined by the TOP method. e energetic matrix E X,Y is presented as (1) e element ϵ(t 1 , t 2 ) means the comparison between the realization X (t 1 ) of X at time t 1 and the realization Y (t 2 ) of Y at time t 2 .
us, the N × N matrix shows the distance between the two time series at different moments and contains all possible pairs of the comparisons.
After obtaining the lead-lag relationship that is quantified as the function t 2 (t 1 ), the coordinate system (x, t) is rotated as where t represents the main diagonal direction of the (t 1 , t 2 ) system and x is perpendicular to t. e origin ( . Even if the above process has successfully found out the optimal path which owns the minimum sum of its distances along its length, there always exist noises included in the two time series affecting the path formation, thus resulting in wrong lead-lag dependence. It has been proved that a weighted average on many paths with almost the same cost can conclude a robust lead-lag structure; each weight is measured according to the Boltzmann-Gibbs factor. Next, the partition functions G(x, t) for all values of x at a time t and their sum G(t) � x G(x, t) is supposed to be calculated. So, the G(x, t)/G(t) represents the probability for a path to be at distance x from the diagonal at time t, and this probability is decided as a compromise between minimizing the mismatch or cost and maximizing the combinatorial weight of the number of paths with similar mismatches in a neighborhood (similar to an "entropy"). Taking the Boltzmann-Gibbs factor as the weight, the recursive equation e T working as "temperature" controls the relative significance of cost versus combinatorial entropy. e larger the T is, the greater the probability of deviating from the path with minimal "energy." Based on the previous calculation, we can get the local time lag <x(t)> at time t: According to the exponential of minus the measure ϵ(x, t) of sameness of two time series, the <x(t)> can be taken as the thermal average of the local time lag at t over all possible lead-lag patterns properly weighted. For a given x 0 and T, the cost e T (x 0 ) of this path can be defined as e algorithm of TOP obtaining the optimal path is continuous, so the initial and terminal points of the path will influence the thermal average of several sample points in the beginning and ending. erefore, we set some different initial and terminal points in this paper and then compute the "energy" of each path. In the end, the path with the smallest "energy" is taken as the final thermal optimal path.

Description of Cross-Correlation Function.
As a traditional statistical method, the cross-correlation analysis is hard to capture the dynamic lead-lag structures, but it can be used to show the time-varying trends in the current context and investigate the results diagnosed by the TOP method. For centered random variables, the cross-correlation function can be calculated as follows: where 〈·〉 denotes the sample average and Var[·] is the sample variance.

Bootstrapping Tests and Statistical Significance.
To examine the significance of the lead-lag configuration obtained from the TOP analysis and cross-correlation analysis, a bootstrap method, which is a statistical technique that can estimate standard error and confidence level of data with nonnormal distribution, is introduced to apply to the problem [67,68]. It has been proved that this statistical method can help to get more robust results [69,70]. After obtaining the lead-lag pattern x(t) based on the TOP analysis or cross-correlation analysis of two time series during a fixed time period, two series are shuffled and applied to TOP analysis at the same T or cross-correlation analysis. is process is repeated n times to produce n paths x i (t) with i � 1, 2, . . . , n while n usually is taken as 1000. erefore, for each t, the 5% quantile x 5% (t) and the 95% x 95% (t) are calculated and denoted by L(t) and U(t). If the x(t) is smaller than L(t) or larger than U(t), we infer that the leadlag function x(t) at time t is significantly different from zero at the level of 95%. As a function of t, p value highlights the time periods during which the lead-lag pattern is significant.

Data Description.
Several studies have proved that the TOP can be conducted on monthly frequency data. For instance, Guo et al. [71] used the TOP on both weekly and monthly data to examine the lead-lag dependence between 4 Complexity the US stock market and the yields of bonds; the significant results supported by bootstrapping tests indicated that the stock market leads the yields. Yao and Kuang [72] took the TOP and 5 economic and financial variables ranging from Jan 1st, 1992 to Dec 31st, 2016 to explore the dynamic leadlag structures between oil price and financial markets in the USA and China and proved that the lead-lag relationship between oil market and the US stock market has a clearer pattern than that between oil market and China stock market. In this paper, we also use six pairs of monthly sectoral time series as our data set which includes stock indices and the corresponding macroeconomic variables from the USA and China. All samples range from Jan 1st, 2005 to May 1st, 2019.
To evaluate the Chinese and the US stock market from a sectoral perspective, we select 3 sectors with different characteristics: consumption, industry, and real estate to focus on. e reasons for choosing these three industries are as follows: first, they are the mainstay industries of the real economy; the value of their output accounts for a large share of economic growth. Second, they are closely related to other industries and play a significant role in promoting the primary, secondary, and tertiary industries. ird, they have different cyclical or defensive characteristics, thus having different responses to the fluctuation of the macroeconomic environment. Table 1 presents the description of the stock sector indices and macroeconomic variables we used. Chinese dataset is retrieved from Wind databases. e CITIC sector indices, which are considered as representative of China's sector stock indices, are chosen as the stock data. It is classified by CSRC (China Securities Regulatory Commission) with reference to the famous index company MSCI (Morgan Stanley Capital International). Meanwhile, the sample of CITIC industry indices takes full account of all Class-A stocks traded on China's stock market. e US stock dataset is downloaded directly from the website https:// finance.yahoo.com while the macroeconomic dataset is obtained from the website https://www.census.gov. e S&P 500 sector indices, classified by GICS (Global Industry Classification Standard), are chosen as the stock data. e S&P 500 index includes 500 companies listed on the major US stock market. Compared with the Dow Jones index, it has more comprehensive samples, so it has higher accuracy and more perfect continuity. erefore, the S&P 500 index can better present the volatility of the US stock market. As there exists the influence of seasonal variations, the monthly closing prices need to be transferred to the return of sector indices while the macroeconomic data are selected in the form of year-on-year rate. Both kinds of series are seasonally adjusted.
e evolutions of three sector indices and the corresponding macroeconomic variables selected from two markets are shown in Figures 1 and 2. Compared with the US stock market, the Chinese stock market presents more violent and frequent fluctuations in the sample period. In case of macroeconomic variables, Chinese macroeconomic indicators show greater volatility, of which the real estate is the most volatile sector. But as far as the USA is concerned, the fluctuation trends of the three sectors are similar. Table 2 displays the descriptive statistics for the dataset. e results show that the average stock return for China is higher than the stock return for the USA, but the values of standard deviations provide evidence that the Chinese stock market contains higher risks. Among them, real estate is the most volatile sector for both stock markets, and this is also confirmed by the standard deviations of macroeconomic variables. Both stock markets are featured with negative skewness and positive kurtosis greater than 3, which indicate that all stock series follow the distribution of high kurtosis and fat tail. e JB-test statistic for both stock returns and macroeconomic variables is significant except for industrial added value, which proves that stock market returns and macroeconomic series are not normally distributed.
e lead-lag relationship between the return series of indices and the corresponding macroeconomic variables in two stock markets is analyzed based on standardized series. Considering that our analysis is based on a comparative study with the data from the largest developed country, the USA, and the largest developing country, China respectively, the research is conducted to understand the differences of the sectoral lead-lag relationships between the stock market and macroeconomic variables for developing and developed countries.

Comparative Analysis Based on the TOP Method.
Based on the TOP method, we take six pairs of standardized time series from the USA and China as the original input data and calculate the local time lag <x(t)> for every two series at the temperature T of 5, 10, and 20. x(t) > 0 represents the macroeconomic data lags of the sector indices; otherwise, it means that the sector indices lag the macroeconomic data. e value of the <x(t)> represents the numerical lags of the sector indices leading the macroeconomic data. Figure 3 shows the lead-lag relationships between stock indices and macroeconomic variables at different temperatures; we can see that even though there are some differences in lead-lag values under different parameters, the leadlag evolutions are roughly similar. Figure 3 consists of two panels; the left one plots the leadlag relationship between the sector indices and macroeconomic variables for China; the right one plots the lead-lag relationships between the sector indices and macroeconomic variables for the USA. We can find that, for the US stock market, three sector indices have been leading the corresponding macroeconomic variables since 2013; for the Chinese stock market, the lead-lag relationships are different for different sectors.

Statistical Significance.
For proving the robustness of the results presented in Figure 3, we apply the bootstrap method to describe the statistical significance. e parameter T is selected as 5 according to the comparison with time difference correlation analysis as well as the results of TOP's numerical experiment. Figure 4 explains the results obtained from the bootstrap test. For the Chinese stock market, Complexity Figure 4(a) illustrates that the lead-lag relationship between the consumption sector index and the total retail sales was not significant at the early stage; the lag function x(t) was below the 5% quantile curve from 2013 to 2017, which means that the consumption sector index significantly lags the total retail sales. Since 2018, the x(t) was above 95% quantile curve, which means that the consumption sector index has started significantly leading the total retail sales. Figure 4(c) shows that the lead-lag relationship between the industry sector index and the industrial added value was not significant at the early stage, but the lead function x(t) was above the 95% quantile curve since 2010, which means that the industry sector index has been significantly leading the industrial added value since 2010. Figure 4(e) illustrates that the relationship between the real estate sector index and the real estate investment was not significant at the early stage, but the lead function x(t) was above the 95% quantile curve since 2009, which means that the real estate sector index has been significantly leading the real estate investment since 2010.
For the US stock market, the same conclusions can be extracted from the three subplots of right one plot; that is, the function x(t) was not significant at the early stage, but the lead function x(t) was above the 95% quantile curve since 2013, which means that the sector indices have been significantly leading the corresponding macroeconomic variables since 2013.

Discussion.
Comparing the lead-lag structure between the consumption index and total retail sales of two markets from Figures 3(a) and 3(b), it can be seen that the lead-lag relationships between two variables for the Chinese stock market have been keeping changing during the research period. First, the lead-lag relationship between the consumption sector index and the total retail sales was not significant from 2005 to 2012, a period corresponding to the stage of a frequently changeable macroeconomic environment. Domestically, the stock market functions and relevant systems were still unstable as the nontradable shares reform was conducted in 2005. Internationally, the adverse effects caused by the global financial crisis in 2008 have not been eliminated. Second, the consumption sector index had significantly been lagging the total retail sales from 2013 to 2016, a period corresponding to the stage of economic transition and downward speed. Facing the decreasing pace of economic growth but the policies of slack liquidity and deep reform, investors were still optimistic about the growth of economic aggregate, and such irrational sentiment promotes a rise in the stock market. erefore, the real economy has been adversely affected by the decline of residents' income and the crowding-out effect of investment on income and thus fell into a continuous descending range which led to a sharp sell-off of the consumption sector index. e role of investor sentiment played in the above process illustrates that the lead-lag relationship presented from 2013 to 2016 is irrational.
ird, the consumption sector index has been significantly leading the total retail sales since 2017 as the real economy entered a steady reviving stage with stable monetary policies, increased residents' income, and enhanced investor confidence.
For the US stock market, as the global largest stock market with the most perfect market mechanism, institutional investors are the main participants, so it is less affected by the irrational investor sentiment. First, the lead-lag relationship between the consumption sector index and the total retail sales was not significant from 2005 to 2012, a period corresponding to the stage of the frequently changeable macroeconomic environment. e US economy had started entering into the recession stage since 2001, so the federal reserve began cutting interest rate continuously from 2001 to 2004, which not only promoted the fast development of the real estate but also planted the seeds of subprime crisis. e rapidly growing bubble made the federal reserve raise interest rate 17 times in a row from 2005 to 2006, and the real economy was adversely affected by the collapse of the real estate market. In the end, the subprime crisis started originating in the USA in 2006, swept the world in 2007, and led to the stock market crash in 2008. Second, the consumption sector index has been significantly leading  pushed forward the stock market entering into the ascending phase, which is followed by the continuous growth of the real economy, the rise in the jobs market, and the increase of residents income and savings in next 3 years. e results and analysis further confirm that the mature stock market has a significant "barometer" effect on the macroeconomy. Comparing the lead-lag structure between the industry sector and the corresponding macroeconomic variables  To further analyze the relationship between the two, we can see that, firstly, the growth rate of fixed asset investment in manufacturing has been decreasing since the downward macroeconomy and the pressure for the stock market going down increased as the investors hold a deteriorating outlook on the real economy; secondly, the industrial added value also fell into a continuous declining range as the decrease of financing, the downturn of economic growth, and the crowding-out effect of real estate. With similar reasons, the lead-lag relationship between the industry sector index and the total industrial production for the US stock market was not significant from 2005 to 2012. Since 2010, the industry sector index has been significantly leading the total industrial production; the US economy has begun to recover and entered into a comprehensive recovery phase in 2013. Driven by the "industrialization" strategy and the fall in energy costs brought by the shale gas revolution, the recovery of the manufacturing sector in the US was accelerated, and the improved economic outlook of investors increased the investment of the relevant enterprises, which promoted the constant growth of industrial output, capacity utilization, and manufacturing PMI. With the continuous rise of the stock market, the industry sector index has been significantly leading the total industrial production since 2013.
Comparing the lead-lag structure between the real estate sector index and the corresponding macroeconomic variables from Figures 3(e) and 3(f ), the lead-lag relationship between the real estate sector index and the real estate investment for the Chinese stock market was not significant from 2005 to 2009, a period corresponding to the stage of a frequently changeable macroeconomic environment. Based on the above similar reasons, the real estate sector was in the stage of insufficiency development. Since 2009, the real estate sector index has been significantly leading the real estate investment. Even though the adverse effects caused by the global financial crisis in 2008 have not been eliminated and the economic structural transition was still in the starting phase, the house prices have been keeping soaring as the policy stimulus and great demands. To further analyze this phenomenon, we find that, firstly, the uncertainty of the economic environment is hard to affect the real estate investment as the investors generally take the real estate as a kind of safe asset, especially when the economy is in a downward stage; secondly, the real estate investment is irreversible to a large extent; therefore, the investors cannot immediately withdraw from the market; finally, a series of preferential policies making investors with speculative psychology drive up the house prices and thus push forward the sector index, which leads to the fast growth of real estate investment. e role of investor sentiment played in the above process illustrates that the lead-lag relationship presented since 2009 is irrational.
With similar reasons, the lead-lag relationship between the real estate sector index and the construction spending of the USA was not significant from 2005 to 2012. Since 2010, the real estate sector index has been significantly leading the construction spending; the US economy has begun to recover and entered into a comprehensive recovery phase in 2013. e financial environment with the low loan rate and the continuous participation of institutional investors in the real estate sector has promoted the strong recovery of the US real estate market; the improved economic outlook of investors increased the investment of the relevant enterprises, and the volume of housing transactions in the USA reached the highest level in 2013 since the subprime crisis. With the continuous rise of the stock market, the real estate sector index has been significantly leading the construction spending since 2013.

Robustness Check.
For each pair of time series, we conduct the cross-correlation analysis and take the bootstrapping test to evaluate the significance levels during three JB is the Jarque-Bera test of normality, which is distributed as χ 2 (2). Symbols * * * , * * , and * indicate confidence levels at 1%, 5%, and 10%.  total retail sales for the time period after August 2013. We can see that there is a significant peak at the positive lag of t � 20 month with c � − 0.19, and this can be seen as roughly confirming the results of the TOP method. However, the cross-correlation only presents a coarse description of the real lead-lag configuration.
For the industry sector, Figure 5(d) explains the crosscorrelation analysis of the industry sector index and the total industrial production for the time period before August 2007. We can see that there are no significant peaks above 95% quantile curves or below 5% quantile curves, meaning that the lead-lag relationship between the industry sector index and the total industrial production is not significant. It is roughly in line with the previous analysis of the TOP showing that there are no significant lead-lag relationships between the two variables. Figure 5(e) explains the crosscorrelation analysis of the industry sector index and the total industrial production for the time period between August 2007 and August 2013; we can see that there are many significant peaks at positive and negative lags; it is difficult to draw a single conclusion about the lead-lag relations, and this is roughly in line with the previous analysis of the TOP. Figure 5(f ) explains the cross-correlation analysis of the industry sector index and the total industrial production for the time period after August 2013; we can see that there is a significant peak at the positive lag of t � 10 month with c � − 0.22 and this can be seen as roughly following the average value of the lead-lag curve shown in Figure 3(d). Similarly, the cross-correlation only presents a coarse description of the real lead-lag configuration.
For the real estate sector, Figures 5(g) and 5(h) explain the cross-correlation analysis of the real estate sector index and the construction spending for the time period before August 2007 and between August 2007 and August 2013, respectively. We can see that there are many significant peaks at positive and negative lags, it is difficult to draw a single conclusion about the lead-lag relations, and this is roughly in line with the previous analysis of the TOP method showing that there are no significant lead-lag relationships between the two variables. Figure 5(i) explains the crosscorrelation analysis of the real estate sector index and the construction spending for the time period after August 2013; we can see that there is a significant peak at the positive lag of t � 15 month with c � − 0.14, and this can be seen as roughly following the average value of the lead-lag curve shown in Figure 3(f ). Similarly, the cross-correlation only presents a coarse description of the real lead-lag configuration.

Conclusion
In this paper, the thermal optimal path method has been applied to explore the lead-lag evolution between the sector indices of the three representative sectors and the corresponding macroeconomic variables. e research period that has been chosen spans from January 2005 to May 2019. Both monthly data from the USA and China have been used to obtain comparative results. For the US stock market, the sector indices of all three sectors lead the corresponding macroeconomic variables; for the Chinese stock market, the lead-lag relationships between the sector indices and the macroeconomic variables are different for different sectors.
Based on the results of the TOP method, we found that the lead function x(t) between the consumption sector index of China and the total retail sales has been varying from negative to positive since 2013, but the real estate sector index and the industry sector index of China lead the corresponding macroeconomic variables since 2010. is means that, for the countries whose stock market is immature, the investor sentiment is easier to affect the "barometer function" of the stock market. For the interpretation of the three sectors with different lead-lag behaviors, firstly, as a fast growing component of the Chinese economy, the real estate sector has a strong crowding-out effect on consumption and industry sectors under the background of the Chinese economy entering the early stage of structural transition and downward speed since 2010; the TOP analysis about the real estate proves that Chinese real estate contains lots of speculative bubbles that restrain the development of entity sectors as well as consumer demands; secondly, compared with industry sector, investors usually tend to take consumption sector as a kind of defensive sectors and neglect the impact brought by the changes of macroeconomic environments; the TOP analysis about the consumption and industry sectors proves that the "barometer function" of defensive sectors is more susceptible to investor sentiment, especially during the downward period.
As for the US stock market, there is no significant leadlag relationship between all sector indices and the corresponding macroeconomics before 2013. is phenomenon illustrates that the outbreak of big influential events like the financial crisis followed by a frequently changeable macroeconomic environment can disable the "barometer function" of the stock market. Considering that the US economy has begun to recover since 2010 and entered into a comprehensive recovery phase in 2013, all sector indices started leading the macroeconomic variables since 2013 as the improved outlook of investors.
Different sectors have different responses to changes in the macroeconomic environment, which are closely related to the country's economic system, the development level of financial markets, and industrial structure. Comparing the analysis of the two countries, we found that, for the immature stock market, the "barometer" function of stock indexes shows obvious industry asymmetric effect, investors are more susceptible to the irrational sentiment which can disable the "barometer function" of stock market, and the role of irrational investor sentiment can be magnified during the economic downward period. Hence, some policy implications are proposed based on the above findings. Financial regulators should pay attention to maintaining the market order and enhancing the transparency of the market; effective policies should also be taken to provide investors with a multifaceted and in-depth education in combination with the characteristics of the industry, so as to guide them to make a reasonable investment. As far as the three industries studied in this paper are concerned, real estate, as an important pillar of a country's economy, is related to the optimization of economic structure and the stability of the Complexity 13 financial system, but it is also very vulnerable to the speculative psychology and has a crowding-out effect on the real sector such as manufacturing and consumption. erefore, the relevant agencies should use administrative and economic means to curb the irrational prosperity of the real estate market, crack down on speculation, and guide the transformation and upgrading of the manufacturing industry. As a defensive sector, the "barometer" function of the consumption sector is more likely to fail in the period of economic downturn. e practical measures might be for governments to build different early warning systems according to different industries. Meanwhile, effective legal frameworks and institutional arrangements should be carefully designed to support the early warning system. For the USA, the "barometer" function of different sector indexes is roughly symmetric. However, even though the US stock market is mature and is less affected by investor sentiment, it still needs to realize that the stock market has been leading the real economy on the basis of the fast economic growth during the past decade and pays attention to the "barometer function" of the stock market when the influential event like the global spread of coronavirus turns on the switch of economic recession.

Data Availability
Chinese dataset is retrieved from Wind databases. e US stock dataset is downloaded directly from the website https://finance.yahoo.com while the macroeconomic dataset is obtained from the website https://www.census.gov.

Conflicts of Interest
e authors declare no conflicts of interest.