1 Introduction

The exploration of the dynamic interplay between oil prices and renewable energy investments has garnered considerable attention, particularly under the lens of sustainable energy transition. This relationship’s complexity is magnified by oil price volatility, directly impacting renewable energy’s strategic and investment landscapes (Shah et al. 2017; Guo et al. 2021). Italy’s energy paradigm, heavily reliant on oil imports yet progressively inclined towards renewable energy, mirrors a broader global trend. This trend has been notably influenced by the CoronaVirus Disease 2019 (COVID-19) pandemic, which has posed significant challenges and opportunities for the energy sector through demand fluctuations, supply chain disruptions, and altered investment patterns (Magazzino et al. 2021a).

Research indicates that renewable energy production’s sensitivity to oil price fluctuations impacts renewable energy firms, particularly in emerging economies like China. This sensitivity disproportionately affects smaller firms, highlighting the broader economic implications of oil price volatility (Cao et al. 2020). Furthermore, the interconnectedness between oil prices and renewable energy companies’ market value reveals a complex policy and investment decision-making landscape, complicating the transition towards sustainable energy (Hsiao et al. 2019). Additionally, the fluctuating oil prices’ influence on renewable energy companies’ risk profiles underscores the need for a stable and predictable energy sector, vital for ensuring the viability and sustainability of renewable energy sources. This is particularly crucial in regions like Africa, where energy security is intertwined with global oil price dynamics (Sadorsky 2012; Tambari and Failler 2020).

Reflecting recent developments, this study acknowledges the outcomes and discussions from COP-28, emphasizing their relevance to the evolving landscape of renewable energy and economic policy, particularly in light of the COVID-19 pandemic’s impact on energy systems worldwide. This study aims to dissect the nuanced relationship between oil prices and renewable energy investments in Italy, spotlighting the pandemic’s unique challenges. By leveraging advanced empirical techniques, this investigation enriches the discourse on energy economics, offering novel insights into Italy’s energy transition amidst global crises. The focus on Italy’s experience during the pandemic’s early phase provides a timely examination of the energy sector’s resilience and adaptability.

The theoretical underpinnings behind the intricate dynamics between oil prices and renewable energy investments during the initial phase of the COVID-19 pandemic can be grounded in the macroeconomic modelling under energy constraints as described by Nieto et al. (2020). The pandemic brought significant disruptions in both demand and supply across energy sectors, leading to volatile oil prices and affecting renewable energy investments. Hammoudeh et al. (2021) and Jia et al. (2021) suggest that oil price volatility and renewable energy stocks exhibit bidirectional causality, particularly under different market conditions and the influence of geopolitical risks and economic policy uncertainties.

Building on the insights of Adebayo and Özkan (2021), who emphasized the impact of socioeconomic factors, renewable energy, and eco-innovation on environmental sustainability, our study deepens the exploration of oil prices and renewable energy production’s interconnectedness. This research seeks to expand on these findings. The aim of the paper is to provide a detailed analysis of how economic factors and renewable energy investments interact, highlighting the role of Machine Learning (ML) in offering tools for dissecting and forecasting energy trends, especially critical under the pandemic’s influence. Alaraj et al. (2021) underscored the efficacy of ensemble trees-based ML approaches in predicting solar photovoltaic power generation, spotlighting the importance of meteorological parameters. Similarly, the predictive capabilities of ML models have been validated by Kavadi et al. (2020) and Peiffer-Smadja et al. (2020), suggesting a valuable pathway for mitigating future energy crises. Magazzino and Giolli (2014) studied the relevance of the connection between energy consumption and aggregate income in Italy with a time-series approach.

This study aims to contribute significantly to the field of energy economics by examining the dynamic relationship between oil prices and renewable energy production. Through deploying advanced methodologies, this research endeavors to deepen the understanding of how these relationships manifest within Italy’s energy landscape, thereby offering a model for future explorations aimed at unravelling the complexities of energy transitions during global crises. How do fluctuations in oil prices influence renewable energy production, and what implications do these dynamics hold for Italy’s energy policy and investment strategies amidst the COVID-19 pandemic?

After this Introduction, Sects. 2 and 3 offer a comprehensive literature review and theoretical framework on the impacts of the COVID-19 pandemic on energy production. Section 4 outlines the methodologies and data employed, ensuring a robust empirical foundation. Section 5 delves into the analysis, presenting and discussing the empirical findings that illuminate the connections between oil prices and renewable energy production. Section 6 provides robustness checks to the empirical findings through ML techniques. Finally, Sect. 7 synthesizes the insights gained into policy recommendations.

2 Literature overview

The interaction between oil prices and renewable energy production has emerged as a focal point of interest in the energy landscape, particularly in the context of the COVID-19 pandemic’s unique challenges in Italy (Ghiani et al. 2020). Italy’s comprehensive lockdown measures have significantly influenced energy consumption habits and market dynamics, thus impacting the correlation between oil prices and the shift towards renewable energy production. The pandemic accelerated a global pivot towards renewable energy, a shift particularly evident in Italy where reduced demand for fossil fuels during lockdowns notably affected environmental impact reductions (Rugani et al. 2021). These developments highlight the critical need to explore how fluctuations in the oil market influence the transition to renewable energy.

Past studies show that spikes and volatility in oil prices can negatively affect macroeconomic stability by inflating prices, elevating unemployment rates, and diminishing asset values. Despite the relatively minor percentage impact on Gross Domestic Product (GDP), mitigating these economic downturns through the increased deployment of renewable energy could counterbalance the economic losses associated with high oil prices (Awerbuch and Sauter 2006; Bloch et al. 2015).

