CORRELATIONS BETWEEN OIL AND STOCK MARKETS: A WAVELET-BASED APPROACH

In a global economy shocks occurring in one market can spillover to other markets. This paper investigates the impact of oil shocks and stock markets crashes on correlations between stock and oil markets. We test changes in correlations with non-overlapping conﬁdence intervals based on estimated wavelets correlations that account for the correlations at diﬀerent scales. This allows us to distinguish contagion from co-movements. Our method, contrary to others existing in the literature does not need adjustment for heteroskedasticity biases on the correlation coeﬃcients. Our results show that oil shocks spread to stock markets aﬀecting the correlation between both markets. During the shock, correlations between oil and stock markets become negative, while in non-shock periods, correlations are around zero or slightly positive. The test conﬁrms that most of the correlations between oil and stock markets are statistically diﬀerent from those in the shock period. The evidence on the change of correlation between stock markets after an oil shock is weaker, the co-movements are stronger but the test does not reject the equality of correlations, except in some speciﬁc cases during the Kuwait war and the OPEC cutback period. Conversely, we only ﬁnd weak evidence that stock market crashes change the correlation between oil and stock markets. Overall, the evidence shows a decrease on correlations between stock and oil markets in oil shock periods, giving support to include oil as an asset class in asset allocation strategies.


