Time-varying connectedness and contagion between commodity prices and exchange rate in Sub-Saharan Africa

Abstract Market participants, policymakers, and practitioners might have ignored the connection between global commodities and the currency markets in sub-Saharan Africa and the potential for contagion at various time scales. We examine the degree of time-varying connectivity and contagion between commodities and the exchange rates of sub-Saharan African countries (SSA). We use the Barunik and Krehlik (BK18) spillover index on monthly data from 1990 to 2019 to illustrate the dynamic connectivity in the time and frequency domains. The BK18 captures the nonlinear, nonstationary, asymmetric, and time-dependent comovements in the relationship. Our analysis indicates that the relationship between commodity returns and exchange rates in Sub-Saharan Africa (SSA) is both time- and frequency-dependent, but stronger at higher frequencies. We observe that, among the three commodities, only crude oil is a dominant spillover propagator. The exchange rates of South Africa dominate spillover transmission among metal-producing countries, and those of Cote d’Ivoire dominate agricultural-producing countries. The dynamic results reveal significant spillovers between commodities and exchange rates during economic turmoil, indicating contagion among the markets. Since uncertainty spillover is more severe amid market upheaval, investors should use their awareness of market dynamics and fluctuations to protect their holdings from lower asset returns. Policymakers should keep a close eye on spillovers because they endanger cross-market connections.


Introduction
The financial economics literature has shown significant interest in connectedness and contagion, mainly driven by financial catastrophes like the Asian, Mexican, and Russian crises, the 2007/2008 global financial crisis (GFC), the 2013 oil price drop, and the COVID-19 pandemic (see, for instance, Boako & Alagidede, 2017;Diebold & Yilmaz, 2009;Jiang et al., 2022).The growing interdependence of countries as economic partners or neighbours has also opened the door to shock spillovers and, as a result, interest in contagion (Owusu Junior et al., 2020).Again, high market integration, especially for nations in the same economic bloc, contributes to high interest in contagion research and financial market expansion as investors seek secure assets (Tiwari et al., 2019).
The numerous academic interests in contagion have generated a debate on what constitutes financial contagion.From the perspective of fundamental contagion theorists, contagion occurs when there is shock transmission from one country or market to another through the real sector or macroeconomic factors (Bekaert et al., 2005;Forbes & Rigobon, 2002;Pritsker, 2000).On the contrary, the pure contagion theorists are of the belief that when shocks are transmitted from one country or market to another without any idiosyncratic factors, there is contagion (see Dornbusch et al., 2000;Kaminsky et al., 2003).The lack of clarity in the meaning of contagion led Forbes and Rigobon (2002) to propose "shift contagion" (SC), which is a significant shift in crossmarket linkages.To them, a cross-market linkage without any significant change in spillover constitutes connectedness.Despite the contribution of SC, the definition and measurement of contagion are still the subject of an ongoing and contentious debate.Contagion is therefore an empirical issue that is contextual in nature; hence, this study seeks to examine the connectedness and contagion between global commodity prices (CP) and exchange rates (ER) in SSA.In line with Forbes and Rigobon (2002), we separate connectedness from contagion and make inferences about any possible decoupling between the two markets.
The focus on commodities and ER is motivated by the high dependence of countries in SSA on commodity exports for revenue.Indeed, nine out of 10 countries in SSA are classified as commodity dependent (United Nations Conference on Trade and Development, 2021), and since these commodities are traded mainly in US dollars on the international market, there is a high probability of shocks emanating from commodity prices to ER in SSA.At the same time, these countries see commodities as assets that can be relied on to hedge their currencies, especially in turbulent times.As a result, understanding the dynamics of interdependence and possible contagion between these two variables will be helpful in the hedging and risk management decisions of policymakers in SSA.
Moreover, information from crises like the GFC and the recent COVID-19 pandemic usually triggers a reaction from market participants and agents to look for alternative assets to put in their portfolios, either for hedging purposes or for diversification.These economic agents could either be rational or irrational, and because of the heterogeneity in their behaviour, they may be following the heterogeneous market hypothesis (HMH) by Muller et al. (1993) or the adaptive market hypothesis proposed by Lo (2004).The idea behind these theories is that the differences among investors cause them to operate at different investment horizons as they respond to volatility differently.Investors' behaviour is thus frequency-varying over time, contrary to the proposition of the efficient market hypothesis (EMH), which sees investors behave similarly.Market participants seeking an efficient portfolio, particularly during times of crisis, look for assets that are uncorrelated or negatively correlated to provide a safe haven (Baur & Lucey, 2010).This is because contagion between assets diminishes portfolio diversification possibilities since it increases correlation (Gulko, 2002).
Financial markets in Africa, including the forex and stock markets, have become attractive to global investors because there is a perception fuelled by some studies that the African markets, like many in other developing economies, are decoupled from global economic activities (see Kose & Prasad, 2010;Kose et al., 2008;World Economic Outlook, 2007).These studies posit that economic activities in advanced markets and the developing and emerging worlds are uncorrelated, contrary to the views of contagion theorists.The implication is that returns from FX markets in SSA and the global commodities market will not be related normally; that is, they will not be correlated.This belief has led to increased capital inflows to SSA markets (Atenga & Mougoué, 2021;oro Owen, 2017;World Bank Group, 2018).The question then is: do the currency markets in SSA offer any diversification opportunities to commodity investors, and do commodities provide hedging potential for currencies in SSA?The answer to the question hinges on the nature of any possible connectedness or contagion between the two variables, and since not much is known in this direction, this study seeks to provide a possible guide to investors and policymakers.
Further, several studies on financial contagion in the financial economics literature have focused on contagion between stock markets (Caporin et al., 2018;Diebold & Yilmaz, 2009;Owusu Junior et al., 2020), between commodities (Bouri et al., 2017;Ji & Fan, 2012;Shen et al., 2022), between currencies (see Antonakakis, 2012;Bubák et al., 2011;Huynh et al., 2020;Kočenda & Moravcová, 2019;Salisu et al., 2018), and between commodities and stocks (Agyei & Bossman, 2023;Alagidede et al., 2021).Yet, contagion between commodity markets and currency markets has received limited attention.The few exceptions, like Dai et al. (2020) and Jiang et al. (2022), focused on only major currencies at the expense of those of weaker economies.The situation in SSA is even worse, as studies on contagion between global commodities and exchange rates (ER) hardly exist.Mention can be made of Katusiime (2018), but apart from the study being limited to only one country (Uganda), no differentiation was made between connectedness and contagion.This gap needs immediate attention due to the high dependence of countries in SSA on commodity exports.
Additionally, previous connectedness and contagion studies between commodities and ER in SSA have concentrated on linear and static time analysis in line with EMH with little or no attention to the time-frequency dimension.This is a significant gap because Muller et al. (1993) found that agents in financial markets respond to volatility differently at different investment horizons, corresponding to high, medium, and low frequencies.Understanding the frequency dynamics of connectedness is critical to finding the origins of connectivity in an economic system since economic shocks have various impacts on variables at different frequencies and intensities.Again, measuring connections in the frequency domain provides another source for managing systemic risk between assets (Baruník & Křehlík, 2018).Moreover, most prior studies have relied on GARCH, transfer entropy, and DY12 methods.Although these methods contain information about static time-domain analysis, they are limited in their ability to examine the frequency information of contagion over time.There is therefore a need to utilise a more robust method capable of capturing the dynamic behaviour of market agents.
This study differs from others by focusing on returns as the source of contagion in commoditydependent developing countries and making the following contributions: First, the study provides novel understandings of the ways in which dependence and contagion spread both within and between ERs in SSA and between global commodities and ERs in SSA by disaggregating return volatility.Such analysis provides more information about the heterogeneous behaviour of investors, which varies across different times (short-, medium-, and long-terms) and may be hidden from studies focusing on composite behaviour (Owusu Junior & Gherghina, 2022).The information provided by the study is helpful to investors and policymakers for risk management.
Second, it examines the dynamic interdependence between commodities and ER at different frequencies (high, medium, and low) and over time.This provides information about how complex connections between CP and ER have evolved over time.Such analyses appeal to HMH, which has indicated that the differences in investor expectations and appetite for risk, among others, make them operate at different investment horizons at different times.Therefore, while institutional investors and monetary policy authorities are more interested in medium and low frequencies, which correspond to medium-and long-terms, speculators focus on high frequencies, which correspond to short-terms.Findings here will therefore be more useful to different participants in the markets making hedging decisions than other studies that focus on only time at the expense of time variation.Third, we quantify connectedness and contagion using the non-parametric method of Baruník's and Křehlík (2018) time-domain, frequency-domain, and time-frequency domain framework (BK18).This method captures non-linear and non-stationary returns.Non-stationarity and non-linearity are becoming important in spillover research.To the best of our knowledge, this method has not been applied to commodities and currency markets in SSA, as prior studies have mostly applied the Diebold and Yilmaz (2012) spillover index and GARCH methods, which are limited in accounting for the frequency dimension of the relationship.Again, BK18 accounts for causality in the frequency domain by using "within" connectivity, contrary to DY12.The BK18 considers composite and pairwise (bidirectional) spillover at different frequencies and timings.It estimates net spillovers by comparing "from" and "to" spillovers.BK18 calculates spillovers like several current studies (see Adam, 2013;Diebold & Yilmaz, 2009;Saiti et al., 2015).BK18's contagion measurement is consistent with Forbes and Rigobon's (2002) "shift contagion" measurement.It captures contagion asymmetry, which benefits investors and policymakers.
Fourth, we present evidence of currency market contagion in 27 commodity-producing and largely commodity-dependent SSA countries.Commodity-dependent countries need to know whether they should spend more time dealing with external shocks from global commodity prices or dealing with shocks from the exchange rates of other commodity-exporting countries within the continent.The use of three major commodities (oil, gold, and cocoa) and several countries provides a broader understanding of the situation in specific countries to aid investor and policy decisionmaking.The methods employed in this study (BK18) can determine the system's most dominant contributor to spillovers.This is important for systemic risk management and portfolio diversification.By using BK18, the study can determine whether a specific country at a specific frequency is a net receiver of return shocks in pairs or as a whole, which other methods are unable to do.
Our findings show a significant time-varying frequency relationship between global commodities and currencies in SSA, with varied spillover contagion during crisis times.We observed that crude oil and cocoa are net transmitters of spillovers to exchange rates, but gold is a net recipient of spillovers.This finding creates room for gold to provide a hedge for the exchange rates of metal-exporting countries.According to market conditions, there are huge opportunities for diversification between commodities and SSA currency markets, as well as between pairs of SSA currencies in systems.
The paper continues as follows: Section 2 is a review of related works, and Section 3 looks at the material and methods.In the fourth section, we concentrate on the discussion of results from the estimation, while the fifth and final section concludes the study with recommendations.

