Predicting Contagion from the US Financial Crisis to International Stock Markets Using Dynamic Copula with Google Trends

: The accuracy of contagion prediction has been one of the most widely investigated and challenging problems in economic research. Much e ﬀ ort has been devoted to investigating the key determinant of contagion and enhancing more powerful prediction models. In this study, we aim to improve the prediction of the contagion e ﬀ ect from the US stock market to the international stock markets by utilizing Google Trends as a new leading indicator for predicting contagion. To improve this contagion prediction, the dynamic copula models are used to investigate the structure of dependence between international markets and the US market, before, during, and after the occurrence of the US ﬁnancial crisis in 2008. We also incorporate the Google Trends data as the exogenous variables in the time-varying copula equation. Thus, the ARMAX process is introduced. To investigate the predictive power of Google Trends, we employ the likelihood ratio test. Our empirical ﬁndings support that Google Trends is a signiﬁcant leading indicator for predicting contagion in seven out of 10 cases: SP-FTSE, SP-TSX, SP-DAX, SP-Nikkei, SP-BVSP, SP-SSEC, and SP-BSESN pairs. Our Google-based models seem to predict particularly well the e ﬀ ect of the US crisis in 2008. In addition, we ﬁnd that the contribution of Google Trends to contagion prediction varies among the di ﬀ erent stock market pairs. This ﬁnding leads to our observation that the more volatile the market time-varying correlation, the more useful Google Trends.


