Stock market returns and oil price shocks: A CoVaR analysis based on dynamic vine copula models

Crude oil plays a significant role in economic developments in the world. Understanding the relationship between oil price changes and stock market returns helps to improve portfolio strategies and risk positions. Kilian (Am Econ Rev 99(3): 1053–1069, 2009) proposes to decompose the oil price into three types of oil price shocks by using a structural vector autoregression model. This paper investigates the dynamic, nonlinear dependence and risk spillover effects between BRICS stock returns and the different types of oil price shocks using an appropriate multivariate and dynamic copula model. Risk is measured using the conditional value at risk, conditioning on one or more simultaneous oil and stock market shocks. For this purpose, a D-vine-based quantile regression model and the GAS copula model are combined. Our results show, inter alia, that the early stages of the Covid-19 crisis lead to increasing risk levels in the BRICS stock markets except for the Chinese one, which has recovered quickly and therefore shows no changes in the risk level.

will grow even more. This economic growth was accompanied by an increase of oil consumption. Therefore, it is important for global investors to investigate the relationship and risk spillover effects between the crude oil market and BRICS stock markets. This is particularly relevant in the light of increased financialization of the oil market, which is subject to speculation of financial investors; see Kilian and Murphy (2014); Kilian and Lee (2014). Consequently, there is danger of risk spillovers that investors and policy makers must be aware of.
Earlier studies focus on interactions between oil price shocks and the macroeconomy; see, e.g., Hamilton (1983), Bernanke (1983), Gilbert and Mork (1986), Hamilton (1988), Barsky and Kilian (2004), or Jones et al. (2004). Later, a considerable amount of literature considers the stock markets as the stock market usually is a good indicator for the economy in a country. For example, (Huang et al. (1996)) find no evidence for correlation between oil future returns and US stock returns. Sadorsky (1999), Jones and Kaul (1996) and Miller and Ratti (2009) suggest that oil prices have a negative influence on stock market returns. However, Sadorsky's (2001) multifactor market model shows a positive relationship between oil price changes and stock price returns in the Canadian oil and gas industry. According to Basher and Sadorsky (2006) and Wang et al. (2013), there is a positive relationship for oil-exporting countries and a negative one for oil-importing countries.
However, these studies do not consider Kilian's (2009) conclusion that not all oil price shocks are alike. He proposes an approach that decomposes the real price of oil into three components, i.e., three kinds of oil price shocks. Shocks to the current physical availability of crude oil, the supply-side shocks, occur for instance in the event of natural disasters. The aggregate demand shocks are shocks in the current demand for crude oil driven by fluctuations in the global business cycle, such as the global financial crisis. The precautionary demand shocks result from shifts in the precautionary demand for oil. Consequently, many subsequent studies follow the approach of Kilian (2009) and decompose the oil price shocks into the three different components by using a structural VAR (SVAR) model. Kilian and Park (2009) observe that oil price shocks caused by a global economic expansion have a positive effect on stock prices, whereas oil-demand shocks have a negative impact. Oil supply shocks seem to have a less significant influence on stock prices. Filis et al. (2011) investigate the time-varying correlation between stock market prices and oil prices using a DCC-GARCH-GJR approach in various oil-importing and oil-exporting countries. Their results show that there is a positive dependence between stock returns and oil demandtype shocks. Mokni (2020) recognizes by using a time-varying parameter regression model that stock returns react to the demand shocks more than to the supply shocks. Additionally, the effect of supply shocks is in general limited and negative, whereas aggregate demand shocks have a positive impact on stock returns. Basher et al. (2012) analyze the relationship between oil prices, exchange rates, and stock markets and find that positive oil supply shocks do not have a severe effect on the stock market prices. An unanticipated demand increase has a small positive impact on stock market prices. Moreover, many studies also show that the relationship between oil price shocks and stock market returns depends on the type of the economy, the political situation, and the importance of oil for the country. Due to the oil intensity in emerging countries, the economic impact of oil price shocks on emerging countries is generally higher than in industrialized countries (Li et al. 2020;Bouoiyour and Selmi 2016;Maghyereh 2006).
Many studies focus on linear relationship or even make the distributional assumption of normality. Moreover, they ignore the time variation of the relationship. In order to also capture nonlinear and asymmetric relationships, some studies employ the copula approach to explore the dependence between stock prices and oil price shocks. Aloui et al. (2013), Sukcharoen et al. (2014), and Li et al. (2020) use time-varying copula models to study the time-dependent relationship between oil prices and stock markets in various countries worldwide. However, these studies do not make a distinction between the different types of oil price shocks. A paper which combines the time-varying copula analysis and the SVAR-based decomposition of oil prices is the paper of Ji et al. (2018). This paper analyzes the dynamic dependence of BRICS countries' stock returns and the three oil price shocks using the dynamic copula model by Patton (2006). Furthermore, a copula-based CoVaR approach is employed to study the risk spillover effects of oil price shocks on stock returns of the BRICS countries from the perspective of extreme market risks. The authors conclude that the dependence is generally time-varying and positive. The oil-specific demand shocks are the most important factor, and oil price shocks from the supply side do not significantly influence the stock market returns. The only exception is China, where the stock market is more sensitive to oil price increases resulting from oil supply shocks.
We consider a similar problem as Ji et al. (2018), studying the dependence properties between stock market returns in BRICS countries and the different types of oil prices shocks. However, we make the following contributions. First, we improve the bivariate modeling of time-varying copula dependence parameter by applying the generalized autoregressive score model (GAS), proposed by Creal et al. (2008). As shown in Manner and Reznikova (2012), the dynamic copula model by Patton (2006) is inferior to other specifications for time-varying copulas, so application of the GAS model is strictly preferable. Second, in order to be able to analyze also multivariate dependence structures, we extend the model by using a dynamic D-vine copula model, which combines the GAS model and the D-vine copula model, as proposed in Almeida et al. (2016). Third, we measure the spillover effects of multiple risk factors jointly using a copula-based CoVaR approach. As the computation of the copula-based CoVaR conditional on multiple variables exceeding certain risk levels is a non-standard problem, we propose using the D-vine-based quantile regression by Kraus and Czado (2017) to compute the required conditional quantile function. For this, we extend this approach for time-varying copulas. For a static vine copula a similar approach to computing the CoVaR has been proposed by Jiang et al. (2021). Finally, our data set spans the time period February 1996 to April 2020. With this data set, we can also derive some conclusions to early effects from Covid-19 crisis on the relationship between stock markets and the oil market.
This paper is organized as follows. Section 2 describes the econometric methodology. Section 3 presents the empirical analysis including the description and some further methodological issues. Finally, Sect. 4 concludes the paper.

