1 Introduction

A dominant commodity in the international market is crude oil, this commodity has for a long time been regarded as a foreign exchange earner to oil-producing economies. Membership report of the Organization of Petroleum Exporting Countries (OPEC) reveals that oil production contributes around 85% and 86% of total export value for Algeria and Nigeria, respectively (OPEC, Annual Statistical Bulletin 2019). This is also true for Egypt and Gabon with oil production accounting for 23% and 84% of its total export (United Nation Statistical Division-Commodity Trade 2018). Thus, making crude oil the prime foreign exchange earner for these African economies.

One key identified external factor that causes distortion in the designed path of oil-dependent economies is oil price shock. Variations in oil supply or demand may result in fluctuations in oil prices. In other words, oil price shocks which is the direct result of alteration in market fundamentals are categorized with respect to price fluctuations (Hamilton 1983; and Kilian 2009). The first oil shock in the 1970s suggests that oil price cycle is unpredictable and that oil prices are volatile (Dehn 2001; and Dibra 2015). Fluctuations in oil prices have implications for oil-producing countries.Footnote 1 Particularly, Mehrara and Oskoui (2007) suggest that oil price shocks are the main source of output fluctuations in oil-producing economies. As a result, several studies have drawn attention to oil price shocks as a significant source of macroeconomic instability (Hamilton 1983; Mork 1989; Cunado and de Gracia 2003; Jimenez-Rodriguez and Sanchez 2004; Hamilton 2005 and Mehrara and Oskoui 2007).

For example, Brent price fell drastically from $94 in June 2014 to $59 at the close of the fourth quarter, the dwindling price persisted and stood at $29.78 per barrel in January 2016 (US Energy Information Administration 2019). It implies that there were periods when oil price was high and high income accrued to oil-exporting countries during after which the countries later experienced lower income resulting from falling oil price. Following the oil price plunge in these years, we observe an adverse effect on output in many oil-producing African countries. GDP annual growth rates fell from 4.7 to 2.99% and 4.31 to 3.88% for Angola, and Gabon, respectively (World Bank 2017). Given the dependent nature of these economies on crude oil, we suspect that GDP declines are associated with global oil price nosedive. This same pattern was observed in Nigeria, output growth fell by 1.1% at the end of the last quarter in 2015, in the first quarter of 2016 it fell to −1.2%, this trend continued till the end of the third quarter (National Bureau of Statistics (NBS) 2016). In Nigeria, this negative growth was also associated with a hike in inflation,Footnote 2 with average annual inflation of 15. 69% in 2016 (World Bank 2017).

Similarly, currency devaluation can further reduce the revenue accrued to the oil producers when the oil price falls. Evidently, with a 55% plunge in oil price in 2016, central banks of oil-exporting African countries were forced to devalue their local currencies against the US dollar. For example, in Algeria, the local currency fell from about 90dinar to $1 to 111dinar to $1. For Angola, the currency depreciated from 115kwanza to $1 to 335 kwanza to $1, the Egyptian pounds were also devalued from about 9pound to $1 to 12pound to $1, a condition stipulated by International Monetary Fund (IMF) to obtain a loan to salvage the deteriorating economy. Even though Nigeria sits as the largest producer in the region, the scarcity of dollar severely affected the economy and triggered a currency float, leading to a currency devaluation from N155: $1 to N360: $1 (IMF 2017).

Oil-exporting African economies are too insignificant to influence oil prices as the interplay of demand and supply on the global scene dictates the price. Organization of Petroleum Exporting Countries (OPEC) annual report submits that seven of its’ fourteen member countries (Algeria, Angola, Congo, Equatorial Guinea, Gabon, Libya and Nigeria) are situated in the African continent, collectively, they produce only about 20% of the total oil supplies in the cartel (OPEC, Statistical Bulletin 2017). This is in contrast with what is obtainable from the Middle East and Central America oil producers with older wells, which of course has great implication for oil-producing African countries. For example, in the phase of dwindling oil prices, oil-exporting African countries are unable to increase oil supplies to keep oil income relatively stable because they operate at near capacity. However, Saudi Arabia- defacto leader usually increase oil production to the tune of oil price declines such that the accruable oil revenue is stable over time (Mohaddes and Pesaran 2016).

Given the reliance of African countries on oil revenue for growth and development, the increasing need for energy resources globally, the production capacity of oil-producing African economies and the incessant interruption in global oil supply, oil price shocks have important implication for growth and aggregate economic stability of oil-exporting African countries.

Several studies have investigated the impact of oil price shocks on macroeconomic performance. With respect to African economies, Wakeford (2006); Akpan (2009); Bouchaour and Al-Zeaud (2012); and Ogunyiola (2015) have investigated the impact of shocks on individual African economies. Other studies have comparatively considered the impact on oil-exporting African countries Olomola and Adejumo (2006), Olomola (2007); Oyelami and Olomola (2016) Rotimi and Ngalawa (2017); Salisu and Akanni (2018) and Olayungbo (2019). However, most of these studies have adopted the Standard vector auto regression (VAR) propounded by Sims (1980) with the exception of Oyelami and Olomola (2016) and Olayungbo (2019) which applied the global VAR developed in Esfahani et al (2011). Particularly, Oyelami and Olomola (2016) limited their study to Nigeria and used only four trading partners such as United States (US), European Union (EU), China and Japan. On the other hand, Olayungbo (2019) examined the spillover effects of the China and US trade war on six selected African countries with only China and US as the trading partners.

This study employed the GVAR model to investigate the asymmetric effects of oil price shocks on the economies of four selected oil-exporting African countries. Thus, making our paper closely related to relevant previous global VAR studies like Esfahani et al. (2011), Mohaddes and Raissi (2015), Mohaddes and Pesaran (2017) and Mohaddes and Raissi (2018). The global VAR model accounts for the interdependencies nature of economies. In addition, oil price is a global commodity whose prices are determined by the economic activities of advanced and emerging countries, and GVAR analysis is a better econometric tool to capture such global effects. And with the GVAR, both the positive and negative (asymmetric) oil price shocks on oil-exporting economies are estimated. Also, GVAR modeling allows us to incorporate more African trading partners such as Asia Pacific, China, Euro Area, Gulf Cooperation Country (GCC) region, Japan, Latin America, Turkey, United Kingdom (UK) and the United States (US). Incorporating larger African trading partners with their trade weights accounts for the interdependence of the selected oil-exporting African countries with the rest of the world. This portrays a more realistic model and a robust global context.