Introduction
Contagion effect across countries and stock markets is an important issue concerned by economists, practitioners, and investors. Understanding the consequences of this effect on the global stock markets is crucial for risk measurement and portfolio allocation. In the recent few decades, the world economy has experienced various financial and economic crises, for example, savings and loans crisis (the 1980s), stock market crash (1987), Tequila crisis (1994), Asian crisis (1997), and the latest global financial crisis (2007). These incidents have generated a tremendous negative effect on the stock markets in many countries. One of the most damaging crises in terms of impact worldwide is the Global financial crisis (2007), which originated from the US subprime mortgage market. Bekaert et al. [1] indicated the US contagion effect rapidly spread to not only the domestic sectors of the economy but also other countries, after the US crisis occurrence. Hwang and Kim [2] revealed that this crisis adversely affected the banking sector, stock market, and credit market, which subsequently caused the economic recession, an increase in the unemployment rate, and a decrease in international trade. As the global economies are interdependent, contagion may occur in different asset markets and even different stock markets. Thus, it is important to investigate and predict the degree of the contagion effect. Additionally, it is essential to know whether and how the markets are linked, and the volatilities are transmitted. If a potential crisis can be detected earlier, the meaningful prediction of its likely consequences would be of great benefit to the financial fund managers, international portfolio investors, financial institutions, as well as policymakers in planning their financial strategies.
In the past, the crisis contagion effect was quite challenging to capture as the data was limited and the efficient data was meager. Of course, we can consider the Gross Domestic Product (GDP), investment, consumption, trade, and financial markets statistics as the data for investigating the contagion effect. However, the detection of the effect of our interest generally requires relatively high frequency data [3]. Fortunately, the prediction of this contagion effect will become much more comfortable in the present time due to the evolution of data science, and the availability of search engines like Google Search.
Google Search is ranked as the most used search engine on the World Wide Web nowadays. It provides aggregated information on the volume of queries for different search terms and how these volumes change over time via the publicly available service Google Trends [4]. Specifically, Google Trends can show a scale of 0 to 100 of the search volumes for a specific keyword related to the cumulative search amount on Google Search [5]. This new type of data can be used as a reflection of public attention. Mavragani et al. [6] suggested that Google Trends is a good analyzer of internet behavior and acts as a reliable tool in predicting changes in human behavior, subject to a careful selection of the searched-for terms. In the financial market domain, investors usually respond to their feelings through Google Search. Hence, from Google Trends, we can observe similar patterns of stock market spikes due to the popularity of the Internet. Not only does the data reflect stock market changes, but that data can be used to anticipate specific future trends.
In the past few years, Google Trends has been considered a useful indicator in many pieces of prediction research. For instance, Guo and Ji [7] used Google Trends data to predict oil prices. Li et al. [5] used Google Search to analyze trader positions and energy price volatility. Hamid and Heiden [8] introduced an economic model using Google Search data to forecast volatility of the stock prices for the S&P 500 and Dow Jones Industrial Average (DJIA) Indices. D'Amuri and Marcucci [9] examined the predictive power of Google-based models in forecasting US unemployment and revealed the higher performance of Google-based models during the Great Recession, with their relative performance stabilizing. Most recently, Xu et al. [10] applied Google Trends to predict the volatility of the stock markets and mentioned that Google Trends is the vital source of the volatility besides macroeconomic fundamentals. According to the conclusions made by these previous papers, we can expect that the forecasting performance can be improved by incorporating the Google Trends data as an additional exogenous variable in the forecasting model.
As we mentioned above, Google Trends provides the field of big data with new opportunities, as it is valid and beneficial for prediction. Therefore, in this study, we consider Google Trends data in the forecasting model to predict the US crisis contagion effect. Note that this crisis quickly spread and rendered a substantial negative impact on the global stock markets. We believe that Google Trends can be used to reflect the crisis contagion effect. The reason behind the use of Google Trends in forecasting contagion effect is that investors may start monitoring the economic trend and the investment information from the Internet long before facing the crisis. These actions give Google Trends, as an indicator, an advantage over other economic and financial indicators that provide information on a crisis or the expectation of the crisis. This is to say, we can view this new type of data as the early warning indicator of the upcoming crisis.
To the best of our knowledge, this is the first paper to attempt using Google Trends for the analysis and prediction of the US crisis contagion effect on the global stock markets. Here, we also propose a new method for capturing and predicting the degree of the spillover effect of the US crisis on global stock markets, which has evolved. To simplify our analysis, we divided the countries into two groups, namely developed and developing countries. For developed countries, we chose the USA, the United Kingdom, Singapore, Germany, Japan, and Canada. To represent the developing countries, we considered China, Brazil, Mexico, India, and Thailand. We selected these countries as they are the largest economies in the group as well as have the best data availability.
The existence of a financial contagion effect is related to the statistical definition. Dornbusch et al. [11] classified contagion in three definitions. Firstly, the contagion is defined as cross-country transmission of cross-country shocks. Secondly, the contagion is defined as the co-movement of shocks or volatilities. Finally, contagion is defined as an increase in the co-movement of volatilities or shocks between or across stock markets during a crisis period [2]. There are comprehensive empirical research works on the contagion effect, and many approaches have been introduced to measure the contagion effect. King and Wadhwani [12]; Lee and Kim [13]; Calvo and Reinhart [14] introduced the use of correlation coefficients to measure the co-movement between the crisis country's total market index returns and the return of other stock markets during the crisis. To verify the existence of crisis contagion, Boyer et al. [15]; and Sruthi and Shijin [16] proposed a t-statistic to test the contagion effect by testing the difference in correlation between the normal and the crisis periods. However, Forbes and Rigobon [17] argued that the test of contagion based on the correlation coefficient is biased as the correlation coefficient is not constant over time. Moreover, Engle [18] suggested that the correlation coefficient is not an appropriate measure of the dependence structure as it is based on a linear relationship. Thus, they suggested the Dynamic Conditional Correlation (DCC)-GARCH model and found that the model provides more reliable results and illustrates the reasonable time-varying contagion effect of the US crisis on international stock markets. Bala and Takimoto [19] investigated stock returns' volatility spillovers in emerging and developed markets using various multivariate-GARCH (GARCH) models, including constant conditional correlation (CCC)-GARCH, CCC-VARMA-GARCH, CCC-VAR-exponential GARCH (CCC-VAR-EGARCH), BEKK-(A)GARCH, and DCC-GARCH. They revealed that DCC-GARCH performance is superior to those of other competing models in the analysis of contagion effect in financial markets. The DCC-GARCH model has been employed by many researchers for investigating the co-movement between stock markets during crisis episodes, for example, Forbes and Rigobon [17]; Celık [20]; Mighri and Mansouri [21], and Chittedi [22].
Although the dynamic conditional correlation, determined by the DCC-GARCH model with the elliptical distribution assumption (e.g., the normal distribution or Student's t distribution), is widespread in measuring the time-varying co-movement between stock market volatilities, there are several drawbacks of this model. First, it cannot capture their nonlinear co-movement [23]. Second, the estimated correlation may bias due to the misspecification of the multivariate distribution. If the dependence between financial markets is asymmetrical, the DCC-GARCH model with the elliptical distribution is not sufficient for measuring this dependence. Thus, this model is inadequately capable of capturing extreme contagion effects. Third, the marginal distribution of the stock markets can be different and exhibit skewness and fat-tail. Thus, the elliptic marginal distribution used in DCC-GARCH may fail to capture the volatility of the stock markets.
To relieve the above drawbacks, the dynamic copula-GARCH of Patton [24,25] is introduced. This model can be used as an alternative way of connecting the marginal distributions to restore the joint distribution. Patton [24,25] mentioned that Copula isolates the pattern of reliance from marginal distributions. Thus, we can easily model the dependence structure, capture the volatility persistence, and solve the heavy tail and skewness problem. In this regard, we can obtain the reliable contagion effect of the US financial crisis on both developing and developed stock markets. Several studies employed this model to measure the degree of contagion. Peng and Ng [26] employed dynamic copula to test the existence of financial contagion. They found a significant asymmetric dynamic dependence among major international stock markets. In some situations, although stock index movements cannot clearly detect contagion, it can be captured by dependence between volatility indices. Chen et al. [27] measured the contagion effect between US and Chinese stock markets during the US financial crisis and showed that dynamic copula performs better than the static copula model. They also revealed that the correlation between stock markets during the crisis period is almost double compared to the non-crisis period. Meanwhile, Samitas and Tsakalos [28] applied the dynamic copula to examine the dynamic correlation among the Greek and the European markets during the recent European debt crisis. Their findings supported the existence of a contagion effect during crash periods but not during the Greek debt crisis.
We notice that all research works mentioned above only consider and use the dynamics of stock time series rather than other information or exogenous variables. Recently, many studies have confirmed the benefit of Google Trends, as the additional exogenous variable, for improving forecasting results [10,29,30]. Therefore, in this study, the US crisis contagion effect on developing and developed stock markets are investigated by the dynamic copula-GARCH with additional Google Trends indicator. Note that the ARMA process constructs the dynamic correlation of this model; thus, in this study, we modify this ARMA process to be ARMAX in order to incorporate the Google Trends variable in the correlation model.
Our contributions to the body of knowledge are four-fold. First, there are no previous studies in the areas of correlation and contagion effect incorporating the Google Trends as the additional factor to predict the contagion effect. Second, we introduce a new approach to investigating the dynamic correlation between the US market and other markets, which can provide us with the correlations more sensitive to the dynamic changes. This method allows us to incorporate Google Trends as the exogenous variable in the dynamic correlation equation. Thus, we can analyze how the degree of dependence changes according to Google Trends. Third, we compare the contagion of the US stock market on both developing and developed stock markets. As we mentioned earlier, there are three definitions of contagion [11]; thus, we can detect the contagion effect between two markets by comparing the degree of volatility dependence during a crisis period and the non-crisis period. We conduct an in-depth contagion analysis by separately estimating copula parameters for the pre-crisis period, during the crisis period and the post-crisis period. If the co-movement of volatilities between stock markets is high during the crisis period, the existence of contagion is confirmed. Finally, this study addresses various copula families provided in the financial literature and compares them to obtain the best dynamic copula model and the robustness of the results.
The rest of this paper is organized as follows: Section 2 presents different copula functions as well as marginal models. Section 3 describes the data. Section 4 presents and discusses the estimation results. The conclusions are presented in Section 5.

Methods
This paper uses several bivariate static and dynamic copula models to study the relationship between the US stock market and international stock markets. In this study, we first employed GARCH (1,1) with a skewed Student's t distribution to model the marginal distribution for each index return. Celık [20] suggested that a GARCH (1,1) model can sufficiently explain the volatility clustering in financial returns, although a few financial studies in the literature used higher-order models. The description of the GARCH (1,1) with a skewed Student's t distribution can be found in the Appendix A. Patton [24] suggested that an appropriate marginal distribution is required for modeling the copulas. If the marginal distribution is misspecified, the probability integral transformation may not be uniform (0, 1). Additionally, the standardized residuals may be faced with heteroscedasticity and autocorrelation problems. For these reasons, we performed the Kolmogorov-Smirnov (K-S) test to confirm the uniform distribution of the transformed series; and employed the ARCH-LM test and Ljung-Box test to examine heteroscedasticity and autocorrelation existence in our standardized residuals.
In this section, we present the main methodology employed in this study: the time-varying dependence process is outlined first, then we describe the estimation of the model.

Bivariate Dynamic Copulas
Our interest is to measure the dependence structure between the US stock return and international stock returns (developed and developing markets); therefore, bivariate copula specification is considered here. We used five copulas; two elliptical (Gaussian and Student's t) and three Archimedean (Gumbel, Clayton, and Frank). Each of these families describes a different dependence structure between two random variables. We considered the Clayton and Gumbel copulas for capturing the asymmetry and dependence in the extreme tails. Clayton exhibits a greater dependence in the lower tail than in the upper, whereas Gumbel exhibits a greater dependence in the upper than in the lower tail. For Gaussian, Student's t, and Frank copulas, they feature a symmetric dependence measure, which is commonly used in many financial works in the literature as the benchmark. The time-varying version of these copula models is briefly discussed in this section.
Ga 0 , Ga 1 , Ga 2 are the parameters to be estimated. In this study, we considered Google Trends as the additional indicator for predicting the contagion effect; thus, the ARMA (1,10) process of Patton [24] is modified to be ARMAX (1,10). Our empirical time-varying dependence equation becomes where κ Ga 1 and κ Ga 2 are the coefficient of Google index of US (GI US ) and Google index of other countries (GI O ), respectively.
The bivariate Student's t copula is defined by where t −1 v (·) is the inverse of the standard Student's t distribution function with v degrees of freedom. ρ T,t is the time-varying correlation within the interval (−1, 1). Like Gaussian copula, this copula has the symmetric dependence structure and presents non-zero tail dependence. The time-varying dependence process of the Student's t copula is, therefore, In addition, the evolution equation for degrees of freedom is given by where γ 0 , γ 1 , γ 2 are the parameters to be estimated. Λ(z) = 2 + ((e z /(1 + e z )) · 100) is the modified transformation for keeping v t within the interval (2, ∞).
The bivariate Clayton copula is defined by where θ Cl,t is the degree of dependence on the value (0 < θ Cl,t < ∞). If θ Cl → ∞ , the Clayton copula will converge to the monotonicity copula with positive dependence. However, if θ Cl = 0, u t and v t become independence. To allow for time-varying dependence, θ Cl,t varies according to: where Λ Cl (z) = z 2 is the modified transformation used to keep θ Cl,t within (0, ∞).
The bivariate Gumbel copula is defined by where the time-varying dependence θ Gu,t can take any value in (1, ∞). The time-varying dependence processes for the Gumbel is where Λ Gu (z) = 1 + z 2 is the modified transformation used to keep θ Gu,t within (1, ∞). Finally, the bivariate Frank copula is defined by where θ F is a time-varying dependence on the value (−∞ < θ F,t < ∞). This family is both comprehensive and symmetric. Therefore, it is not appropriate for modeling extreme events. The time-varying dependence of Frank copula is given by the following equation where Λ F (z) = 1 is the modified transformation used to keep θ F,t within (−∞, ∞). Copulas can also be used to characterize the dependence in the tails of the distribution. Two measures of tail dependence related to copulas are known as the upper and lower tail dependence coefficients. They are indeed very helpful for investigating the behavior of the extreme market, say boom and burst. The computation of tail dependence is referred to as Joe [31].

Estimation of Copulas: The Inference for Margins Method (IFM)
In the estimation of the dynamic copula, this study follows Joe and Xu [32] using the two-step Maximum Likelihood procedure known as inference function for marginal (IFM). Joe and Xu [32] showed that the IFM method has high efficiency of the easily implemented procedure compared to the one-step Maximum Likelihood method. According to Sklar's theorem [33] and Patton [24,25], we can derive the bivariate dynamic copula density by taking the partial derivative of joint density function (Equation (A7) in Appendix A) to obtain the joint density: where c t (·) is the conditional copula density (dynamic copula density). f t (·) is the univariate marginal distribution. Thus our full likelihood function for dynamic copula-based GARCH (1,1) can be written as where Θ C = 0 , 1 , 2 , κ 1 , κ 2 ) is the vector of the dynamic copula parameter. Θ G,i = u, ω, α, β, v,λ), i = 1, 2, is the vector of the GARCH-skewed-t parameter. Then, the joint conditional log-likelihood function to be maximized is expressed as According to IFM, we can estimate the parameters of GARCH-skewed-t and the parameters of the dynamic copula, separately. Therefore, the parameters for our model are estimated by the following process: Step 1: Estimate the parameters for the GARCH-skewed-t by maximum likelihood method Step 2: Estimate the parameters for the dynamic copula based on the estimated parameters obtained from step 1.

Data and Summary Statistics
To investigate the co-movement or contagion between the US stock market and international stock markets, we selected the weekly data spanning from 4 January 2004, to 30 December 2018. The beginning of this sample period is dictated by the availability of the Google Trends data and reflects our desire to have balanced data for all the stock markets for comparison purpose. Our data starts in 2004 due to the availability of the Google Trends data. Our objective, again, is to explore whether there is a contagion effect of the US stock market on both developing and developed stock markets. To achieve this, we divided our study period into three sub-periods referred to as pre-crisis  [34]. If data is not available due to holidays or other reasons, the stock index price shall be equal to the previous day's trading price.
This study used the S&P 500 stock index (SP) to represent the US stock market since it is one of the most important stock markets in the US. The exogenous variable that was specific to this study was the weekly Google Trends or Google index (GI) of the US, developed, and developing countries. Ten candidate keywords, "BANK", "CDO", "CDS", "CRISIS", "HEDGEFUND", "HOUSELOAN", "MORTGAGE", "SECURITIZATION", "STOCK", and "SUBPRIME" were considered to obtain the Google Trends data over the corresponding period for predicting the directions of the contagion effect. GI represents the likelihood of a random user from that area doing a Google search for that particular keyword during that week. Our data were freely collected from https://www.google.com/trends/?hl=en. We chose to use these keywords as the leading indicators of crisis-search activities for two main reasons. First, these keywords are the most popular among different crisis-search-related keywords, and some were suggested in many previous works (such as Aluko et al. [35]; Aragon et al. [36]; and Zorgati et al. [37]). Second, we believe that it is used most widely across the broadest range of investors.
Before we investigated our contagion prediction algorithm, we needed to process our stock indices data and the corresponding Google Trends data or GI in such a way that they were stationary and comparable. The first difference of the logarithm of stock indices was taken to extract the log returns of the stock indices. For GI, according to Bijl et al. [38], we transformed the GI to be abnormal GI (AGI), which is defined as where σ GI is the standard deviation of the GI for the past 52 weeks (1 year).
To find the appropriate keyword for explaining the contagion effect, we computed the R-squared and time-lagged correlation values between each lagged keyword and corresponding stock return. The advantage of these two measures is that it allows us to understand the strength and sign of the relationship between lagged keyword and stock return. In this simple test, we considered only the lag of Google keyword since we aimed to use this keyword as the predictor variable for predicting the US contagion. The results of the correlation coefficients and R-squared are presented in Table 1. For the overall sample period, R-square shows a weak relationship for all considered pairs, with maximum values of 0.0224 for "SUBPRIME"-DAX pair. According to these results, we can observe that "Crisis" at lag zero exhibits the highest relationship Mexico (MXX) and India (BSESN) stock markets, while "Crisis" at lag one exhibits the highest relationship for Canada (TSX); "STOCK" at lag zero and lag one show the highest relationship with US (SP) and UK (FTSE) stock markets, respectively; "HOUSELOAN" for Singapore; "MORTGAGE" for Brazil; "CDO" at lag one for China; "SUBPRIME" for Germany; "SECURITIZATION" for Japan and "BANK" for Thailand. Therefore, these selected lagged keywords were further used to predict the contagion effect of the US stock market on the developing and developed markets.
Turning to the statistical properties of the return series, Table 2 reports the summary statistics for the weekly stock market returns and Abnormal Google index (AGI) of the 10 countries during the three sub-periods. By examining the mean, standard deviations, skewness, and kurtosis values during the different sub-periods, several pieces of evidence emerge from this Table. For the stock market return, we observe that most of the developed stock returns are negative and standard deviations are higher during the crisis period compared to the pre-and post-crisis periods. We also observe that the mean returns of developing markets are all positive during the crisis. The reason may be because these developing markets are in newly industrialized countries which have abolished the capital inflow barrier and the foreign exchange restriction. Therefore, stock markets of these countries have been interested in US investors who expected the high return, and thereby leading to higher growth of these markets during the US crisis [39]. Comparing the standard deviations of the three sub-periods, we find that the standard deviations of stock returns are higher during the crisis period. Additionally, the kurtosis in all markets exceeds three, and the values of skewness deviate from zero, indicating a leptokurtic distribution. We, therefore, estimated a GARCH model assuming a skewed Student's t density for the innovation.      Meanwhile, the descriptive statistics of all AGI series show the highest mean value during the crisis period reflecting the significance of the high crisis-search-related keywords during that time. Finally, the Augmented Dickey Fuller test was conducted to examine the presence of the unit roots for all returns during all considered sub-periods. The results show that all series are stationary at the level.

Marginal Model
In the first step, we employed the univariate GARCH (1,1)-skew-t model to model the marginal distributions for three sub-periods considered in this study. The estimation results for the margins are summarized in Table 3. We find that the estimated ARCH coefficient (α) and GARCH coefficient (β) are mostly significant at the 5% level for all markets' returns, signifying the presence of clustering volatility phenomenon in all stock returns during pre-crisis, crisis, and post-crisis periods. Moreover, the conditional variance equations (α + β) are found to be less than one for all cases, indicating that our market returns series satisfies the stationary condition. We also observe that (α + β) is very close to 1. This implies the high volatility persistence of our series. Moreover, the negative sign of the skewness parameter (λ) and degrees of freedom parameter (v) are strongly significant, suggesting that the residual distribution cannot be normally distributed and that applying the Skew-t distribution is suitable for our GARCH (1,1) model.
After estimating the GARCH models, we obtained the standardized residuals from this estimation. To evaluate the goodness-of-fit of standardized residuals, the Ljung-Box test (Q10) and the Engle's ARCH-LM test were conducted to examine the autocorrelation and heteroscedasticity problems, respectively. Table 3 also provides the results of the Ljung-Box test and Engle's ARCH-LM test. We notice that the p-values of the Ljung-Box test do not reject the null hypothesis of no autocorrelation of standardized residuals of the GARCH models at Lag 10. From Engle's ARCH-LM test, the p-values are generally greater than 5% indicating the non-rejection of the null hypothesis of no ARCH effect at lag one. According to these two tests, our standardized residuals are confirmed to be reliable.
Before the second step of copula estimation, the marginal distribution must be transformed to be uniform (0, 1). Thus, the cumulative skewed Student's t function was used to transform our standardized residuals. We then applied the Kolmogorov-Smirnov (KS) test to test whether the marginal distribution is uniform in the interval (0, 1). The results in the last column of Table 3 show that the p-values are greater than 5%, indicating the innovations correctly specified uniform (0, 1). We subsequently conclude that the marginal distributions can adequately explain each market return. Hence, the copula model, in the second step, can correctly capture the dependence between the US stock market and international stock markets (developed and developing markets).

The Degree of Contagion: Static Copula
In this section, we aim to examine the existence of the contagion effect of the US stock market on international stock markets. According to Boyer, Kumagai, and Yuan [15], the stock market crises are spreading if the co-movement between two markets is higher during the crisis period. Thus, five static copulas, namely Gaussian, Student's t, Clayton, Gumbel, and Frank, were used to measure the co-movement between markets in the three sup-periods: pre-crisis, crisis, and post-crisis periods. This gave us a simple look at the presence of the contagion effect. The results from the static copulas are presented in Table 4. We separately estimated these copula parameters for three sub-periods in order to compare the degree of contagion across pairs of the US stock market (SP) and international stock markets.
Prior to interpreting the results, we had to find the optimal copula functions explaining the co-movement between different stock market pairs during the considered sub-periods separately. To find the best fit copula functions, we considered the Akaike information criterion (AIC) [40], and the lowest value indicated the best copula function. The best copula specification is indicated in bold. First, we focused on the pre-crisis period, the static Gaussian copula is the best choice for SP-SSEC, SP-FTSE, SP-MXX, and SP-SET pairs, Student's t copula for SP-BVSP pair, Clayton copula for the SP-Nikkei pair and Frank copula for SP-STI, SP-TSX, SP-BSESN, and SP-DAX pairs. However, in the crisis period, we observe that SP-STI, SP-MXX, and SP-SET pairs are well modeled by Gaussian copula. The best-fitting copula for SP-TSX and SP-DAX pairs is the Student's t copula, while the best-fitting copula for SP-SSEC, SP-BSESN, and SP-Nikkei pairs is the Clayton copula. For SP-BVSP and SP-FTSE pairs, we find that Gumbel and Frank copulas are, respectively, the optimal functions. Lastly, in the post-crisis period, AIC shows that the static Gaussian copula performs better than the other static copulas for SP-STI, SP-TSX, and SP-DAX pairs, Student's t copula for SP-FTSE, SP-MXX and SP-SET pairs, Clayton copula for SP-SSEC and SP-Nikkei pairs, and Gumbel copula for SP-BVSP and SP-BSESN pairs. It is important to note that the dependence structure is modeled by the copula function; hence the selection of the best copula should depend on the characteristics of dependence observed between market returns. According to the various copula functions given in Table 4, it is clear that each market pair, during the different periods, is captured by different copula functions. In order to get a better picture of the contagion effect during the considered sub-periods, we computed the different dependence measures expressed by Kendall's tau and tail dependence. Table 5 provides these measures based on the best estimated copulas in Table 4. For the contagion effect during the pre-crisis, Kendall's tau based on the best fit copula is negative in SP-FTSE, SP-STI, SP-TSX, SP-DAX, SP-SSEC, and SP-SET pairs and positive in SP-Nikkei, SP-BVSP, SP-MXX, and SP-BSESN pairs. The negative correlation between the US stock market and Singapore stock market is the highest with a value of −0.91, while the positive correlation between the US market and Mexico is the highest. Regarding the asymmetric tail dependence, we see that the lower tail dependence parameter estimates of the Clayton copula are low, with a value of 0.37 for SP-Nikkei. The symmetric tail dependence parameter estimates for the Student's t copula are also low, with a maximum value of 0.14 for the SP-BVSP pair. This indicates that there are extreme dependences in SP-Nikkei and SP-BVSP pairs, which imply that extreme movements of the US market caused extreme movements of Japanese and Brazilian stock markets. We then considered the crisis period, for all stock markets except Thailand, the correlation between the US stock and other stock returns is positive. This indicates that the US market return positively correlated with index returns in all stock markets during the crisis period (except Thailand). Pastpipatkul et al. [39] revealed that during the United States' subprime crisis that occurred in 2008, the Thai stock market had experienced greater swings in capital inflows and thereby boosting the stock market return. Thus, it is reasonable to have a negative correlation between the US and Thai stock markets. We also observe that the correlation values of these stock pairs are relatively higher compared to the pre-crisis period (except for India and China). The increase of the dependence measures during the crisis period is evidence of contagion from the US financial crisis to all stock markets (except for India and China) during this period. Interestingly, there are no signs of Indian and Chinese stock markets to be affected by the US stock market. China and India are the largest and the most liquid markets in Asia, and therefore are likely to be the most integrated with global capital markets. It would then be expected that these markets would not be susceptible to the contagion effect of the US market. Additionally, the correlation between SP-BSESN and that between SP-SSEC are weak, implying the independent movement between the US stock and these two markets. Lastly, we focus on the post-crisis period. For all stock pairs, the correlation between the US stock and other stock returns is positive, indicating that the contagion effect of the US market is positively transmitted to all index returns after the crisis period. In addition, as the static Student's t copula for SP-FTSE, SP-MXX, and SP-SET pairs, Clayton copula for SP-Nikkei and SP-SSEC pairs, and Gumbel copula for SP-BSESN perform better than the other models, this confirms the tail dependence for these market pairs which in turn implies that the extreme movement of the US stock return causes the extreme movements in the stock markets of England, Mexico, Thailand, Japan, and China. When we compare the estimated dependence measures between the post-crisis period and crisis period, we find a decrease in the correlation between the US market and other stock markets or the lower degree of dependence after the crisis period. This might be related to the decrease of volatility, especially from speculation. In other words, after the crisis period, investors seek to realize a long-term benefit by selling or purchasing specific assets. This fact allows for the decrease of stock price fluctuation, which leads to a decrease in volatility and, consequently, the decrease of correlation. Another explanation for the decrease in the dependence between international stock markets and the US market is that the international markets could not be affected by possible contagion effects [41]. In essence, the results from the static copulas and Kendall's tau test suggest that the contagion effect from the US stock market to all stock markets (except China, Canada, and India) is greater during the turmoil period than during the normal period. These results are in line with those of Mokni and Mansouri [41] and Mohti et al. [42], who reported that many stock markets became more integrated with the US stock market during the financial crisis period.

Dynamic Copula with Google Trends
We turn to the main purpose of this study in this section. The predictive power of Google Trends in forecasting the US contagion effect is presented through the dynamic copulas. We estimate time-varying dependence parameters using dynamic copulas for full samples. To show the performance of our dependence prediction with Google Trends models, we compared them with the dynamic copula without considering Google Trends data. The estimated dynamic copulas without Google Trends parameters are reported in Table 6. The parameters of the time-varying dependences of the chosen copula are also reported in Tables 6 and 7. The parameter 0 represents the dependence levels, 1 represents the degree of persistence, and 2 captures the adjustment in the dependence process. The additional parameters, κ 1 and κ 2 , are also provided for dynamic copula with the AGI model. Note that κ 1 and κ 2 are the coefficients of Google index of the US market and Google index of each country's stock market, respectively. To check if the dynamic dependence structure is appropriately modeled by two additional abnormal Google Trends or AGI, we employed the Likelihood ratio test, and the results are reported in Table 8.      Note: Numbers in bold present the best dynamic copula with the Google Trends result. The parentheses ( ) present the standard error. According to the result of the correlation measure in Table 1, all stock pairs are estimated using the AGI with lag zero, except for SP-FTSE, SP-SSEC, and SP-TSX. These three pairs are estimated using the AGI with the lag. Prior to checking the performance of dynamic copula with AGI models using the likelihood ratio test, we first considered the performance of the models without AGI displayed in Table 6 for model selection based on the AIC. The Gaussian copula was chosen for SP-STI, SP-DAX, SP-MXX, and SP-SET, reflecting the symmetry in co-movements of these stock pairs. The Student's t copula was selected for the pair SP-FTSE, indicating that the link between the two countries' markets is more prominent in the extreme market. The Clayton copula was selected for SP-Nikkei, SP-SSEC, and SP-BSESN, which shows that there is a left tail dependence between these pairs. Finally, the Frank copula was solely selected for the pair SP-BVSP, indicating a symmetric co-movement and tail independence. For the case of dynamic copula with the AGI model, the symmetry in co-movements is illustrated by the choice of the Gaussian copula for all stock pairs, except SP-TSX and SP-SSEC pairs. This indicates that the co-movement between the US market and each international stock market is symmetric when Google Trends data is given as the predictor in the model. Table 8 summarizes the results of best fit (optimal) copulas and the best copula model when including the Google Trends for each market pair.
To test whether the dynamic copula with AGI is superior to the copula without the AGI model, a likelihood ratio test is performed. The underlying marginal distributions are the same for both copulas, so it is possible to use a likelihood ratio test on the copula likelihoods. In this test, we also tested these two models based on the same copula family. We assumed the null hypothesis is dynamic copula without AGI and the alternative is dynamic copula with AGI. Considering that there may be some significant individual AGI that has a decisive effect on the contagion, thus dynamic copula with AGI is segmented, and the Likelihood-ratio test was divided as shown in Table 8.
We set parameters κ 1 and κ 2 to be zero in the time-varying dependence equation for the dynamic copulas without AGI. The model under the null hypothesis without AGI was thus nested in the model under the alternative hypothesis with AGI parameters. The result is provided in the last three columns of Table 8. These tests reveal that the null hypothesis is rejected for SP-FTSE, SP-TSX, SP-DAX, SP-Nikkei, SP-BVSP, SP-SSEC, and SP-BSESN pairs, inferring that Google Trends can help in predicting future co-movement between these seven pairs. Concerning the AGI parameter estimates κ 1 and κ 2 , we can observe that the increase in US AGI increases the co-movement for SP-BVSP, SP-TSX, SP-BSESN, and SP-Nikkei but decreases the co-movement for SP-FTSE, SP-SSEC, and SP-DAX pairs, suggesting that the contagion effect of the US on each of those four markets that moved in the same directions of the crisis-keywords searched by US people.
Furthermore concerning the parameter κ 2 , the findings reveal the positive influence of individual AGI on the co-movement for SP-SSEC, SP-BSESN, and SP-Nikkei pairs, indicating that crisis-keywords searched by Chinese, Indian, and Japanese internet users have a positive effect on the co-movement between the US stock and each of these three markets. In addition, we considered the LR-test in the last two columns in which the null hypothesis is dynamic copula without AGI, and the alternative is dynamic copula with only one AGI. Interestingly, we observe that US AGI has statistically significant effects on the contagion for SP-FTSE, SP-TSX, SP-BVSP, SP-SSEC, and SP-BSESN pairs, while there are significant effects of UK AGI, Canadian AGI, Germany AGI, Chinese AGI, Indian AGI, and Japanese AGI on contagion. All other assessed AGIs appear to have been relatively less exposed to the effects of the contagion. These results indicate that the contagion between the US and some international markets may be predicted by either crisis-keywords searched by US people or crisis-keywords searched by local people. The effect of AGI on the co-movement would be stronger if a single AGI had been introduced in the time-varying copula equation.
To get a better picture of the time-varying evolution, we illustrate the evolution of conditional Kendall's tau between the US stock market and 10 international stock market returns over the full sample period. These conditional Kendall's tau values were computed from the dynamic copula with the AGI model (presented by the red line) and the dynamic copula without the AGI model (presented by the blue dashed line) in Figure 1. Interesting results from the figures of the dynamic copula with AGI can be summarized as follows: (1) the evolution of conditional Kendall's tau values obtained from the two models takes different patterns. In general, we find that the conditional Kendall's tau values from dynamic copula with the AGI model are greater and fluctuate more than the conditional Kendall's tau values from dynamic copula without AGI model for all pairs. The influence of AGI varies among different market pairs, in particular, the more volatile market pair. The market pair, which shows high volatility of time-varying correlation, is well predicted by AGI. This result proves once again the usefulness of AGI in predicting US contagion. Besides, it is evident that the dynamic copula without AGI seems not to predict the contagion effect well as the conditional Kendall's tau values of SP-FTSE, SP-DAX, and SP-SET pairs (blue dashed line) are not sensitive to the US crisis. (2) There are some interesting pieces of evidence provided by the dynamic copula with the AGI model (red line). It is clearly shown that the dependence between the US and other markets increases markedly in 2008. We observe either a large positive or negative correlation across market pairs during the crisis in 2008. This result provides evidence of a contagion effect between international stock markets and the US stock market during the US financial crisis. In addition, the stock markets of England, Japan, Brazil, and Mexico show a high correlation with the US stock market. The correlations for these pairs increase from around 0.4 to 0.7 and then decrease sharply after 2008. This result indicates that the contagion effect from the US stock market to the stock markets of England, Japan, Brazil, and Mexico are not persistent. (3) The negative values of Kendall's tau are presented during the crisis period in two cases: SP-SSEC and SP-SET, suggesting that a decrease in the US stock market forces the US capital outflows to Chinese and Thai stock markets and thereby boosting these stock markets while the US stock market was still in a bearish regime. (4) After the US financial crisis, there is a decrease in dependence, perhaps because of capital regulations and market segmentation. Note that the blue dashed line is dynamic copulas without AGI, and the red line is dynamic copulas with AGI. The time-varying paths of conditional correlations for the paired returns were calculated by the parameters obtained from the best fit time-varying copula models presented in Table 8.

The Out-of-Sample Forecasting Performance
In this last section, the out-of-sample forecasts of conditional correlation are considered to examine the validity of our models. The forecasting performance of four dynamic copula models, namely dynamic copula without AGI (Model 1), dynamic copula with US AGI (Model 2), and dynamic copula with non-US AGI (AGI of international countries) (Model 3), dynamic copula with two AGIs (Model 4), were considered. Out-of-sample one-day-ahead forecasts of conditional correlation were generated based on these models, where parameters were estimated each week separately based on a rolling sample with a fixed size of 104 (approximately two-year period; the first  (2004)(2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015)(2016)(2017)(2018). Note that the blue dashed line is dynamic copulas without AGI, and the red line is dynamic copulas with AGI. The time-varying paths of conditional correlations for the paired returns were calculated by the parameters obtained from the best fit time-varying copula models presented in Table 8.

The Out-of-Sample Forecasting Performance
In this last section, the out-of-sample forecasts of conditional correlation are considered to examine the validity of our models. The forecasting performance of four dynamic copula models, namely dynamic copula without AGI (Model 1), dynamic copula with US AGI (Model 2), and dynamic copula with non-US AGI (AGI of international countries) (Model 3), dynamic copula with two AGIs (Model 4), were considered. Out-of-sample one-day-ahead forecasts of conditional correlation were generated based on these models, where parameters were estimated each week separately based on a rolling sample with a fixed size of 104 (approximately two-year period; the first in-sample period is from January 2006 to December 2007. The evaluation of forecasts was performed for 10 years from January 2008 to December 2018. This paper adopts the method proposed by Fiszeder and Fałdziński [43] to compare the performance of the competing models. The model confidence set (MCS) of Hansen et al. [44] was conducted to choose the best forecasting models with a certain probability. The mean squared error (MSE) and mean absolute deviation (MAD) were employed as the loss functions for the MCS test. The MSE and MAE can be computed by where τ t and τ t are the estimated conditional correlation and the actual conditional correlation (rolling window correlations), respectively. N is the number of out-of-sample.
In this comparison, a 52-week rolling window correlation (1 year) was used as a proxy for the actual correlation. It should be noted, however, that this rolling correlation does not necessarily reflect the real value of the actual correlation at a specific week as it can only be computed from intraweek data and that the rolling correlations are computed from data spanning several months. Nevertheless, the rolling correlations were utilized to observe the general trends and patterns of the actual correlation levels across time in the sense that a good correlation model should efficiently capture the dynamic movements of these proxy correlations. According to Hansen et al. [44], they introduced two test statistics, namely, the rang statistic and the semi-quadratic statistic, therefore, we also considered these two test statistics and used bootstrap simulation at 5000 times to compute the p-value. The MCS test results based on two loss functions, MSE and MAD, are shown in Table 9. We note that, when the p-value is higher, it means that they are more likely to reject the null hypothesis of equal predictive ability. In other words, the greater the p-value, the better the model. For more details of the MCS test, we referred to Hansen et al. [44].  According to the MCS test results in Table 9, mixed results are reported. All test statistics indicate that forecasts of correlation based on the dynamic copula with two AGIs (Model 4) is significantly more accurate than other competing models for SP-FTSE, SP-TSX, SP-DAX, and SP-BVSP stock market pairs. We also find that dynamic copula with US AGI (Model 2) provides better out-of-sample correlation forecasts than other models for the SP-BSESN pair. Considering the dynamic copula with non-US AGI (Model 3), we find that this model predicts SP-DAX and SP-Nikkei pairs well. However, for the remaining stock market pairs of SP-STI, SP-MXX, and SP-SET, we find that dynamic copula without AGI (Model 4) is the best one. According to MCS test results, it can be concluded that if the Google Trends data is considered as the predictor variable in the dynamic copula model, the better contagion prediction is obtained.

Conclusions
Our investigation of the contagion effect from the US stock market to 10 international stock markets (developing and developed markets) was developed using dynamic copula based GARCH models. We proposed a new approach for predicting the contagion effect by incorporating Google Trends data as the additional exogenous variables in the time-varying dependence equation. Subsequently, five copula families consisting of Gaussian, Student's t, Clayton, Gumbel, and Frank were considered, and AIC values selected the best fit for each of the pairs (one international market and the US market). We divided our study period into three sub-periods referred to as pre-crisis (4 January 2004, to 31 July 2007), crisis (1 August 2007, to 31 December 2012, and post-crisis (4 January 2008, to 30 December 2018). To examine the contagion effect, Kendall's tau was used for comparing the correlations between the crisis period and the non-crisis period. Additionally, we employed the likelihood ratio test to test whether the copula likelihood of the dynamic copula with the AGI model is significantly better than the copula likelihood of the copula without AGI.
In a nutshell, the results from the static copulas and Kendall's tau demonstrate the correlation between the US stock market and all stock markets (except China, Canada, and India) is higher during the crisis period than during the normal period. However, the results of the dynamic copula models provide evidence that the correlation between the US stock market and other stock markets increases markedly in 2008, corresponding to the US financial crisis. Either positive or negative correlation across market pairs is observed during this period, indicating that the contagion effect increased during the US financial crisis. Finally, we examined the predictive power of the Google Trends data in predicting the US contagion effect, and the likelihood ratio test, as well as MCS, show that seven out of 10 pairs reject the null hypothesis that the model with AGI and that without AGI perform equally well. This result indicates that Google Trends data can improve the prediction of time-varying copula dependence. We find that the contribution of Google Trends to contagion prediction varies across stock market pairs. If the correlation presents a high fluctuation, AGI seems to play a significant role in predicting this time-varying correlation. This result proves the usefulness of AGI in predicting contagion. Finally, our empirical results may be useful for policymakers and investors for predicting the contagion effect of one stock market to another stock market, as well as providing potentially significant implications for risk management.
As co-movement patterns of stock market pairs tend to change significantly during a financial crisis, our dynamic copula model may not be appropriate for capturing the structural change of the dependence. It has a possibility of regime-switching behavior in dependence structures. Future studies should also explore the contribution of the Google Trends data to the dependence using Markov-switching dynamic copulas to capture asymmetry in the form of high dependence and low dependence regimes. In addition, our model could be extended to search on the impact of Google Trends data on the risk contagion not only through correlation but also through all moments of the distribution. For this purpose, it can be implemented by the model of Del Brio et al. [45] and Del Brio et al. [46]. Lastly, it is interesting for further research to examine the contagion effect of oil prices and the exchange rate on stock markets. Funding: This financial support of this work is provided by Center of Excellence in Econometrics, Chiang Mai University.