Methodology
We need an adequate model for the joint distribution of a vector time-series and follow the ideas of Almeida et al. (2016) combining the D-vine copula model with a generalized autoregressive score (GAS) model to allow for time-varying dependence parameters. This approach leads to the favorable situation that the joint distribution is separated into several bivariate time-varying copulas and its marginals. Then, we can apply a sequential maximum likelihood estimator (MLE) to estimate the required parameters.
We aim to model the joint distribution of a d-dimensional time series r t = (r 1,t , . . . , r d,t ) for t = 1, . . . , T , where each r i,t follows a ARMA (m, n)-GARCH ( p, q) model, i.e., and F i is the distribution function of the innovations with zero mean and unit variance. For the error distribution, we consider the normal and the skewed t-distribution by Hansen (1994). The best fitting ARMA-GARCH model is selected based on the BIC.
The joint distribution F of the standardized innovations z i,t can now be decomposed according to Sklar's Theorem into its marginals F 1 , . . . F d and its copula C: The joint density is given by where c is the corresponding copula density. Estimation of the copula requires transforming the standardized innovations into uniformly distributed variables. For this purpose, we use the probability integral transformation and define the copula data as u i,t = F i (z i,t ,δ i ), whereδ i denotes the estimated parameter vector for margin i and we define u t = (u 1,t , . . . , u d,t ). We assume that the parametric copula density c is time-varying, i.e., u t ∼ c(u t |θ t , F t−1 ; γ ), where F t−1 is the information set available at time t − 1, θ t is the time-varying copula parameter, and γ is the vector of time-independent parameters. In Sect. 2.1, we introduce the GAS model, which allows modeling time-varying dependence in bivariate copula models. Section 2.2 introduces D-vine copulas, and in Sect. 2.3 we combine the time-varying GAS copulas and the D-vine model to obtain a flexible model allowing for high-dimensional and time-varying dependence. Section 2.4 reviews the value at risk and conditional value at risk, and Sect. 2.5 shows how D-vine-based quantile regressions can be used to compute the conditional value at risk in high-dimensional settings.

Generalized autoregressive score copula model
The generalized autoregressive score (GAS) model was introduced in Creal et al. (2013). Consider a bivariate time series process (u i,t , u j,t ) for t = 1, . . . , T and fixed 1 ≤ i = j ≤ d. Assume that its distribution is given by copula c, i.e., with θ i j t ∈ the time-varying parameter of the copula c. Without loss of generality, we assume that θ i j t is a scalar for all i, j and t. To handle different copula families in a unified fashion, we parameterize the copulas with Kendall's τ ∈ (−1, 1), as for many bivariate copulas there is a one-to-one relationship between the copula parameter and Kendall's τ , i.e., there is a function r such that θ Equivalently, we can express λ The scaling factor S i j,t is defined as the square root of the inverse of the Fisher information. 1

