Introduction

Today, financial markets play such an important role in the development of a country that market booms directly affect country development. Those considering entering financial markets are concerned with losing capital and reducing asset values. Thus, reducing financial risks and risks that may threaten capital has always been an area of concern for traders and investors (Toque and Terraza 2011, 2014; Peng et al. 2011; Kou et al. 2014, 2019; Li et al. 2022a). Alternatively, banks and business sectors have been exposed to funding risk as a major source of vulnerability throughout the financial crises. Some studies have used financial ratios to examine bankruptcy predictions for the banks and business sectors based on financial crises and busts of the other financial markets (Kwak et al. 2012; Lardic and Terraza 2019; Kou et al. 2021a, b).

In recent years, the worldwide spread of the coronavirus disease 2019 (COVID-19) has created a big shock in the economies of the world. This shock was accompanied by a fall in the value of stock market indexes and oil prices, as well as other financial assets. In response to this pandemic crisis, governments have decided on extensive shutdowns and heavy restrictions, which have enhanced instability in the financial markets and sustained the crisis phenomenon. During financial crises, investors search for more secure investments. In particular, they tend to prefer investing more in cash and low risk assets. In recent years, the development of cryptocurrencies has recently gained the attention of investors as a means of enhancing portfolio returns (Makarov and Schoar 2020; García-Medina and Luu Duc Huynh 2021; Moreno and Garcia Medina 2023) and improving the risk and return profile of a well-diversified portfolio (Briere et al. 2015).

The stock market is one of the most important financial markets. An index’s change reflects the performance of the market and the boom or bust of a country’s economy. There are different ways in which stock market activity can affect a country’s economy. It is a constituent part of the financial markets and one of the main arteries of finance in an economy. A strong stock market plays such an important role in a country’s economy that some economists believe that the difference between developed and underdeveloped countries lies not in the presence of advanced technology but rather in the presence of an integrated and active stock market (Kyrtsou and Terraza 2000; Göçken et al. 2016, 2019; Rounaghi and Nasirzadeh 2016; Abbaszadeh et al. 2020; Arashi and Rounaghi 2022).

In addition to the stock market, investors are also interested in the gold market as a way to maximize profit and minimize risk. Gold has maintained its value for many years, making it popular among investors. Gold is often viewed as a long-term investment that preserves investors' purchasing power during periods of high inflation. As with other asset classes, investing in gold depends on several factors. The right decision requires an analysis of past trends and a thorough examination of the current state of the global market. It also involves the determination of how to invest based on the data and the current situation. Investing in this type of asset has the advantages of high long-term profit and quick liquidity.

The situation is different when it comes to the Bitcoin market. Bitcoin is a relatively new investment market, having entered the market only in the last few years. There are active Bitcoin markets 24 h a day, 7 days a week. Understanding Bitcoin’s capabilities is crucial for financial market participants (Ciaian et al. 2016; Stensas et al. 2019; Nasir et al. 2019; Kim et al. 2019; Hakim das Neves 2020; Ante 2020; Mizerka et al. 2020; Kristoufek 2020; Lahiani et al. 2021; Malladi and Dheeriya 2021; Kwon 2021; Li et al. 2022b; Lorenzo and Arroyo 2022). Among the digital currencies that have emerged in the last decade are Bitcoin, LiteCoin, PeerCoin, AuroraCoin, DogeCoin, and Ripple. Among them, Bitcoin stands out due to its price volatility and outstanding growth. Several studies have shown that Bitcoin is a highly innovative and attractive digital currency (Brandvold et al. 2015; Shaikh 2020; Giudici et al. 2020; Kayal and Rohilla 2021; Ma and Tanizaki 2022).

Despite being created as a digital currency, Bitcoin is also used as an asset (Baur et al. 2018a, b). As such, several authors have examined Bitcoin with other conventional financial instruments, including its role as an asset or hedging tool (Bouri et al. 2017, 2018; Shahzad et al. 2019). Some existing studies suggest that Bitcoin should be considered an asset due to its efficient market hypothesis (Jakub 2015; Wei 2018; Tiwari et al. 2018; Le Tran and Leirvik 2020; Noda 2020; Ghazani and Jafari 2021). Meanwhile, other studies have found that Bitcoin is highly volatile and has substantial returns (Baek and Elbeck 2015; Symitsi and Chalvatzis 2019; Agosto and Cafferata 2020). Consequently, speculators and investors consider Bitcoin an alternative asset class to conventional currencies.

Investments in gold and Bitcoin generated big profits during the COVID-19 pandemic (Jin et al. 2019; Bouri et al. 2020a, b), and there is still debate about whether Bitcoin can replace gold in times of financial crisis. The dynamic nexus between Bitcoin, gold, and American stock markets during the COVID-19 pandemic was investigated because investors are interested in determining the degree of uncertainty of the financial markets during times of financial crises.

This paper’s main finding is showing how different asset classes contribute to improving risk-adjusted returns and how Bitcoin investment could improve portfolio diversification benefits for investors during financial crises.

To achieve this objective, this study analyzes the joint dynamics of conditional volatility and correlation under an asymmetric relationship between volatility and shocks in returns using a VAR-DCC-EGARCH specification. This model is compared with an attractive and efficient alternative forecasting tool that uses Artificial Neural Networks (ANNs). Several distinguishing properties of ANNs have made them extremely popular in forecasting. One of their most notable characteristics is that they are nonlinear, nonparametric, data-driven, and self-adaptive.