I. Introduction
The keystone of portfolio allocation as well as risk management decisions is the correlation structure of security returns. Thus, modelling the dynamics of correlations remains an important task for both financial research as well as for applications in the financial industry. Financial literature showed the time varying nature of correlations (see e.g. De Santis and Gerard, 1997; Shawky et al., 1997;Solnik, 1995, 2001) and has analysed the impact of stock market crashes or currency crises on correlations between international stock markets. King and Wadhwani (1990) examines whether there has been a change in correlation coefficients between Japanese, the U.K., and the U.S. stock markets before and after the stock market crash of 1987. They find a significant increase in the coefficients after the crash. In a influential study, Forbes and Rigobon (2002) notice that heteroskedasticity biases contagion tests based on correlation coefficients. They show that looking at unadjusted correlation coefficients is not appropriate as the computed correlation coefficient is an increasing function of the variance of the underlying asset return, so that when coefficients between a tranquil period and a crisis period are compared, the coefficient in the crisis period is biased upwards as volatility rises substantially (see Forbes and Rigobon, 2002). Yet, Corsetti et al. (2005) argue that this finding is a result of an assumed underlying unrealistic model and Bartram and Wang (2005) report that these biases come from the assumptions of the analysis. Hence, when model-free correlation estimators are used, adjustments are not needed.
This work focus on the correlation structure between oil and stock markets. Energy is a strategic commodity used as an input in all economic activity, therefore turmoils in the oil market can affect stock returns as well as stock market linkages due to the worldwide energy dependence. 1 Moreover, if stock markets are bellwethers of the economy, dramatic changes in stock prices can betoken future macroeconomic changes that might affect oil demand. We investigate the question whether oil price shocks and stock market crashes have an impact on 1 More the link between economic recessions and oil prices we refer the reader to the seminal paper of Hamilton (1983). stock market and oil market correlations. Differently from works of Huang et al. (1996) ;Chen et al. (1986); Jones and Kaul (1996); Driesprong et al. (2008); Ramos and Veiga (2012), the focus of our work is not on the direct impact of oil shocks in stocks market returns, but on the impact on the correlation structure between those markets.
To analyze this issue, we follow the recent works that propose to use different frequency levels to distinguish between contagion and interdependence. Bodart and Candelon (2009) work in the framework of a Vector Autoregressive (VAR) model and propose a contagion test based on a causality measure applied at different frequencies. Orlov (2009) uses the finite Fourier transform without assuming any model for the data. Fourier analysis allow a decomposition of the covariance into different frequency levels. Contagion is estimated as the change of the high-frequency components of the covariance from the crisis period with respect to the tranquil one. Gallegati (2012) identifies contagion and interdependence during the U.S. subprime crisis of 2007 through wavelet decomposition of the original returns series. He advocates that the multiresolution decomposition property of the wavelet transform can be used to separately identify contagion and interdependence by associating each to its corresponding frequency component.
He proposes to use the information of the high frequency part to test for contagion, while the low frequency component could be used to analyse interdependence.
The plan of work is the following. We analyse the impact of sharp oil increases during the period 1990-2011 such as the ones of the Kuwait and Iraq wars, the OPEC cutback in 1999 and the peak of oil in July 2008 on four stock markets indexes: Germany, Japan, the U.K. and the U.S.. Next, we test for contagion between oil and stock markets, but also for contagion between stock markets given an oil price shock, i.e., if during a period of turbulence of oil markets, correlation between international stock markets changes significantly. Finally, we also analyse the impact of stock market crashes in the correlation structure of oil and stock markets.
In order to deal with all these issues, wavelets are going to be used as the main methodology.
The wavelet methodology is appropriate because it allows decomposing a time series into different frequency components that extract the short-term behavior and the low-frequency components that capture the more long-term dynamics of a variable.
Moreover, we extend the methodology of Gallegati (2012) based on wavelets to test for contagion between oil and stock markets and within stock markets given an oil shock. The test is a graphical one based on non-overlapping confidence intervals of estimated wavelet coefficients calculated in periods of shocks and non-shock periods. We present the results in a new visualization tool, where the confidence intervals of different periods are shown along the time line.
The plot easily represents the changes of correlation along time and allows to test the existence of contagion for a given shock by checking visually the overlap among two consecutive periods.
Our main findings are the following. In periods without shocks, correlation between oil and stock markets tend to be close to zero or slightly positive. An oil shock, like the ones caused by the Kuwait and Iraq wars, spillovers to stock markets, and changes the correlation between oil and stock markets, that becomes negative. The year of 2008 is characterized by a rise of oil prices that peaks in July 2008; but the aftermath of the crisis distinguishes from the other periods of rises, because correlation between oil and stock markets is positive. Like Huang (2011) we find that different wavelet details can capture different information, but the four day frequency captures the majority of changes of correlation between oil and stock markets, while the one day frequency just points significant changes in correlations, for some stock markets, around the Kuwait war and the 2008 oil peak. The evidence on the change of correlation between stock markets after an oil shock is weaker, the co-movements are stronger but the test does not reject the equality of correlations, except in some cases during the Kuwait war and the OPEC cutback period. The results also show that the impact of stock market crashes on changes of the correlation structure between oil and stock markets is weak.
To our knowledge this is the first paper studying the impact of oil shocks and stock market crashes on the correlation structure of stock markets and oil markets. Moreover, our paper contributes to the literature on financial contagion 2 and oil shocks, providing new evidence on the break of correlations between stock and oil markets due to oil shocks and on the impact between stock market linkages, making use of recent methodological developments that overcome heteroscedasticity biases.
The remainder of the paper is organized as follows. Section II explain the details of the methodology used to test changes in correlations. Section III describes the data, presents and analyses the results. Section IV concludes the paper.

II. Methodology
The methodology is based on wavelets, it allows the study of time series on a variety of scales (or frequencies), to obtain correlation estimates for different frequencies and consequently to test for contagion between financial markets. 3 Different definitions of contagion have been used in the literature. 4 We follow Boyer et al. (2006), King and Wadhwani (1990) and Forbes and Rigobon (2002), among others, that define contagion as a significant increase in cross-market linkages after a shock to one country (or a group of countries) and measured by cross-market correlations.