Literature review
Despite the ongoing debate on the concept of contagion, empirical studies abound in the literature, with inconsistencies probably due to the multiplicity of measurements.Several studies in this area have concentrated on the return and volatility spillovers between the exchange rates of major currencies in the world, with varying outcomes.Bubák et al. (2011) conducted a study on volatility transmission between the currencies of Central European (CE) countries and the EUR/USD exchange rate, relying on model-free estimates of daily exchange rate volatility.The findings showed that in the Central European markets, there are statistically significant intra-day spillovers among the currencies.Except for the Czech Republic and Poland, there were no spillovers from EUR/USD markets to CE markets.In a study to examine the volatility spillover and exchange rate co-movement before and after the Euro introduction, Antonakakis (2012) utilised a VAR-based spillover index for major currencies in Europe and the US dollar.The results show that spillovers were important, but on average they were smaller after the euro was introduced than they were before.This shows that spillovers change over time and need to be looked at from time to time.
Similarly, Salisu et al. (2018) examined the return and volatility spillovers in the global exchange rate markets, focusing on the six most traded currency pairs (Aussie, Cable, Euro, Gropher, Loonie, and Swissy) in the world using daily data from January 1999 to December 2014.The result from the DY12 model indicates that interdependence exists among major currency pairs, but while return spillovers exhibit mild trends, volatility spillovers exhibit no trend at all.It must be pointed out that, apart from the study focusing on only the major currencies in the world, the analysis was only done in the time domain, which falls short of bringing out the total dynamics at different levels.
In a related study, Kočenda and Moravcová (2019) investigated spillovers, co-movement, and hedging costs in the EU forex markets with monthly data from 1999 to 2018.They concluded that correlation and spillovers were unstable; the correlation becomes negative during turbulent times, and cross-currency spillovers rise at times of crisis.Not only do their findings contradict some aspects of Antonakakis (2012), but they also assume a time-domain analysis.More recently, Huynh et al. (2020) considered the role of trade policy uncertainties in studying connectedness and spillovers in the foreign exchange market over the period from 1999 to 2019 for nine major US dollar exchange rate currencies.It came out that connectedness and spillovers are present only after considering trade policy, albeit at a higher level of volatility than the return.This study, just like previous studies, ignores the weaker currencies and is also limited to time-domain analysis.
Other contagion studies have focused on exchange rates and stock market relationships.For example, Lin (2012) focused on the emerging Asian market by studying the co-movement between exchange rates and stock markets.The autoregressive distributed lag (ARDL) was used, and the findings show that spillovers become stronger during crisis times, which is a sign of contagion during turbulent times.But while the study attempts to differentiate between connectedness and contagion, the method used is more linear in nature, which defeats the nonlinear nature of financial data like stock prices and exchange rates.In a similar vein, Moore and Wang (2014) examined the dynamic linkages between real exchange rates and stock returns, focusing on the US market and emerging Asian markets.Using the dynamic conditional correlation (DCC) approach, they discovered that trade balance is a key influencer of the relationship between Asian and US markets, while interest rate differential is the primary influencer on US markets.But, like Lin (2012), this study is limited by the fact that linear models cannot show the whole picture of what is going on.Boako and Alagidede (2017) carried out a more thorough investigation into the existence of "shift contagion" in African stock markets using weekly data to examine extreme events (downside movement from the global exchange rate and developed stock markets).The conditional value at risk (CoVAR) based on the copula method was employed, and the findings show that, based on "shift contagion," there is evidence of contagion from some developed stock markets and exchange rates to African stock markets.They argued that shocks do not happen only during crisis times but can also happen post-crisis, so there is "delayed-shift contagion."While we share the view that there can be a delay in contagion, a simple extension of the study period does not necessarily defeat the implicit assumptions of the SC since the SC still captures shocks after the crisis period.However, the mathematical assumptions in implementing shift contagion (SC) might be its main weakness, an issue this thesis seeks to correct.Some studies have used multi-scale analysis to study the nonlinear connection between commodities and foreign exchange markets, albeit with a focus on major currency markets and mostly one commodity (oil or gold).For instance, Benhmad (2012) studied the nonlinear causality between oil prices and the US dollar, relying on the wavelet approach.The findings show that the causality relationship was bi-directional and varied over frequency but was unidirectional at the first frequency, running only from oil to exchange rate.In a similar fashion, Reboredo and Rivera-Castro (2014) examined the importance of gold to exchange rate risk management in terms of hedging and downside risk.The analysis was done at different investment horizons using wavelet multiresolution analysis.The findings show that over the period 2000-2013, the depreciation of gold and the US dollar had a positive dependence on other currencies used in the study at all-time scales.Despite these two studies using the same approach but with different commodities, the findings are not consistent for both.While the former does not obtain a consistent relationship at all frequencies, the latter does.This creates room for an assessment of the relationship between different commodities and different currencies.Moreover, the wavelet method used in both studies has the probability of smearing the energy of the decomposed frequencies, thus making their reliability suspect.
Uncertainty in the results is also evidenced in Wen et al. (2017), who sought to assess the nonlinear Granger causality and time-varying effect between crude oil and the US dollar.In this study, multiple methods were applied, including the Hiemstra and Jones test, the Diks and Panchenko test, and the time-varying parameter structural autoregressive model (TVPSAR).The finding of the study was that the exchange rate does not cause the oil price, but rather the other way around: the exchange rate has a more stable negative effect on the oil price.Despite the multiple methods used in Wen et al. (2017), none of them has the capability of proper decomposition to present frequency-level information.
In a recent study, Yıldırım et al. (2022) investigated the volatility transmission between real exchange rates and real commodity prices for three emerging economies: Mexico, Indonesia, and Turkey.The study suggests that a bidirectional causality exists between the CP and ER but that the relationship varies with time and that volatility transfer disappears in times of crisis, particularly during the COVID-19 pandemic.Yıldırım et al. (2022) also revealed that, though both precious metals and oil have safe-haven potential for the exchange rate, risk transfer from oil only happens in Indonesia and not in the other two countries.One weakness of this study is that it is a timedomain study with no frequency dimension.Again, the study also confirms the importance of studying different commodities and different exchange rates due to the inconsistencies in the outcomes for both oil and gold in the same study.
Other studies on co-movement and connectedness have concentrated on other sectors and assets.One such study is that of Athari and Hung (2022), who focused on the asset class comovement pre-and post-COVID-19 eras with specific emphasis on equity, digital assets, commodities, and fixed income.Using daily data from 2017 to 2021, the results from the wavelet analysis indicate that co-movement among assets during the COVID-19 pandemic intensified relative to the pre-COVID period.The problem is that the study relied on commodity indexes instead of specific commodities, making it difficult for specific country policies.Kirikkaleli and Athari (2020) studied bank credit supply and economic growth in Turkey using data from 1993 to 2017.Findings from the wavelet analysis concluded that ownership structure plays a significant role in the connection between credit supply and economic growth in the short and long run.A related study by Athari et al. (2021) focused on credit ratings for economic risk in Balkan countries.Using data from 1999 to 2019, the results show that while there is one-way causality between credit rating and the economies of Bulgaria and Croatia in the long run, feedback causality exists between credit rating and the economies of Greece, Slovenia, and Romania.While these studies show the importance of studying connections between assets on different time scales, they did not focus on the currency market with an emphasis on some European countries.There is therefore a need to provide evidence from the African currency market and global commodities due to their important contribution to global commodity exports.
Contagion studies on African currency markets have primarily been linear or time-domain analyses.For instance, Katusiime (2018) investigated price volatility spillovers from commodities to the exchange rate in Uganda using dynamic conditional correlation (DCC), constant conditional correlation (CCC), and time-varying conditional correlation (TVCC).The study found that market interconnectedness and volatility spillover are generally low but increase during times of crisis, using data from January 1992 to April 2017.Atenga and Mougoué (2021) study the return and volatility spillover to African currencies using data from 2000 to 2019.The empirical results of the DY12 model show that African currencies respond more to themselves than to global factors, except for Botswana, Morocco, Tunisia, and South Africa, which may be linked to other currencies.
The forgoing literature presents the following issues and weaknesses: (1) that most empirical evidence has focused on major currencies in developed economies; (2) that there are inconsistencies in empirical findings when different commodities are used for different currency markets or even when the same commodity is used for different currencies; (3) that many existing studies concentrate on linear interaction; (4) that there is a paucity of empirical evidence on time-variation, particularly in SSA; and (5) that there is a lack of studies testing the "decoupling hypothesis" in the frequency domain of the currency market in SSA from global CP.Based on the weaknesses identified in the literature, this study fills the gaps by: (1) using three commodities (oil, gold, and cocoa) and the exchange rates of 27 commodity-producing countries in SSA; (2) appealing to the HMH and presenting evidence in the frequency domain; and (3) employing the BK18 approach.In the process, we differentiate between connectedness and contagion, similar to Forbes andRigobon (2002) andOwusu Junior et al. (2020), and make an inference about the decoupling hypothesis in SSA.We take frequency heterogeneity into account in our analysis, which gives investment and policy decisions a more complete picture.