An analysis of renewable energy consumption, oil prices, and economic activity uncovers a complex causal relationship, with evidence pointing to bidirectional causality between shifts in renewable energy consumption and economic growth across the distribution spectrum. This suggests that renewable energy production can stimulate economic growth, particularly during periods of elevated oil price volatility, underscoring the strategic importance of developing renewable energy markets to enhance energy efficiency (Troster et al. 2018). Additionally, the asymmetric relationship observed in high-income countries between oil prices and renewable energy consumption indicates that positive oil price changes exert a more substantial impact on renewable energy adoption than negative ones, highlighting the need for policies that address the diverse effects of oil price fluctuations on renewable energy uptake (Guo et al. 2021).

This effect suggests that higher oil prices may prompt a shift toward renewable energy as a viable alternative to conventional energy sources, highlighting renewable energy’s potential as a safeguard against oil price volatility (Içen and Tatoğlu 2021). Moreover, in the context of G7 countries, the dynamic between oil price changes and renewable energy consumption exhibits a distinct pattern; positive oil price fluctuations have a different impact compared to negative ones, illustrating a complex interplay that varies across nations (Tugcu and Topcu 2018). This complexity extends to economies such as Pakistan, where renewable and nuclear energy have asymmetric effects on economic growth, indicating that different energy sources respond uniquely to economic stimuli, with significant implications for energy policy and economic development strategies (Luqman et al. 2019).

Recent empirical evidence highlights a strategic transition towards renewable energy in response to fluctuations in oil prices, suggesting a shift towards more sustainable energy market practices. This evolution is supported by significant macroeconomic benefits associated with investments in renewable energy, which have the potential to alleviate GDP losses linked to the oil-GDP dynamics. These investments are pivotal in enhancing economic resilience and facilitating the shift from fossil fuels to renewable energy sources, thus contributing to environmental preservation (Awerbuch and Sauter 2006). Within Italy’s energy context, Brady and Magazzino (2018), and Magazzino (2017; 2012; 2018) delineated the positive influence of renewable energy consumption on economic growth, substantiating the growth hypothesis through the identification of a unidirectional causal relationship from renewable energy towards overall income.

Moreover, the COVID-19 pandemic has underscored the volatility of the oil market and elevated the significance of renewable energy sources. Despite a decline in oil prices, the resilience demonstrated by the renewable energy sector, with sustained or increased investments in solar, wind, and other renewable energies, underscores the essential role of accelerating the transition to renewable energy in post-pandemic recovery and strengthening energy security (Aktar et al. 2021; Elgammal et al. 2021; Jiang et al. 2021). This backdrop necessitates a comprehensive understanding of the interplay between oil prices and renewable energy adoption for policymakers to formulate robust, sustainable energy policies capable of withstanding future crises and fostering long-term environmental and economic stability.

The literature employs time–frequency analysis methodologies to explore the relationships among oil prices, renewable energy production, and economic indicators during Italy’s COVID-19 pandemic period. Drawing on the approaches of Bilgili et al. (2023) and Kuşkaya et al. (2023), this study extends these methodologies to the Italian energy context, incorporating insights from Reboredo et al. (2017) on the interconnection between oil price fluctuations and economic stability. The Robinson (1995) Log-Periodogram (RLP) method, alongside Granger causality tests as established by Psaradakis et al. (2005), facilitates a nuanced examination of the dynamics within energy markets and economic indicators, offering empirical evidence to inform policy decisions aimed at sustainable recovery and resilience.

3 The impact of the COVID-19 pandemic on energy production

The examination of  pollution’s role in Italy during the pandemic underscores the broader need towards renewable energy sources, exemplifying the potential for biomass and similar renewables to consolidate their presence in the energy sector (Coccia 2020). Italy’s strict lockdown measures provide a unique viewpoint on the dynamics between oil prices and renewable energy, offering insights into how these measures influenced energy consumption patterns and the subsequent effects on both renewable and traditional energy sources.

In this period, a decrease in traditional energy usage was observed, primarily due to diminished industrial operations and mobility. This demand reduction directly affected the oil and renewable sectors, with evidence pointing to a considerable impact on renewable energy production and the EU’s energy composition (Guevara et al. 2020; Prol and O 2020). Additionally, the downturn in oil prices during the pandemic initially lessened renewable energy’s competitiveness. Nonetheless, the eventual recovery in oil prices indicates a strategic orientation towards renewables, promising a more sustainable direction for the energy market.

The pandemic’s influence on renewable energy trends significantly altered global energy consumption and production patterns. With the economic challenges posed by the pandemic, renewable projects encountered obstacles and opportunities alike. An analysis of China’s power usage during the pandemic illustrates the power sector’s adaptive response, including a decrease in electricity generation and consumption yet an uptick in renewable energy production, showcasing resilience towards sustainable energy sources (Mastoi et al. 2022). This adaptation reflects a global shift towards sustainable energy amidst unprecedented challenges.

Moreover, the energy transition has been expedited by the pandemic, emphasizing the need to integrate climate policy with economic recovery strategies. Evaluations across different countries show a varied response to the energy transition, unified by a commitment to clean technology and goals of achieving carbon–neutral energy production (von Lüpke and Well 2020). This transition forms part of a larger global movement towards energy sustainability, crucial for post-pandemic recovery (Kılkış 2021). The focus on renewable energy as a foundation for economic reconstruction stresses the importance of policy initiatives and investments to overcome the challenges of energy system transitions (Lamperti et al. 2020).