In this study, we try to find a safe haven for Bitcoin, gold, and stock markets by applying a hybrid VAR-DCC-EGARCH-ANN method that considers a time-varying investment horizon. In the literature, various hybrid ANN models such as the EGARCH in-mean model-ANN (Episcopos and Davis 1996), EGARCH-ANN (Hajizadeh et al. 2012; Kristjanpoller and Minutolo 2015; Lahmiri and Boukadoum 2015; Lu et al. 2016), ANN-ARMA-GARCH (Mademlis and Dritsakis 2021) are developed. The innovation in this paper is related to the use of new econometrics and econophysics techniques including hybrid VAR-DCC-EGARCH and ANN for forecasting in finance and economic areas, especially for forecasting in Bitcoin, gold, and stock markets.

The paper is organized as follows: section "Literature review and theoretical background" discusses the stock markets, gold markets, and Bitcoin markets, as well as different aspects of their financial behavior. The trends of these markets before and during the COVID-19 pandemic are compared in section "Financial behaviors of the Bitcoin, gold, and stock markets before and during the COVID-19 pandemic". Sections "Data and empirical methodology" to "Discussions and conclusion" explain our methodology and discuss the results. A multivariate GARCH model was used to take the time-varying effect of covariation between markets into account, and we compared the results of this methodology with those obtained by a hybrid ANN method. The conclusion states the limits of our study and makes some suggestions for future research.

Literature review and theoretical background

In this paper, the behaviors of the Bitcoin, gold, and stock markets were analyzed. Because investors are familiar with the traditional gold and stock markets, only Bitcoin’s characteristics will be covered, since it is a newly emerging market. Studies about Bitcoin, gold, and the stock market will be covered here.

The inventor of Bitcoin is Satoshi Nakamoto. Bitcoin do not have banknotes or coins like other currencies, such as the dollar or the euro. Bitcoin is a virtual currency that can be bought, sold, ordered online, and traded like a stock. However, it is based on computer code, so it follows its own rules. The production and distribution of Bitcoin are not controlled by any government, group, or organization.

The price of Bitcoin is generally determined by supply and demand. However, several factors can affect it. For example, legislation banning Bitcoin mining or trading of Bitcoin in one of the major economies could affect its price. Development situations, developers’ decisions, important and expected events, the effect of financial and economic variables and other factors can influence the price of Bitcoin. Some of the factors mentioned above can have a positive effect on the price of Bitcoin. For example, offering more financial products such as futures contracts and Exchange Traded Funds (ETFs) can attract the attention of many investors. Positive legislation in this area could also benefit Bitcoin (Xu et al. 2019; Fang et al. 2022).

Recently, considerable research has been conducted on Bitcoin’s price behavior. Kapar and Olmo (2019) analyzed the price discovery between Bitcoin futures and spot markets. They discovered that a common component drives both prices, provided by a weighted combination of futures and spot markets. They also demonstrated that deviations from the equilibrium condition equating the futures and spot log price can predict the return on the Bitcoin spot price but not the futures price. Philippas et al. (2019) proposed a dual-process diffusion model to investigate whether Bitcoin prices respond to informative signals with jumps. These signals were derived from the volume of corresponding hashtags on Twitter and Google Trends. The empirical findings suggest that Bitcoin prices are influenced in part by social media attention, implying a new evidence on the sentiment-price relation for Bitcoin.

In another study, Sebastião and Godinho (2021) examined the predictability of three major cryptocurrencies—Bitcoin, Ethereum, and LiteCoin—and the profitability of trading strategies devised through machine learning techniques. According to their findings, machine learning provides robust techniques for exploring the predictability of cryptocurrencies and for devising profitable trading strategies in these markets, even under adverse market conditions.

Additionally, many researchers have compared different aspects of Bitcoin, gold, and stock markets before and during the COVID-19 pandemic that influenced the decisions of investors and business and government policymakers. These studies are listed in Table 1. Among them, Al-Yahyaee et al. (2018) compared the three markets and concluded that Bitcoin has the strongest long-memory and multifractality features; it is also the least efficient.

Table 1 Studies on Bitcoin, gold, and stock markets before and during the COVID-19 pandemic

Some studies concern the interesting results of the diversification benefits of cryptocurrencies. The benefits of incorporating Bitcoin in a traditional benchmark portfolio of stocks and bonds were investigated by Platanakis and Urquhart (2019). According to their findings, investors should incorporate Bitcoin in their portfolios because it provides significantly higher risk-adjusted returns. In a complementary study, Shahzad et al. (2020) compared the hedging characteristics of gold, Bitcoin, and G7 stock markets. Their findings indicate that gold offers comparatively higher and more stable conditional diversification benefits than Bitcoin for stock investments in G7 markets. According to some studies, Bitcoin has lower dependence on other asset classes. In particular, Bouri et al. (2020b) examined the time frequency dependency between Bitcoin, gold, commodities and the stock markets. Specifically, they showed that the benefits of diversification vary in the time–frequency space, with Bitcoin exhibiting a superiority over both gold and commodities.

Baur et al. (2018a) analyzed the relationship between Bitcoin, gold, and the U.S. dollar, and their results show that Bitcoin returns, volatility, and correlation characteristics are distinctively different compared with gold and the U.S. dollar. Kwon (2020) expanded this investigation to a value-at-risk analysis examining Bitcoin's tail behavior with the dollar, gold, and stock market index. Based on the contemporaneous correlation, Bitcoin and the dollar, and the stock market index exhibit similar tail behavior.