D-vine models
The vine copula model enables us to construct multivariate copulas with a wide class of bivariate copula families as building blocks. The decomposition of the joint density into conditional pair copulas is not unique, and the number of possible constructions for a d−dimensional copula density is very large and equal to d 2 · (d − 2)! · 2 ( d 2 ) (see Morales-Napoles et al. 2010). Therefore, Bedford and Cooke (2002) introduced a graphical model called regular vine (R-vine). The R-vine is a sequence of nested trees, which allows to organize and illustrate the needed pairs of variables and their corresponding sets of conditioning variables. D-vine copulas are a special case featuring a specific structure. The following statements are the basis for the vine copula theory. Let (X 1 , . . . , X d ) be a random vector with joint distribution F and density f , respectively. The density f can be decomposed recursively by Using Sklar's Theorem, we can rewrite the conditional density f (·|·) , e.g., for dimen- where c 12 denotes the density of a bivariate copula. Similarly, for dimension d = 3, we get For simplicity, we introduce for distinct indices i, j, i 1 , . . . , i k with i < j and i 1 < · · · < i k the abbreviation where D := {i 1 , . . . , i k } and x D := (x i 1 , . . . , x i k ). With this notation, we can formulate the decomposition of conditional distribution of (X 1 , X k ) given X 2 = x 2 , . . . , where r : s := (r , r + 1, . . . , s) for integers r and s with r < s. Substituting (2.5) into (2.3) and replacing s = i, k = i + j leads to where we drop the arguments of the copulas for simplicity. We see that the joint density can be separated into its marginal densities and several conditional pair copulas. In particular, if the marginal distributions of X k are uniform for all k = 1, . . . , d, then the density in (2.6) is called a D-vine copula density and the corresponding distribution function is a D-vine copula distribution function. In general, c i,i+ j|(i+1):(i+ j−1) (·, ·) depends on the conditioning variables x (i+1):(i+ j−1) , so we make the common simplifying assumption that this dependence does not hold in our case. In our case, c i,i+ j|(i+1):(i+ j−1) (·, ·) only depends on the values of F(X i |x (i+1):(i+ j−1) ) and F(X i+ j |x (i+1):(i+ j−1) ).
In order to compute the conditional distribution functions given in (2.4) for a Dvine copula, we use the following formula from Czado (2019) is the h-function associated with the pair copula C i j . The nodes in the D-vine tree represent the particular pairs of observations or pseudo observations obtained from previous trees and the edges represents the respective pair copula density with respective copula parameters. The pseudo-observations in the higher trees depend on the pair copulas in the lower trees. Based on the pseudo data u j|D −i and u i|D −i from the previous tree, the pseudo-observations for the next tree can be computed as Hence, the pseudo-data can be calculated recursively by starting with the copula data from the first tree and then using the bivariate copulas and pseudo-data from lower trees.
As an example, consider a D-vine copula density of dimension d = 5. The joint copula density c can be written as The bivariate unconditional and conditional copula densities of the above factorization can be easily reconstructed from the corresponding D-vine tree shown in Fig. 1. For more details on vine trees and vine copulas, we refer to Czado (2019).