A study for China showed that reducing coal consumption and increasing renewable energy production during the pandemic contributed to better air quality and reduced COVID-19 mortality rates (Rume and Islam 2020). Moreover, global analyses indicate that renewable energy investments offer not only environmental and health benefits but also economic resilience against the fluctuations experienced by fossil fuel markets during crises (Selin 2021). Collectively, these findings advocate for the acceleration of renewable energy initiatives as a comprehensive strategy for improving public health, protecting the environment, and ensuring economic stability amidst pandemics and other global adversities (Perera et al. 2021).

4 Data and methodology framework

The oil prices and renewable energy production series for Italy during the first wave of the COVID-19 pandemic were extracted from the International Energy Agency (IEA) database. These series were recorded on a daily basis, spanning from January 2nd, 2020, to September 30th, 2020, encompassing the most critical phase of the pandemic crisis for the country. Regarding the control variable for the PWC analyses, the industrial production has been retrieved from the Main Economic Indicators database by OECD.

Regarding the variables as described in Table 6 in the Appendix, Brent oil prices are characterized by an average value of 41.1597 and a standard deviation of 13.8055, reflecting considerable market volatility. In contrast, Biomass energy manifests greater price stability, denoted by a mean of 49.7393 and a standard deviation of 4.8986. Solar energy production reports an average output of 81.1653, alongside significant output fluctuations, as indicated by a standard deviation of 24.4589. Hydroelectric power exhibits the highest mean output at 140.2930, yet it is subject to notable variability with a standard deviation of 35.9475. Wind energy production has an average level of 53.1548, coupled with a wide dispersion of values (standard deviation = 34.9396). Geothermal energy records the lowest average production at 15.4220, with minimal variability, evidenced by a standard deviation of 0.5617, suggesting a remarkably consistent production profile.

As shown in the box plots in Fig. 7 in the Appendix, Brent oil prices and Solar have medians around the value of 50, but only Brent shows significant lower outliers. Biomass has a concentrated distribution with a median just below 100, with outliers on both ends. Hydro and Wind share a median near 100, yet Hydro displays greater variability and upper outliers, while Wind has fewer extremes. Geothermal is distinct, with a very low median and a narrow distribution, except for a few high-value outliers. The correlation analysis as depicted in Fig. 8. in the Appendix indicates the pairwise relationship between various energy-related variables. A positive correlation is observed between Solar and Hydro (0.46), suggesting a potential complementary relationship in their variations. Conversely, a substantial negative correlation is evidenced between Solar and Brent oil prices, indicating an inverse association. The majority of other variable pairings exhibit relatively low to moderate direct correlations.

Inspired by Bilgili et al. (2023), who analyzed the dynamics between the COVID-19 outbreak and stock markets using the wavelet-partial wavelet coherence model, and Kuşkaya et al. (2023), who explored solar energy’s impact on environmental sustainability, this research extends these analytical frameworks to the Italian context. Additionally, insights from Bilgili et al. (2024) on the nexus between oil price fluctuations and the banking sector are integrated to assess economic stability. These collective methodologies enable a nuanced understanding of how energy markets and economic indicators interact within the pandemic’s scope, offering empirical evidence to guide policy-making towards sustainable recovery and resilience. This study employs advanced time–frequency analysis techniques, drawing upon the methodologies from recent literature, to examine the interconnections between oil prices, renewable energy production, and economic indicators during the COVID-19 pandemic in Italy. For all empirical methods, except ML techniques, variables are normalized through natural logarithm transformations. In the context of ML applications, normalization is accomplished via the “scale” function.

RLP method is performed. In addition, to check the robustness of the RLP findings, a range of power values (from 0.40 to 0.60) is also given. The establishment of causal relationships in econometric analysis of time series generally relies on the idea of predictability and is determined through the testing of Granger causality (Granger 1969). Granger causality’s popularity originates from its identification through reduced-form VAR models, which are applicable to a collection of potentially interrelated variables. Nevertheless, similar to other facets of structural stability, Granger causality might be substantiated within one timeframe but could be precarious when alternative periods are taken into account (Psaradakis et al. 2005). Phillips et al. (2011) and Phillips et al. (2015) developed theoretical outcomes for testing and date-stamping asset price bubbles. Building upon these findings, Shi et al. (2018) and Shi et al. (2020) reexamined the concept of time variation in Granger causality testing, showing the feasibility of evaluating the stability of causal relationships over time.

To incorporate time variation in Granger causal orderings and pinpoint the timing of changes, it is necessary to employ recursive estimation methods. Three algorithms capable of generating a sequence of test statistics include the Forward Expanding (FE) window, the Rolling (RO) window, and the Recursive Evolving (RE) window. The FE algorithm, as introduced by Thoma (1994), is a conventional method employing standard forward recursion. Within the RO algorithm, as outlined by Swanson (1998) and further detailed by Arora and Shi (2016), a window of size [Tw] is systematically moved through the sample, progressing one observation at a time. Subsequently, a Wald test statistic is calculated for each window. In the RE algorithm, for a specified observation of interest, the procedure involves calculating a test statistic for every potential subsample of size r0 or greater, where the observation of interest serves as the common endpoint for all subsamples. This process is iterated by considering the observation of interest at every point in the sample, limited only by the minimum window size. Baum et al. (2021) employed recursive procedures to reassess the temporal stability of Granger causality between the US industrial production and three macroeconomic variables.