Several empirical studies have been used to investigate risk spillovers and estimate the correlations between asset market returns. There are two perspectives on risk analysis: the relationship of COVID-19 metrics with stock market performance and economic uncertainty and the transmission volatility during the COVID-19 crisis. Kakinuma (2021) investigated the nexus between Southeast Asian stock markets, Bitcoin, and gold before and during the COVID-19 pandemic. According to the results, Southeast Asian stocks markets, Bitcoin, and gold appear to be more interdependent during pandemics. Matkovskyy and Jalan (2019) found significant contagion effects between the financial and Bitcoin markets. They suggest that risk-averse investors avoid risky Bitcoin markets during crisis periods in favor of less volatile and more established markets, especially NASDAQ and NIKKEI.

Jiang et al. (2022) investigated the volatility spillover mechanism between Bitcoin, crude oil, gold, stocks, foreign exchange and natural gas market. They observed that shifts in external market attention across various markets are more likely to cause overall volatility spillovers. Moreover, they showed that Bitcoin acts as a hedge in the financial system rather than a safe haven.

Earlier literature has discussed hedges and safe havens investments as they have a strategic role for investors. According to Baur and Lucey (2010) a hedge is an asset that is uncorrelated or negatively correlated with another asset on average while a safe haven asset, on the other hand, has a low correlation or a negative correlation with another asset only during a market crash. Safe haven assets are designed to help investors mitigate downside market risk during stressful times. Another distinction is between a strong (weak) safe asset which has a negative correlation (uncorrelation) with another asset.

Evidence from these studies suggests that the diversification benefits of cryptocurrencies are not robust geographically or across markets. To the best of our knowledge, this study is the first attempt to test whether adding Bitcoin to a portfolio of traditional assets can enhance the risk/reward relationship during a crisis period and then contribute to the literature on the diversification benefits of cryptocurrencies during the COVID-19 period. Furthermore, other factors—including investor attitudes and economic conditions—can affect the accuracy of prediction. For this reason, precise prediction is still a challenging process in the Bitcoin, gold, and stock markets. Therefore, this paper’s motivation is to use fewer input data and a more straightforward model structure to get better prediction results for Bitcoin, gold, and stock markets.

Financial behaviors of the Bitcoin, gold, and stock markets before and during the COVID-19 pandemic

Coronavirus was first identified in late 2019 and broke out globally in early 2020. COVID-19 has swept into many countries and was announced as a global pandemic by the World Health Organization (WHO) on March 11, 2020. Like any other industry, the Bitcoin, gold, and stock markets were affected by the COVID-19 pandemic (Chen et al. 2020; Yousaf and Ali 2020; Sikiru and Salisu 2021; Arif et al. 2021; Shahzad et al. 2021; Youssef et al. 2021; Wang and Liu 2022; Hui and Chan 2022).

However, the virus provided more opportunities for some financial assets, especially cryptoassets. Since Bitcoin was created, there has always been an expectation that this digital currency is a safe investment. In other words, with the stock market crashing, investors can take refuge in Bitcoin and virtual currencies. It is the same relationship that exists between the stock market and precious metals.

Many studies have examined whether cryptocurrencies (especially Bitcoin) can act as hedges and safe havens. Jareno et al. (2020) found the existence of positive and statistically significant connectedness between Bitcoin and gold. A study by Bahloul et al. (2021) examined whether the Morgan Stanley Capital International (MSCI) all-country world index, the Islamic index, gold, and Bitcoin could be used as hedges or safe haven assets against world conventional stock markets from April 30, 2015, to March 27, 2020. In the sub-period of COVID-19, empirical findings suggest that gold is only a weak safe asset, while Bitcoin is more of a weak hedge asset. Będowska-Sójka and Kliber (2021) also determined that cryptocurrencies can play the role of weak safe havens in the stock market. During the four months following the WHO’s official designation of COVID-19 as a global pandemic, Diniz-Maganini et al. (2021) looked at the price efficiency and net cross-correlations of Bitcoin, gold, a U.S. dollar index, and the Morgan Stanley Capital International (MSCI) world index. They used intraday price data at 5-min intervals for Bitcoin, gold, the MSCI world index, and the US dollar index for March 11, 2020, through July 10, 2020. Based on their results, when short time scales for returns series of data were considered, the net cross-correlations between these assets were relatively weak, but when longer time scales for returns series of data were considered, net cross-correlations were negative and significantly higher. Futhermore, they found that when the time is greater than two months, gold can be considered a safe haven for investors holding the MSCI world and U.S. dollar indexes, and when the time scale exceeds three months, Bitcoin can be considered a safe haven for the MSCI world index.

Despite the similarities found in the above-mentioned studies, Chemkha et al. (2021) demonstrated that gold is a weak safe haven for the assets considered during COVID-19, and Bitcoin cannot provide shelter due to its increased volatility. Omane-Adjepong and Paul Alagidede (2021) examined the COVID-19 effects on the Bitcoin market, gold market, and Africa’s stock markets. According to their findings, neither traditional safe havens nor Bitcoin can provide a safe haven for Africa’s emerging stock markets. Palladium and gold, however, provided a more stable environment for small-sized stock markets than the other candidates. Shehzad et al. (2021) compared gold and Bitcoin as safe-havens during the COVID-19 pandemic using a wavelet approach.Their findings highlighted that gold had more robust safe -haven properties than Bitcoin during COVID-19.

It appears that there is no consensus regarding the safe haven properties of Bitcoin during COVID-19. Therefore, the current study contributes to the literature by examining Bitcoin volatility before and during COVID-19. Several aspects of Bitcoin’s volatility can be analyzed to better understand its dynamics and capabilities as a financial asset. Examining an assets’ trends is the first step to understanding how volatility changes over time. The evolution of Bitcoin’s price between 2015 and 2020 is represented in Fig. 1, while Fig. 2 shows Bitcoin’s price performance during the COVID-19 pandemic. We observed a sustained upward trend from 2015 to 2018, with a peak at over $19,000 in December 2017. However, there was a reverse in the trend in 2018 due to some viewpoints in the financial and investment sectors and other economic and financial factors. While this decreasing trend continued in 2019, Bitcoin's price increased sharply during the COVID-19 crisis from $ 7,149.44 at the end of 2019 to $ 65,930.54 at the end of 2021, as illustrated in Figs. 1 and 2.