The rest of the paper is organized as follows. Section 2 outlines the literature review; Sect. 3 gives the relevant theoretical issues, and Sect. 4 provides the GVAR methodology. Lastly, Sect. 5 gives the results of the lag length selection, cointegration test, weak exogeneity test, persistence profile, generalized impulse response result and generalized variance decomposition while Sect. 6 provides the concluding remarks.

2 Literature review

Pioneering work on oil price effect was carried out by Darby (1982) and Hamilton (1983), these studies focused on the US economy. The Darby (1982) was unable to find a significant relationship between oil prices and macroeconomic variables, but Hamilton (1983) findings suggested that oil prices Granger cause changes in unemployment and GDP in the US economy. This finding thus birthed several other empirical researches on the role and impact of oil price fluctuation in macroeconomic conditions of economies. For example, Gisser and Goodwin (1986) investigated the popular notion that oil prices affects the US macro-economy using the VAR model over the period 1961Q1 to 1982Q4 for the US economy. The study found that oil price shock had significant impact on the macro-economy (unemployment, GNP and inflation) than monetary or fiscal policies. Also, the study revealed that prior 1973, inflation had a statistically significant relationship with oil prices, which became weakly significant post 1973 embargo.

Estimating the bi-variate and partial correlations within a reduced form model for seven OECD countries (the US, Canada, Japan, West Germany, France, the UK and Norway) over the period 1967Q3–1992Q4. Mork and Mysen (1994) found a negative correlation between oil price increases and GDP for most of the countries, but positive in Norway which is a large oil-producing country. The correlations with oil price decreases are mostly positive, but significant only for the US and Canada.

Similarly, Bernanke et al. (1997) investigated the role of monetary policy as an important component in the oil price–GDP relationship for the US over the period 1973–1990 using the structural vector autoregressive (SVAR) model. Evidence from impulse response showed that most of the GDP response to oil price over 1973, 1979–1980 and 1980 shock episodes would have been avoided if the Federal Reserve had maintained interest rate pre-shock level. The findings downplayed the effect of oil price shocks, but attributed the lower GDP during recessions to monetary policy.

Following from previous submissions, Brown and Yucel (1999) using a seven-variable VAR model of the US economy investigated and found that after an oil price shock, the economy responds with a reduction in real GDP while interest rates and price level increases. In line with this, the study found nominal GDP remains constant given that the decline in real GDP, and the rise in deflator are similar in magnitude thus implying monetary policy neutrality. Hence the study suggests that the US monetary policy has no role in heightening the effect of past oil price shocks.

Similarly, Hamilton and Herrera (2001) re-examined Bernanke et al. (1997) assertion using the same methodology and study period. The study found an opposite result, the impulse response suggest that monetary policy is incapable of averting contractionary consequences of oil price shocks as suggested by Bernanke et al.(1997). They demonstrated that by using longer lag length, oil shocks still led to a fall in output, implying that monetary policy plays limited role in easing the effect of oil shocks on the US economy. Hence, the study corroborating Brown and Yucel (1999) argued that counter-inflationary monetary policy is barely responsible for the recession experienced in the US during the era of oil shocks.

Using structurally integrated VAR over the period 1980–2003, Manera and Cologni (2005) investigated the direct influence of oil price shocks on macroeconomic indicators (price of oil, real GDP, interest rate, money supply, exchange rate and inflation) of the G7 countries and how the monetary authorities react to the oil price shocks to stabilize the economy. The study found that in most countries in the sample, unexpected oil price fluctuations led to inflationary pressure and a decline in GDP.

However, comparing the impact of oil price shocks in the twentieth century with that of the early twenty-first century on GDP of six developed countries (US, England, Germany, Italy, France and Japan). Blanchard and Gali (2007) adopted the VAR modeling approach covering the period 1970–2003. Evidence of a reducing effect of oil price shocks on US macroeconomic aggregates was found. Specifically, the study noted that the relationship between oil price and GDP changed from negative to positive in the both eras, respectively.

Berument et al. (2010) investigated the consequence of oil price shocks on sixteen selected Middle East and North Africa (MENA) countries using the VAR model over the period 1952 to 2005. The study suggested that in oil prices fluctuations did not have a statistically significant impact on the outputs of oil-importing countries (Bahrain, Djibouti, Egypt, Israel, Jordan, Morocco and Tunisia). Whereas, oil price increase had a positive and statistically significant effect on output in oil-exporting countries (Algeria, Iran, Iraq, Kuwait, Libya, Oman, Qatar, Syria and the United Arab Emirates).

In Nigeria, Iwayemi and Fowowe (2011) examined the impact of oil shocks on the Nigerian economy. Using different measures of linear oil price shocks, the Granger-causality tests, impulse response functions, and variance decomposition analysis all showed that different measures of oil shocks have no impact on output, government expenditure, inflation and the real exchange rate. The study supports the existence of asymmetric effects of oil price shocks as a decline in oil prices significantly affects output and the real exchange rate.

In a bid to account for differences in oil demand and supply, Cashin et al. (2014) employed a set of sign restrictions on the GVAR model to investigate the differential effect of demand shocks and supply shocks on the global economy using a sample of 36 countries for period 1979Q2–2011Q2. The study revealed that understanding the underlying cause of the shock is crucial to determining the macroeconomic effect for net-importers and net-exporters. For the case of oil price shock driven by supply shortage, oil exporters experience positive effect on economic activity but net-importers experience long-lived negative economic effect. Whereas, oil price shock resulting from demand, both net-exporters and net-importers experience increase in real GDP and inflationary pressure.

Considering the international linkage between the Nigerian economy and her trading partners, Oyelami and Olomola (2016) examined the effect of external shocks (oil price shocks and macroeconomic shock) on the Nigerian economy to underscore the pattern of reaction to shocks. The study employed the GVAR approach for the period 1986–2014, data of bilateral trade with developed trading partners (US, EU, China and Japan) were used in constructing the foreign variables. The study found that GDP and exchange rate responded to oil shocks while inflation and short-term interest rate responded to macroeconomic shocks from the developed trading partners.