PWC is emerging as a pivotal analytical tool in the realm of time–frequency analysis, illuminating the dynamic interplay between variables across various frequency components. Expanding on traditional wavelet analysis (WA), PWC enhances analysis precision by offering a localized and frequency-specific measure of coherence between time series. It transcends the limitations of wavelet coherence, particularly in its capacity to delineate intricate relationships among multiple variables. PWC introduces the novel aspect of partial coherence, enabling researchers to isolate the impact of a third variable while scrutinizing the coherence between two primary variables. This approach is instrumental in discerning direct interactions between variables, unobscured by the influences of extraneous elements. PWC’s versatility extends to fields as diverse as neuroscience, climate science, and economics, providing invaluable insights into the complex dynamics of these disciplines (Kristoufek et al. 2016).

A key advantage of PWC lies in its ability to unearth dynamic interactions that may remain hidden in conventional time–frequency analyses. Traditional measures like cross-spectral density or wavelet coherence often yield a generalized overview of variable relationships, overlooking variations across different frequency bands. PWC, in contrast, facilitates the identification of specific frequency components where coherence is most significant, thereby enabling a more nuanced understanding of the dynamics at play (Grinsted et al. 2004).

The mathematical underpinnings of PWC involve decomposing time series into various frequency components using wavelet transforms. Crucially, partial coherence is calculated while controlling for the effects of a third variable, rendering PWC a potent tool for unearthing direct relationships. Although the computation of PWC can be complex, involving cross-wavelet transforms and demanding computational resources, advancements in computing and algorithm efficiency have democratized its application across various scientific domains. Despite its value, PWC presents challenges, such as selecting appropriate wavelet basis functions, deciding the decomposition level, and addressing edge effects. Moreover, interpreting PWC results requires an in-depth understanding of the data and potential confounding factors affecting coherence patterns (Ng and Chan 2012).

In the empirical analysis, we incorporate ML regression mechanisms such as Bagging, Boosting, Support Vector Machine (SVM), and Neural Network (NN) regression to provide robustness checks for the analysis. These mechanisms have been shown to enhance prediction accuracy and model performance in various studies.

Bagging, a powerful ensemble learning method, involves training multiple models using different subsets of the training dataset. Each model in a bagging ensemble operates independently, and their predictions are aggregated, usually through averaging, to produce the final prediction. This approach is particularly effective in reducing model variance and preventing overfitting. Bagging has been successfully applied in various domains, such as bankruptcy prediction, where it has shown improved accuracy over single models (Barboza et al. 2017).

Boosting is another ensemble technique that builds a series of models in a sequential manner, where each subsequent model attempts to correct the errors made by the previous models. Unlike bagging, the models in boosting are dependent on each other, and the final prediction is a weighted sum of all the models’ predictions. This method is highly effective in increasing model accuracy, particularly for weak models. Boosting has been employed in diverse applications, including cyber-phishing attack prevention, demonstrating superior performance compared to individual models (Chen and Chen 2019).

SVM is a powerful and versatile ML algorithm used for both classification and regression tasks. It works by finding the optimal hyperplane that maximizes the margin between different classes in the feature space. SVM is particularly effective in high-dimensional spaces and when there is a clear margin of separation in the data. The versatility of SVM is further enhanced by using kernel functions, allowing it to handle non-linear relationships. SVM has been applied in various predictive modeling tasks, where it has shown high accuracy and robustness (Moguerza and Muñoz 2006).

NN for regression emerged as sophisticated tools for modeling complex non-linear relationships within datasets, surpassing traditional regression methods in certain aspects. These networks often utilize feedforward architectures with one or more hidden layers, granting them the capability to approximate any function without relying on assumptions about the data’s distribution. This characteristic has proven beneficial in various fields, such as medical research, where neural networks have been instrumental in predicting survival data and identifying distinct patient groups with varying prognoses (Faraggi et al. 2001).

In comparison to conventional regression models, neural networks have shown enhanced performance, particularly when dealing with skewed or complex datasets. Kumar (2005) highlighted the superiority of neural networks over regression models in analyzing skewed data, emphasizing their effectiveness in handling more intricate analytical tasks.

5 Empirical findings

Given the nature of our data—with a daily frequency—we choose to run a long memory (fractional integration) test, in order to inspect the stationarity properties of the selected series. The results of the RLP test are given in Table 1.

Table 1 RLP estimates of the fractional differencing parameter.

The RLP estimates for the fractional differencing parameter across various energy sources reveal significant findings. For Oil Prices (OilP), the estimated d values are consistently above 1 across different power levels, with highly significant t-statistics and low p values, indicating strong evidence of long memory behavior. The first differences of Oil Prices (ΔOilP), however, show much lower estimated d values with not significant p Values, suggesting a lack of long memory after differencing. Biomass and Wind exhibit no significant long-memory characteristics at most power levels. In contrast, Solar and Hydro energy sources show significant estimates of d at certain power levels, particularly at 0.40 for Solar and across a range of powers for Hydro, indicating potential long-memory behavior. The first differences of Solar (ΔSolar) and Hydro (ΔHydro) generally present negative estimated d values, with ΔSolar showing significance at higher powers and ΔHydro at 0.60, suggesting a change in memory properties after differencing. Geothermal shows a mix of non-significant and significant results, with a notable significance at a power of 0.60. These results indicate a varied presence of long memory characteristics across different energy sources, with significant implications for econometric analysis and forecasting in energy markets.

