Investor Happiness and Predictability of the Realized Volatility of Oil Price

We use the the heterogeneous autoregressive realized volatility (HAR-RV) model to analyze both in sample and out-of-sample whether a measure of investor happiness predicts the daily realized volatility of oil-price returns, where we use high-frequency intraday data to measure realized volatility. Full-sample estimates reveal that realized volatility is significantly negatively linked to investor happiness at a short forecast horizon. Similarly, out-of-sample results indicate that investor happiness significantly improves the accuracy of forecasts of realized volatility at a short forecast horizon. Results for a medium and a long forecast horizon are insignificant. We argue that our results shed light on the role played by speculation in oil products and the potential function of oil-related products as a hedge against risks in traditional financial assets.


Introduction
The oil market's recent financialization has led to increased participation of hedge funds, pension funds and insurance companies, in the market, thus, rendering oil a profitable alternative investment in the portfolio decisions of financial institutions [1][2][3][4][5] (Bahloul et al., 2018, Bonato 2019. Hence, accurate estimates of oil-price volatility are of vital importance to oil traders. At the same time, this is a concern from the policy perspective, as oil-price volatility has been shown to negatively impact economic activity as well since it captures macroeconomic uncertainty [6,7] (Elder and Serletis 2010, van Eyden et al., 2019). Oil-price fluctuations have also many consequences for most non-energy producing companies by increasing the cost of doing business. Companies always seek new ways of managing oil-price volatility, and governments are concerned about the impact of oil-price volatility on economic growth and prosperity. A better econometric understanding of oil-price volatility is vital for its effective management and could lead to a competitive advantage by reducing operating costs and business risk. According to [8] Henriques and Sadorsky (2010), the key is an increase in a firm's environmental sustainability because it goes in line with a lower energy-price exposure. However, in the short term, it is economically important to proceed with a systematic characterization of the types of events that cause oil-price volatility to fluctuate over time. In light of this, high-frequency forecasts of oil-market volatility can be used in mixed-frequency models to predict the future path (Hong andYogo 2012, Singleton 2014). At the same time, if investor sentiment weakens, with oil-related products now serving as a possible hedge against risks in traditional financial assets [31,32] (Olson et al., 2017(Olson et al., , 2019, trading in the oil market may increase, resulting in higher volatility, and hence a negative relationship between RV and the happiness index. To the best of our knowledge, this is the first paper to analyze the role of the happiness index in out-of-sample forecasting of the realized volatility of oil-prive movements. Two papers related to our work are the studies by [33,34] Qadan and Nama (2018) and Zhang and Li (2019), who provide in-sample evidence of predictability from measures of investor sentiment for oil-market volatility at daily, weekly, and monthly frequencies, but not based on intraday data, using various linear, nonlinear, and frequency-domain (wavelet) econometric methods. Somewhat related are the analyses of [35,36] Guo and Ji (2013) and Ji and Guo (2015). They look at the role of internet-searches on oil-related events for in-sample predictability of oil-market volatility. [37] Campbell (2008) highlighted that the best test of any predictive model (with regard to the econometric methods used and in terms of the predictors employed) is in its out-of-sample performance, and, hence, our analysis can be considered to be a robust extension of the works of [33,34] Qadan and Nama (2018) and Zhang and Li (2019), given that in-sample predictability cannot obligatorily induce out-of-sample predictability.
The remainder of the paper is organized as follows: Section 2 describes the methods used in our empirical analysis. Section 3 presents our data. Section 4 summarizes our empirical results and Section 5 concludes the paper .

Methods
Building on the results documented by [38] Andersen et al. (2012), we use intraday data to compute the median realized variance (MRV) as our jump-robust estimator of the integrated daily realized variance of oil-price returns. Since there is chance of confusion, in this study we make use of the terms realized volatility and realized variance in an interchangeable way. The median realized variance MRV has the advantage that it minimizes the potential effects of market-microstructure noise and jumps in our study. More specifically, we use MRV because, first, it has has better theoretical properties than other tripower variation estimators. Second, MRV is a jump-robust measure of integrated variance. MRV is less biased than other estimators in the presence of jumps. Thereby, MRV helps us to keep our forecasting models parsimonious. Third, MRV mitigates the effect of microstructure noise and has better sample properties as compared to other estimators of realized volatility. Fourth, MRV has better finite-sample robustness in the presence of "zero" intraday returns during a trading day. We define MRV as follows: where X t,i stands for intraday oil-price return i within day t, and i = 1, .., T is the number of oil-price intraday observations (or T − 1 oil price returns within a day. The scaling factors make certain that every summand on the right-hand side gives an unbiased estimate of the underlying spot variance if the corresponding block of returns is i.i.d. Gaussian (see [38] Andersen et al., 2012 for more information regarding this issue). Variants of the HAR-RV model [21] (Corsi 2009) are employed for modeling and therefore forecasting daily realized volatility of oil-price returns. The key feature of the HAR-RV model is that it uses volatilities from different time resolutions to forecast the realized volatility of oil-price returns. The model, thereby, captures the main idea motivating the heterogeneous market hypothesis ( [39] Müller et al., 1997). This hypothesis stipulates that different classes of market participants populate the oil market, where traders in the different classes differ in their sensitivity to information flows at different time horizons (that is, short-term traders versus long-term traders). Despite its simple structure, the HAR-RV model can capture various volatility properties (i.e., long memory and multi-scaling behavior). The benchmark HAR-RV model is given as follows: where the index h stands the forecast horizon, the β's represent the coefficients to be estimated, and t+h represents the error term. We study a short and two longer forecast horizons: h = 1, 5, 22. As for the two longer forecast horizons, we follow earlier literature and use the average daily realized volatility over the forecast horizon being studied. Furthermore, RV w,t is the average RV from day t − 5 to day t − 1, while RV m,t stands for the average RV from day t − 22 to day t − 1. When we include investor happiness (H A) in the benchmark HAR-RV model, we get the following extended model: We also extend the benchmark HAR-RV model in several other dimensions. These other extensions render it possible to assess the role played by H A for forecasting realized volatility when we take into account other predictors commonly studied in the literature on realized volatility. Specifically, we extend the benchmark HAR-RV model to feature a measures of realized kurtosis (RKU) and realized skewness (RSK). In line with [40] Amaya et al. (2015), where scaling by √ T and T, respectively, implies that the magnitudes correspond to daily skewness and kurtosis. We consider RSK as a measure of the asymmetry of the daily oil-return distribution and RKU as a measure that allows us to capture extreme deviations far away from the center of the daily oil-return distribution. We also take into account jumps.
In line with [41] Andersen et al.
where N t is the number of jumps within day t, and κt, j is the jump size. Therefore, RV t is as a consistent estimator of the integrated variance t t−1 σ 2 (s)ds including the jump component. In this analysis, in order to detect jumps we construct RV t by the following: ∑ T i=1 X 2 t,i . Then, following [42] Barndorff-Nielsen and Shephard (2004), when lim T→∞ BV t = t t−1 σ 2 (s)ds, where BV t is the realized bipower variation given by BV t = µ −1 Thus, BV t is considered as a consistent estimator of integrated variance whiteout the jump component. We apply a formal test for detecting jumps. In line with [43] Barndorff-Nielsen and Shephard (2006), the jump test is given by where ν bb = π 2 2 + π − 3, ν qq = 2, and TP t stands for the Tri-Power Quarticity given by: t−1 σ 4 (s)ds even in the presence of jumps. Take into account that for each t the JT t D ∼ N(0, 1) as T → ∞. Finally, based on the study implement by [44] Zhou and Zhu (2012), the jump detection scheme is re-defined by the following: When we study the out-of-sample predictability of RV, we use a fixed-length daily rolling-estimation window. We use as our benchmark a rolling-estimation window that comprises 1200 daily data (which corresponds to approximately half the sample size), but we also study a somewhat shorter (1000 daily data) and a somewhat longer (1400 daily data) rolling-estimation window. In order to compare the out-of-sample accuracy of the different HAR-RV models (that is, the models without and with HA included in the vector of regressors), we use the modified [45] Diebold and Mariano (1995) test proposed by [46] Harvey, Leybourne and Newbold (1997). In doing so, we use the relative forecast errors to take into account the impact of heteroskedasticity on our results (e.g., [

Data
We employ intraday data obtained from West Texas Intermediate (WTI) oil futures traded in NYMEX over a 24 h trading day (pit and electronic) to calculate daily measures of realized oil-price volatility as well as realized skewness and kurtosis. The data (in continuous format) came from from www.disktrading.com and www.kibot.com. When the expiration of a contract approaches, we roll over the position of the contract to the next available one, given that there is an increase in activity. We define daily oil-returns in terms of end of day (New York time) price difference (close to close). As for intraday returns, we construct 5-min prices via last-tick interpolation, and we construct 5-min returns by taking the log-differences of these prices, which we then use to calculate the realized skewness and kurtosis. Following [51] Liu et al. (2015), a 5-min sampling frequency is adequate for liquid assets, such as WTI futures. In other words, on the one hand, such sampling frequency used in this study is not too low to give poor data analysis, while on the other hand it is not too high to give rise to spurious jumps because of market frictions.
It is clear that investor sentiment cannot be directly considered as a measurable or observable. Traditionally, two paths have been taken to measure investor sentiment ( [52,53] Bathia and Bredin 2013, Bathia et al. 2016). Taking the first path means that investor sentiment, as proposed by [54,55] Baker and Wurgler (2006,2007), is identified by several market-based measures that are used as proxies for investor sentiment, while survey-based indices comprise the second path. More recently, building on the research by [56] Da et al. (2015), who constructed an investor-sentiment index employing daily Internet search data coming from millions of households in the U.S. by emphasizing specific 'economic' keywords that mirror investors' sentiment towards economic developments, a third approach has originated. The idea motivating this third approach is to extract metrics of investor sentiment from news and contents of social media (for example, see [57] Garcia 2013). Da et al. (2015) [56] argued that their method, and in general the third approach associated with internet-based measure of investor sentiment, is more transparent compared to the two other competing market and survey-based approaches. This is because the former has the disadvantage of being the equilibrium outcome of many economic forces other than investor sentiment, while the latter is more likely to be beleaguered by measurement errors as it inquires about attitudes. Furthermore, both traditional approaches tend to produce metrics of investor sentiments at lower (monthly or quarterly) frequencies.
Keeping these points in mind, our proxy for investor sentiment corresponds to the daily happiness index derived from the website https://hedonometer.org/api.html. The raw daily happiness scores are extracted by means of a natural language processing technique based on a random sampling of about 10% (50 million) of all messages posted in Twitter's Gardenhose feed. In order to quantify the happiness of the atoms of language, Hedonometer.org merged the 5000 most frequent words from a collection of four corpora: Google Books, New York Times articles, Music Lyrics, and Twitter messages. The result is a composite collection of approximately 10,000 unique words. Then, using Amazon's Mechanical Turk service, Hedonometer.org had each of these words scored on a nine point scale of happiness, with 1 corresponding to "sad" and 9 to "happy". Words in messages written in English (containing about 100 million words per day) are assigned a happiness score based on the average happiness score of the words contained in the messages.
Our analysis spans the period from 9 September 2008 to 26 May 2017 on a daily basis, while the start and end dates of the sample used are solely restricted by the availability of the happiness index and the intraday data on oil prices, respectively. Basic statistics of the data used are given in Table 1.    As already mentioned in Section 1, the link between investor happiness and realized volatility of oil-price returns can be either positive or negative. Our in-sample results for the full sample of data demonstrate that, when we use the HAR-RV model to capture the implications of the heterogeneous market hypothesis for the dynamics of realized volatility, the estimated coefficient of investor happiness, H A, has a negative sign and is highly significant for h = 1, while the coefficient becomes insignificant and turns positive for h = 5 and h = 22. The results for the HAR-RV model for h = 1, hence, can be interpreted as indicating that, with oil acting as a hedge against risks in traditional financial assets, trading in the oil market and, as a result, volatility increase in times of lower investor happiness and, thereby, weaker investor sentiment. The results for the two longer forecast horizons, in contrast, suggest that investor happiness has no clear effect on the dynamics of the oil price, perhaps reflecting that the price pressure on oil is driven by a mixture of (i) the economic cycle (when investor happiness is high; the price of oil goes up in good market condition due to increase in industrial production), and, (ii) oil-market related shocks (when investor happiness is low). Any interpretation, however, should not be stretched too far given that the estimated coefficient of investor happiness for h = 5 and h = 22 is not significantly different from zero. Table 3 reports our main out-of-sample results. We report results for three different lengths of the rolling-estimation window, three different forecast horizons, and two loss functions (linear and quadratic). The results compare the accuracy of forecast computed by means of the HAR-RV model with the accuracy of forecast as extracted from the HAR-RV-HA model. The results are consistent across the linear and quadratic loss functions and strongly suggest that investor happiness improves out-of-sample forecast accuracy for the short forecast horizon (that is, for h = 1). Results for the two longer forecast horizons (h = 5 and h = 22 ) are not significant, which is consistent with the in-sample results. We next assess the robustness of our results. To this end, we document in Table 4 results for three alternative HAR-RV models. On one model, we add realized kurtosis (RKU) to the vector of standard HAR-RV regressors. In another model, we add realized skewness (RSK) to the benchmark HAR-RV model. In yet another model, we consider a measure of jumps as an additional regressor. Results are consistent across the three models: investor happiness improves forecast accuracy at the short but not at the two longer forecast horizons. As another robustness check, we used the fluctuation test developed by [59] Giacomini and Rossi (2010) to compare the HAR-RV with the HAR-RV-HA model. Corroborating the results we report in Table 3, the fluctuations test indicates a superior performance of the HAR-RV-HA model at the short forecast horizon. Results of the fluctuations test are available from the authors upon request.  [60], among others, proposed and further studied study the concept of downside and upside realized semi-variances (RV − and RV + ) as measures based entirely on downward or upward movements of intraday returns. RV − t and RV + t are computed by the following:

Empirical Results
} is the indicator function. Downside and upside realized semivariances allow us to capture the sign asymmetry of the prices process, which is crucial for portfolio risk assessment and management. Again, we observe significant test results, this time for downside as well as upside realized semivariance, for the short forecast horizon. The test results for the two longer forecast horizons are insignificant (Table 5).

Concluding Remarks
We have estimated various HAR-RV model to assess whether a recently developed search-based measure of investor happiness predicts the daily realized volatility of oil-price returns, where we have estimated realized volatility from high-frequency intraday data. We have reported results of both in sample and out-of-sample analyses. Our main finding is that, when we use the HAR-RV model to capture the implications of the heterogeneous market hypothesis, investor happiness is significantly negatively linked at a short forecast horizon to realized volatility as far as the in-sample analysis is concerned. In a similar vein, investor happiness improves the accuracy of short-term forecasts of realized volatility in our out-of-sample analysis. In sum, our empirical results are consistent with the view that (i) trading in the oil market and, thereby, realized volatility increase in times of lower investor happiness because oil acts as a hedge against risks in traditional financial assets, and, (ii) this hedging property helps to improve the accuracy of short-term out-of-sample forecasts of realized volatility of oil-price returns.
In a recent paper, [61] Deeney et al. (2015) developed sentiment indices directly related to the WTI and Brent crude oil markets using a suite of financial proxies similar to those used in equity research, though at lower (monthly) frequency. As part of future research, it would be interesting to develop such indices at daily frequency and use it in our forecasting experiment. This will allow us to compare the relative roles of the proxies of sentiments that are directly related to the oil market with those that measure the general mood of investors associated with the overall financial market. Finally, it would be particularly interesting to expand our study so as to see whether investor happiness predicts other energy commodities.