A. Wavelet series decomposition
Time series of financial returns can be decomposed into orthogonal components: the wavelet details (D 1 , D 2 , ..., D J ) and the wavelet smooth (S J ). Let r it be a time series i of financial returns at time t. r it can be approximated using the orthogonal wavelet series approximation that contains the wavelet smooth coefficients v r i J,k and the wavelet detail coefficients w r i j,k , such that: for j = 1, 2, .., J. Equation (1) represents the wavelet decomposition of r it . As an example, the wavelet decomposition of r it , for a level 4 of multiresolution, consists of 4 wavelet details (D 4 (t), D 3 (t), ..., D 1 (t)) and a single wavelet smooth (S 4 (t)). The wavelet smooth captures the low frequency dynamics and the wavelet details the high frequency characteristics of r it . The maximum number of scales in this case is 2 4 that must satisfy 2 4 ≤ T , where T is the number of observations in the sample.
In the literature, there are many mother wavelets that can be used to compute the wavelet transform and the corresponding coefficients. Following Gallegati (2012), we use the Daubechies extremal phase orthogonal wavelets with symmetric-padding boundary conditions (Daubechies, 1992) with length eight since filters with moderate lengths, such as eight, seem to be adequate to capture the main features of financial time series (see Gençay et al., 2001). We use a modification of the Discrete Wavelet Transform (DWT) known as maximal-overlap DWT (MODWT), a stationary wavelet transform, designed to avoid the lack of translation-invariance of DWT (Percival and Walden, 2000). The frequency of the data is daily and like Gallegati (2012) we consider that contagion corresponds to the wavelet details of level 1 (1 day), level 2 (2 days) and level 3 (4 days). Computations have been performed using the waveslim package developed by Whitcher for the R statistical package of R Core Team (2012) and the wavelet toolbox of MATLAB (2010).