The results of the TVGC test are reported in Table 2. They present a nuanced understanding of the directional causality among different variables related to energy sources. Notably, a clear unidirectional causal link is identified from Biomass to Oil Prices, as all three statistical measures (FE, RO, RE) consistently support this finding. In the case of Solar and OilP, the RO and RE statistics underscore a unidirectional causal flow from Solar to OilP, suggesting Solar’s predictive power over OilP movements. The analysis for OilP and Hydro reveals a neutrality hypothesis; in fact, the tests do not support the existence of Granger causality in either direction, implying independent movements between these two variables.

Table 2 Time-Varying Granger Causality test results

The relationship between Wind and OilP appears to be complex; a weak causal flow from Wind to OilP is detected under the RE statistic, whereas both RO and RE statistics signal a significant causal link from OilP to Wind, indicating a potential bidirectional causality but with varying degrees of evidence. Similarly, the causality between OilP and Geothermal is indicated to be bidirectional as per the RE statistic, yet the FE and RO tests suggest a stronger unidirectional causality from OilP to Geothermal. These findings highlight the intricate and variable nature of causal relationships within the energy sector, demonstrating how different energy sources influence oil prices and vice versa. The variation in causality direction and strength across different pairs and statistical windows underscores the importance of employing a nuanced, multi-faceted approach when analyzing causality in economic time series.

Figure 1a1–e2 display the 90th and 95th percentiles of the empirical distribution of the bootstrap statistics, to be compared with the sequence of FE, RO, and RE test statistics. Figure 1a1–a2 show a significant causal link from Biomass to OilP, but just in the first four months of the sample period (January 2020-April 2020). Figure 1b1–b2 evidence how Solar causes OilP; however, this is true only for the second half of the time span (from July to September). The absence of any causal link is clear from Fig. 1c1–c2, for OilP and Hydro. A sort of bi-directional causal nexus seems to appear between OilP and Wind, but in the last portion of the sample (since August 2020). Finally, Geothermal seems to cause OilP only in August, while the reverse causation is found in May.

Fig. 1
figure 1figure 1

Source: Authors’ elaborations in Stata

Recursive Expanding Wald tests of Granger causality results.

Overall, these graphs consistently reinforce the conclusion that Granger’s causal relationships exhibit high levels of dynamism. In fact, the observed patterns of causation in the data are shown to be contingent on the specific recursive algorithm employed. The Granger causality results reveal dynamic causal relationships between various energy sources and OilP over time. Significant causality from Biomass to OilP is identified only in the early months of 2020. A causal relationship from Solar to OilP is evident in the second half of the year, while no causality is found between OilP and Hydro. An interesting bi-directional causality emerges between OilP and Wind towards the end of the sample period. Similarly, a bidirectional causality is observed between OilP and Geothermal, with specific months showing unidirectional causality from one to the other. These findings underscore the temporal variability and complexity of causal interactions in the energy market.

In Figs. 2, 3, 4, 5 and 6, we present the PWC results. We calculate the PWC between oil prices and each of the energy series, while controlling for industrial production. Additionally, we examine the Partial Phase-Difference (PPD) and the Partial Wavelet Gain (PWG), providing insights into the extent of the impact that a shock in one variable has on the other. To streamline the presentation, we showcase the mean values for the phase differences and partial gains corresponding to the two examined frequency bands: cycles with periods ranging from 8.5 to 12.5 days and from 20 to 34 days. When computing the mean for phase differences, which are measured on a circular scale, a circular mean is employed, as it is the suitable measure in this context (Zar 1996).

Fig. 2
figure 2

Source: Authors’ elaborations in Matlab

Partial Wavelet Coherency analysis between Oil Prices and Biomass. Notes: On the left: PWC between Oil Prices and Biomass. The black/gray contour designates the 5%/10% significance level. The color code for coherency ranges from blue (low coherency close to zero) to red (high coherency close to one). In the middle: Partial Phase-Differences. On the right: Partial Wavelet Gain.

Fig. 3
figure 3

Source: Authors’ elaborations in Matlab

Partial Wavelet Coherency analysis between Oil Prices and Solar. Notes: On the left: PWC between Oil Prices and Solar. The black/gray contour designates the 5%/10% significance level. The color code for coherency ranges from blue (low coherency close to zero) to red (high coherency close to one). In the middle: Partial Phase-Differences. On the right: Partial Wavelet Gain.

Fig. 4
figure 4

Source: Authors’ elaborations in Matlab

Partial Wavelet Coherency analysis between Oil Prices and Hydro. Notes: On the left: PWC between Oil Prices and Hydro. The black/gray contour designates the 5%/10% significance level. The color code for coherency ranges from blue (low coherency close to zero) to red (high coherency close to one). In the middle: Partial Phase-Differences. On the right: Partial Wavelet Gain.

Fig. 5
figure 5

Source: Authors’ elaborations in Matlab

Partial Wavelet Coherency analysis between Oil Prices and Wind. Notes: On the left: PWC between Oil Prices and Wind. The black/gray contour designates the 5%/10% significance level. The color code for coherency ranges from blue (low coherency close to zero) to red (high coherency close to one). In the middle: Partial Phase-Differences. On the right: Partial Wavelet Gain.

Fig. 6
figure 6

Source: Authors’ elaborations in Matlab

Partial Wavelet Coherency analysis between Oil Prices and Geothermal. Notes: On the left: PWC between Oil Prices and Geothermal. The black/gray contour designates the 5%/10% significance level. The color code for coherency ranges from blue (low coherency close to zero) to red (high coherency close to one). In the middle: Partial Phase-Differences. On the right: Partial Wavelet Gain.