Methodology
We provide details of the Baruník and Křehlík (2018) spillover methods, which was relied on to achieve the purpose of the study.Baruník and Křehlík (2018) spillover method, commonly called BK18 was motivated by Diebold and Yilmaz's ( 2012) method (DY12), which estimates connectedness among variables in the time domain.Barunik and Krehlik extended the DY model to incorporate the frequency domain in estimating connectedness.The benefit of the BK18 method is its ability to account for connections in the time domain, frequency domain, and time-frequency domain.The DY12 calculates connectedness from generalised forecast error variance decompositions (GFEVDs), which are based on the matrix of vector autocorrelation (VAR) model of local covariance stationarity.For instance, if we denote K À variance process as Y t ¼ ðy 1;t; . . .; y k;t Þ 0 at t ¼ 1; . . .; T, then, the VAR ρ ð Þ may be expressed as; From Equation (1), ; i and � t represent coefficient matrix and white noise respectively with (possibly non-diagonal) covariance matrixπ.In the equation above, the system makes it possible to regress each of the variables on its own ρ lags and the ρ lags of other variables.This makes ; have complete information of the connection between all the variables.It must be indicated that it is helpful to work with KxK ð Þ matrix ðI K À ; 1 L À . . .À ; p L p Þ with identity I K .The L ð Þ and theðL p Þ represent the lag and lag polynomial respectively.In this process, if the root of θ Z ð Þ j j lies outside the unit circle, then the VAR process contains a vector moving average i:e Where ψ L ð Þ is an infinitely lag polynomial.Building on Diebold and Yilmaz (2012) the GFEVD can be expressed as; Where ψ h is KxK matrix having a coefficient corresponding to h lags i:e:; h ¼ and represent the contribution of the k th variable to the variance of the forecast error of the element j.It is worth noting that the sum of each row does not necessarily add up to one, so each element of the decomposition matrix is normalized as follows; It should be noted that ð ΘH Þ j:k provides a pairwise connectedness measure from j to i at horizon H that can be aggregated by design.The connectedness measure is defined by Diebold and Yilmaz (2012) as the amount of variance in forecasts contributed by errors other than own errors or the ratio of the sum of the off-diagonal element to the sum of the entire matrix, which is expressed as From ( 5), Tr � f g is the trace operator, and the denominator stand for the sum of all the elements of ΘH Matrix.Accordingly, connectedness is the relative contribution of the other variables in the system to the forecast variances.Until now, the link between commodity prices and exchange rates has been clearly demonstrated in time domain.We can also measure spillovers from one country to another.Barunik and Krehlik extended the DY model to incorporate the frequency domain in estimating connectedness.As a foundation, if we consider a frequency response function ψðeÞ À iω ¼ � h e À iωh ψ h of Fourier transformable coefficient ψ h with i ¼ ffi ffi ffi ffi ffi ffi ffi À 1 p , then, a spectral density of Y t at a frequency ω can be expressed as MA 1 ð Þ filters series as follows; The power spectrum S y ω ð Þ expresses how the variance of the Y t is distributed over the frequency component ω and is very important in understanding the frequency dynamics.The generalized causation spectrum over ω� Þ j;k indicate the portion of the ith variable at a given frequency ω due to shocks in the kth variable.From that, we can interpret the quantity as within-frequency causation based on the denominator which shows a spectrum ofjth variable at a frequency of ω.The most logical thing to do now is to weigh F ω ð Þ ð Þ j;k by the frequency share of the variance of the jth variable to get the natural decomposition of GFEVD to frequencies.This is expressed as The weighted function defined in ( 8) is the power of jth ð Þ variable at a given frequency which sums up the value of real numbers through to 2�.Indeed, it is appropriate to measure connectedness over time horizons if we have proper financial application.Therefore, measuring connectedness at different frequency bands instead of just at a single frequency is very necessary.So as a general representation, if we have a frequency band d ¼ a; b ð Þ : a; b� À �; � ð Þ; a<b; then, the GFEVDs can be expressed as From ( 9), a scale generalized variance decomposition can be expressed over the same frequency band d as follows.
Consequently, ( 9) and ( 10) respectively define the within-frequency and frequency connectedness over d as follows Based on the estimation of Baruník and Křehlík (2018), C w d measures the connectedness within a frequency band which is exclusively weighted by the power of the series.The C F d on the contrary decomposes the original connectedness into separate parts which add up to the original connectedness measure.In this study, the frequency bands � þ 0:00001; �=4; �=12; 0 ð Þ as seen in Baruník and Křehlík (2018) and Tiwari et al. (2019) are used.