Fig. 1
figure 1

Source: https://www.koyfin.com

Bitcoin trend (2015–2020).

Fig. 2
figure 2

Source: https://www.koyfin.com

Bitcoin and COVID-19 pandemic.

To better understand these trends, it could be helpful to observe the evolution of Bitcoin mining's geographical distribution. In Fig. 3, we compared the Cambridge Bitcoin Electricity Consumption Index (CBECI)) at the end of 2019 with the index at the end of 2021. With 73.46% of the average monthly hashrate share, China dominated this technology until the end of 2019. However, this share fell to 19.14% in 2021, and China’s major player is gradually ceasing its Bitcoin mining activities for political, energy, and economic reasons. In contrast, the United States share has risen from 3.87% to 37.45%, which placed it in first place in 2021. The pandemic crisis, coupled with a weak dollar, caused big financial companies to shift to cryptocurrency, and Bitcoin has seen a significant rise in its price.

Fig. 3
figure 3

Source: https://ccaf.io/cbeci/index

Comparison of the cambridge Bitcoin electricity consumption index for the periods 2019 and 2021.

The pandemic crisis resulted in the economy becoming more digital. This explains the why cost of energy is driving Bitcoin’s geographical redeployment. Bitcoin’s insatiable appetite for electricity has ignited a global debate about reducing carbon emissions based on cryptocurrencies. As the energy transition becomes a crucial issue for economies, the question of finding alternative energy sources arises. In their paper, Kou et al. (2022) analyzed innovative ways for solving carbon emission problem by generating more electricity using solar energy investment projects.

In Figs. 4 and 5, the Bitcoin market trend is compared with the gold and the stock markets before and during the COVID-19 pandemic. Before the pandemic, Bitcoin was in general disconnected from traditional financial markets. However, when COVID-19 emerged, the price of Bitcoin has risen significantly, and the question was raised about the correlation structure and its evolution between all markets.

Fig. 4
figure 4

Source: https://www.koyfin.com

Fluctuates of the Bitcoin market in comparison with the gold market and stock markets before the COVID-19 pandemic (2018–2019).

Fig. 5
figure 5

Source: https://www.koyfin.com

Fluctuates of the Bitcoin market in comparison with the gold market and stock markets during the COVID-19 pandemic (2020–2021).

The dynamic relationship between the Bitcoin, gold, and stock markets was investigated before the COVID-19 pandemic outbreak. Consequently, we asked the question: Were Bitcoin, gold, and American stock markets independent before the COVID-19 pandemic? Additionally, our study examines the dynamic nexus between the Bitcoin, gold, and American stock markets during the outbreak of the COVID-19 pandemic and verified the following hypothesis: Have the Bitcoin, gold, and American stock markets become interdependent during the COVID-19 pandemic.

Data and empirical methodology

Data

To investigate the effect of the COVID-19 pandemic on the Bitcoin, gold, and American stock markets, we collected two data samples from each asset class: before the COVID-19 pandemic (2018–2019) and during the COVID-19 pandemic (2020–2021). The daily closing prices were collected from Yahoo Finance. Because the closing price series are non-stationary, the series are transformed into return series. The choice of returns is motivated by the strong rejection of the Phillips-Perron test for unit roots for all the data series included in our analysis.Footnote 1

Descriptive statistics of the returns

Tables 2 and 3 demonstrate the descriptive statistics of the returns of the Bitcoin, gold, and stock markets over a period from 2018 to 2019 (before the COVID-19 pandemic), and from 2020 to 2021 (during the COVID-19 pandemic).

Table 2 Descriptive statistics of the returns of the data (before the COVID-19 pandemic, 2018–2019)
Table 3 Descriptive statistics of the returns of the data (during the COVID-19 pandemic, 2020–2021)

When comparing the average return over both periods for all investments, the return was higher over the second period. In particular, Bitcoin returns were higher compared to other investments, even if its return reaches more negative values over the second period. Except for Bitcoin, the return volatility is substantially the same for all investments with a lower variability for gold.

The difference between the maximum and minimum returns for Bitcoin was the highest, suggesting that Bitcoin fluctuations were significant relative to other markets. Indeed, Bitcoin exhibited the greatest variability for the two periods. During the COVID-19 pandemic, Bitcoin appeared to be the riskiest asset with more negative extremes.

Non-linearity of the data and autocorrelation of the data

Before modeling, it is necessary to determine the presence of nonlinear components in our data sets. The results of the Brock et al. (1987) test are given for all the return series (see the tables in Appendix A, Tables 8, 9, 10, 11, 12, 13, 14, 15, 16, 17), and autocorrelation in the returns are tested using the Ljung Box test (the tables are given in Appendix B, Tables 18, 19).

For American stock markets, the non-linearity hypothesis is accepted regardless of the period. The results are different according to the periods for gold. Before the COVID-19 pandemic, the hypothesis of non-linearity was rejected. During the COVID-19 pandemic, the test accepted the hypothesis of non-linearity in the returns. Concerning Bitcoin, the non-linearity was rejected for the two periods.