On the left of Fig. 2, the PWC between OilP and Biomass is reported. There are three relevant regions of high coherency. The first one is located in the 8.5–12 day frequency-band, and roughly corresponds to February 2020. The second is located at lower frequencies (12–20 day period) and involves March 2020. Finally, there is a third wider region, again at lower frequencies (in the 20–34 day frequency-band) from the beginning of the sample to February 2020. In this region, the phase-difference is between 0 and π/2, showing that price returns of both variables are in-phase with OilP leading.

On the left of Fig. 3, we show the PWC between OilP and Solar. Three relevant regions of high coherency emerge. The first one is located in the 8.5–12 day frequency-band, for June 2020. The PPD between the two variables is in the range (π; π/2), suggesting an anti-phase relation with Solar leading. The second one is located at a 20-day period from mid-March to mid-April 2020. Then, a third region is detected, at a 20–34 day frequency-band for February, mid-May and mid-June 2020, and at the end of the sample period. Here, the phase-difference is between -π/2 and 0.

On the left of Fig. 4, we show the PWC between OilP and Hydro. As for the previous case, it is possible to note three relevant regions of high coherency. The first one is located in the 8.5–12 day frequency-band, and runs from mid-February to mid-March 2020. Then two larger areas are located at lower frequencies (20–34 day frequency-band), one at the beginning of the sample, while the other runs from the end of March to the start of June 2020. In this region, the phase-difference is between 0 and π/2, showing that price returns of both variables are in-phase with OilP leading.

In Fig. 5, the PWC between OilP and Wind is given on the left. In this case, only two relevant areas at low frequencies (20–34 day frequency-band) are found, from mid-May to mid-June and at the end of the observed time period. For the latter region, the phase-difference is between -π/2 and -π, which implies that, at this frequency, changes in the oil prices still lead to changes in Wind; however, the relation is now negative.

Finally, the PWC between OilP and Geothermal is provided on the left of Fig. 6. For this pair of variables, we found two relevant regions, located in the 8.5–12 day frequency-band, for February and June 2020. Another region of high coherency is detected at lower frequencies, when the phase-difference is between 0 and π/2, the price returns of both variables are in-phase, and OilP leads. To summarize the PWC findings, the high coherency regions are roughly located in the same regions, especially in February 2020, which represented the peak of the COVID-19 pandemic. Moreover, the PPD showed that often the variables are in-phase with OilP leading. This highlights the strong connections between the examined series, but also how renewables follow the oil prices dynamic.

In conclusion, our empirical findings uncover a nuanced causal interaction between wind energy and oil prices, where a subtle causality from wind to oil prices is observed through RE statistics. This contrasts with a more clearly defined causal direction from oil prices to wind energy, as highlighted by both RO and RE analyses, suggesting a nuanced bidirectional causality with varying levels of support. Similarly, the relationship between oil prices and geothermal energy demonstrates potential bidirectionality according to RE statistics, although FE and RO tests predominantly indicate a unidirectional influence from oil prices to geothermal energy. These results illustrate the multifaceted and varied nature of causal linkages within the energy domain.

Corroborating these insights, recent studies provide a complementary perspective. Mastoi et al. (2022) detail the shifts in China’s power sector amidst the pandemic, noting a decrease in conventional electricity generation coupled with an increase in renewable energy production. This observation resonates with the patterns discovered in our analysis, highlighting how external shocks like the COVID-19 pandemic can reshape the causality within energy systems. Furthermore, the manuscript’s findings on bidirectional causality between oil prices and renewable energies, such as wind and geothermal, towards the latter part of the analysis period, find support in the broader research landscape. Adebayo and Kirikkaleli (2021) and Alola and Adebayo (2023) explore the influence of technological innovation and renewable energy consumption on environmental sustainability, revealing dynamic interconnections that align with the causality trends identified in this study, particularly during pivotal moments such as the COVID-19 pandemic’s peak in February 2020. This concurrence underscores the complex interplay between renewable energy initiatives and oil price dynamics, further validating the manuscript’s empirical results through the lens of existing scholarly discourse.

6 Robustness checks via machine learning

The RLP, TVGC, and PWC analyses serve as the core empirical framework of this study, elucidating the intricate dynamics and causal relationships between oil prices and various renewable energy sources. These foundational analyses reveal significant insights into the long-term memory characteristics and directional causality within the energy sector, showcasing the multifaceted interactions between energy variables. In this section, we analyze the results from various ML regression models in a multivariate framework, as shown in Table 4. The outcomes of the Bagging, Boosting, SVM, and NN (via the nnet function) models are provided below. The nnet function, a tool for modelling complex nonlinear relationships that might not be readily apparent or analyzable through traditional statistical methods, provides a sophisticated approach to examining the data.

These results give a comprehensive understanding of the different ML techniques’ effectiveness in modelling the relationship between oil prices and renewable energy series. The varying performance metrics and importance of specific renewable energy sources across models underscore the complexity of this relationship and the need for diverse analytical approaches. The models’ performance is evaluated based on Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R-squared values. The Boosting model shows a lower MSE and RMSE, indicating better predictive accuracy compared to the other models. The NN, while having the highest MSE and RMSE, could capture more complex patterns in the data (Table 3).

Table 3 ML regression model results using multivariate equation system