B. Wavelet-based correlations
In this paper, we are interested in testing for significative changes in the wavelet correlations between international stock markets and oil market and also for changes between pairs of international stock markets. We do it separately for each scale j. Consider two periods, for instance the Kuwait War (I 1 ) and the period after the Kuwait War until the OPEC agreement (I 2 ). Let ρ j (X, Y ) I 1 and ρ j (X, Y ) I 2 be the wavelet correlations of two random variables (X, Y ) in these two periods I 1 and I 2 , respectively. The null hypothesis of the test rejected at a significance level of 5% if the two confidence intervals for ρ j (X, Y ) I 1 and ρ j (X, Y ) I 2 at confidence level of 95% are non-overlapping (see Gallegati, 2012;Gençay et al., 2001Gençay et al., , 2002. We use the intervals estimators proposed by Whitcher et al. (2000) because they are robust to is the p×100 percentage point for the standard normal distribution andρ j is the following unbiased estimation of the wavelet correlation at scale j : The wavelet covarianceγ j and the wavelet variancesσ j for interval I can be estimated aŝ whereĨ is the interval I after removing the times t that are affected by the boundary conditions, N is the length ofĨ, andw X j,k (respectively,w Y j,k ) are the detail coefficients of the MODWT decomposition of r X (resp. r Y ) at scale j.
In order to simplify the visualization of the different tests, for each pair of series of interest (i.e., for each stock market and oil returns, and for each pair of stock market returns) we plot the confidence interval of the wavelet correlation at each scale level j in a set of periods of interest.
Let I 1 , I 2 , . . . , I K denote the periods of interest, we propose to jointly visualize the confidence intervals of the wavelet correlation at certain scale j for all the K periods. In this way, testing if the correlation in period I r is significatively different from that in period I s would correspond to compare the intervals obtained in these periods. If the intervals do not overlap, then the correlations are significatively different at that scale j. Plotting the intervals over time becomes a useful tool for summarizing and interpreting the test results.

III. Empirical results
In this section we present the data set and we calculate the wavelet multiscale correlations between stock market returns of different countries, and between stock and oil returns. Then, we test for changes in the correlations at different frequencies. Several papers in the literature interpret statistically significant changes in the correlations as evidence of contagion (see, for instance, Baig and Goldfajn, 1999;Ellis and Lewis, 2000;Forbes and Rigobon, 2002;King and Wadhwani, 1990). Therefore, we first analyze the impact of oil shocks in the correlations between stock and oil markets; then, given an oil shock, we analyse the impact between stock market correlations. Finally, given a shock in the stock market, we investigate whether exist contagion between oil and stock markets.

A. Data
The data are stock market indexes of Germany, Japan, the United Kingdom, the United States and a world market index, a value-weighted portfolio of national stock markets, provided by  Table I reports the summary statistics of stock market indexes and oil returns. Stock markets indexes register positive mean returns during the period, except the Japanese. Volatility is lower for the world and the U.S. stock indexes. Excepting for Japan, the distributions of returns are negatively skewed for stock markets and oil. Therefore, the Jarque-Bera test rejects the assumption of Gaussian returns for all stock and oil returns.
In order to compute the correlations and test for contagion, we adjust the data for different time zones by matching the return series of U.S. at time t to the daily return series of Germany, the U.K. and Japan at time t + 1. We consider that most of the news come from the U.S., as it is the largest stock market and one of the world's largest oil producer. Figure 4 presents the results of testing changes in the correlations and consequently contagion between the oil market and international stock markets for three frequencies (1, 2 and 4 days).

B. Changes in correlations given oil shocks
A statistical change in correlation happens if, for two consecutive shock and non-shock periods, the estimated confidence intervals for the correlations between the series of wavelet details of oil returns and the series of wavelet details of stock market returns i, where i ∈ {Germany, Japan, U.K., U.S.}, do not overlap.
We start by the analysis of one day impact on the correlations (first column of Figure 4).
For this frequency, we observe three significant changes in correlations: First, at the Kuwait war period, between the U.S. and the oil markets; the second and the third at the oil peak in July 2008, between the Japanese and the oil market, and between the U.S. and the oil market. We observe that the surge in oil prices leads to negative correlations between stock and oil markets.
After these periods, the correlations become positive.
The panels of column two of the same figure depicts the estimated confidence intervals for the correlations at the frequency of two days. For this frequency, we observe three changes in the correlation between stock and oil markets. The first and second at the Kuwait war period, between the Japanese and the oil market, and the US and the oil market; the third, during the oil peak period, between the U.S. and the oil market. During the Kuwait war, the correlations between the series of wavelet details of the major stock and oil markets are quite negative meaning that increases in the prices of oil lead to decreases in the returns of international stock markets.
For the first two cases the estimated confidence intervals do not overlap with the confidence intervals of the period after the shock, where the correlations are almost zero, meaning that the change in correlations is statistically significant. Regarding the last case, correlation is strongly negative and after the shock, it becomes positive and statistically different from that of the previous period, and the estimated confidence intervals do not overlap.
Column three of Figure 4 depicts the estimated confidence intervals for correlations at the frequency of 4 days. For this frequency we observe several changes in the correlation between oil market and the stock markets that correspond to three oil shock periods: the Kuwait war, the Iraq war and the oil peak period. For the first period, the German, Japanese, the U.K. and the U.S. stock markets register very negative correlations that are statistically different from those of the following calm period, where the correlations are almost zero. In the second period, there is a change in the correlation between the German, the U.K. and the U.S. stock markets and the oil market. Once more the correlations during the Iraq war are very negative and statistically different from those of the following calm period. Finally, in the oil peak period all the correlations between stock markets and oil market are negative and statistically different from those of the calm period, where the correlations are positive. Overall, the results are quite consistent: oil shocks that cause an increase of oil price change the correlations between stock markets and oil returns, making them quite negative and statistically different from those of the non-shock periods. The oil shock related with OPEC cutback in 1999-2000 does not seem to lead to changes in correlations, which may be explained by the Kilian (2009) findings that shocks to the production have a lesser impact in the U.S. economy that shocks caused by precautionary demand.
Therefore, the evidence is consistent with soars in oil prices affecting negatively stock market returns and for the majority of the stocks markets, the frequency of four days notices the majority of correlation changes. On the other hand, the non-shock periods are in general characterized by positive but small correlations between stock markets and oil returns. The exception is the period after the peak of oil prices that coincided with the aftermath of the subprime financial crisis, where correlation increases. The next step is to investigate contagion between stock markets once an oil shock occurs. If all stock markets returns fall sharply then correlation is expected to increase, the question at stake is whether the change in correlation is statistically significant. We report results for the wavelet detail series of level 3, that is, at frequency of four days. It was for this frequency that we observed the majority of the changes in correlation in the previous analysis. 5 Looking at Figure  5, we observe only three changes in the correlation that correspond to two oil shock periods: the Kuwait war and the OPEC cutback periods. For the first shock, we find contagion between the U.K and the Japanese stock markets, and the U.S. and the Japanese stock markets. In these cases the correlations are positive and significant different from those of the calm period, that are also positive but of less magnitude. Finally, for the OPEC cutback period, we observe a change of correlation between the U.K. and German stock markets. However, the correlation although positive is smaller than that of the following calm period.
Summing up, we find a transmission of shocks occurring in the oil market to the international stock markets. If the event implies a raise in oil prices, we find a negative impact in correlations between stock and oil markets. This impact can be observable at one day frequency for some stock markets and the change in correlations is more frequent and intense at the frequency of four days. Finally, oil shocks can intensify co-movements between stock markets, in particular for the frequency of four days. As an example consider the Kuwait war. In this period the correlations among stock markets become, in general, more positive and statistically different from those of the following period without oil shocks.

C. Changes in correlations given financial shocks
It is well documented in the literature that correlations among financial time series of returns are much greater in periods of market turbulence, than in periods of non-turbulence (see, among others, Ang and Chen, 2002;De Santis and Gerard, 1997;Das and Uppal, 2004;Erb et al., 1994;Longin and Solnik, 2001). Considering the turbulence period caused by financial shocks, we inspect contagion between oil and stock markets given a crash in stock markets.
We considered daily stock market return drops larger than 5%, that allows to capture impor-  is an increase in correlation between the U.K. and oil that are highly positive and statistically different from those of the following calm period that are around zero.

IV. Conclusions
In a global economy shocks occurring in one market can affect other markets, changing the structural linkages between assets. This paper tests for contagion at different frequencies between oil market and stock markets. The paper uses the methodology of Gallegati (2012) based on wavelets and proposes to jointly visualize the confidence intervals of the estimated wavelet correlations calculated in periods of turbulence and periods of non-turbulence at certain scale for all the periods. The wavelet methodology is appropriate because it allows decomposing a time series into different frequency components that extract the short-term behavior and the low-frequency components that captures more the medium-term dynamics of a variable. Gallegati (2012) argues that the multi-resolution decomposition property of the wavelet transform can be used to separately identify contagion and interdependence by associating each to its corresponding frequency component.
We test for contagion between oil and four large stock markets, Germany, Japan, the U.K. and the U.S.. We focus on changes of correlations due to sharp oil increases like Kuwait and Iraq wars, the OPEC cutback in 1999-2000 and the peak of oil in July 2008. The results confirm that oil shocks affect correlations with stock markets. During the shocks, correlations tend to be negative because oil prices increases and stock markets go down, anticipating economic downturns. In non-shock periods, there is an increase in correlations between oil and stock markets that fluctuate around zero. The period after the oil price spike of 2008 distinguishes because correlation between oil and stock markets increases for high positive values. The change of correlation between stock markets related to oil shocks is not so perversive. The Kuwait war changes correlations between the U.K. and the Japanese stock markets, and the U.S. and German ones. The OPEC cutback changed correlations between the U.S. and the U.K. stock markets, and the U.K. and Germany ones. Analyzing the effect of stock markets crashes, we find weaker evidence that they affect the correlation between oil and stock markets.
Our work provides new evidence to the literature on oil shocks, showing that the impact of oil shocks is likely to lead negative correlation between stock markets and oil. However, in line with Kilian (2009), not all shocks are alike, oil price increases caused by "oil supply shocks" like the one OPEC cutback do not seem to change correlation.
The analysis carried out has a number of implications of interest to policy makers and but also to the construction of optimal portfolio diversification strategies. The results give support to include oil as an asset class in portfolios due to low correlations with stock market indexes and in case of oil shocks it can offer downside protection, due to the negative correlation. Moreover, stock market crashes do not seem to affect the correlation structure between oil and stock markets.     . Intervals for correlations among stock markets and oil in shock and non-shock periods. Detail levels 1, 2 and 3.