There is autocorrelation in the square of the residuals of the processes (see the results of the Lagrange Multiplier test in Appendix C, Tables 20, 21, 22, 23, 24, 25, 26, 27, 28, 29). Then, a model of conditional volatility is required for all assets.

Another stage of the econometric analysis is to test for the interdependence of the markets. In particular, to determine the impact of the COVID-19 pandemic on the dynamics of market correlations.

Empirical methodology

To demonstrate the effect of the COVID-19 pandemic on the Bitcoin, gold, and stock markets, two approaches were considered. First, the dynamic connectedness between the markets was investigated by employing the class of the VAR-DCC-GARCH models, and the ANN model was explained. A second time, these models will be used for the comparison of predicted values.

VAR-DCC-GARCH–type models

Originally, GARCH models propose to measure conditional variance for individual assets or indexes. This takes the sensitivity and persistence of volatility shock into account. In this study, we are interested in a specific model that analyzes the various relationships between the assets. Indeed, volatility moves together more or less closely over time across assets and markets. GARCH multivariate models (MGARCH) allow for analyzing volatility transmission between different assets, and the introduction of DCC-GARCH models enables the analyzes of interdependence among markets by estimating time-varying conditional correlations (Engle 2002).

To measure both the transmission of returns and volatility spillovers among different markets, first, we compare different orders of vector autoregressive processes (VAR models). A VAR model explains the joint evolution of assets through their lags. Using the Schwarz criterion, we consider the vector autoregressive processes of order 1. The conditional mean of a VAR(1) can be written as follows:

$$\begin{aligned} & r_{t} = \mu + \Phi r_{t - 1} + \varepsilon_{t} \\ & {\text{with}} \\ & \varepsilon_{t} = H^{1/2} \;\eta_{t} \\ \end{aligned}$$
(1)

where ηt is a vector of independent and identically distributed random vectors.

According to the study, from Eq. (1), \(r_{t}\) is a 5 × 1 vector of returns, μ is a 5 × 1 vector of constants, \(\Phi\) is a 5 × 5 matrix of autoregressive coefficients, and \(\varepsilon_{t}\) is a 5 × 1 vector of innovations:

$$\begin{array}{*{20}c} {r_{{t = \left( {r_{1t} , \ldots r_{5t} } \right)^{\prime } }} } & { \mu _{{ = \left( {\mu_{1} , \ldots \mu_{5} } \right)^{{^{\prime } }} }} } \\ {\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\Phi_{11} } & {\Phi_{12}}& {\ldots} & {\Phi_{15} } \\ {\Phi_{21} } & {\Phi_{22}}& {\ldots} & {\Phi_{25} } \\ {\Phi_{31} } & {\Phi_{32}}& {\ldots} & {\Phi_{35} } \\ {\Phi_{41} } & {\Phi_{42}}& {\ldots} & {\Phi_{45} } \\ {\Phi_{51} } & {\Phi_{52}}& {\ldots} & {\Phi_{55} } \end{array} } \\ \end{array} } \right]} & {\varepsilon_{{t = \left( {\varepsilon_{1t} , \ldots ,\varepsilon_{5t} } \right)^{\prime } }} } \\ \end{array}$$

The conditional variance is defined as

$$H_{{\text{t}}} = D_{t} R_{t} D_{t}$$
(2)

where Dt = diag (√ℎ11,t, √ℎ22,t, … ….√ℎ55,) is a diagonal matrix of standard deviations for each of the return series obtained from estimating a univariate GARCH (1,1) process formulated by the following equation:

$$h_{ii,t} = \omega_{i} + \alpha_{i} \varepsilon_{i,t - 1}^{2} + \beta_{i} h_{i,t - 1}$$
(3)

With ℎii,, the conditional variance depends on the unknown parameters ωi (the constant), αi, (the coefficient of the ARCH part of the process), and βi (the coefficient of the GARCH part of the process).

\(R_{t} = (\left( {Q_{t} } \right))^{ - 1/2} Q_{t} (diag\left( {Q_{t} } \right))^{ - 1/2}\) represents the time-varying conditional correlation matrix.

Qt is (n × n) variance–covariance matrix of standardized residuals, defined by:

$$Q_{t} = \left( {1 - \alpha - \beta } \right)\overline{Q} + \alpha DCC\varepsilon_{t - 1} \varepsilon_{t - 1}^{\prime } + \beta DCCQ_{t - 1} .$$
(4)

with

$$\overline{Q} = cov\left( {\varepsilon_{t} \varepsilon_{t}^{\prime } } \right) = E\left( {\varepsilon_{t} \varepsilon_{t}^{\prime } } \right)$$
(5)

\(\overline{Q}\) represents the unconditional covariance of the standardized residuals obtained by the univariate GARCH model α, and β are the parameters to be estimated. The sum of these coefficients must be less than one to respect the positivity of the matrix Qt.

To ensure that the matrix \(H_{{\text{t}}}\) is defined as positive, it is necessary to verify the conditions on the joint correlation coefficients:

$$\alpha DCC \ge 0\;{\text{and}}\; \beta DCC \ge 0,\;\alpha DCC + \beta DCC < 1$$
(6)

In the DCC-GARCH model, volatility is assumed to follow a symmetric response to volatility shocks. Usually, in the analysis of the financial data, negative market shock causes volatility to rise more than similar positive market shock. In this paper, we can improve the GARCH specification and forecasts by calculating volatility asymmetry if it is identified in the data. One of the asymmetric GARCH processes is the (EGARCH) model proposed by Nelson (1991). A feature of the DCC-EGARCH model is that the Dt matrix elements are generated not by using univariate symmetric GARCH processes, but by using an asymmetric EGARCH model, where the volatility is defined by:

$$\sigma_{t} = \sqrt {{\text{exp}}\left( {\omega + \alpha \left| {z_{t - 1} } \right| + \gamma z_{t - 1} + \beta \ln \left( {\sigma_{t - 1}^{2} } \right)} \right)}$$
(7)

In Eq. (7), the parameter γ reflects the effect of asymmetry. The DCC-EGARCH models estimate univariate EGARCH-type processes (which could differ for each asset). Then the EGARCH models are used to standardize the individual residuals. A second time, the correlation dynamics of these standardized residuals can be specified. We note that to adapt the EGARCH model to the multivariate case using a DCC specification, the changes relative to the symmetric DCC-GARCH model concern only the implementation of the first step of the procedure. These models offer the flexibility of the univariate GARCH family models without the complexity of multivariate GARCH, and the main benefit of the EGARCH model is the ability to calculate for potential asymmetries in the response to volatility shocks via the gamma term.

VAR-DCC-EGARCH-ANN model

Artificial intelligence modeling has recently attracted attention as a new technology in finance and economic forecasting areas. In this paper, we used an alternative approach that relies on an ANN to capture the nonlinear relationships between market volatility. In the prediction, ANN is a strong competitor to regression and time series. It is well suited to modeling problems with unknown variables. It is also appropriate when static circumstances or other conditions make traditional techniques ineffective and when applying a time series is difficult. In situations when it is necessary to learn linear or nonlinear mapping, the attributes that make up an ANN provide good solutions. As a result of these attributes, ANNs would be able to tackle complicated problems precisely and flexibly (Azadeh et al. 2007).

The ANN includes three layers: the input layer, the output layer, and the hidden layer. The neuron takes the values of the input parameters, adds a bias, and then adds them up using the weights assigned. The transfer function would be used to calculate the output’ value. The number of input parameters matched the number of neurons in the input layer. In mathematical terms, neuron \(P\) performance can be given as follows:

$$u_{P} = \mathop \sum \limits_{i = 1}^{n} w_{Pi} x_{i}$$
(8)
$${\text{y}}_{{\text{P}}} = \varphi \left( {{\text{u}}_{{\text{P}}} + {\text{b}}_{{\text{P}}} } \right)$$
(9)

where \({\text{x}}_{1} , \ldots ,{\text{x}}_{{\text{n}}}\) are denoted as input parameters. \({\text{w}}_{{{\text{P}}1}} , \ldots ,{\text{w}}_{{{\text{Pn}}}}\) are defined as the connection weights of neuron \({\text{P}}\).\({\text{ u}}_{{\text{P}}}\) is given as the input combiner while \({\text{b}}_{{\text{P}}}\) is denoted as the bias. \(\varphi\) is the activation function. Finally, \({\text{y}}_{{\text{P}}}\) is denoted as the neuron output. Details about the ANN can be found in Moghaddam et al. (2016).

In this paper, a multilayer feed-forward back propagation neural network is used. The proposed hybrid ANN model uses a Levenberg–Marquardt algorithm as a training algorithm. This algorithm is used to solve a nonlinear least squares problem (Selvamuthu et al. 2019).

VAR-DCC-EGARCH was first created, as explained in the previous section. Second, ANN used lagged returns and predicted conditional volatility from the VAR-DCC-EGARCH models. Thus, the proposed method is created by inputting the outcome of the preferred VAR-DCC-EGARCH model into the ANN, called a VAR-DCC-EGARCH-ANN model.

Results of the VAR-DCC-EGARCH model and VAR-DCC-EGARCH-ANN model

For each time series, the relationships between assets’ returns that influence each other were analyzed. The conditional mean equation is estimated using a VAR(1) model (Tables 30, 31 in Appendix D). Before the COVID-19 period, the results show that there was no significant return spillover between the series. However, during the COVID-19 period, the coefficients of own mean spillovers for Bitcoin and gold were significant. Then, the lag of the returns had a direct effect on the current returns of these assets.

This effect is positive for gold, while it is negative for Bitcoin. The cross-market spillover reveals a unidirectional negative return spillover from the stock markets to Bitcoin and a positive return spillover from gold to Bitcoin and from gold to Nasdaq. Accordingly, when Bitcoin returns increase, investors tend to decrease their investment in stock markets and increase their investment in gold.

In the next step, the residuals from the VAR(1) models are used to estimate the time-varying DCC series. Tables 4 and 5 present the estimation results of the conditional variance models. The Ljung Box test on the standardized residuals of the VAR-DCC-EGARCH models can be found in Tables 32 and 33 in Appendix D. The results of the test suggest no autocorrelation in the standardized residuals of our models.

Table 4 The performance measures of the VAR-DCC-EGARCH model (Period1: before the COVID-19 pandemic)
Table 5 The performance measures of the VAR-DCC-EGARCH model. (Period2: during the COVID-19 pandemic)

It can be seen from Tables 4 and 5 that the majority of the coefficients are significant. For some data series, the α coefficients from the variance equation are not significant, especially concerning the first and the second periods for Bitcoin and the second period for gold. However, the results show that the β coefficients from Eq. (3) are always significantly positive. This indicated that the lag volatility had a positive impact on the conditional volatility for all series. The leverage effect is significant for all data series, except Bitcoin and gold in the second period.

We noticed that the joint coefficients αDCC and βDCC, which represent the parameters of the conditional correlations, are significant. The persistence of the conditional correlation is calculated from the sum of αDCC and βDCC. For the two periods, we found a persistently high level of values superior at 0.9. The estimated VAR-DCC-EGARCH model parameters allow for determining the values of the conditional correlation for the pairs of series. The correlation values for a particular pair of series indicate the strength of the relationship between the two series. It also shows changes in the upward index and downward trends of these interrelationships over time.