The application of ML models, including Bagging, Boosting, SVM, and NN, to investigate the relationship between oil prices and renewable energy production (Biomass, Solar, Hydro, Wind, and Geothermal) offers a robust analytical framework for energy economics research. These models’ performance metrics serve as critical indicators of predictive accuracy and model fit.

The Boosting model demonstrates superior predictive performance, evidenced by the lowest MSE (0.1708) and RMSE (0.4133) among the multivariate models evaluated. This suggests that the Boosting algorithm, through its iterative refinement process, effectively captures the linear and non-linear relationships between the dependent and independent variables. Conversely, the NN model, despite its higher MSE (0.7529) and RMSE (0.8677), may offer unique insights into complex, non-linear interactions within the dataset, which could be pivotal for comprehending the multifaceted effects of renewable energy production on oil prices. The R-squared values provide a measure of the models’ explanatory power, with the Bagging model achieving a high R-squared value of 0.8368, indicating its efficacy in explaining a significant proportion of the variance in oil prices through the predictors used. This model’s ensemble approach, aggregating multiple decision trees, enhances its ability to model the variability in oil prices accurately.

Table 4 highlights the importance scores for each renewable series. Solar energy shows the highest importance score, suggesting that it represents a significant predictor. However, there is not a great difference in the calculated importance scores.

Table 4 Bagging regression model results

Table 4 presentation of importance scores for each renewable energy series within the Bagging regression model provides critical insights into the relative influence of different renewable energy sources on oil prices. The prominence of solar energy, with the highest importance score (39.0645), underscores its significant predictive power in the model. This reflects solar energy’s growing impact on the global energy market, possibly attributed to advancements in solar technology, decreasing costs, and policy-driven incentives for renewable energy adoption. The relatively high score for hydro (31.2144) and geothermal (28.8925) energy further suggests these sources also play substantial roles in modeling oil price dynamics, indicating a diversified energy portfolio’s relevance in economic analysis.

The closer range of importance scores, though with solar energy leading, indicates a balanced interplay among renewable energy sources in their collective influence on oil prices. This balance highlights the complexity of the energy market, where multiple renewable sources contribute to the economic landscape, affecting oil price volatility and trends. For energy economists and policymakers, these insights emphasize the need for a comprehensive understanding of various renewable energies’ roles in shaping oil prices. The data suggest that while solar energy may currently have a more pronounced effect, other renewables like hydro, geothermal, wind, and biomass also contribute significantly, reinforcing the argument for diversified energy policies and investments to mitigate the economic impacts of oil price fluctuations.

In Table 5, the Boosting model’s results are detailed, showing the gains, cover, and frequency for each variable. Solar and Geothermal energies appear as prominent variables, with high gain scores, indicating their strong influence in predicting oil prices.

Table 5 Boosting regression model results

The importance scores for renewable energy sources such as biomass, solar, hydro, wind, and geothermal energy in the Bagging and Boosting models (Tables 4 and 5) provide a deeper understanding of which renewable sources are most influenced by oil prices. Solar energy consistently shows high importance and gains scores across models, indicating its significant role in the oil-renewable energy relationship. The Boosting model’s gain, cover, and frequency values for different variables offer a nuanced view of each variable’s contribution to the model. Variables with higher gain scores are more influential in the model, which can be pivotal in formulating energy policies.

Overall, the robustness checks using different ML models underscore the complexity of the relationship between oil prices and renewable energy production. The insights gained from these analyses are crucial for developing more informed and effective energy policies, especially in the context of renewable energy promotion and investment. The lower MSE and RMSE in the Boosting model compared to the Bagging, SVM, and NN models suggest higher predictive accuracy. This could indicate that the Boosting model is more effective in capturing the nuances of the relationship between oil prices and renewable energy production. Conversely, the higher MSE and RMSE in the NN model may imply a more complex model that could capture deeper, nonlinear relationships in the data, though at the cost of greater predictive error.

These robustness checks significantly bolster the empirical findings derived from the RLP, TVGC, and PWC test results. The consistency observed in the importance scores across different renewable energy sources, as highlighted in the Bagging and Boosting models, reaffirms the significant predictive power of solar energy, alongside the notable influences of hydro and geothermal energies. This convergence of results across both primary empirical analyses and subsequent ML-based robustness checks underscores the reliability of the identified relationships, thereby providing a solid foundation for policy formulation and investment strategies in the energy sector.

These findings can inform energy policies, suggesting that a focus on solar energy development could constitute a strategic response to fluctuations in oil prices. Moreover, geothermal energy’s high gain score suggests it could be a key area for investment and policy focus, particularly in regions with geothermal potential. The variability in the model performance and variable importance highlights the need for continued research in this field. Future studies could explore the reasons behind the differences in model performance and the implications of these findings for long-term energy strategies and sustainability goals. These insights from the robustness checks using ML models provide crucial information for policymakers and stakeholders in the energy sector, emphasizing the need for data-driven strategies in the transition towards renewable energy. These robustness checks reveal the complexities and nuances in the relationship between oil prices and renewable energy production. The insights from different ML models provide valuable guidance for policy formulation, emphasizing the need for strategic focus on particular renewable energies like solar and geothermal. As the global energy landscape evolves, these findings offer crucial insights for shaping sustainable and resilient energy policies.

7 Concluding remarks and policy recommendations

