1.
Introduction
Crude oil, being termed as "industrial blood", has long been not only an strategic material for operations of the global economy (Aastveit, 2014), but also a key source that fluctuates the dynamics of the financial system (Georgellis, 1994). Since the beginning of the 21st century, the oil market has featured evident characteristics that closely links to industrial production while exerting an important influence on the financial sector, leading to oil-related assets featured with increasingly-evident financial attributes (Ren et al., 2022a, b). Recently, changes in financial market trends are no longer the only important factors affecting stock prices, while globally important commodities like oil also manifest marked influences on fluctuating the stock market dynamics (Ahmed and Huo, 2021; Hu and Ying, 2017). In parallel, along with changes in the demand and supply of oil, the volatility of stock prices varies accordingly (Chiou and Lee, 2009), which would then have an enormous impact on the economic and financial system worldwide and even the way of life of (Zhang, 2017; Zhao et al., 2016). Such changes in the oil market could result in oil shocks, which would then further affect stock market volatility.
It is known that oil can affect stock price volatility which makes the risk of market rise (An et al., 2018). Therefore, it is important to account for the role of oil shocks in driving the stock market dynamics and the associated systemic risk. While existing literature examines the impact of a single oil price shock on the stock market (Shahrestani and Rafei, 2020), but they are questioned by the fact that only one component of the oil price dynamics is considered, leading to the overfitting of the corresponding results. At the same time, there exists related literature that employs various linear models for the prediction analysis such as the quantile approach (Xu et al., 2019), and GARCH-type models (Cunado and de Gracia, 2014). However, the linear framework is often questioned by limited predictive power and a relatively large variance of asymptotic unbiasedness in a large sample (Duan et al., 2021; Barsky and Kilian, 2001).
To this end, we follow the literature Lu et al. (2021) and fill the gap by making a comprehensive decomposition on various types of oil shocks that contains NPI, ANP, SNP, LPI, NPI2, respectively. By using an international daily dataset ranging from 1 January 1989 to 31 January 2020, the prediction of the stock market dynamics is then investigated under a Fourier transform-based LSTM framework, while considering the aforementioned five types of oil shocks. As for the oil shock decomposition, it is worth noting that we extend the literature by testing significance of the five oil shocks' coefficients through gradient descent and thus capture the main elements. Then we apply predictability metrics and conduct a series of robustness tests to examine the performance of different models for oil shocks over a predictable forecast horizon.
Several important findings emerge from our analysis. First, the five oil shocks are found to have either positive effects (e.g., NPI, LPI, SNP and NPI2) or negative effects (i.e., ANP) on the stock market volatility during the in-sample prediction. Accordingly, estimated coefficients of the contemporaneous impact of the five oil shocks on the stock volatility dynamics are 0.0024, 0.0018, 0.0153, 0.0420, -0.0005. In terms of effectiveness of the predictive role of oil shocks, ANP, SNP and NPI2 are shown to be more efficient in learning stock market volatility, while NPI and LPI entail relatively larger training rounds with relatively insignificant predictive power. Moreover, the Fourier transform-based LSTM model is found to be superior to other competing models, indicating that the Fourier transform helps enhance the stock volatility prediction. Robustness of our results is further checked through a battery of additional analyses including the alternative evaluation method, and different forecasting horizons, etc. Our results are important and possess practical implications for various stakeholders.
This paper is organized as follows. We conduct a literature review in section 2. Several oil shock measures are used in section 3, along with some mathematical provement and efficiency of comparative models. Section 4 shows the evaluation results of our empirical analysis and conducts related tests. Section 5 makes a conclusion.
2.
Literature review
The mystery of international crude oil price volatility is one of the tantalizing problems that economists have been trying to unravel, and it is also one of the world's most difficult problems (Dickey and Fuller, 1979). Since the oil crisis in 1974, the issue of oil prices has received increasing attention from academics and government agencies at home and abroad (Haugom et al., 2014), and has now become the focus of attention in the world economy, politics and diplomacy. Since oil resources have become urgent and important for the development of the world economy (Liow et al., 2021; Charfi and Mselmi, 2022), many scholars have developed various forecasting methods to predict oil prices. In 1931, Hotelling proposes the famous depletable resource model to study the mechanism of oil price formation. By assuming different market participants and oil market structures, they establishes various theoretical models to analyze and predict the causes and trends of international crude oil shocks. In addition, since international crude oil prices are time series reflecting the supply and demand information of the oil market (Ren et al., 2022c), scholars at home and abroad usually use time series methods to study and forecast international crude oil prices, such as Granger's causality research method (Rapach et al., 2010), Box and Jenkins' ARIMA (autoregressive integrated sliding average) model method (Wei, 2003), Engle's ARCH (autoregressive conditional (heteroskedasticity) model approach, the co-integration theory and error correction model proposed by Engle and Granger in 1987, etc.
At the same time, there exists an ongoing strand of research for the stock price volatility. In terms of stock market volatility characteristics, Fama (1970), in his seminal study of stock returns, finds that the nth period volatility of returns is affected by prior period volatility, showing initial volatility clustering and the presence of conditional heteroskedasticity effects. Chen and Zhu (2007) in their study of stock volatility clustering in different industries, show that in the presence of major unexpected events, all industries volatility shocks emerge, but the degree of volatility varies. Chen and Zhou (2002) conduct an empirical analysis of China's SSE Composite Index through a GARCH family model and find that, similar to stock markets in Europe and the United States, volatility clustering exists in China's stock market. Chen (2009) conducts a study based on the daily returns of the CSI 300 index through the ARCH family model and conclude that the daily return volatility of the CSI 300 index is not only characterized by clustering and persistence, but also shows a spike and a thick tail. LIU and WANG (2017) analyze the returns of SZSI component index and SSE Composite Index by ARMA-TGARCH-M model. They point out that both indices have the characteristics of volatility agglomeration and spike back tail, and there is a long duration of external shock volatility.
Regarding the stock market dynamics driven by oil shock, Duan and Wang (2016) focuses on emerging market countries and analyzes the relationship between stock prices and oil prices through a VAR-BEEK-GARCH model, and the study shows that international oil shock have a certain degree of directional effect on stock volatility, while oil prices are not significantly influenced by stock market fluctuations. Sun and Yang (2012) use a VAR model to examine the relationship between stock prices and oil prices using a dataset ranging from 2007 to 2011. He (2012) uses a VAR model to analyze the daily data of Brent crude oil spot price and SSE Composite Index during 2007–2011. The results show that although oil price shocks affect the SSE Composite Index, the effect is insignificant. He et al. (2020) analyzes the relationship between stock market and oil price volatility after the stock reform in China, using various GARCH-type models, and concludes that oil price volatilized has an inverse effect on the stock market in normal market conditions. Such the relationship is not evident under extremes conditions. He and Wang (2013) use a VAR model to investigate the relationship between WTI crude oil spot price, Daqing crude oil spot price, and SSE index by using a VAR model. The study shows that the SSE index return is not significantly affected by Daqing crude oil spot price movements, while the SSE index is positively impacted by WTI crude oil prices. Cheng and Chang (2016) employ a VAR model using weekly data from 2011–2015 to analyze whether the share prices of listed oil companies in China are affected by oil price shocks. The empirical test shows that oil price volatility only affects share prices of two subsidiaries of CNPC. It still remains a question that how oil shocks affect stock market since views are multiple, either positive or negative, and the forecasting methods that currently exist are somewhat deficient in terms of accuracy.
3.
Method and data
3.1. Monthly realized volatility
Following previous researchers, we're inspired by some achievements (Christiansen et al., 2012; Ren et al., 2022c). Due to the various application of the S & P 500 index, we take it as an resource to build the data set. Moreover, It is rather easy to calculate the monthly realized volatility (RV in short) from daily returns. The way of computing this index can be expressed as below:
where M represents the index of samples in month t, rt,j acts as the jth daily return of month t.
3.2. Five oil shock measurements
Inspired by Maheu et al. (2020) which establish oil shock measures based on quarter, we adopt five kinds of oil shocks as the input variable, which can be shown more deeply later.
1. Net price increase
According to Maheu et al. (2020), net price increases can be expressed as:
where Ot shows what WTI oil futures' price is at t period. Additionally, O∗t=max{Ot−1,…,Ot−36} is calculated on the past three years as research (Hamilton, 2011) depicts that data based on three-year has more contribution to the performance of predictions than that in one-year.
2. Asymmetric net price change
Considering both positive and negative shocks (Qiao et al., 2019; Sukharev, 2020), the asymmetric predictive power should be considered in prediction.The calculation of a positive shock is illustrated before. And a negative shock can be gained as follows:
where O∗∗t=min{Ot−1,…,Ot−36} is calculated by the three-year data as it in NPI.
3. Symmetric net price change
Knowing that it's valid to put the constraint identically on the positive shocks along with negative shocks as a method to improve the performance of forecasting (Kilian and Vigfusson, 2013), we also adopt this kind of measurement:
where d+t indicates the net price increase, while the net price was represented as d−t decrease. The occasion that a shock of oil prices is from the highest to the lowest means the measurement will be zero since both kinds of shock are dealt with in the same way.
4. Large price increase
Based on the common expectation theory, an unexpected shock will make an enormous influence on the stock price. This index can be used the same as Kilian and Vigfusson (2013), which is:
where I() is an indicator function, which means only when the argument is true can its result be one while zero in other situations.
5. Net price increase indicator
The indicator's value is 0 or 1 to find out if there is an increase of oil price over O∗t, which can be formulated as:
where d+t represents the net price increase. This indicator can lessen outliers' effect which might be shown the capability of capturing this kind of asymmetric shock.
3.3. The Revised Benchmark AR Model
The result of (Paye, 2012) shows that, the volatility of stock relates to actual economic circumstances a lot with a slight hysteresis. Moreover, current economic conditions are reflected in this phenomenon, meaning that lagged volatility includes necessary information (Wen et al., 2022; Xiao et al., 2019). Based on the information standard of AIC and SC (Barsky and Kilian, 2004), 1 lag of volatility is conducted to carry on the prediction. Following the concept, the autoregressive (AR) containing 1 lag is defined:
where RVt−1 refers to 1 lag of RV, ϵt represents the stochastic component.
Adding five types of oil shocks to this basic model, we can understand the effects of them better, which can make comparasion with each other in forecasting performance:
Referring to the conclusion given by Zhang et al. (2019), combining various approaches contributes a lot to the forecasting process which will be better than individual model's average performance considering that actual market conditions keep altering, and there will be many outliers that are not easy to detect immediately. As a consequence, a multi-forecast model is conducted to largely lessen the uncertainty. This is achieved by aligning weighted averages to various models.
Assume that each weight is w1,w2,w3,w4,w5.
which can be redenoted as,
3.4. Long Short-Term Memory
Long Short-Term Memory (LSTM) is a kind of temporal recurrent neural network, which is particularly conducted to fix the long-term dependence issue of general recurrent neural networks, and can achieve the prediction of periodically varying values (Clark and West, 2007). The gates in LSTM include the input gate, the forget gate and the output gate. The mentioned gates contribute to the model differently, acting as multiple functions together. Deciding the refreshment part of the input information is the function of the input gate, which can result of gaining the result iteratively. As its name, the forget gate aims to forget some kind of information, namely kept part of the information in the former memory cell, which helps to reduce the phenomenon of over fitting. At last, the output gate decides what kind of information should be treated as the final outcome. The three gates and formulas are as follows:
where ht−1 is the output of the previous layer, xt is the current layer input, σ is the sigmoid activation function that maps variables between 0 and 1, wf,wi,wc,wo is the network weight, b is network bias, ct−1 is the memory unit of the previous moment, ct is the memory unit of the current state, and ht us the output of LSTM unit.
3.5. Fourier transform
Fourier transform, which represents the ability to indicate a certain function satisfying certain circumstances as a linear combination of trigonometric functions along with their integrals, by which the period of the change data can be found.
Suppose there is a polynomial,
Divide the polynomial f(x) into two parts according to the parity of the a subscript.
Suppose f1(x),f2(x),
Then we gain,
And since,
So when substituting wkn(k<n2) into f(x),
And when substituting wk+n2n(k<n2) into f(x),
This translates into a recursive solution of the subproblem.
3.6. Gradient descent
Gradient descent turns out to be one of the most popular methods as a way to solve optimization questions with no constraints (Engle et al., 2013). By step to step refreshment strategy of changing the values of parameters according to the gradient direction of the object function, the results can be gained easily by this kind of method which shows good property since it works simply for the computer to conduct.
According to the bias between prediction and actual value, we can easily find that for regression function,
in which ω,b denote the vector of coefficient and intercept, its loss function is,
in which i denotes the i-th sample of the data set.
For the cost function Eˆω, following the common denotion, we replace Eˆω with J(θ), and ω,b with θ0,θ1.
Actually, it is relatively easy to write in math form:
Repeat until convergence
In which α denotes the learning rate, and the parameters should be refreshed simultaneously. The reliance on the loss function to approximate the actual parameters is more sensitive, which makes it a good identification of oil shocks.
As for the multi-linear regression, the algorithm works the same except for additional individual parameters refreshment, which means each parameter in each iteration is updated simultaneously based on the gradient of the previous round, making the contemporaneous parameters without time series correlation.
Actually, different parameters needs different learning rate, RMS and RMSProp can be used to help fix this situation.In RMS condition,
While in RMSProp condition,
Through the above learning rate adjustment, the recognition of oil shock will be more sensitive, and even solve some unrecognizable problems that cannot be solved by traditional joint cubic equations.In addition, this will also improve the prediction effect by filtering out the main factors influencing the prediction problem in the latter order.
3.7. Data
This paper studies the role of oil shocks on the stock volatility prediction where the data information of the crude oil and stock markets is respectively represented by WTI oil futures and S & P 500 index. Our employed data are from Global Financial Data between 1st January, 1989 and 31st January, 2020. As depicted in Table 1, the statistical properties of the variables involved are described in detail, in which ***, **and * denote rejections of the null hypothesis at the 1%, 5% and 10% levels, respectively.
The realization volatility of the S & P 500 Index is signed as RVt. Five oil shocks are measured by five measurements mentioned before. Q(n) represents the test that Ljung and Box (1978) proposed as the Ljung-Box statistic (Choi et al., 2018). In Table 1, it can be found that the kurtosis of variables above show high feature. The Ljung-Box test shows there are serial auto-correlations of 22nd order among the RV, LPI, and NPI2. Moreover, it can be obviously seen from the ADF test that sample data are stationary since no sign of unit root is observed at the 1 % significance level.
4.
Empirical analysis
4.1. Regression by Gradient Descent
Using the RV of given data, we then put it into the model established as follow. By the equation we obtained before, which is,
The loss function of it is,
in which yt represents the true value of ln(RVt) while Ln(ˉRVt) denotes the prediction value calculated in equation 32.
In solving for the minimum of the loss function, gradient descent can be conducted to solve iteratively to minimize the loss function and then the values of parameter can be refreshingly converged to the final result. After the previous model, the individual β coefficients can be obtained after 100000 cycles of stabilization.
The result is (0.6966, 0.7273, 0.0024, -0.0005, 0.0018, 0.0153, 0.0420), from which we could conclude that the first, third, fourth, fifth shock has positive effect to RVt while the second shock has negative effect to RVt. Since the regression coefficient of the previous period on the current period in this regression equation is as high as 0.727308431, which makes it the most main factor to prediction. To reduce the complexity of the model, the following forecasts use time series data to predict RVt rather than forecast other index. The input items are RVt−1, NPI, ANP, SNP, LPI, NPI2, and the output of them is RVt, corresponding to our prediction work.
4.2. Finding the Period by Fourier Transform
To predict the RVt, at first we look at the RVt changing by time.It is easy to see through the curves that there is a clear cyclical nature to volatility changes, but the random wandering behavior makes forecasting harder than regular indicator movements, which is caused by the many endogenous effects of oil shocks.
Combining the previous equation for the calculation, we obtain its period as 68.7 months.As mentioned, studies usually take the relation between oil shock and the volatility stock as a liner relation while it actually isn't, which results in neglecting the slope heterogeneity of them according to specific occasions. This may be one of the reasons we don't find the same way on the nature of their relationship since it might lead to several biased findings in such relationship. The results will be improved if their periods are obtained by fourier analysis and combined with oil shocks to perform LSTM forecasting.
4.3. Prediction by LSTM
In the model setup, we use a three-layer structure, with 512 neurons in the first layer and 128 neurons in the second layer, and then use sigmoid to finally map the data between (0, 1) after summing the 128 data in the third layer, and compared with the labeled values to calculate the loss after optimizing the coefficients and then entered the next round of training.We set a total of 1500 epochs to train the LSTM model and observe the loss at the end. If the loss is too high, we add a dropout layer to retrain the model for that data. The final prediction results and images can be obtained.
Then, the prediction for the later 72 months is combined with the previously derived later period.
4.4. Forecast Analysis
It is obvious to find that our proposed model is better than the current model in all aspects than the test set outside the sampling range by all metrics as shown in Table 2. Besides the six variables we mentioned before, there are 5 other generally adopted ways to make prediction, which are mean, median, trimmed mean, and discount mean squared which contains two ways, namely the DMSPE1 and DMSPE2 (Gokmenoglu et al., 2021). The following findings are presented. First, regarding the results of forecasts, the R2OOS(%) values of AR-LPI are higher than 0 while others have a R2OOS(%) value lower than 0, which means such models behave worse than the benchmark model in forecasting. Second, the R2OOS(%) of Fourier-LSTM is 19.984, which means fourier transform based LSTM increases the correctness by 19.9841% more than the benchmark, showing the fourier transform way contributes to forecasting to some extent.
The sudden jump in financial returns is partly due to structural breaks which is because of the investors' multiple expectations about the future of the stock as well. The excellent performance of the LSTM can also be attributed to the treatment of noise in fourier transform that allows the model to effectively identify cyclically varying anomalies and reject them, which make it avoid noise and overfitting problems.
4.5. Robustness Test
The QLIKE and MSE are adopted as an index to evaluate the robustness. Refering to Hansen et al.(2011)'s conclusion, the model confidence set (MCS) is used to measure how the performance the model will act in test set. Additionally, the stationary bootstrap method is applied to compute the p-value of model confidence set test. Table 3 shows all the results.
In the research of predicting international crude oil shock by models, in order to enhance the interpretability of model prediction results, most of the research scholars analyze and predict the future international crude oil price movements by studying the influencing factors related to international crude oil prices and using statistical methods such as correlation coefficients and multiple regression models, while the above-mentioned due to the different degrees of influence of different influencing factors on international crude oil prices in different periods. In particular, it is difficult to identify the impact of short-term international crude oil shock on stock market returns due to the combined effect of multiple influencing factors.
However, our experimental results effectively confirm that the prediction method solves the above problems. Table 3 shows all the results. Some findings are listed. First, only the based on QLIKE is the MCS p-values greater than 0.25 in five forecasts, all of which are less than 0.25 when computing the MSE value of them. Moreover, the Fourier transform-LSTM' MCS p-values are greater than 0.25 in each occasion, indicating the fourier transform is efficient to improve the performance of predicting the volatility of stock market.
5.
Conclusions
This paper analyses the impact of various oil shocks on the stock volatility prediction by using Fourier transform based Long Short-Term Memory(LSTM). The oil shocks are decomposed into five components in a comprehensive manner. Based on a daily dataset involving the volatility of the S & P 500 index and WTI oil futures' price, we find that various oil shocks perform differential impacts on stock volatility dynamics by using gradient descent. The stock volatility is featured by an evident autoregressive feature that the current stock volatility it is found to be significantly driven by its past values. Moreover, by considering the role of five oil shocks on the stock volatility dynamics, our results show that the LSTM method containing fourier transform can contribute to the performance of forecasting which is valid in economic and test meanings. Additional analyses reassure robustness of our findings.
Our paper sheds new lights on clear interpretation regarding the role of oil shocks in stock market dynamics and prediction of the latter, both of which help market participants make sensible decisions to investment risk reduction. Moreover, our obtained results further help policymakers and investors anticipate the market volatility by using a superior forecasting method, formulate reasonable risk management when encountering unexpected oil shocks, reduce systemic risk, and thus enhance effectiveness of financial market interventions. In addition, as a research extension, in the future research agenda, other potential stock volatility drivers on the stock market dynamics such as macroeconomic factors and policy shifts will be further considered in the stock volatility prediction. In addition, future agenda for research extension might be considerations of the role of other potential drivers in the field of macroeconomics and policy for stock volatility.
Acknowledgement
This research was supported by the Natural Science Fund of Hunan Province (2022JJ40647).
Conflict of interest
All authors declare no conflicts of interest in this paper.