Table 6 reports the means of conditional correlations. The tail behavior of Bitcoin and gold, as well as the stock market indexes, is very similar in terms of contemporaneous correlation. The results show that the conditional correlations are the lowest for gold and Bitcoin whatever the period considered, indicating the role of Bitcoin and gold in hedging against stock indexes.

Table 6 Means of conditional correlations

Conversely, the conditional correlation of stock market indexes is strongly positive with a value above 0.7 for both periods. Finally, the data comparison between both periods highlights the conditional correlation between Bitcoin and the stock market indexes over the second period.

Figures 6, 7, and 8 analyze the dynamics of the relationship between the Bitcoin, gold, and stock market indexes before and during the COVID-19 pandemic.

Fig. 6
figure 6

Conditional correlation of the Bitcoin market with the gold market before the COVID-19 pandemic and during the COVID-19 pandemic

Fig. 7
figure 7

Conditional correlation of the Bitcoin market with the S&P500 before the COVID-19 pandemic and during the COVID-19 pandemic

Fig. 8
figure 8

Conditional correlation of the gold market with the NASDAQ before the COVID-19 pandemic and during the COVID-19 pandemic

With the exception of pairwise comparison, conditional correlations are very volatile throughout the periods and markets, but they remain relatively low with values below 0.5.

The study found that there was a more positive dependency between Bitcoin and the S&P500 during the first part of each period, with the highest positive correlation in late 2020 (0.53). The decoupling between the Bitcoin and gold markets is more pronounced just before the beginning of the COVID-19 pandemic, and from 2021, with the highest negative peak obtained in late 2019 (−0.2).

In addition, Bitcoin has a higher relationship with the S&P500 with the most positive conditional correlation values, during the COVID-19 pandemic. In particular, the strongest correlation value is observed in March 2020, with a value above 0.5. This indicates that the behavior of Bitcoin is quite similar to traditional investments.

During the pandemic crisis period, correlations rose, reducing the effect of potential diversification of assets. Further, conditional correlations between gold-Nasdaq reached the highest positive values in the first period and the highest negative during the COVID-19 pandemic which brings into question its behavior as an asset class. This result confirms the general observation that gold returns are inversely related to the situation in the stock markets. Furthermore, the conditional correlations between gold and other assets are the lowest regardless of the period.

The forecasting performance of the VAR-DCC-EGARCH (1,1) model was, first, the predicted covariances and correlations are compared (Figs. 9, 10, and 11). They are both visually observed. Forecasting values calculated in a sample from the last 10 days, are represented in red. Correlations figures give focus on the last 20 days’ estimations.

Fig. 9
figure 9

Forecasted conditional covariance and correlation of Bitcoin with the gold market before the COVID-19 pandemic and during the COVID-19 pandemic

Fig. 10
figure 10

Forecasted conditional covariance and correlation of Bitcoin with the S&P500 before the COVID-19 pandemic and during the COVID-19 pandemic

Fig. 11
figure 11

Forecasted conditional covariance and correlation of gold with NASDAQ before the COVID-19 pandemic and during the COVID-19 pandemic

It was observed that the predicted interdependences of Bitcoin with gold are relatively low whatever the period (around 0.04).

The negatively correlated interrelations between Bitcoin and the S&P500 during the first period are expected to increase at the end of 2019, and during the second period, the forecasting values show a long-run tendency to behave as any asset investment with a positive correlation of around 0.2.

The same trend is observed between the gold and the Nasdaq for the first period, showing that at the end of 2019, the forecasted correlation values are positive but to a lesser extent (around 0.1). However, the forecasted conditional correlations are expected to decline during the COVID-19 period.

More generally, it should be observed that an increasingly noticeable value of the conditional correlations at the end of 2019 corresponds to the beginning of the pandemic period.

We carry out the analysis by forecasting conditional volatility (Figs. 12, 13). Forecasting results were calculated for horizons from 1 to 10 days. To compare the conditional volatility, we simply use the absolute values of daily returns as a proxy measure for the realized volatility.

Fig. 12
figure 12

Conditional volatility of all data before the COVID-19 pandemic

Fig. 13
figure 13

Conditional volatility of all data during the COVID-19 pandemic

From the above graphs, we can observe that the volatility has a time-varying nature. While the volatility trend is similar to the stock market indexes with a sharp increase at the end of 2019, Bitcoin has two phases with relatively low volatility until the end of November 2018 and a strong upward recovery thereafter. As for gold, it seems to have stochastic volatility. While the forecasted conditional volatility for stock market indexes and Bitcoin follows a similar upward trend, the gold volatility prediction is stable.

In the second period, all markets show close movements of volatility to higher levels than before gold which acts differently from the others.

The gold market does not seem to be integrated with the other markets over the whole period. One of the major reasons for this smooth volatility in the gold market is the herding behavior of investors toward the markets where their returns were relatively much higher in particular in Bitcoin. Therefore, the forecasts of volatility are then expected to rise.

To test and compare the forecasting ability of our model, we use different measures of forecast error accuracies. The average squared difference between outputs and targets is known as MSE. It is better if the value is as low as possible. There is no error if the value of MSE, RMSE, and MAE is zero. Three performance measures, including MSE, RMSE, and MAE, are used to compare the results of the proposed methods. Table 7 shows the performance measures of the methods before and during the COVID-19 pandemic.

Table 7 The performance measures of the proposed models