An extensive investigation into the impacts of the COVID-19 pandemic on the global energy sector has been conducted to underscore the vital need for diversifying energy sources to bolster both security and sustainability. The oscillations in oil prices, alongside the economic obstacles posed by the pandemic, have starkly underscored the pressing need to shift towards renewable energy sources as a stable and reliable alternative (Saif-Alyousfi and Saha 2021). This transition is not merely pivotal for sparking economic recovery offering a solid investment climate, but also for alleviating the adverse effects of oil price volatility on the worldwide economy. Our analysis, probing into the nexus between oil prices and renewable energy systems during this period of upheaval, furnishes critical insights. It argues in favour of strategic investments in renewable infrastructure and technology as essential for facilitating a seamless transition to a low-carbon economy (Rita et al. 2021).

Causality results reveal dynamic causal relationships between renewable sources and oil prices over the time horizon. The analysis shows significant causality from Biomass to oil prices during the initial months of 2020. Conversely, a causal relationship from solar energy production to oil prices becomes apparent in the latter half of the year, while no causality is detected between oil prices and hydro energy production. Interestingly, a bidirectional causality emerges between oil prices and wind energy production towards the end of the sample period. Similarly, bidirectional causality is observed between oil prices and geothermal energy production, with certain months exhibiting unidirectional causality from one to the other. These findings highlight the temporal variability and complexity of causal interactions within the energy market.

In PWC findings, the high coherency regions are roughly located in the same regions, especially in February 2020, which represented the peak of the COVID-19 pandemic. Moreover, the PPD showed that often the variables are in-phase with oil prices leading. This highlights the strong connections between the examined series, but also how renewables follow the oil prices dynamic.

Robustness checks, conducted through several ML algorithms, highlighted that all renewable sources exerted an influence on oil prices; nevertheless, solar, hydro, and geothermal exhibit the highest importance scores.

The pandemic served as a pivotal moment, prompting a re-evaluation of energy consumption patterns and investment priorities among governments, businesses, and individuals. Our findings on the dynamic interaction between oil prices and renewable energy elucidate the complexities involved in the energy transition process. It requires unwavering policy support and substantial investments in sustainable technologies to navigate this transition effectively. Essletzbichler (2012) discussed the regional contributions and technological advancements in renewable energy within the UK, while Lee et al. (2014) explored Seoul’s energy autonomy through innovative policies; Kiragu (2015) examined the limits of government intervention in green economy transitions, reinforces the necessity of governmental actions in accelerating the move towards renewable sources.

The imperative for sustainable energy policies in response to the COVID-19 pandemic is reinforced by studies that establish a direct link between environmental sustainability and public health outcomes. Research across the United States has indicated that areas with a stronger commitment to renewable energy sources and lower levels of pollution experienced fewer severe cases of COVID-19, highlighting the health benefits of clean energy transitions (Gillingham et al. 2020). Similarly, research in China has demonstrated that significant reductions in coal consumption and increases in renewable energy production during the pandemic have led to improved air quality and lower COVID-19 mortality rates (Zhang et al. 2021). Moreover, global analyses suggest that investments in renewable energy not only offer environmental and health advantages but also provide economic resilience against the volatility experienced by fossil fuel markets during global crises (Chang et al. 2020). These findings collectively support the acceleration of renewable energy policies as a comprehensive strategy for enhancing public health, protecting the environment, and ensuring economic stability in the face of pandemics and other global challenges (Norouzi 2021).

The findings from this research make a crucial contribution to the existing body of knowledge on the behaviour of energy markets, particularly in the context of the COVID-19 pandemic. By employing the RLP estimates for the fractional differencing parameter across various energy sources, our study unravels the intricate dynamics of long-memory behaviour in energy prices and their derivatives. The clear distinction in memory characteristics between the original oil prices and their first differences provides crucial insights for econometric modelling and forecasting in energy economics. The absence of long memory in biomass and wind energy, contrasted with the significant long-term dependencies identified in solar and hydro energy sources, suggests a differentiated impact of market conditions on renewable energy sources.

Moreover, the dynamism observed in Granger causality relationships between energy sources and oil prices highlights the evolving nature of these interactions over time. The temporal specificity of causality, with distinct patterns emerging at different periods within the study’s timeframe, underscores the impact of external shocks and policy changes on the energy sector (Magazzino et al. 2021b). The identification of bidirectional causality between oil prices and certain renewable sources towards the latter part of the sample period signals a maturing interdependence within the energy market. This interdependence is crucial for understanding the feedback mechanisms at play and for designing comprehensive strategies that leverage the synergies between different energy sources.

The application of Bagging and Boosting models to assess the influence of oil prices on renewable energy sources further enriches our understanding of the oil-renewable nexus. Solar energy’s prominence in these models as a key variable affected by oil price movements accentuates the interconnectedness of traditional and renewable energy markets. This interplay is critical for developing resilient energy systems that can withstand global shocks such as the COVID-19 pandemic. The nuanced contributions of different variables in the Boosting model, as evidenced by gain, cover, and frequency values, provide a granular view of factors driving the oil-renewable relationship. This granularity is invaluable for crafting nuanced energy policies that consider the varied roles and impacts of different energy sources.

In sum, this research provides a comprehensive analysis of the long-memory characteristics of renewable series, the impact of oil prices on renewable energy sources, and the dynamic causal relationships within the global energy sector during the COVID-19 pandemic. These insights are instrumental for advancing econometric analysis in energy markets, informing policy formulation, and guiding strategic investments towards achieving a sustainable and resilient global energy system.

Future research may explore the same topic for different countries, to compare the behaviour of the energy series in a critical phase of recent history. In addition, alternative empirical methodologies might be employed, such as the Nonlinear Autoregressive Distributed Lags (NARDL) model, state-space model, or dynamic factor model.