D-vine-based multivariate dynamic copula models and estimation
Now, we introduce dynamics into the D-vine copula model by using the bivariate dynamic GAS copula as the pair copulas in a D-vine copula model. First, we assume that all conditional and unconditional pair copulas in (2.6) are bivariate parametric copulas. Further, we are given a time-varying copula parameter θ l(i, j) t for the bivariate copula density c l(i, j) (·, ·; θ Our dynamic parametric D-vine copula density is then given by (2.8) where the parameter vector θ t consists of the parameters of all pair copulas and we omit the parameters of the conditional marginal distributions.
The estimation of the model is done via inference function for margin (IFM) method by Joe and Xu (1996) as the logarithm of the joint density in (2.2) is a sum of marginal and copula log-likelihood functions. The idea of IFM is to maximize the log-likelihood separately. First, the marginal parameters are estimated separately and standardized residuals are formed. Then, we transform the standardized residuals with the parametric probability integral transformation in order to obtain copula data for the next step. According to (2.8), the copula density of a D-vine copula is a product of bivariate conditional copulas. Therefore, we can also estimate the copula parameters for each pair copula sequentially. We start in the first tree and utilize the estimation results from tree 1 to form pseudo copula data for the estimation of copula parameters in the second tree. We proceed with this approach until we have estimated all necessary pair copulas. According to Nagler et al. (2020), this multi-step estimator is consistent and asymptotically normal.
It is important to note that the order of variables in the first tree influences the estimation results and must be chosen with care. A common strategy is to choose the order of variables in the first tree such that neighboring variables have the highest Kendall's Tau values among all possible orderings. We follow this procedure to determine the D-vine in our applications.
Density forecasts can be easily be computed from the suggested model, as the model is fully parametric and the time-varying parameters follow observation driven models. Hence, risk measures can be predicted in a straightforward fashion and the model can be used for portfolio optimization. We do not perform a prediction exercise in this paper due to the limited number of potential out-of-sample observations for a credible evaluation of these multivariate density forecasts 2 . However, the predictive performance of this model for weekly and daily stock (market) returns is studied in Almeida et al. (2016).

Value at risk and conditional value at risk
The value at risk (VaR) is a common tool in financial risk management. It measures how much maximum loss an investor will suffer in a given time period and with a given probability. We distinguish between the upside and the downside risk. Given the log return r t of the underlying asset at time t and the confidence level α, the VaR of a long financial position considers the lower tail of the return's distribution and is defined as P(r t ≤ −V a R long α,t ) = α. The VaR of a short financial position considers the upper tail of the return's distribution and is defined as If the distribution F t of r t is continuous and strictly increasing, we can compute the VaR with help of the respective quantile function F −1 t , i.e., As the VaR only measures a single asset's risk 3 , but we want to compute the systemic risk exposure of multiple assets and the risk spillover effects, we consider the conditional value at risk (CoVaR) as proposed by Adrian and Brunnermeier (2016). They define the CoVaR as the VaR of a financial system conditional on a given event.
Consider an institution i and some event C(X j ) with j = i. Then, the CoV a R α is defined as the α-quantile of the conditional probability of the financial system's return r i : Here we define the event C(X j ) as the situation when a market or various markets are in an extremal downside or upside risk situation with tail probability β. That means that these returns are equal to their respective downside or upside VaR. In the case of two observed markets, we define the downside CoVaR with tail probability α of market 1 at time t conditional on market 2 being in downside risk with tail probability β as follows: Similarly, the corresponding upside CoVaR with tail probability α can be defined as The CoVaR can be computed by solving this equation numerically. However, using the results from Hakwa et al. (2015), we can compute the CoVaR directly in our time-varying copula setting using the quantile function and the inverse h-functions: with θ 1,2 t the corresponding time-varying copula parameter of the copula C 12 associated to the returns r 1,t and r 2,t .

D-vine-based quantile regression
Equation (2.10) above allows us only to compute a bivariate copula-based CoVaR. In the empirical analysis we also want to stress more variables simultaneously, i.e., we want to consider more general events C(X j ) that involve extreme events of various variables. To extend the copula-based CoVaR approach to such a multivariate setting, we make use of the D-vine-based quantile regression proposed by Kraus and Czado (2017). The quantile regression means prediction of conditional quantiles. This is exactly how the CoVaR is defined.
Let us assume that we want to predict the quantile of the return Y of asset 1 (response variable) given the returns ( We can express the joint conditional distribution function of Y as follows: (2.11) Hence, we can express the conditional quantile function in terms of the inverse marginal distribution function F −1 Y of the response Y and the conditional copula quan- To get an estimate of the conditional quantile function, we have to first obtain the estimates of the marginalsF Y andF j , j = 1, . . . , d, then the estimates of the copulaĈ V |U 1 ,...,U d and finally use the expression: (2.12) The difficulty lies now in the estimation of the multivariate copula C V |U 1 ,...,U d . The solution is to fit a D-vine copula to (V , U 1 , . . . , U d ) such that V, as the response variable, is the first node in the first tree. The predictor variables are ordered such that the neighboring variables have the highest Kendall's Tau values among all possible orderings. Finally, we can express the conditional copula function in terms of nested h-functions by using Eq. (2.7) as shown by Kraus and Czado (2017). We can extend the above equations for time-varying copulas. We illustrate this in a 4-dimensional example by letting the copula parameter be time-varying. The example is inspired by the example in Kraus and Czado (2017).
Example 1 Assume we want to compute the conditional distribution of the variable V 1 conditioned on the variables V 2 , V 3 , V 4 . Moreover, assume that the optimal D-vine order is: Then, using Eq. (2.7), we can express the conditional distribution of V 1 given (V 2 , V 3 , V 4 ) as follows: ) the time-varying dependence parameter for each pair copula of the D-vine copula density.
By inverting the above expression, we get the conditional quantile function: Using Eq. (2.12), we get a closed expression for the conditional quantile function for dimension n = 4: For the implementation of the time-varying D-vine-based quantile regression, we adopt code from the R package vinereg.

Empirical analysis
Our aim is to investigate possible risk spillover effects between BRICS stock returns and different types of oil price shocks. In Sect. 3.1, we apply the structural VAR to decompose the oil price into three types of oil price shocks. Sect. 3.2 presents the data and preliminary analysis. In Sect. 3.3, we utilize a time-varying copula approach to model the bivariate dependence between BRICS stock returns and oil price shocks. In Sect. 3.4 we conduct a multivariate risk spillover analysis by using dynamic D-vine models.

Decomposing oil prices
Kilian (2009) assumes that the real price of oil can be decomposed into three oil price shocks, the oil supply shocks, the aggregate demand shocks, and the precautionary demand shocks. In order to extract these effects from the monthly crude oil price, he utilizes a structural vector autoregressive (SVAR) model with lag order 24. The SVAR representation is given by with s t − the percent change (log difference) in global crude oil production, g t − an index of real economic activity, and p t = 100 ln np t C P I t /100 − the real oil price expressed logarithmically. Here, np t refers to the nominal oil prices and C P I t to the U.S. consumer price index.
We follow the identification strategy in Kilian (2009) assuming a lower triangular form of A and the variable ordering given above. He argues that supply cannot be expected to respond to demand shocks in the same month as oil-producers need some time to react to changes in demand. Furthermore, it appears reasonable that aggregate demand does not respond immediately to oil market-specific shocks. Estimation is based on the reduced form representation. The structural shocks t are obtained through the Cholesky decomposition of the covariance matrix of the reduced-form residuals.
The (structural) oil price shocks are defined as follows: • SS t (crude oil supply shocks )-unpredictable innovations in global oil production, • DS t (aggregate demand shocks)-unpredictable innovations in global real economic activity that cannot be explained based on crude oil supply shocks, • O S t (oil-specific demand shocks)-unpredictable innovations in real oil price that cannot be explained based on oil supply shocks and aggregate demand shocks.
The oil price decomposition is computed as the cumulative effect of oil supply shock p SS t , of aggregate demand shock p DS t , and of oil-specific demand shock p O S as follows: where p t = c+ p SS t + p DS t + p OS t with a constant c, and p SS t , p DS t , p OS t the components of real oil prices, i.e., oil supply shocks, aggregate demand shocks, and oil-specific demand shocks.
Our analysis is based on the first differences of the oil price components p SS t , p DS t , and p OS t , which we consider as oil price shocks.

Data and preliminary analysis
In order to extract the three oil price shocks, we took monthly data from February 1994 to April 2020, i.e., 327 observations, of the following three variables : (1) World oil production as a proxy of world oil supply s t from the U.S. Energy Information Administration (EIA), (2) the Kilian index as the global economic activity index g t which we collected from the personal website of Lutz Kilian 4 , and (3) United States crude oil imported acquisition cost by refiners (collected from the EIA) deflated with the U.S. Consumer Price Index (collected from U.S. Bureau of Labor Statistics) as the real price of oil p t . The Kilian index is constructed from an equally weighted index of the percentage growth rates, obtained from a panel of single voyage bulk dry cargo ocean shipping freight rates measured in dollars per metric ton. The construction of the index controls for fixed effects associated with shipping routes, ship sizes, and types of cargo. We refer to Kilian (2009) for more details.
Using these variables, the SVAR(24) is estimated as described in Sect. 3.1. Figure  2 presents the evolution of the three components of real oil price, p SS t , p DS t , p O S t , defined in (3.2). We observe that oil prices are driven by different factors in different time periods. The supply shocks have a comparably small effect on the oil price and are relatively constant. The most volatile effect on the oil price is due to the oil-specific demand shocks. The drop and the subsequent increase of oil price during the Asian financial crisis in 1998/99 are contributed solely to the oil-specific demand shocks. The strong decrease of oil price due to the global financial crisis in 2008 has resulted especially from oil-specific demand shocks, but also from aggregate demand shocks. The same is valid for the Covid-19 crisis in 2020. Thereby, we can confirm the claim of Kilian and Park (2009) and Mokni (2020) that the oil price is mainly influenced by the demand side and there is little influence by the supply side. For the further analysis we use the oil price shocks defined as p SS t , p DS t , and p OS t . Moreover, as we want to analyze the dependence between different oil price shocks and BRICS stock returns, we collected monthly BRICS stock returns from investing.com, yahoo finance and the official website of BSE India. We summarize the used   Table 1. The choice of the price index for a particular country was mainly driven by the availability of the data and the importance of the index. Figure 3 depicts the evolution of the log returns of the BRICS countries' stock market indices for the period of February 1996 till April 2020. We notice a quite similar development of the stock returns. Russia and Brazil exhibit the most volatile log returns, whereas South Africa has the lowest volatility. Overall, we observe three periods with exceptionally large losses. The first is the Asian crisis in 1998, the second the global financial crisis in 2008, and the last the Covid-19 crisis in 2020. Table 2 presents the summary statistics of the log returns in each of the BRICS countries and the three oil price shocks. The table shows that the monthly means of all stock returns of the BRICS are positive and Brazil has the highest monthly mean return or 0.961% and China the lowest monthly mean return or 0.567%. Russia's log returns have the largest and South Africa's the lowest standard deviation. The skewness is negative for all countries, implying that the log returns are skewed to the left. Furthermore, the kurtoses are all positive, indicating a heavy tailed distribution of the log returns. The significant results of the Jarque-Bera statistics show evidence that BRICS returns exhibit a non-normal distribution. The Ljung-Box test with lag order six indicates that there exists autocorrelation for the Russian and Chinese return series. The Ljung-Box of squared residuals and the Lagrange multiplier test statistics with lag order six indicate that all BRICS log returns exhibit heteroskedasticity and ARCH effects.
The summary statistics of the oil price shocks reveal that the oil supply shocks have positive mean, while the other two oil shocks have negative mean. The oil-specific demand shocks have the largest standard deviation of 8.292 among all oil shock types. Besides, the test statistics show that all shocks are serially correlated. The Jarque-Bera statistic indicates a normal distribution for the supply shocks. Additionally, the aggregate demand shocks and the oil-specific demand shocks exhibit conditional heteroskedasticity.
In view of the descriptive statistics, it is reasonable to apply ARMA(m, n)-GARCH( p, q) models for the marginal distributions of the returns r i,t of country i at time point t, as defined in (2.1). For the conditional mean, we choose simple ARMA models with lag length minimizing the Bayesian information criterion (BIC). The conditional variance of the residuals is modeled using a GARCH(1, 1) model with either normal or skewed t distribution, again depending on the minimum BIC.
According to the BIC, we apply an ARMA(1, 0)-GARCH(1, 1) model with a normal distribution as conditional distribution of the standardized residuals for the two oil demand shocks and an ARMA(1, 1)-GARCH(1, 1) model with a normal distribution for the oil supply shock. For Brazil, Russia, and India, we employ an ARMA(0, 0)-GARCH(1, 1) model with skewed t innovations and for China and South Africa, we employ an ARMA(0, 0)-GARCH(1, 1) model with normal distribution. The estimated parameters (and their standard errors) of the marginal distributions are given in Table  3. Most coefficients are significant at the 5%-level. Moreover, we ensure with a Ljung-Box test that the residuals and squared residuals show no autocorrelation. The model fit is evaluated in two ways. First, we check the model assumptions by comparing the sample quantiles of the standardized residuals with the theoretical quantiles. Figure 4 shows the QQ-plot for all three oil price shocks and Fig. 5 for the stock market returns. They illustrate a good model fit with few deviations from the theoretical quantiles in the tails. Second, we performed the following goodness-offit tests: Kolmogorov-Smirnov, Cramer-von-Mises, Anderson Darling, and Neyman smooth test. None of the tests rejects the null hypothesis for any of the series. Consequently, we can use the estimated parametric distributions of the standardized residuals to perform the probability integral and obtain copula data for the further analysis, i.e., whereμ it = E(r it |F t−1 ) andσ 2 it = V ar(r it |F t−1 ) are the estimated conditional mean and standard deviation of the variable i at time t from the ARMA-GARCH model, Table 3 ARMA-GARCH estimation results

Bivariate analysis
We begin by estimating appropriate dynamic copula models for each stock market with the three oil price shock variables, respectively. For modeling the dynamics in dependence over time, the GAS copula model is used. 5 The estimation of the best dynamic GAS copula is done with maximum likelihood estimation, where we allow for the following copula families: Gaussian, Student t, Clayton, Gumbel, Survival Clayton, and Survival Gumbel. The selection of the best copula family is based on the Akaike Information Criterion (AIC). In order to replicate the whole dependence spectrum (negative and positive dependence) for the Clayton, Gumbel, and their survival copulas, we allow the model to use the 90 • -rotated versions of these copulas, whenever the dependence is negative. Table 4 provides summary statistics for the time-varying dependence parameter for each pair. 6 Looking at the best fitting copula families, for 7 out of 15 pairs a symmetric copula was chosen, the Gauss copula in most cases. In terms of asymmetry, the Gumbel and survival Clayton copulas are characterized by upper tail dependence and lower tail independence, whereas for the Clayton copula we have lower tail depen-   dence and upper tail independence. We can conclude that for all BRICS countries and the oil supply shocks, upper tail dependence is present (survival Clayton and Gumbel copulas). This means that when the supply of oil is extremely high, then also the stock market returns tend to be high, which is to be expected. For oil the exporters, i.e., Russia and Brazil, high oil supply has a direct effect on the profitability of companies in the oil export sector. For the oil-importing countries high oil supply is beneficial via lower prices. Further, we can conclude from the upper tail dependence between the aggregate demand shock and Russia's stock market (Student copula) that an extremely high global demand level will result in rising stock returns. This is reasonable, because Russia is an oil-exporting country and its economy is highly dependent on oil companies. Moreover, for ZA-DS, RU-DS, BR-OS, and IN-OS we have evidence for lower tail dependence. Turning to the strength of dependence measured in terms of Kendall's tau, while the average dependence is close to zero, there is some notable variation. While overall positive dependence dominates, there are also periods with considerable negative dependence. Based on the estimated models, the V a R and CoV a R are computed as explained in Sect. 2.4 using α = β = 0.05. We want to test for (1) the existence and the significance of risk spillover effects and (2) asymmetric effects of CoVaRs. This is done by comparing the upside and the downside CoV a R and V a R and testing their equality. Table 5 provides summary statistics for the differences between the CoV a R and the V a R. While the CoV a R tends to exceed the V a R in absolute terms there is a notable variation presents. To additionally assess the asymmetric effects, we construct two additional samples, namely , and test their equality. We test Table 6 Kolmogorov-Smirnov test for spillover effect and asymmetry ZA,OS 0.210 * * * 0.210 * * * 0.476 * * * * , * * and * * * denote significance level at 10%, 5% and 1%, respectively these hypotheses using the two-sample Kolmogorov-Smirnov (KS) test: where F 1,n and F 2,m are the empirical distribution functions of the first and the second sample, respectively. Table 6 summarizes the results of the KS test for risk spillover and asymmetric effects. There are no significant risk spillover effects from oil supply shocks to BRICS stock returns, except in Brazil (upside and downside) and Russia (upside), the oilexporting countries in the sample. However, there are significant risk spillover effects from aggregate demand oil shocks to BRICS stock returns, except in South Africa (upside and downside). Furthermore, there are significant risk spillover effects from oil-specific demand shocks to almost all BRICS stock returns, except in Brazil (upside) and in India (upside). In addition, we get significant results for asymmetric effects between upside and downside risk spillovers of almost all oil price shocks on all log returns of the BRICS countries, with an exception of China and the oil demand shocks and the oil-specific shocks.

Multivariate analysis
In this section we want to investigate multivariate risk spillover effects by combining several variables in our analysis. Again, we measure the risk spillover effects by estimating the upside and downside value at risks (VaRs) and conditional value at risks (CoVaRs). We calculate the VaR at a 95% confidence level (α = 0.05). The CoVaR is defined as the VaR for BRICS stock returns at a 95% confidence level (α = 0.05), conditional on the VaR for several variables at the 95% confidence level (β = 0.05). For calculating the multivariate CoVaRs, we combine the GAS model from Sect. 2.1 and the flexible D-vine-based quantile regression model from Sect. 2.5. Using this approach, we can analyze the effects on a country when all oil price components are shocked. Moreover, we are able to answer the question, how a stock market in one specific country would react to several oil price shocks and/or extreme stock market situation in other BRICS countries.
Let us say a few words on the D-vine copula model, estimated for the D-vine-based quantile regression. Due to the high dimension and complexity of our model and the increasing estimation uncertainties in the higher D-vine trees, we decide to allow for time constant copulas, in order to minimize the number of parameters to be estimated. We rely on the AIC for selecting the best pair copula. That means that for each pair copula in the D-vine copula model we estimate time-varying and constant copulas from the following families: Normal, Student t, Clayton, Survival Clayton, Gumbel, Survival Gumbel, and Independence copula.
Based on the D-vine estimation results, we compute the downside (upside) CoVaR of the variable of interest, say i, conditional on, e.g., OS, DS, SS being simultaneously equal to their downside (upside) VaR. We can calculate this by using Eq. (2.12) and the estimated conditional mean and standard deviation from the ARMA-GARCH model: We consider two types of analyses. First, we consider each countries stock market return conditional on all three oil shocks. Second, we look at the CoVaR of each country conditional on the most influential oil prices shock together with a shock to either one or all other BRICS stock markets. This allows us to see how influential multiple shocks are on the estimated CoVaR relative to the univariate VaR and the bivariate CoVaR.
We do not present detailed estimation results for the D-vine copula models, but these details can be found in Kielmann (2020). Graphical representations of the VaR and CoVaR for all studied countries and different conditioning variables can be found there as well. Below, we put some focus on the presentation of the results for China given its importance in the global economy.
We use a Kolmogorov-Smirnov (KS) test to test whether the CoVaR of each countries stock market returns, conditional on all three oil price shocks, significantly differs from the CoVaR conditional on the oil-specific demand shocks (OS).
To conduct the test, we use the two time series of the CoVaRs (CoV a R i|O S and CoV a R i|O S,DS,SS ) for the downside and for the upside risk effect for country i, respectively. To assess the (conditionally) asymmetric effects, we construct two additional samples, , and test their equality. The tests reject all hypotheses with one exception, namely the upside CoVaR for Russia. 7 Hence, we can conclude that inclusion of all oil price shocks in the risk spillover analysis leads to significant differences for the upside risk and for the downside risk, compared to the inclusion of only one oil price shock. Moreover, (conditionally) asymmetric effects cannot be rejected.
The summary statistics of the risk measures can be found in Tables 7 and 8. It can be seen that, as to be expected, multiple oil prices shocks lead to an increase in the risk measure. Looking at the different oil shocks in Table 7, we can see that supply shocks (SS) do not increase the risk, whereas demand (DS) and oil prices-specific (OS) shock do increase the risk notably, especially for the oil exporters Russia and Brazil. It is notable that joint shocks of all three oil price components increase the risk significantly compared to shocks in the individual components. This is not surprising as, by construction, the oil shocks are (unconditionally) orthogonal to each other. The largest increase in risk due to oil price shocks can be observed for Russia, which is not surprising given the dependence of the Russian economy on oil. Table 8 shows the results for the CoVaR conditional on (1) the most influential oil shock alone, (2) together with the most influential stock market shock, (3) together with a shock to all BRICS stock markets, and (4) together with country-specific shocks to inflation and exchange rates (vs. the US$) as proxies for macroeconomic shocks. As macroeconomic shocks we consider devaluations of the exchange rate and high inflation, which are typically seen as negative macroeconomic conditions. 8 This is done as, obviously, spillovers will occur between international stock markets and we want to evaluate how strong these spillovers are. Furthermore, macroeconomic shocks are also considerable risk factors and we want to compare their effect to shocks to the other risk factors. As to be expected, a larger number of shocks increases the CoVaR with the exception of China and South Africa, for which the risk conditional on shocks to all BRICS countries is not larger than conditionally only on the country with the strongest dependence. Comparing Tables 7 and 8, we can conclude that China and South Africa are less vulnerable to BRICS stock market shocks compared to the other countries after controlling for the most relevant oil shocks. Furthermore, for Brazil, Russia, India, and South Africa macroeconomic shocks increase the CoVaR risk in a similar magnitude as oil or stock market shocks. For China shocks to inflation and exchange rates have no noticeable spillover effects.
Focusing on the example of China 9 , Fig. 6 depicts the evolution of the downside resp. upside VaR and CoVaR of the Chinese stock market returns, conditional on 7 Detailed results for these hypothesis tests can be found in Kielmann (2020). 8 For the macroeconomic data we consider standardized residuals from the best-fitting ARMA models with ARCH(1) errors, as there is only weak evidence for ARCH effects in these series. Details concerning the modeling of these series are omitted to preserve space and can be obtained by the authors upon request. 9 Similar graphs and more detailed results for the other countries are available from the authors upon request.  figure. For the most time points in the observed time period, we see that both the downside and the upside CoVaRs from the model with all oil shocks are higher than the CoVaRs from the model with only the oilspecific demand shocks. However, we observe that at some time points, the CoVaR conditional on all three oil price shocks being equal to their VaR is even lower than the VaR. This can be explained by the time-varying dependence permitted in our model, which identifies periods of negative dependence. In order to analyze the risk spillover effects from oil-specific shocks (OS) jointly with shocks in the stock markets in BRICS being equal to their VaR on the Chinese stock market, we apply the D-vine model with the ordering CN-BR-RU-ZA-IN-OS. Figure 7 depicts the CoVaRs for the model with all BRICS and the oil-specific demand shocks, for the model with Brazil and the oil-specific demand shocks, and for the model with only the oil-specific demand shocks. We observe that the extreme market risks in Chinese stock market does not change much if considering all BRICS stock market in our analysis, compared to our model if only including the Brazil stock market and the oil-specific shocks. From Figs. 6 and 7, we can see that the Covid-19 shock in early 2020 is not visible in the (conditional) risk level of the Chinese stock market.

Conclusion
This paper quantifies risk spillover effects from different types of oil price shocks to the stock markets of the BRICS countries in a multivariate setting relying on three methodological pillars. First, we base our risk spillover analysis on the bivariate time-varying GAS model of Creal et al. (2008), a recommendable specification for introducing time variation in copula models. Second, we extend the bivariate copula-based analysis of a risk spillover to a multivariate one. Third, using the D-vine-based quantile regression of Kraus and Czado (2017), we are able to investigate the effects of several oil price shocks simultaneously on BRICS countries' stock returns and, additionally, consider interdependencies between BRICS stock markets and with macroeconomic variables.
Our empirical results provide clear evidence that the dependence between oil shocks and stock returns is time-varying and mostly positive. However, the extent of this dependence strongly depends on the type of oil price shocks and the importance of oil for an individual country. In general, the oil-specific shocks are the most influential oil price shocks for BRICS stock market movements, whereas the oil supply shocks hardly influence the stock markets and their extreme market risk level. Furthermore, our analysis of risk spillover effects of extreme risks in the oil market shows us that especially demand oil shocks influence the risk level of stock returns in the BRICS.
We observe that the Asian financial crisis, the global financial crisis, and the Covid-19 crisis led to significantly increasing risks in the stock markets. However, we also found that China's stock market has recovered quickly from the Covid-19 crisis. Based on our multivariate risk spillover analysis, we can conclude that including all oil price shocks in our analysis, instead of only one oil price shock, leads to higher risk spillover effects on the stock markets in BRICS. Moreover, we find that there are considerable interdependencies between the BRICS stock markets leading to considerable risk spillovers in addition to oil shocks. Finally, joint shocks to inflation and exchange rates also spill over to the respective stock markets for Russia, Brazil, and South Africa, whereas they do not for China and India.
The described empirical findings provide important implications for financial investors to improve their portfolio strategies and risk positions. They are also are helpful for the governments in BRICS countries, in order to react better to oil price shocks or BRICS wide stock market shocks. From a policy perspective, we saw that stock markets of oil-exporting countries are more vulnerable to oil demand shocks. Reducing this vulnerability is crucial for preventing significant economic and financial instability in these countries that may spill over to other countries via financial and non-financial contagion channels.
The methodology we suggest should be useful in different applications. The D-vine-GAS copula model is highly flexible and can be applied in large dimensions without exploding computational requirements. Combined with the D-vine-based quantile regression this allows for a flexible and general risk spillover analysis compared to the commonly used bivariate analysis in which the CoVaR is computed based on a single risk event. Conditioning on multiple joint risk events improves the empirical usefulness of the this risk measure. This methodological contribution could be of interest in a number of applications as it increases the usefulness for copula-based CoVaR estimation.
Funding Open access funding provided by University of Graz.

Conflicts of interest
The authors have no conflicts of interest to declare. All co-authors have seen and agree with the contents of the manuscript. We certify that the submission is original work and is not under review at any other publication.
Human and animal rights This article does not contain any studies with human participants or animals performed by any of the authors.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.