However, Mohaddes and Pesaran (2017) quantified the effect of oil prices on the global economy for the period 1946M6–2016M6 using the GVAR model developed by Mohaddes and Pesaran (2016). The study suggested that oil prices decline reduced interest rate and inflation in most countries but increases real equity prices and output in the long-run for the global economy. Olayungbo (2019) employing the GVAR model for data ranging from 1970 to 2017 projected impact of the US-China trade war on Algeria, Angola, Egypt, Gabon, Nigeria and Tunisia which are oil-exporting African countries. The generalized impulse response functions (GIRF) revealed that the effects of foreign GDP shocks were positive and persistent for all the selected countries due to the trade relation between the selected countries and the powerful entity (US and China). Furthermore, in a more recent paper, Chudik et al. (2021) used a threshold-augmented dynamic multi-country model to measure the macroeconomic effects of the COVID-19 pandemic from the period 0f 1979Q2 to 2020Q4 for advanced and emerging economies. The result of the study showed smaller impact of the pandemic on China and other emerging Asian countries while deeper and long-lasting effects were found for the United Kingdom and other advanced economies. The counterfactual result showed that the pandemic could reduce the world real GDP by 3 percent. Finally, Ahmadi and Manera (2021) investigated the reactions of 3 major net oil-exporting countries which are Canada, Norway and Russia to oil price shocks using nonlinearity and asymmetry effects. The threshold structural VAR estimation showed little evidence of asymmetric response of output to asymmetric oil price shocks. The study is done for the 3 individual countries without considering the multi-country effects of their trading partners.

3 Theoretical issues

The first theoretical issue of oil as a resource is resource curse theory propounded by Auty (1993). The theory argues that endowment of natural resources is expected to generate positive impacts on the welfare of the citizens of the resource-endowed country. The theory emerged in the 1950s and 1960s when low- and middle-income countries blessed with natural resources were unable to use their resources to improve their economy. In other words, the theory explains a situation whereby availability of resource has a neutral or negative effects on societal welfare. Countries with non-renewable resource wealth face both an opportunity and a threat. When these resources are used well, these resources can create greater prosperity for current and future generations, and when used poorly, or squandered, they can cause economic instability, social conflict and lasting environmental damage. This is the dilemma of many oil-exporting African countries.

The second theory is oil price volatility. Volatility can be described as anything that is changeable. The more a variable fluctuates over a period of time, the more volatile the variable. With regards to this study, volatility argument is anchored on the fact that revenue from natural resources especially oil is volatile and it fluctuates with respect to market fundamentals which directly affects oil prices. Every year government of oil-producing nations plan the budget on a benchmarked price based on oil price projections. With sharp fluctuations in oil prices, a resulting positive or negative fiscal imbalance surface arising from either shortages or excess of revenue overestimated budget.

Another theory is the Keynesians’ argument on business cycle theory “General Theory of Employment, Interest and Money” postulated by Keynes (1936), this theory was a synthesis of economic, psychological, sociological and monetary studies. Keynes advocated that aggregate demand plays a key role in determining the macroeconomic conditions such as: employment, output, inflation. The theory argued that an increase in total investment and expenditure on products and services leads to an increase in production. With an increase in production, output increases, employment level improves. However, when aggregate demand is low, the level of production will be less leading to a fall in output, employment and consumers income.

In relation to the global oil market, the theory points out that fluctuations in oil prices have resulted in boom and bust in world and regional economies. In regards to the US, four basic explanations underscore how fluctuating oil prices accounts for business cycle, these are classic supply shock, a development in financial markets, real balance effect and income transfers (Brown et al. 2003). The classic supply shock theory argues that scarcity of oil leads to oil price hikes which in turn reduces output. In production, the resultant effect of oil price hikes is rationing of oil input, which leads to reduction in labor productivity and adversely affects output. On the other hand, the reduction in labor productivity leads to a reduction in real wage rate and increases unemployment rate. Additionally, oil price surge leads to a transfer of income from oil-consuming economies to oil-producing economies. However, income flows in the reverse direction when oil price falls. This trend is possible as increases in oil prices leads to an increase in purchasing power and consumer demand in oil-exporting countries. However, income transfers from oil-exporting to importing countries in the phase of oil plunge leads to a reduction in aggregate demanding which affects spending and places a downward pressure on price level.

3.1 Data sources and variable definition

This study utilized quarterly data over the period of 1980–2018 in order to examine the effects of oil price shocks on the output performance of the four selected oil-exporting African countries such as Algeria, Egypt, Gabon and Nigeria representing Central Africa, North Africa and West Africa. These selected African countries rely on oil revenue to sustain their economies. Although, this study initially considered the inclusion of some other oil-exporting African countries like Libya and Angola due to their abundance of oil reserve and the volume of oil production in the region. However, missing and unrecorded data prevented their inclusion.