Data
The data used as input for the VAR analysis were the monthly return series for three commodities and the exchange rate.The series covered log returns from January 1990 to December 2019 for commodity-exporting countries in sub-Saharan Africa following IMF classification.Three commodities (gold, cocoa, and crude oil) were utilised for the study based on their massive revenue contribution to countries in SSA, and data on commodity prices were gleaned from the World Bank commodity price database, commonly called the "Pink Sheet".These three commodities were selected from three categories: metal commodities, agricultural commodities, and energy commodities, respectively.Data on exchange rates were sourced from the International Financial Statistics (IFS) database of the IMF for countries included in the study.The exchange rate is a measure of the rate between a particular country's currency and the US dollar.Countries selected for the study were grouped into three groups based on their level of dependence on a particular commodity or commodities.The connection between gold and ER was calculated for metal-exporting countries; that of cocoa and ER for agricultural-exporting countries was done; and finally, the estimation of oil and exchange rates for energy-exporting countries was done.
Table 2 presents the stationarity test results and the series' descriptive statistics.Also, results on the graphical behaviour of both the original and return series of the commodities are presented in Figure A1 in Appendix A. The graphs in Figure A1 show that the original series' behaviour is unstable.For instance, commodity prices recorded sharp price drops between 2007 and 2008.The sharp change in price may have been a result of the GFC over the period.The return series of commodities has stable trends with some volatility in the study space.The augmented Dickey-Fuller (ADF) test by Dickey and Fuller (1979) and the Phillips-Perron (PP) test by Phillips and Perron (1988) indicated that all the return series were stationary at the 1% significant level.In conducting    the analysis, the entire set of 359 data points was used to calculate the spillover in the time domain and the frequency domain.The data were then rolled over to account for the timefrequency domain, with a window size of 100 and a forecast horizon of 12 months.The lag selected for the VAR model was done in order to minimise the AIC.It is worth noting that, when using the BK18 method, it is unnecessary to exogenously designate the start and end times of the crisis when using the rolling window approach.By visualising the resulting spillover indices, we can take into consideration significant alterations in the shape of spillovers as we roll the data across the whole sample period (Yilmaz, 2010).The Diebold-Yilmaz and Barunik-Krehlik spillover frameworks have this as a major advantage over other methods.
Table 1 displays the selected bands' interpretations in the BK18 framework.The selected bands were to help in accounting for time-frequency spillovers in the short-, medium-, and long-terms, respectively.