The MSE, RMSE, and MAE measures reveal that the VAR-DCC-EGARCH model performed better for Bitcoin during the COVID-19 pandemic. To obtain better forecasting values, the VAR-DCC-EGARCH-ANN model is applied to predict Bitcoin, gold, and stock markets’ values. The results of the performance measures, including MSE, RMSE, and MAE, demonstrate that the proposed VAR-DCC-EGARCH-ANN has remarkable prediction performance for Bitcoin, gold, and stock markets. For example, MSE’s maximum value is 0.000028617. To model and predict nonlinear time series, VAR-DCC-EGARCH-ANN can be used as a powerful computational method for Bitcoin, gold, and stock markets.

Discussions and conclusion

Since late 2019, COVID-19 has spread around the world, affecting more than human health. There has been an unprecedented worldwide economic recession, caused primarily by political restrictions, such as stay-at-home mandates and business closures. The value of the dollar, the euro, the pound, and other global currencies fell sharply, as well as industrial and economic indicators such as the S&P 500, Nasdaq, and Dow Jones in the United States, which have reached a point on the chart that may be unprecedented in the last two decades. At the same time, bondholders have seen their savings value decline.

This paper investigates the dynamic nexus of Bitcoin, gold, and American stock markets during the COVID-19 pandemic. We tested the model conditional volatility, and we used VAR-DCC-EGARCH and VAR-DCC-EGARCH-ANN models to observe spillovers across markets and the nature of such spillovers through different periods.

We explored the relationship between Bitcoin and other financial assets’ volatility using data from Bitcoin, American stock indexes (S&P500, Nasdaq, and Dow Jones), and gold prices. Because the Bitcoin market exhibits low dynamic conditional correlations with financial assets during the stability phase, our findings support the notion that they are a new investment asset class. However, we notice that the link between Bitcoin, American stock indexes, and gold has strengthened since the beginning of 2020, confirming the coronavirus’s contagious effect.

We tested whether Bitcoin can be used as a stock market hedge in our study. We have looked into the advantages of hedging through diversification between Bitcoin and stock markets. We may compare its hedging ability to that of gold using this method of study. If the COVID-19–confirmed case shocks are integrated into variance specifications, our empirical findings demonstrate a substantial dynamic conditional correlation between the Bitcoin, gold, and stock markets. The existence of the financialization of Bitcoin, gold, and stock markets is demonstrated by these empirical findings.

Based on our results, the estimate of the VAR-DCC-EGARCH model parameters allows for determining the values of the conditional correlation for the pairs of series. By using the VAR-DCC-EGARCH model, we observed that the tail behavior of Bitcoin and gold, as well as the stock market indexes, is very similar in terms of contemporaneous correlation. Also, MSE, RMSE, and MAE measures reveal that the VAR-DCC-EGARCH estimations achieve better forecasting performance during the COVID-19 pandemic for the stock market indexes, while for the other assets, the model better explains the volatility before the COVID-19 pandemic period, especially for gold.

The results of performance measures—including MSE, RMSE, and MAE—demonstrated that the proposed VAR-DCC-EGARCH-ANN has remarkable performance for the Bitcoin, gold, and stock markets.

The forecasting performance comparisons between the econometric model and the ANN model show that the proposed ANN model forecasts Bitcoin with higher accuracy. This confirms that Bitcoin price excess volatility is better captured by the VAR-DCC-EGARCH-ANN model.

These results can be confirmed in future research by including a greater number of hybrid ANN types and architectures. Particularly, to determine if hybrid models have been shown to outperform in different forecasting experiments and to understand to which specific situations each model may be better suited. This would expand the evidence obtained in this study and provide greater guidance on which models to use for different volatility profiles for the best forecasting results.

Our findings contribute to the study of the pandemic’s financial and economic effects by demonstrating that “COVID-19 surprises” have bidirectional spillover impacts on the Bitcoin, gold, and stock markets. These results demonstrate that while all markets have shown signs of “COVID-19 surprises,” there was a difference in the extent to which the pandemic influenced the financial markets.

Managerial and theoretical implications

This paper provides evidence on which analyzed assets provide the best safe haven for investors in times of crisis. In addition, there are important implications for investors who seek protection from downward movements in financial markets. Furthermore, our findings could be of interest to regulators and governments when engaging in further discussions on the role of Bitcoin in financial markets.

The results of our study also give theoretical proof that COVID-19 affected the Bitcoin, gold, and stock markets.

From a policymaking perspective, getting accurate practical justifications for the volatility of the Bitcoin, gold, and stock markets during the COVID-19 pandemic is an essential stage in establishing advantageous monetary policy strategies and correct tactics.

From the perspective of portfolio risk managers, the diversification benefits of Bitcoin are generally consistent and increase dramatically during periods of market volatility. As a result, using Bitcoin in a stock market portfolio lowers the portfolio’s risk.

These findings have important implications for investors and portfolio managers. Also, our findings have substantial implications for regulators’ oversight of financial markets during a global crisis, as well as investors’ cross-market hedging of systemic shock spillover risks.

Limitations of the study and scope of further research

The key limitation of the study is the small study duration that is covered by the pandemic period. The extension in time gives more choices to select other proxies as a market return to evaluate financial markets. In addition, it is still unclear whether the economic or political conditions of each country under study may affect the empirical results.

These limitations open the door for future research to investigate the nexus between the volatility of the Bitcoin, gold, and stock markets over a longer period and for the development of different models to help policymakers, investors, and portfolio risk managers invest in these markets. Additionally, an expanded analyzes of the observation of structural breaks in the level of correlation with the separation of high- and low volatility periods of the Bitcoin, gold, and stock markets concerning the reported volatility interaction, it would be interesting.