For the four selected African countries, three endogenous variables were considered which are: real gross domestic products, consumer price index and the exchange rate of country i at time t in US dollars. In the same vein, three foreign variables were employed in the model which were tested and treated as weakly exogenous. Also, this study employed a global variables of oil price. The Brent oil price used is oil price per barrel priced in dollar term. The oil price is a global variable treated exogenously for the selected African countries. With the exception of none, all itemized macroeconomic and financial variables have been widely employed in similar studies on a global level. (Cashin et al. (2014); Mohaddes and Raissi, (2015, 2018). The summary of the sources of data and description of measurement of variables are presented in Table 1.

Table 1 Summary of Sources of data and definition of variables. Sources International Financial Statistics (2020), World Development Indicator (2020), British Petroleum statistics OPEC (2020) and IMF’s Direction of Trade Statistics Database (2020)

4 Methodology

The GVAR model in this study consist of endogenous four country-specific VARX* models. In each of the VARX* models, the country-specific variables are related to a deterministic variable such as time trend (t) and a set of country-specific foreign variables. Also, the order of the individual country VARX*(\({p}_{i}, {q}_{i}\)) model, where \({p}_{i}\) denotes the lag order of the endogenous (domestic) variables, and \({q}_{i}\) denotes the lag order of the exogenous (foreign) variables. In the country-specific model for the sampled countries, we chose 3 endogenous and exogenous variables due to data availability. The endogenous variables employed are (\({y}_{t}, {\pi }_{t}, {e}_{t}\)) while the foreign variables are (\({y}_{t}^{*}, {\pi }_{t}^{*}, {e}_{t}^{*}\)) representing foreign GDP, inflation and exchange rate, respectively, following the works of Mohaddes and Pesaran (2017). However, in their study, 5 foreign variables such as foreign equity, foreign output, foreign inflation, foreign exchange rate, US short-run interest rate, and US long-run interest rate were used.

Following the GVAR model of Mohaddes and Pesaran (2015; 2018); the study considers N countries indexed by i = 1,…, N. The country-specific VARX*(1, 1) models can be written as:

$$ X_{it} = \alpha_{i0} + \alpha_{i1} + \varphi_{i} X_{i,t - 1} + \Lambda_{i0} X_{it}^{*} + \Lambda_{i1} X_{i,t - 1}^{*} + \mu_{it} $$
(1)

With t = 1, 2,…, T and i = 1, …, N.

Where \({\text{X}}_{{{\text{it}}}} = {\text{k}}_{{\text{i}}} \times {1}\) vector of country-specific variables and \({\text{X}}_{{{\text{it}}}}^{*} = {\text{k}}_{{\text{i}}}^{*} \times {1}\) vector of foreign variables specific to the country i. \(\Lambda_{i0} \,and\Lambda_{i1}\) are \(k_{i} \times k_{i}^{*}\) matrices of coefficients related to the contemporaneous and lagged foreign variables, respectively. \(\alpha_{{0}} = {\text{k}}_{{\text{i}}} \times {1}\) vector of fixed intercept, \({\alpha }_{i1}= {k}_{i}\times 1\) vector of coefficients of the deterministic trend and \(\mu_{\,it}\) is a \({\text{k}}_{{\text{i}}} \times {1}\) vector of country-specific shocks which is assumed to be serially uncorrelated with zero mean and a non-singular covariance matrix.

$$ {\text{i}}.{\text{e}}.\quad \mu_{it} \sim i.i.d.(0, \Sigma_{ii} ) $$
(2)

However, it is assumed that there is an inter-country correlation among the idiosyncratic shocks.

$$ {\text{i}}.{\text{e}}.\quad E\left( {\mu_{it} \mu^{\prime}_{{jt^{\prime}}} } \right) = \left\{ {\begin{array}{*{20}c} {\Sigma_{ij} } \\ 0 \\ \end{array} \,\,\,\,\,\,\,\,\,\,\begin{array}{*{20}c} {for\,t = t^{\prime}} \\ {for\,t \ne t} \\ \end{array} } \right. $$
(3)

From the above specifications, the construction of the GVAR model allows for the interactions among the different countries through three separate but interrelated channels: (1) the contemporaneous interaction of country-specific domestic macroeconomic variables, Xit with country-specific foreign variables, \({\text{X}}_{{{\text{it}}}}^{*}\) and with their lagged values; (2) the contemporaneous dependence of shocks in country i on the shocks in country j as indicated by the cross-country covariance \(\Sigma_{ij}\), where \(\Sigma_{ij} = {\text{cov}} \left( {\mu_{it} ,\mu_{jt} } \right) = E\left( {\mu_{it} \mu^{\prime}_{{jt^{\prime}}} } \right)\,\,\,\,\,\,for\,i \ne j\).

Each country VARX* model is estimated individually, treating \({\text{X}}_{{{\text{it}}}}^{*}\) as weakly exogenous I (1), to ensure consistency of parameter estimates. Assuming the weak exogeneity of the foreign variables implies that each oil-producing country is treated as a micro-entity: in other words, its activities cannot affect the global oil supply, at least in the long-run.

To measure the foreign variable, trade weights of a country which is calculated as cross-sectional averages of the domestic variables using data on bilateral trade as the weights. The choice of bilateral trade weights, over financial weights, is that the former is an important determinant of national business cycle fluctuations (Mohaddes and Pesaran 2017).

$$ y_{it}^{*} = \sum\limits_{j = 1}^{15} {w_{ij} } y_{jt} $$
(4)

where i = 1, 2, …, 4 and j = 1, 2, …, 32. Country organized into 11 trading blocs, i refers to Algeria, Egypt, Gabon and Nigeria, and country j comprises of 11 trading blocs (Africa, Asia Pacific, China, Euro area, GCC region, Japan, Latin America, Turkey, UK, Canada and the US which comprises of 32 countries). The 11 trading blocs are made up of 32 countries (See Table 6 in Appendix). The trading partners represent close to 90% of the world trading partners of the selected oil-exporting African countries (IMF Direction of Trade 2020). The trade weights of the trading partners are also presented at the Appendix. (See Table 9). Unlike most of the GVAR papers that treat each of these countries individually, we follow the Allegret et al. (2015) which aggregated countries according to region. Thus, our GVAR model consists of the four focus countries, their five (5) trading regions (Latin America, Gulf, Africa, Asia and Europe) and six (6) keyFootnote 3 trading partners (Canada, China, Japan, Turkey, US, UK) which are treated as standalone. This implies that our study incorporates 11 blocs.Footnote 4 Hence, data gathering, computation and analysis strictly follow this arrangement.

The \({w}_{ij}\) refers to the bilateral share of trade between country i and country j, which is calculated as a three-year average to reduce the impact of individual yearly movement, while \({y}_{jt}\) is the average log of GDP of country i’s trading partner at time t. The study intends to compute the weights using trade in 2013, 2014 and 2015 as this captures a period of normalcy before the countries experienced recession in 2016.The trade weights were computed as:

$$ w_{ij} = \frac{{T_{ij,2013} + T_{ij,2014} + T_{ij,2015} }}{{T_{i,2013} + T_{i,2014} + T_{i,2015} }} $$
(5)

where \({T}_{ijt}\) is the bilateral trade between country i and country j at time t and is calculated as the average of exports and imports of country i with j. \({T}_{it}\) is the total trade of country i at time t = 2016, 2017 and 2018. Which can be written compactly as

$$ T_{it} = \sum\nolimits_{j = 1}^{15} {T_{ijt} } $$
(6)

In addition to the domestic and foreign variables, the GVAR model also contains global variable. This is the global oil price i.e., \(d = (p_{t}^{0} )\). This global variable is the third interactive channel in the GVAR model. In considering the macroeconomic effects of oil price shocks on the macroeconomic indicators of the sampled countries, we also include nominal oil prices (US dollars) in the country-specific VARX* models. Following the literature, the oil price equation is a model in oil prices past value (\(p_{t - 1}^{0}\)) and real income \((y_{t} )\) with all variables being in logs.

$$ p_{t}^{0} = c_{p} + \varphi_{1} p_{t - 1}^{0} + \alpha_{1} y_{t - 1} + \mu_{t}^{0} $$
(7)

Given that the economies under study are insignificant to affect global oil prices. The global variables \(d = (p_{t}^{0} )\) is treated exogenously for all the endogenous five African countries. Hence, augmenting the country-by-country VARX* Eq. (1) with the global variables we have the GVAR model given as

$$ X_{it} = \alpha_{i0} + \alpha_{i1} t + \Phi_{i} X_{i,t - 1} + \Lambda_{i0} X_{it}^{*} + \Lambda_{i1} + {\text{X}}_{i,t - 1}^{*} + \Gamma_{i0} d_{t} + \Gamma_{i1} d_{t - 1} + \mu_{it} $$
(8)

To solve the model, consider the VARX* model of the country-specific model without the global variables, we, therefore, group the domestic and foreign variables as \({Z}_{it}=\left( {X}_{it}^{^{\prime}}, {{X}_{it}^{*}}^{^{\prime}}\right).\) Hence, the country-specific model could be written as:

$$ A_{i} Z_{it} = a_{i0} + a_{i1} t + B_{i} Z_{i,t - 1} + \varepsilon_{it} $$
(9)

where \(A_{i} = ({\rm I}_{ki} ,\Lambda_{i0} ),B_{i} = (\Phi_{i} ,\Lambda_{i1} )\) and \(B_{i}\) are \(K_{i}\)\(\times (K_{i} + K_{i}^{*} ),\) and \(A_{i}\) has a full row rank, such that rank \((A_{i} ) = K_{i}\).

Collecting all the country-specific variables in the k × 1 global vector as:

$$ X_{it} = (X_{0t}^{^{\prime}} ,X_{1t}^{^{\prime}} ,X_{Nt}^{^{\prime}} )^{^{\prime}} $$
(10)

where \(k = \sum\nolimits_{i = 0}^{N} {K_{i} }\) the total number of the endogenous variables, the country-specific variables can be written as:

$$ Z_{it} = W_{i} x_{t} ,\;{\text{with}}\;i = 0,1,2,...,N $$
(11)

\(W_{i}\) is a (\(K_{i} + K_{i}^{*}\)) X \(K\) country-specific link matrix constructed on the basis of trade weights that allows the country-specific models written in terms of the global variable vector. Substituting Eq. (11) into (9), we have:

$$ A_{i} W_{i \times t} = a_{i0} + a_{i1} + B_{i} W_{i,t - 1} + \varepsilon_{it} $$
(12)

Stacking all the equations yields:

$$ G_{0} x_{t} = a_{0} + a_{1} t + G_{1} x_{t - 1} + u_{t} $$
(13)

where \(a_{0} =\) \(\left( {\begin{array}{*{20}c} {a_{00} } \\ {a_{10} } \\ {\begin{array}{*{20}c} {a_{20} } \\ \vdots \\ {a_{N0} } \\ \end{array} } \\ \end{array} } \right)\), \(a_{1} = \left( {\begin{array}{*{20}c} {a_{01} } \\ {a_{11} } \\ {\begin{array}{*{20}c} {a_{21} } \\ \vdots \\ {a_{Nt} } \\ \end{array} } \\ \end{array} } \right)\), \(\mu_{t} = \left( {\begin{array}{*{20}c} {\mu_{0t} } \\ {\mu_{1t} } \\ {\begin{array}{*{20}c} {\mu_{2t} } \\ \vdots \\ {\mu_{Nt} } \\ \end{array} } \\ \end{array} } \right)\), \(G_{0} = \left( {\begin{array}{*{20}c} {A_{00} W_{0} } \\ {A_{10} W_{1} } \\ {\begin{array}{*{20}c} {A_{20} W_{2} } \\ \vdots \\ {A_{N0} W_{N} } \\ \end{array} } \\ \end{array} } \right)\), \(G_{1} = \left( {\begin{array}{*{20}c} {A_{00} W_{0} } \\ {A_{11} W_{1} } \\ {\begin{array}{*{20}c} {A_{21} W_{2} } \\ \vdots \\ {A_{N1} W_{N} } \\ \end{array} } \\ \end{array} } \right)\).

derived as

$$ x_{t} = b_{0} + b_{1} t + f_{1} x_{t - 1} + \varepsilon_{t} $$
(14)

where \(f_{t} = G_{0}^{ - 1} G_{1}\), \(b_{0}\) = \(G_{0}^{ - 1} a_{0}\), \(b_{1} = G_{0}^{ - 1} a_{1}\) and \(\varepsilon_{t} = G_{0}^{ - 1} \mu_{t}\).

The dynamic properties of the GVAR model in Eq. (14) is analyzed using the generalized impulse response functions (GIRF) and the generalized forecast variance error decomposition. The impulse response and the variance decomposition can be expressed with the covariance matrix \(\sum\nolimits_{\varepsilon } { = E(\varepsilon_{t} ,\varepsilon_{t}^{^{\prime}} )}\) in Eq. (14).

5 Empirical analysis and discussion of results

Most time series variables are not always stationary. Estimating non-stationary variables may lead to spurious regression which cannot be used for precise prediction, and sound inferences cannot be drawn (Gujarati 2004). In this study, the Augmented Dickey-Fuller (ADF) test and Weighted Symmetric (WS) were done for the domestic variables (GDP, inflation and exchange rate), foreign variables (US inflation rate and the dollar exchange rate) and the global variable (oil price). We found all the series to be non-stationary for the domestic, foreign and global variable. We therefore proceeded to the lag length selection which is crucial to the cointegration test.Footnote 5 Due to space constraints, the results of the unit root are not presented in this paper.

5.1 Lag length selection criteria

The selection of an appropriate lag length is as important as determining the variables to be included in a model. With inadequate lag length, a model may be mis-specified thus fail to generate appropriate residual that tend toward the white noise process. Nevertheless, including too many unnecessary lags means a loss of data needed for estimation, loss of degree of freedom, and may generate statistically insignificant result and multi-collinearity. All these problems necessitate the need to determine the optimal lag length before the test for cointegration in order to avoid any of the highlighted problems. For this study, the lag of the domestic (p) and foreign variables (q) for each country-specific VARX* models were selected using the Akaike Information Criterion (AIC). The maximum lags of two and one were allowed for the domestic and foreign variables, respectively. Which represents a (1, 1) or (2, 1) lag length combination. The decision rule is based on which lag length combination reports a minimum AIC value. Strictly following the decision rule, we observe that the test produced varied results with a mix of VARX* (2, 1) and VARX* (1, 1). Specifically, From Table 2, the criterion chose a VARX* (2, 1) for all except countries except China, Egypt and United States which chose VARX* (1, 1) model. Also, for the serial correlation test on the residuals of the individual country models, a lag order of four was specified as recommended by Smith and Galessi (2014) for quarterly series.

Table 2 Choice Criteria for Order of the VARX* Models Together with Corresponding Residual Serial Correlation F-Statistics

5.2 Cointegration test

The model used for the cointegration test consists of three endogenous and foreign variables for each country. Except for the US, the endogenous variables in the model are domestic GDP, domestic inflation and exchange rate while the foreign variables in the model are the foreign GDP, foreign inflation and the oil price. For the US, the domestic variables comprise of domestic GDP; inflation and oil price while foreign GDP; foreign inflation and foreign exchange rate are modeled as foreign variables. Oil price is modeled as endogenous for the US because the country is the world leading consumer of crude oil and as such US demand for crude oil affects the oil price. The GVAR model estimation is done based on the number of cointegrating vectors in the individual VARX* model as specified by the trace statistics using AIC lag selection criterion. The dimension of the cointegration space for the country-specific models is determined by the results of the Johansen’s maximum eigenvalues test statistics and the trace statistics in comparison with the critical values of the trace statistics test at 5% level of significance. The critical values of the models which also includes the weakly exogenous variables are obtained from Mackinnon et al. (1999). Depending on the rank specified for each of the country, if the trace statistics is less than the trace critical value then we cannot reject the null hypothesis of cointegrating relations. Accordingly, with a maximum of three endogenous variable for each country, the test reports that there are two cointegrating vectors in Algeria, Asia, Egypt, China, Gulf and Turkey, while Africa, China, Gabon, Japan, Nigeria, UK and the US all have one cointegrating relations, but Euro area and Latin America have no cointegrating relations. Table 3 shows the results of the cointegration test. Hence, model one which relates the effect of oil price shocks on output, inflation and exchange rate for these countries has forty-five (45) endogenous variables, which contains nineteen (19) cointegrating relations and twenty-six (26) stochastic trends (unit roots). Given that the GVAR comprises of both cointegrating and non-cointegrating vectors, a vector error correction models and vector autoregressive models are estimated, respectively, for the countries (regions).

Table 3 Detailed Cointegration Result at 5% level of Significance

5.3 Weak exogeneity test

The estimation of country-specific models is based on the assumption that foreign variables are weakly exogenous with respect to the long-run parameters of the model. The assumption implies that there is no long-run feedback from the endogenous variables to foreign variables, though this does not rule out the contemporaneous and lagged short-run feedbacks between the two sets of variables. For this study, the lag of the domestic (p*) and foreign variables (q*) for each country-specific VARX* models were selected using the Akaike Information Criterion (AIC). The maximum lags of two (2) were allowed for both domestic and foreign variables, which suppose a (1, 1); (1, 2); (2, 1) and (2, 2) choice combination. The decision rule is based on which lag length combination reports a greater AIC test statistics for each country (region). Also, for the serial correlation test on the residuals of the individual country models, a lag order of four was specified as recommended by Smith and Galesi (2014) for quarterly series. To this end, Table 7 shows the choice criteria for selecting the order of the weak exogeneity regression together with its corresponding residual serial correlation F-statistics. Strictly following the decision rule, we observe that the test produced varied results with a mix of VARX* (2, 2), VARX* (1, 2) and VARX* (1, 1) lag selection. Table 7 presents a compact summary of the optimal lags chosen for the weak exogeneity regression. The criterion chose a VARX* (1, 1) for the US and Algeria, VARX* (2, 2) for Africa, Euro and Gulf and VARX* (1, 1) for other countries (regions) in the model.

Table 4 Generalized forecast error variance decompositions of negative oil price shocks for output (Explained by conditioning on contemporaneous and future innovations of the country equations)

In the same vein, following Dees et al. (2007), the weak exogeneity test was performed using joint F- significance test of the estimated error correction terms for the country-specific foreign and global variables. We cannot reject the null hypothesis of weak exogeneity for each country’s global and foreign variable if F-statistics is less than the F-critical values at 5% level of significance. From the results in Table 4, we accept the hypothesis of weak exogeneity for most of the foreign and global variables except for cases of foreign output in Canada, Japan, UK and the US, foreign inflation in Algeria and Asia and oil prices in Algeria. This implies that weak exogeneity assumption were rejected at the 5% level of significance in 7 out of 144 series which amount to only about 5% of total series used for the estimation. The results are presented at the Appendix Table 7Footnote 6.

5.4 Persistence profile

It is now important to investigate the dynamic properties of the GVAR-Oil model when the 32 individual country (i.e., the 11 trading blocs. See Table 6 at the Appendix) are combined with the oil price equation. The Persistent Profiles (PPs) reveal the time profile of the effects of variable-specific shocks on the cointegrating vectors in the GVAR model. In other words, it reveals the speed with which the long-run relations converge to their equilibrium states. If the vectors under consideration are truly cointegrating then the PPs value tends to zero as horizon tends to infinity, thereby confirming the existence of a long-run relations. In the PP analysis, we observe one of the two cointegrating vector in the Gulf Region fails to converge to zero. Implying that the number of cointegrating vector for the entire system (GVAR model) is less than the number of cointegrating vector when assessed on individual country basis. As recommended by Galesi and Smith (2014), we reduced Gulf’s cointegration relation by one, which results to a better-behaved PP. On impact, the PPs are normalized to take the value of unity, the rate at which individual PPs attain zero depicts the speed at which equilibrium correction takes place in response to oil price shocks. Figure 1 presents the PPs of the all the cointegrating vectors in the model. Focusing on the four-oil-exporting African countries as shown in Fig. 1, it is evident that they all demonstrate convergence to their equilibrium states howbeit at different speed which is evident by the differing PP slopes. Gabon and Nigeria have the fastest convergence rate which is less than eight (8) quarter while Algeria and Egypt have slower convergence. In the literature, a faster PP convergence have been observed for major oil-exporting economies (Mohaddes and Pesaran 2016), which have been adduced to relatively underdeveloped nature of money and capital market in these economies Esfahani et al. (2011).

Fig. 1
figure 1

Persistence Profile

Figures are median effects of a system-wide shock to the cointegrating relations with 95% bootstrapped confidence bounds. CV means cointegrating vector, Algeria and Egypt have 2 cointegrating vectors while Gabon and Nigeria have 1 cointegrating vector.

5.5 Generalized impulse response functions (GIRF)

We present here the response of output of the selected four African oil-exporting countries to both positive and negative oil price shocks. Crude oil is a global product that is consumed in all countries of the world. Like other commodities, its demand and supply as well as demand and supply of its substitute affect the prevailing oil price. In the past, positive oil price shocks have occurred to oil-exporting countries because of shortages in supply (1970’s); increasing demand due to industrialization and surge in global aggregate demand (early twenty-first century). On the other hand, negative oil price shocks arise from increasing supply (1980’s and 1990’s); global recession (2008); and production of Shale oil by US (2014). Panel A in Fig. 2 depicts the effects of a one standard error negative shocks to global oil prices while Panel B shows the responds to one standard error positive shocks. As observed oil prices respond significantly to these shocks. The responses are direct, showing and upward slope for a positive shock and a downward slope for a negative shock. We also observe that the magnitude of response for a positive shock is greater even in the long-run compared to response for a negative shock. The negative oil price shocks ranges from −0.2 to −0.8 while the positive oil price shocks ranges from 0.2 to 1.

Fig. 2
figure 2

One standard error negative and positive shocks to global oil price

Generally, the transmission of oil price shocks takes effect in all the countries as evident in the shape and direction of their GIRFs shown in Fig. 3. The speed of response varies across the countries, as shown from the steepness or otherwise of the slopes. In the same vein, the median lines show that output responds positively to oil price shocks. This relationship is plausible as these countries are crude oil producers and as such, any positive fluctuation in oil prices results in immediate increase in oil earnings which is evident in their domestic output. Similarly, negative shocks to oil prices simultaneously trigger immediate negative response from output. However, for Algeria, Egypt and Nigeria we observe a lagged responds to oil price shocks. The delay is more substantial in Nigeria, amounting to about six (6) quarters for both negative and positive shocks. This could possibly be owing to high production capacity of the chief earner in the region. Hence, oil revenue investment in other sector could serve as resistance to oil price shock for two or more quarters before taking a toll on the economy. Conversely, the GIRF for Gabon reveals a contemporaneous relationship, as output responds immediately to both positive and negative oil price changes. Specifically, Panel A in Fig. 3 shows the response of output to negative shocks in global oil price for the focus countries. At the earlier stage for Algeria, there is gradual decline in output amounting to only a 0.002% in the sixteenth 16th quarter, between 17th and 21st period output attains stability with almost unnoticeable response to negative shocks in oil price. Beyond this period Algeria’s output steadily decreases in response to negative shocks to oil prices. Total decline amounts to 0.003% by 40th quarter. However, this effect is significant only in the short and medium run. This significance is adduced to the 20% oil sector contribution, compared to Nigeria’s to less than 10% oil sector contribution to output (OPEC, Annual Statistical Bulletin 2019). The effective implementation of growth inducing policies could account for the insignificant decline in output in the long-run. Again, as shown in Panel B, positive oil price shocks have a significant positive increasing effect on output in Algeria. The significance is underscored by the position of the confidence bands, which lies beneath (above) the horizontal line of GIRF. From Fig. 2, we observe that the effect of oil price shock on output in Algeria is steady given the gradual slope, and also the effect is asymmetrical given oil price shock of 0.004% on output with different magnitude for both positive and negative oil price shocks. This suggests asymmetric effect of oil price shock on Algeria’s economy.

Fig. 3
figure 3

Panel A Effect of A one Standard Error Negative Shock to Global Oil Price on output (Bootstrap mean estimates after 1000 draws, 90% bootstrap error bound). Panel B: Effect of A one Standard Error Positive Shock to Global Oil Price on output (Bootstrap man estimates after 1000 draws, 90% bootstrap error bound)

Likewise, Egypt’s output response to oil price shocks is significant throughout the period. This is plausible as the Algerian and Egyptian economies are situated in North Africa and are member-country of the Middle East and North Africa (MENA) region which possess about 60% percent of world crude oil reserve. Over the years, the region has been a major source oil price shocks especially in the 1980’s, owing to incessant political and civil wars which forestall oil production. Also, the effect of positive oil price shock is contemporaneous while negative shocks show lagged responses. These variations could be owing to the dominance of the gas production over crude oil in Egyptian economy, hence negative shocks arising from activities in the international crude oil markets can be cushioned with revenue from gas sales. Furthermore, the effect of oil price shocks to Egypt’s output is asymmetrical, having greater effect with positive oil price shocks than when oil price plunge. The negative oil price shock for Egypt is from −0.002 to −0.003% over the study period similar to Algeria. Even though the Egyptian and the Algerian output responds steadily to variations in oil price; evident from the steady slope, we observe that the magnitude of output responds to both positive and negative shocks are greater in Egypt compared to Algeria with magnitude shocks of 0.02% to 0.04%. This result also suggests the presence of asymmetric oil price shock effect for Egypt like Algeria. Bouchaour and Al-zeaud (2012) employed the VECM analysis on oil price and Algeria’s output and found the relationship to be positive but only in the long-run. This aligns with our study which found a statistically significant positive relationship in the medium and long run. In addition, our finding is also similar to work of Mork (1989) that concluded positive changes in the real oil price had more predictive effects on US real GDP growth than the negative changes. Our conclusion here is that oil price increase matters for both Algeria and Egypt.

Panel A in Fig. 3 shows that the effect of negative shocks to oil price on Gabon’s output is short-lived, and amounted to only −0.001% throughout the study period. In the same vein, the median output effect of positive oil price shocks is positive with a value of 0.001% which is similar to the negative shocks. This result suggests symmetric behavior of oil price shocks in Gabon’s economy. From Fig. 3, we observe that the effect oil price shock is symmetrical for Gabon in the short run and long run. This effect is, however, insignificant throughout the period.

Similarly, the median output effect for Nigerian economy shows a marginal direct response to negative oil price shocks, until output attains steady states in the medium run. For positive oil price shocks, output equally responds positively with a steady value of 0.001%. Contrary to oil price declines, the effect of positive oil price shocks on output persists throughout the horizon, also suggesting a symmetric effect for Nigeria. Fig. 3 also shows that output does not respond synchronously (i.e., there is a delay in response) to variations in oil prices. This could be adduced to the growth inducing contribution of other sectors in the economy in the very short-run. However, output effects are insignificant, which could be attributed to the marginal contribution (only 10%) of the oil sector to output in the Nigerian economy (OPEC, Statistical Bulletin, 2019). This finding aligns with that of Olomola and Adejumo (2006), Iwayemi and Fowowe (2011), Alley et al. (2014) which employed a VAR model and reports an insignificant relationship between oil prices and output in Nigeria. We therefore conclude that oil price shocks are symmetric for output growth in Gabon and Nigeria. The result is in support of Kilian and Vigfusson (2011) that found symmetric effects of oil price changes on US economy.

Summarily, from Panel A and B in Fig. 3, we observe that positive oil price shocks have more noticeable effect on output of Algeria and Egypt while symmetric effects are found for Gabon and Nigeria. This is particularly prominent in the Egypt’s output. Secondly, effect of positive and negative shocks to oil price persists in the long run (i.e., a delay in reaching steady states) for Algeria and Egypt, although, the magnitude of the effect is smaller for negative shock than for positive shocks. One the other hand, in Gabon and Nigeria the effect of oil price shocks fades in the short-run for both negative and positive oil price shocks. Furthermore, the GIRF findings corresponds to the persistence profile (PP) analysis. From the individual PPs, we observed that there is a delay in attaining equilibrium in Algeria and Egypt while Nigeria and Gabon attain equilibrium in the (faster) short run.

5.6 Generalized forecast variance error decomposition

To provide a robust and empirically valid investigation, we attempted the disaggregation of shocks to oil price shocks. This is with a view to determining the relative contribution of oil price shocks to output fluctuations in the selected African economies and accounting for their trading partners in explaining the asymmetric behavior of oil price. The generalized forecast variance error decomposition for negative oil price shocks as shown in Table 4 shows that 0.59% of the response is a result of shock to itself. This means that oil price responds to shocks to itself and variations in output. Specifically, we observe that instantaneously, oil price variations account for 0.59% shock in itself at the initial period and increased to 2.38% at the last quarter. We found output of China, US, Latin America and Asia to have the highest contributions of 0.55, 0.28, 0.31 and 0.17%, respectively, in the 5th quarter. This explains that contributions to oil price fluctuations emanates from shocks in output of trading partners are relatively huge while oil-exporting African countries contribute negligibly to oil price shocks.

In the long term, we observe that contributions from oil price to output of the selected African countries diminishes. However, output contribution from China, US, Latin and Asia to forecast error of oil price initially increase in the short-term but are seen to decrease progressively in the medium term which also extends to the long term. These highlighted group of countries are oil consumers, and their output contributes significantly to forecast error of oil price. Intuitively, this trend is feasible as negative shocks in oil price tends to improve these economies by reducing per unit cost of production given cheaper oil input. Howbeit the relationship tends to diminish in the long run. In the same vein, as regards the generalized forecast variance error decomposition for positive oil price shocks as presented in Table 5, we found that 0.59% of the response of oil price shock to itself. This means that oil price responds instantaneously to variations in output and shocks to itself. We found that the percentage of oil price response to positive shocks from itself is the same with negative oil price shocks.

Table 5 Generalized forecast error variance decompositions of positive oil price shocks for output (Explained by conditioning on contemporaneous and future innovations of the country equations)
Table 6 Countries in the GVAR Model and their Grouping
Table 7 Selection of Order of the weak exogeneity regressions with corresponding residual serial correlation F-Statistics
Table 8 Structural break tests
Table 9 Fixed Weight Matrix (2013–2015).

Similar to negative oil price shocks, output contribution from China, US, Latin and Asia to forecast error of oil price initially increase in the short-term but are seen to decrease progressively in the medium term which also extends to the long term. China is found to have the highest contribution to oil price shocks with 0.55%, followed by Latin America and US with values of 0.30 and 0.29%, respectively. We conclude here that the contribution of the output of the selected oil-exporting African countries is negligible while the contribution of their trading countries like China, Latin America, US and Asia is large. The results corroborate the results of the impulse response.

6 Concluding remarks

The study investigated the effect of oil shocks on economies of oil-exporting African countries from the first quarters of 1980 to the last quarter of 2018. The objective of this study is achieved by first carrying out preliminary tests on the unit root, followed by cointegration test, weak exogeneity test of the global variable in the relationship between oil shocks and output in each selected country. Next, we examined the persistent profile and found the long-run convergence for all the selected African countries. The stability test that accounts for structural breaks were also conducted. Lastly, the study investigated the asymmetric effect of oil price shocks on output of the selected African countries using generalized impulse responses and generalized variance error decomposition. The result of the oil price simulation reveals that output in oil-exporting African countries respond to oil price shocks. Asymmetric oil price is present in both Algeria and Egypt. The result implies that positive oil price matters for Algeria and Egypt. We recommend that energy policies in Algeria and Egypt should always be targeted to maximize oil revenue during the era of oil price increase. On the other hand, oil price shocks are symmetric to Nigeria and Gabon’s economies. The result implies that both Nigeria and Gabon’s economy are indifferent to both negative and positive shocks. In a way, the effects of oil price shocks on output are negligible in Gabon and Nigeria while the positive effects are higher and persisted in Algeria and Egypt. It is also recommended that the African countries can build their Foreign Reserves and Sovereign Wealth Funds during positive oil shocks as a buffer against future negative oil price shocks. Finally, as regards the contributions of the selected African trading partners, we found China as the highest contributor to oil price shocks followed by Latin America, US and Asia. This implies these countries are dominant players and determinants in the movement of the global oil price.