Empirical results
In this section, emphasis is placed on discussing the results obtained from the Baruník and Křehlík (2018) framework.The analysis is presented in two sections.The first part focuses on the results from the frequency domain, classified as static analysis (Baruník & Křehlík, 2018;Diebold & Yilmaz, 2012).The analysis then proceeds to the second section for the results of the rolling window, which is described as the time-frequency variation by the extant literature (see Baruník & Křehlík, 2018;Diebold & Yilmaz, 2014; J. M. Polanco-Martínez, 2019; J. Polanco-Martínez et al., 2018).

Static frequency connectedness
In this static analysis, three frequencies are selected, and the results are presented in three Tables 3, 4 and 5, for oil and energy-exporting countries, gold and metal-exporting countries, and cocoa and agricultural-exporting countries, respectively.The expected contribution from commodity/exchange rate j innovations to the forecast error variance in commodity/exchange rate i is represented by the ijth entry.The proportion of the forecast error variance attributable to the commodity's or exchange rate's own innovations is represented by diagonal entries (i = j) (shocks).These are the table's greatest values, which makes sense given their size.
When discussing the overall connectedness results in Tables 3-5, the emphasis is on within connectedness (WTH) rather than absolute (ABS) connectedness.This is due to the fact that, although it is intriguing to learn that, when broken down into frequency bands, total connection adds up to absolute connectedness, within connectedness has the crucial additional function of pointing out causality in the system.In the view of Baruník and Křehlík (2018), cross-sectional dependence on connectedness can distort causal effects when using variance decomposition.As a result, by using the cross-sectional correlations, they modify the correlation matrix of the VAR residuals, which Diebold and Yilmaz (2014) also pointed out.
Again, we need to point out that the results in Tables 3-4 can be interpreted as causality within connectedness.This is because there is a corresponding within-connection value for each of the absolute connection values, which signifies an element of causation.The observations in Tables 3-5 give a clear picture of causality because, throughout the results, values of within-connectedness are higher than those of absolute connectedness.This suggests that the main reason for the lower absolute connectivity is the smaller number of correlations happening at the same time.Also, in line with Anas et al. (2020), the decoupling hypothesis is accepted when a commodity contributes negative, zero, or less than 1% to within-or net spillovers.In other words, if a commodity is contributing negative or zero spillovers within the system, it is a sign of a negative or no connection, but where it is positive and less than one, it is still an indication of a weak connection with the exchange rate.Within to measure return spillovers from commodity/country j to other countries, including from own innovation to commodity/country k.Within from measure return spillovers from other countries to commodity/country j, including from own innovation to commodity/country k (Tiwari et al., 2019).The three largest contributors to spillovers are in bold for all frequencies.Within to measure return spillovers from commodity/country j to other countries, including from own innovation to commodity/country k.Within from measure return spillovers from other countries to commodity/country j, including from own innovation to commodity/country k (Tiwari et al., 2019).The three largest contributors to spillovers are in bold for all frequencies.
The results in Table 3 concentrate on the spillovers between oil returns and exchange rate returns of fuel-producing countries in SSA.It can be observed from the results that the average absolute spillovers are 3.48 for Band 1, 1.57 for Band 2, and 1.01 for Band 3.This indicates that the short-term dominates spillovers and the long-term has the lowest spillovers between the oil price and exchange rate.Surprisingly, Ghana and oil returns dominate spillovers in Band 1, with Angola and Nigeria, the two largest producers of crude oil, contributing the least.Bands 2 and 3 follow a pattern that is very similar to band 1, where oil returns predominate, followed by Ghana, Mauritania, and Angola, which recorded the fewest spillovers.Together with Ghana's exchange rate, crude oil return is therefore a dominant propagator of the average absolute spillovers for energy-exporting countries in the frequency domain.However, Cameroon and Mauritania are the biggest recipients of spillovers from other countries.
The result on crude oil returns and the ER has some implications for market participants.For starters, diversification in the long term can be advantageous over diversification in the short term with stronger spillovers.This can be achieved by combining crude oil and an exchange rate or by combining ERs.Second, the major oil-producing countries do not dominate spillovers, as smaller producing countries do in most cases.The indication is that when one relies on returns as the source of spillovers, there is a less dominant effect from large markets.Finally, because oil returns are the most dominant propagator of spillovers at all frequencies, they transmit significant spillovers in relative terms.The findings here support several empirical studies that have observed the crude oil price as the biggest transmitter of global shocks to oil-producing countries (see, for instance, Benhmad, 2012;Wen et al., 2017).
In a nutshell, when it comes to exchange rate returns, oil-producing countries in SSA must exercise caution when it comes to policies of integration or dependence among themselves rather than with countries outside Sub-Saharan Africa.Moreover, it can also be suggested that the spillovers among the ER of many oil-producing countries are not stronger than the impact emanating from crude oil, and so countries must consider hedging their ER against crude oil volatilities.The results also show that oil-producing countries are not separated from shocks in crude oil prices because there is a connection at all frequencies.
In Table 4, we find the results of spillovers between gold returns and ER returns for metalexporting countries in sub-Saharan Africa.In terms of correlation dynamics, it is interesting to see that the average absolute and within-connectedness follow a similar pattern, as shown in Table 3.The exception in Table 4 is that the magnitude of the average connectedness is higher in the case of gold than in the case of oil.For example, in the case of gold returns and metal-exporting countries' ERs, the average spillovers within those bands are 16.77%, 6.88%, and 4.85%, respectively.In spillovers, the short-term also outweighs the medium-to long-term.Other findings are that in band 1, which represents the short-term frequency, South Africa (3.64%), Botswana (3.38%), and Namibia (3.29%), which are all southern African countries, dominate absolute spillovers.Rwanda (0.28%) and the Democratic Republic of the Congo (0.28%) recorded the lowest contributions to spillovers.Band 2 sees South Africa leading, Namibia coming in second, and Botswana coming in third.The Democratic Republic of the Congo and Rwanda come in last.Band 3 has the same countries dominating spillovers, but the DRC and Rwanda are the two nations with the fewest spillovers.The absolute spillovers for gold returns are 0.58, 0.15, and 0.09 for bands 1, 2, and 3, respectively.
The findings have some implications for the spillovers between gold returns and exchange rate returns in SSA metal-producing countries.First, owing to the strength of spillovers in the short term, it will not be advisable for investors to undertake diversification in the short term.They should rather consider the long term for such an investment, as the weakness in spillovers will make it more beneficial.Shocks from gold returns are transmitted more strongly in the short-term than in the medium-and long-term.It must be pointed out that the gold return is among the least likely to shock the exchange rate, making it less risky for metal-producing countries in SSA.This finding is consistent with several empirical findings that have identified the gold price as a weak transmitter of shocks to the exchange rate (see Ciner et al., 2013;Reboredo & Rivera-Castro, 2013).Moreover, policymakers must be cautious with integration policies like the African Continental Free Trade Area (ACFTA), since a strong dependence can easily trigger spillovers among the ERs of these countries.The results in Panel B provide evidence in support of the "decoupling hypothesis" at all frequencies.
We now move to the results in Table 5, which focus on spillovers between cocoa returns and the exchange rate of countries that produce agricultural commodities.Thirteen countries are included for this purpose.Surprisingly, the results in Table 5 are like those in Table 3 and Table 4 in terms of the correlation of average absolute and within-connectedness.The average absolute spillovers for bands 1, 2, and 3 are 16.41%, 6.28%, and 3.68%, respectively, which are like those between gold and the exchange rate.Just like in the case of Table 3 and Table 4, band 1 dominates bands 2 and 3 in terms of spillovers.In bands 1 to 3, the absolute (to) spillovers from cocoa returns are 1.3%, 0.45%, and 0.21%, in that order.But cocoa returns do not produce the most dominant spillovers, as that position is taken by exchange rates in the Comoros and Cote d'Ivoire, with figures of 1.45% and 1.06, respectively, in band 1, with the lowest coming from Nigeria and Ethiopia.Moving to bands 2 and 3, the situation is not different from band 1 because Comoros and Cote d'Ivoire are still dominant, with absolute (to) spillovers with Mauritius in the mix.For these last two bands, Ethiopia produces the fewest spillovers, followed by Nigeria.In terms of the policy and investment implications, the explanation provided in panel B at the average absolute (to) connected levels is also applicable here.
At this stage, it is necessary to bring out the issues relating to net spillovers.The earlier discussion in Tables 3-5 concentrated on spillovers "from" and "to" between commodity returns and the exchange rate.To determine the net position of a commodity or exchange rate in terms of spillovers, it is necessary to find the difference between spillovers (from) and spillovers (to), which represent net spillovers.A positive net spillover makes a commodity or an exchange rate a net transmitter of spillovers, while vice versa makes a commodity or an exchange rate a net recipient of spillovers.The results of net spillovers are found in the last rows of each band in Tables 3-5.The results in Table 3 show that oil returns are a net transmitter of spillovers, but this is very weak in the short term, which confirms the existence of the "decoupling hypothesis" only in the short term.The cocoa return found in Table 4 is also a net transmitter of spillovers to the ER of food and beverage-producing countries in the short-and long-terms, but zero in the medium-term.The implication is that agricultural commodity exporting countries are insulated from short-to medium-term shocks from cocoa returns.However, the gold return in Panel B is a net recipient of spillovers from the exchange rate in metal-producing countries, which is also across all bands.The dynamics here make gold a good asset for portfolio diversification and have great potential for hedging ER, particularly for metal-producing countries.
For energy-exporting countries, Angola, Cameroon, and Mauritania are the net recipients of spillovers, while Nigeria and Ghana are the net transmitters of spillovers across all bands, as seen in Table 3.As a result, combining crude oil with the ER of either Ghana or Nigeria is a good possibility for portfolio selection.In terms of metal-producing countries, the ER of Burundi, the Democratic Republic of the Congo, Guinea, Mali, Mauritania, and Rwanda are net recipients of spillovers, whereas Botswana, Ghana, Mozambique, Namibia, South Africa, and Zambia are net transmitters across all bands.South Africa is the biggest net transmitter, which is not surprising since it is the biggest economy among metal-producing countries and a leading producer of gold in SSA.Concerning countries that focus more on the production of agricultural commodities, seven out of the 13 countries (Ethiopia, Gambia, Kenya, Madagascar, Malawi, Nigeria, and the Seychelles) are consistently net recipients of spillovers, with Comoros, Cote d'Ivoire, Mauritius, and Uganda also net transmitters of spillovers across all bands.
A close examination of the results in Table 5 indicates that two countries (Eswatini and Ghana) are net recipients and net transmitters at the same time.When it comes to shock transmission, there is a big-producing country effect for oil and metal-exporting countries, but both small and big countries for cocoa-producing countries.To stabilise the ER, oil-exporting countries should make policies that specifically target shocks from global oil prices as well as the ER of Nigeria due to their consistent net transmission of shocks.Similarly, policies from countries that produce cocoa must focus on dealing with fluctuations in cocoa returns, and those from ERs for Cote d'Ivoire, Comoros, Mauritius, and Uganda.Since gold is a net recipient of shocks, metal-exporting countries should not have many problems with shocks emanating from gold but should rather worry inwardly about shocks coming from the exchange rates of southern African countries and from Ghana, a leading producer of gold.Investors should also keep in mind that the dynamics are not only static but also frequency-dependent, so policies must be considered on a country-by-country basis rather than as a blanket policy for all countries.

Time-frequency-domain (time-varying) connectedness
In the previous analysis, the assumption was that the direction of spillovers does not change over time but only changes at different frequencies, which makes them static.This assumption is not entirely accurate, as the nature and direction of shocks change with time, hence their time-varying nature.This is particularly true considering the impact of financial market regime changes and the changing nature of the business cycle.For instance, extreme events like financial crises and changes in the regulations of financial markets have tended to change the narrative on shock transmission at various times.Thus, spillovers transmitted from one asset to another are likely time-varying and, as such, not static.To incorporate the time-frequency domain in the analysis, a rolling window approach in the BK18 framework has been utilised with a window size of 100 and a 12-month forecast horizon.The results are presented in Figure 1 for rolling total spillovers.
Concerning oil-and energy-exporting countries, as seen in Figure 1(a), an increase in frequency is accompanied by an increase in the magnitude of overall connectedness.It is observed that in the short-term (band 3.14 to 0.79), the fluctuation is between 10% and 20%; in the medium-term (band 0.79 to 0.26), it is between 1% and 15%; and it fluctuates between 1% and 12.5% in the long-term (band 0.26 to 0.00).The return spillovers, however, exhibit some situations of sharp contagion at different frequencies.For instance, in the short term, an episode of a sharp increase in spillovers to about 60% was observed around 2001, which may be due to the 2000 global recession.In the medium term, a similar incident was recorded between 2000 and 2001 at about 18%.In band 3 (0.26 to 0.00), which represents the long-term, there were upward changes in spillovers from 5% to about 12.5% between 1998 and 2000.The sharp changes in the short-and medium-terms were very steep but short-lived; however, those in the long term persisted for a while, though not as high as those in the short-and medium-terms.
For gold and metal exporting countries (Figure 1(b)), we observe increasing frequency with increasing overall connectedness.The fluctuation in the spillovers was between 30% and 85% in the short term, between 5% and 20% in the medium term, and between 1% and 15% in the long term.Strangely, no episode of connectedness or contagion was recorded between 1990 and 1997 or between 2012 and 2018 at all frequency bands.This is an exhibition of the "decoupling hypothesis" between gold returns and exchange rates for metal-producing countries.However, 1997 witnessed sharp upward return spillovers for all frequencies, though different in magnitude.The increases were 75% for band 1, 21% for band 2, and 13% for band 3.Then, around 2001, another sharp change occurred, but this time in different directions at different frequencies.For instance, while band 1 recorded a steep increase in spillover episodes to about 90%, bands 2 and 3 had a sharp downward trend to 2.5% and 1%, respectively.This period was characterised by what was called the "Brown Bottom" (the sale of about half of the UK's gold reserve), which had a massive impact on gold prices (Maund, 2007).Shifting attention to Figure 1(c), which relates cocoa to agricultural exporting countries, similar observations to (a) and (b) were made.Following increasing magnitude in overall relation to increasing frequency, the average fluctuations were between 35% and 60% for band 1, 10% to 20% for band 2, and 22% for band 3. Concerning band 1 (3.14 to 0.79), a sharp upward contagion incidence was seen in 2004 and 2007, with 68% and 60%, respectively.In Band 2, there was a sharp increase in spillovers to about 50% in 2001.But while the situation in bands 1 and 2 was mainly one-off events, several episodes of sharp increases occurred in the long term (band 3) between 1998 and 2008, with the highest of about 26% happening around 2002.
All in all, the strength of contagion is higher in the short-term than in both the medium-and longterm for all commodities when time variation is considered.Again, an interesting observation is that contagion is short-lived in many instances.This may be a result of lessons learned from the previous commodity price collapse in the late 1980s and early 1990s, which prepared many countries in the sub-region to manage it better.Worth mentioning is the fact that many of the contagion episodes occurred during or just after the crisis period.For instance, the energy-exporting countries recorded contagion of about 60% around 2001, and in the same period, both metal-exporting countries and food and agricultural-exporting countries recorded contagion of about 90% and 50%, respectively.These occurrences were most likely a result of the recession that hit many developed nations between 2000 and 2001 as well as the delayed effects of the Asian financial crisis, which had an impact on global commodity trade.The 2007-2009 global financial crisis and the Eurozone crisis also produced similar episodes of contagion.It is safe to say that the results here have an element of delayed contagion based on spillovers coming after a crisis moment.Also, there are instances of a sudden change in spillovers, which is also in line with the "shift contagion hypothesis" and the "decoupling hypothesis," which show up at some point specifically between gold returns and exchange rates.This study, however, demonstrates that contagion in the currency markets in SSA is frequency-varying.
In summary, the results point to some important lessons that policymakers must consider.It is clear from the results that there is always a danger posed by the immediate aftermath of a commodity price crisis or financial crisis, which must be a concern.However, there are instances where spillovers were delayed or prolonged, as happened after the 2007-2008 financial crisis and the Eurozone recession.There is therefore the possibility of delayed spillovers from an extreme event, which should not be ignored.The results also point to the fact that connectedness is not just time-dependent but also frequency-dependent.But the strength of dependence is higher at the higher frequencies than at the lower frequencies, though the persistence is greater at the lower frequencies.This suggests that diversification between commodities and the exchange rate of commodity-producing countries in SSA will be more beneficial in the long-and medium-terms than in the short-term due to the strong interdependence.

Robustness analysis
We check the robustness of return spillover between commodities and exchange rate using wavelet multiple cross-correlation (WMCC) proposed by (Fernández-Macho, 2012) which capture the frequency connectedness dynamics in the relationship.Fernández-Macho (2012) define wavelet multiple correlation ϕX λ j À � À � as a single set of multi-scale correlations as follows; where P j is the (n×n) correlation matrix of W jt , and the max diag(・) operator selects the largest element in the diagonal of the argument.Based on Equation ( 13), the wavelet multiple crosscorrelation ϕX; τ λ j À � À � is estimated as: From ( 14), w ijt; is selected to maximize ϕX; τ λ j À � and the fitted values of w ij on the rest of wavelet coefficient at scale λ j À � is ŵijt .A more detail estimation procedure can be found in Fernández-Macho (2012).The results of the WMCC are presented in Figures 2a-c for oil-exporting countries, metalexporting countries and agricultural exporting countries.By convention (in heatmaps), the magnitude of contemporaneous correlations for WMCC is indicated by the scale on the right, which ascends from blue to wine in colour.The advantage of the WMCC is that it goes beyond telling correlation at various scales and also indicate the market leadership (lag) based on the dashed-lines.
The results indicate that while there is market leadership at some scales for oil-exporting countries, there is no market leadership for metal-exporting countries or agricultural exporting countries.Ghana dominates spillover propagation at the higher scale, and crude oil and Nigeria dominate spillovers at the intermediate scales for oil-exporting countries.For metal-exporting countries, South Africa is the most dominant propagator of spillovers but has no market leadership, followed by Namibia.Comoros dominates spillover propagation, although it has no market leadership, followed by Cote d'Ivoire.The results of the WMCC are therefore quite similar to those of BK18.

Conclusion and recommendations
The study focused on the connectedness and contagion between commodity prices and exchange rates in commodity-exporting countries in Sub-Saharan Africa (SSA).The extant literature has concentrated on spillovers among stock markets and commodities in developed and emerging markets, with little emphasis on developing countries like those in SSA.This study concentrated on the returns of commodities and the exchange rate as the origin of contagion and thus emphasised the role of cross-sectional correlation in the origin of connectedness.
In this study, monthly log-return series for crude oil, gold, and cocoa were computed, as were the ERs of five energy-exporting countries, 13 metal-exporting countries, and 13 agriculturalexporting countries.Commodities are used as propagators of spillovers.Spillovers in the system were captured in the static frequency domain (BK18) and the time-varying frequency domain (BK18).
The findings of the study show that there are differences in spillovers and contagion for different commodities.Additionally, when frequency levels rise, connectedness rises as well, and short-lived outbreaks of contagion eventually give way to dependency.The results also revealed that in the medium-to long-term, within-connection levels are lower than in the short-term, so diversification advantages can be realised from both static and time-varying perspectives.
There is no clear evidence from the results of the study that the exchange rates of large commodity-exporting countries are the dominant propagators of spillovers.We also found that gold and cocoa do not dominate spillover transmission to exchange rates in Sub-Saharan Africa, although oil returns and cocoa returns are net transmitters of spillovers to oil-exporting countries and agricultural-exporting countries, respectively.Surprisingly, gold returns happen to be a net receiver of spillovers, with the exchange rates of South Africa, Namibia, and Botswana (all southern African countries) dominating spillover transmission among the metal-exporting countries.Oil returns were dominant among oil-producing countries, while Comoros and Cote d'Ivoire dominated the agricultural-producing countries.Further, Mauritania and Nigeria have a passing contagious association with oil returns in the net's pairwise directional connectedness.The same can be said for South Africa's gold returns and the Comoros' cocoa returns.
Since the study concentrated on contagion and connectedness between commodities and exchange rates, the findings are significant for improving portfolio diversification, risk management,

Note: Dashed-lines indicate localisations
and the stability of the financial market.Policymakers should thus understand and monitor the connection between these markets and their interaction with global shock factors for effective decision-making.Again, instead of focusing on external shocks from commodities, policies aiming to reduce the impact of external shocks on exchange rates should rather be heavy on other commodity-producing countries' exchange rates.This stems from the fact that shock propagation is stronger in the currency markets of other exporting countries than global commodities.Also, when it comes to how return shocks spread, policymakers should look at the exchange rates of both small and large commodity-producing countries since there is no large country dominance in the study.
From the perspective of investors, there is a need to understand the dynamic connectedness for possible portfolio diversification and hedging strategies.To this end, investors seeking to create a new portfolio can combine investments in gold and the currencies of metal exporting countries due to the weak connection between these assets.Investing in cocoa can also provide a good hedge against the currencies of cocoa exporting countries at low to medium frequencies due to the low shock spillovers from cocoa to those currencies.
In general, this study demonstrates that not only does contagion in the currency market shift or delay, it is also time-frequency dependent.For the energy exporting countries (EEC) and agricultural exporting countries (AEC), decoupling is rejected but partially accepted in the metal exporting countries (MEC).The study has therefore examined the "decoupling hypothesis" in the currency market of CEC in SSA, which was not previously done.This is new evidence that is critical for hedging and risk management decisions, as well as portfolio diversification strategies, for commodity exporting countries that are also commodity dependent.In line with the HMH, policy and investment decisions in SSA's currency market should take into account the short-, medium-, and long-terms.This is because different factors may affect the movement in each time frame.
Finally, although the shape behaviour of contagion was not described in this study, Owusu Junior et al. (2020) indicated that there is a "shape shift" in contagion among stock markets.By focusing on the higher moment, the strength of contagion between individual commodities and the exchange rate may change, which can also provide an additional source of diversification.As a result, this research can be expanded by comparing contagion at higher levels in commodity-dependent SSA countries.

Figure
Figure 1.Overall rolling spillovers between commodity prices and exchange rate of Sub-Saharan African countries.(a) Oil and exchange rate, (b) Gold and exchange rate, (c) Cocoa and exchange rate.

Table 3
(Tiwari et al., 2019) return spillovers from commodity/country j to other countries.Absolute from measure return spillovers from other countries to commodity/country j. b Within to measure return spillovers from commodity/country j to other countries, including from own innovation to commodity/country k.Within from measure return spillovers from other countries to commodity/country j, including from own innovation to commodity/country k(Tiwari et al., 2019).The three largest contributors to spillovers are in bold for all frequencies.

Table 4
a Absolute to measure return spillovers from commodity/country j to other countries.Absolute from measure return spillovers from other countries to commodity/country j. b

Table 5
Absolute to measure return spillovers from commodity/country j to other countries.Absolute from measure return spillovers from other countries to commodity/country j. b