**1. Introduction**

#### *1.1. The Motivation for this Research*

Crises loom large in finance and macroeconomics. Defining transitions between bull and bear markets, or between recessions and expansions, helps identify distinctive financial or economic regimes. Commodity markets, especially those related to petroleum, undergo their own fluctuations. Indeed, abrupt and abnormal movements within these notoriously turbulent markets often signal trouble in other sectors of the broader economy. Oil price volatility, in particular, experiences structural shifts. The intense financialization of commodities, including crude oil and refined fuels, heightens the importance of identifying shifts and disruptions in volatility across time.

This article proposes a novel method for identifying critical moments in commodity markets, ranging from structural shifts to abrupt disruptions. It places special emphasis on

**Citation:** Chen, J.M.; Rehman, M.U. A Pattern New in Every Moment: The Temporal Clustering of Markets for Crude Oil, Refined Fuels, and Other Commodities. *Energies* **2021**, *14*, 6099. https://doi.org/10.3390/en14196099

Academic Editor: Periklis Gogas

Received: 31 July 2021 Accepted: 15 September 2021 Published: 24 September 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

markets for crude oil and refined fuels. Unsupervised machine learning can distinguish crises from normal conditions. It can identify anomalies within an economic time series and set those trading days apart for closer examination, as opposed to finding time time-varying effects through conventional analysis.

Recent work by the authors has demonstrated the use of clustering and manifold learning to arrange commodities into discrete markets for fuels, precious metals, base metals, and agricultural commodities by climate [1]. In an extension of that work, this article focuses more closely on the *temporal* domain of these markets. A suite of clustering can identify critical periods affecting all commodity markets, such as the 2008–2009 global financial crisis and the COVID-19 pandemic. These critical periods also affect markets specific to oil and refined fuels. Even closer examination reveals additional periods of special interest to energy-related markets. Most of those periods are shorter, acute supply disruptions through extreme weather or acts of war.

As between the clustering of commodities and trading days, temporal clustering poses the greater technical challenge and offers the greater practical reward. Discrete commodity markets number in the dozens. A comprehensive span of financial history can cover thousands of trading days. The configuration of commodities in metaphysical financial space need not observe a particular order. By contrast, cogent, temporally defined market regimes must represent contiguous or nearly contiguous blocs of trading days.

Certain branches of finance and macroeconomics seek to define cyclical peaks and troughs. Many conventional definitions of bull and bear markets or recessions and expansions within the broader economy, however, rely upon arbitrary benchmarks or even subjective judgment. If stock prices fall more than 20 percent from a recent peak, for instance, many analysts are prepared to declare the onset of a bear market. A 10 percent decline, by contrast, is labeled a "correction."

Relative to these arbitrary, categorical distinctions, a mathematically informed treatment of conditional volatility forecasts may identify contiguous or nearly contiguous clusters of trading days. Although this article does not immediately pursue the possibility, the methods that it applies may ultimately enable new ways to identify distinctive regimes in financial markets or the broader economy. Though bull-and-bear market indicators and peak-and-trough definitions of the business cycle will undoubtedly persist, data-driven alternatives or complements may arise from unsupervised machine learning and related forms of artificial intelligence.

Unsupervised machine learning also obviates disputes over the definition of local maxima and minima across potentially expansive spans of financial history. These methods serve as an extended metaphor for one of the greatest challenges in machine learning and artificial intelligence: determining whether a model has been globally optimized, or whether an optimization algorithm has converged locally.

By the same token, reliance on unsupervised machine learning presents challenges unique to this set of methods. Unlike conventional regression-based methods or their equivalents within predictive applications of supervised machine learning, unsupervised methods such as clustering and manifold learning are not typically used to validate research hypotheses. They struggle to perform either of the traditional tasks in economics. Other methods outperform unsupervised machine learning in forecasting values and in enabling causal inference. What unsupervised machine learning does excel in doing, however, is revealing patterns within data itself, without reliance on labels, values, or research hypotheses formulated by human analysts.

Mindful of the potential of unsupervised machine learning, as well as its limits, this article targets questions that routinely arise in traditional research on commodities, broader financial markets, and the real economy. This article answers those questions in the narrower, more specific context of energy-related commodities. There is intense interest in comovement and connectedness among commodities trading, financial markets, and macroeconomic phenomena. These relationships are known to vary across time. At its most

intriguing, time-varying conditional volatility supports hypotheses regarding cyclicality and structural shifts in many branches of economics.

This article asks whether raw data consisting of nothing more than logarithmic returns or conditional volatility forecasts can distinguish among ordinary trading days, acute crises that bend the arc of energy commodities trading sharply but only temporarily, and more enduring turning points that can credibly be described as turning points or structural shifts. If unsupervised learning succeeds in this task on a limited slice of the economic universe, then this article may support new approaches that can complement traditional peak-to-trough methods of defining cyclicality in financial markets and the broader business cycle.

#### *1.2. A Section-by-Section Summary*

Section 2 of this article reviews the literature on comovement and volatility spillovers in commodity markets, particularly those involving energy. Section 2 also reviews the literature on rules-based definitions of bull and bear markets and economic recessions. This extended review of the relevant economic literature provides complete background on volatility in crude oil and refined fuel markets. Section 2 ultimately explains why connections between commodities trading, financial markets, and the broader economy motivate efforts to describe cyclicality and other manifestations of variability in the volatility of energy-related markets over time.

Section 3 presents data sources and describes the unsupervised machine-learning methods underlying this article. Conditional volatility forecasts based on a GJR-GARCH(1, 1, 1) process for 22 commodity markets from 2000 through 2020 constitute the primary data source. The subarray containing volatility forecasts for four oil and fuel markets provides the central focus. Logarithmic returns, for all commodities and the energy-specific subset, constitute an additional source of data.

Section 4 aggregates results from five clustering methods—affinity propagation, meanshift, spectral, *k*-means, and hierarchical agglomerative clustering—as applied to a comprehensive market basket of 22 commodities and to a more focused basket of four energyrelated commodities: Brent, West Texas intermediate, gasoil, and gasoline. *t*-distributed stochastic neighbor embedding, or *t*-SNE, helps visualize all clustering results.

Meaningful temporal clusters for broader commodity markets delineate the global financial crisis and the COVID-19 pandemic. Focused clustering in energy-related markets identifies several additional critical periods for crude oil and refined fuel markets. Section 5 presents and distinguishes those two sets of results.

Section 6 discusses the implications of this article's findings for managers, investors, and policymakers. Critical periods in energy-related markets demand a different approach to hedging and risk management, not merely for commodity investors, but also for investors using commodities to neutralize other sources of risk. The role of energy-related crises in macroeconomic policymaking also warrants careful consideration.

The identification of temporal regimes in commodity markets through clustering suggests the generalizability of unsupervised machine learning to other markets and to macroeconomic data. The second half of Section 6 describes these and other possible paths for future research.

#### **2. Literature Review**

The economic literature germane to this article spans four distinct subjects:


This section addresses each body of literature in turn. A review of the relevant literature on unsupervised machine learning is deferred until Section 3s presentation of materials and methods.

#### *2.1. Price Volatility in Crude Oil and Refined Fuels* 2.1.1.OilPriceVolatility

Commodity markets figure prominently in developmental economics and international trade. Representing a quarter of global trade in goods, commodities provide the most important source of income for some of the world's poorest countries [2,3]. Because advanced economies rely so heavily on petroleum-based fuels for transportation and many industrial processes, the wealth of developed nations also hinges on oil-based commodities [4].

The pervasive financialization of commodities raises the premium on proper understanding of the price and volatility dynamics in these markets [5]. This is particularly true of crude oil and fuels refined from it [6–9]. Producers and industrial customers have the greatest stake, since oil price volatility directly affects investments in oil inventories, production and transportation facilities, and physical capital based on oil consumption [10]. These sunk investments demonstrate why "costly reversibility" is a prime mover in the economics of market structure and industrial organization [11–14].

Because of their intrinsic volatility and their dependence on global supply chains, energy markets are especially sensitive to external shocks. The diverse factors affecting oil prices include sociopolitical disturbances, shifts in the global supply and demand, and technological and regulatory changes promoting demand for renewable energy [15]. Discrete events, "such as wars, the release of OPEC production quota decisions, oil stock fluctuations and extreme weather," also affect oil prices [16] (p. 256).

Chronic or acute, these factors are never stable. Structural breaks punctuate the timevarying conditional heteroskedasticity of oil price volatility [17]. Although conventional tools for forecasting oil prices and volatility abound [18,19], models that ignore structural breaks and other sources of temporal variability in volatility "will have very low power" [17] (p. 555). This is ye<sup>t</sup> another instance in which accurate forecasting relies upon the more realistic assumption that volatility does not remain constant [20].

#### 2.1.2. Refined Fuels: Gasoline and Gasoil (Diesel)

Because gasoline and gasoil are refined petroleum products, their price and volatility dynamics depend heavily upon the economics of oil. These markets are nevertheless subject to forces befitting their proximity to retail consumers. Gasoline and gasoil are affected by time-varying consumer income [21] and the price elasticity of demand for petroleum-based fuels among other retail-level energy sources [22]. Demand for gasoline may be less elastic than typically assumed, especially in the short run [23].

Perhaps the most distinctive trait of the price behavior of refined fuels, particularly gasoline, is its asymmetry [24–27]. The "rockets and feathers" hypothesis posits that increases in crude oil prices are transmitted much more quickly to gasoline than decreases [28–30]. Data across the United States showed that retail gasoline prices increased 0.52 percent within the first week of an anticipated 1 percent increase in oil prices, but fell 0.24 percent within the first week of a 1 percent decrease [31].

Other sources describe asymmetry in gasoline pricing according to Edgeworth price cycles, characterized by sawtooth-shaped time series consisting of many price decreases punctuated by occasional upward jumps [32,33]. Straightforward measurements of gasoline demand have shown that elasticity decreases as volatility rises [34,35]. Both the "rockets and feathers" hypothesis and Edgeworth price cycles are consistent with this account of volatility.

Other sources contest the presence of asymmetry in the relationship between oil and refined fuel markets [36]. Asymmetry, if present for gasoline and gasoil in Europe, is fleeting and appears over very short time horizons [37]. Asymmetry appears in Spain and Italy, but not in Greece, the United Kingdom, or the United States [38]. Time-varying effects such as volatility clustering and structural breaks affect the degree of asymmetry in the transmission of volatility from oil to gasoline [39]. Findings of asymmetry may depend on the frequency at which volatility data is sampled [40].

One study reaches an intriguing conclusion: The "rockets and feathers" hypothesis tells the dominant story of oil–gasoline asymmetry, but not the exclusive story [28]. When oil prices are falling, on average, gasoline prices follow a contrary "boulders and balloons" dynamic by which gasoline more swiftly tracks oil price declines than increases. The reversal in the polarity of oil–gasoline asymmetry strongly suggests that volatility transmission between crude oil and refined fuels varies over time. Indeed, the presence of opposite tendencies, based on the timing of the broader business cycle, suggests that asymmetry, persistence, and cyclicality in volatility must be understood in the context of other capital markets and the macroeconomy [41,42].

Though literature on the price dynamics of gasoil is relatively sparse and inconclusive, national fuel mix policies appear to account for some of this fuel's differences relative to gasoline [43]. The European Union [44] and the United Kingdom [45] both nudge their transportation sectors to favor gasoil over gasoline. With mixed success, the United States has maintained a heating oil reserve to stabilize prices for this variant of gasoil, widely used to heat homes in the northeastern region of that country [46]. Home heating can be expected to be one of the least elastic sources of demand for gasoil, at least over short time horizons, for households that depend on this fuel.

#### *2.2. Comovement and Volatility Spillovers within Commodity Markets*

#### 2.2.1. The Financialization of Commodities and Hedging Strategies

As a prime outgrowth of the coordination of commodity markets with other aspects of global finance [5], comovement and volatility spillovers among commodities warrant careful evaluation [47]. Commodity futures have become popular tools for diversification [48,49]. Tools for managing financial risk in other capital markets apply directly to energy-related commodity markets [50]. Commodities as safe havens can offset turbulence from other asset classes, from equities to currencies [51]. The "universe of financial assets," spanning diverse "investment strategies," heightens the importance of "risk transfer between oil" and markets for other "global, large and liquid" assets [52] (p. 56).

Unstable energy prices often induce investors to hold other assets alongside energy commodities. Hedging strategies and portfolio rebalancing enable investors to manage comovement [53]. At a minimum, oil price shocks affect non-energy commodities [54–57]. A study of volatility in oil and refined fuel should therefore consider comovement and volatility spillovers linking energy with other commodity classes, especially metals and agricultural products.

#### 2.2.2. Precious Metals

The traditional role of precious metals as hedges against inflation and economic turbulence [58] casts those commodities in sharp relief against crude oil and refined fuels [59–61]. Markets for oil are more volatile than markets for gold and silver [62]. Precious metals exhibit hedging and safe haven properties *vis-à-vis* energy [49,59,63,64]. Connections between gold and oil extend to other financial instruments [60,65].

Financial risk may not run equally between two markets. Among instances of volatility spillover in commodity markets [66–68], the propensity of oil to transmit volatility to precious metals poses the greatest challenge to investors in energy-related commodities [69–72]. As the global financial crisis of 2008–2009 demonstrated, precious metal returns may be more sensitive to disaggregated structural oil shocks [72].

#### 2.2.3. Base Metals

Because oil prices heavily affect input costs for industrial processes using base metals, connections between energy markets and metals extend beyond gold, silver, platinum,

and palladium [73,74]. Although one study identified platinum, gold, and silver as net transmitters of volatility to oil [60], such spillover may not persist across all periods and market states. Indeed, traditional distinctions between precious and base metals may not hold across all financial conditions. Tin, gold, nickel, lead, and aluminum transmit return and volatility to oil markets. Copper, zinc, and platinum are net receivers—but only "at certain specific moments" [75] (p. 12). Time-varying fluctuations became especially pronounced during the global financial crisis [60] and the COVID-19 pandemic [75].

#### 2.2.4. Agricultural Commodities

Energy markets also transmit volatility to agricultural commodities [3,71,76–79]. The dependence of agricultural commodity markets on energy prices varies over time [80]. A structural break appears to have shifted the relationship between oil and agricultural commodities after 2006 [81]. Sources differ in attributing the disruption to a change in biofuels policy [76] or to a broader crisis in food crops [78].

The relationship may vary more subtly over time [80]. During periods such as the financial crisis of 2008–2009, oil and agricultural commodity markets crash simultaneously. Connectedness likewise strengthened during the COVID-19 pandemic [82]. Under normal economic conditions, however, these markets move in opposite directions. This pattern implies that hedging will fail in the very conditions when hedges would prove most valuable. The counterbalancing effect also denies investors the opportunity to realize excess profits in both markets.

These conclusions are neither universal nor inevitable. A different study focusing on common crisis periods such as the global financial crisis and the pandemic rejects two key conclusions of other studies [83]. Oil and crops have a bidirectional relationship in which each class of commodities transmits volatility to the other with roughly equal probability over long time horizons. As a surprising consequence, oil and agricultural prices remained relatively stable throughout the pandemic.

Certain crops (particularly corn and soybeans) either compete directly against crude oil as a renewable substitute or serve as a complementary product [84]. A third crop, sugarcane, affects these markets because of its substitutability for corn [85]. Conventional wisdom holds that high oil prices invite competition from corn-based ethanol and soybeanbased biodiesel [86].

This relationship, like many others, appears to depend on the state of the market: Spillovers from oil to agricultural and biofuel markets are stronger when oil prices are higher [87]. Conversely, concerns over the diversion of common-pool resources used in agriculture from food to fuel production reach their peak during economic crises [88].

Closer scrutiny of the impact of biofuel policies on oil and gasoline price variability [89] has not found conclusive evidence that energy markets spur volatility in corn [90] or that policy-stimulated demand for biofuels has elevated prices or volatility in agricultural markets [91]. The answer to the conundrum may lie in the limited economic impact of biofuel policies. If such policies were abolished around the world, biofuel demand would implode without materially affecting overall demand for agricultural commodities [92].

#### 2.2.5. The Geopolitics of Energy-Related and Agricultural Commodities

The prominence of oil and export crops in many developing economies heightens the economic, political, and diplomatic sensitivity of volatility spillovers involving those markets [3]. Connectedness between these commodities bridge distant geographic markets, such as Chinese crops and crude oil, whether around the world [93] or specifically in the United States [94]. As a rule, however, research on the impact of oil price volatility on developing countries that import rather than export petroleum remains limited [95].

A global study spanning 157 countries at different stages of development attributed 40 percent of income volatility to oil price fluctuation [96]. Though "the adverse effects of [price] instability" are often "much more severe" in developing countries, those governments can rarely afford "the extensive support programs that typify the agricultural

sectors of the developed world" [97] (p. 1729). Dependence on natural resource extraction is so often associated with stunted economic development that this paradox is known as the "resource curse" [98–101].

Geopolitical tension from oil divides importing and exporting countries [102,103]. Importing countries must rely on insecure foreign sources of an economic lifeblood [104], while global trade and politics drive fiscal policy and economic cycles in exporting countries [105]. The rapid emergence of China portends the revival of a Great Game among global superpowers in central Asia and other oil-rich regions [106].

Again, however, the economic effects are asymmetrical. Economic reactions to energy price shocks in exporting countries are greater and more persistent than in importing countries [107]. In the long run, both oil-importing and -exporting countries stand to lose. At least among OECD countries, oil price volatility stunts economic growth in net importers, while oil price uncertainty hurts net exporters [108]. Furthermore, to the extent that oil price volatility suppresses international trade and globalization, the ensuing reduction of global welfare harms all countries [109].

#### *2.3. Broader Financial and Macroeconomic Effects of Oil and Fuel Price Volatility* 2.3.1.FinancialMarketsbeyondCommodities

Oil markets transmit volatility to other capital markets, including equity markets [110,111]. Although one study concludes that the American stock market is neither a net transmitter nor a net receiver of volatility relative to oil or precious metals [60], others have found spillover effects in smaller economies such as Iran [112] and South Korea [113].

Stock returns and stock market volatility in oil-exporting countries such as Qatar, Saudi Arabia, and Venezuela are assuredly affected by oil prices [114]. These effects follow a regime-switching framework based on the cyclical state of these countries' equity markets— specifically, whether stocks in oil-producing countries are in a bull or bear market [114]. Some sources advise investors in oil-exporting countries to increase their allocation to oil [115,116].

The relationship between oil price volatility and the equity market may depend on the cyclicality of both markets. The "relationship between oil prices and US equities could depend on both the nature of oil price shocks and how well the US stock market is performing" [117] (p. 6). Complete understanding of the mutual dependence of oil prices and broader capital markets requires not only some understanding of cyclicality in commodity and equity markets, but also a principled way of identifying critical periods within financial history.

To like effect, structural heterogeneities in foreign exchange markets coincide with geopolitical and economic impacts [118]. In conjunction with broader macroeconomic phenomena, oil markets exert dynamic influence on trade in currencies [118]. Portfolio managemen<sup>t</sup> and other forms of risk managemen<sup>t</sup> therefore hinge on the relationship between oil prices, exchange rates, and the business cycle.

#### 2.3.2. Macroeconomic Effects

Oil price volatility impairs economic growth [119]. Like many other phenomena connected to oil and fuel markets, the macroeconomic effects of disruptions in energyrelated markets are asymmetrical. Oil price increases stunt economic growth more deeply than corresponding decreases in price spur economic activity [120,121]. Even sharp price drops may reduce aggregate output in oil-importing countries by raising uncertainty or inducing inefficient reallocation of resources [122].

Macroeconomic uncertainty spurred by oil price volatility varies over time. Volatility typically peaks during financial crises and recessions [123]. Nonlinear measures capture the overall economic effects of oil price shocks [124]. Oil price volatility in the wake of economic, geopolitical, and natural disturbances often combines short-term perturbations with longer-term macroeconomic factors [125].

A useful trichotomy summarizes the macroeconomic component of oil price volatility [126]. First, "most commodity prices are endogenous with respect to the global business cycle" [127] (p. 313). Second, demand shocks cause slow but sustained changes in price. Third, and in stark contrast, supply shocks have immediate but small and ultimately evanescent price impacts. In oil-related markets, crises and recessions generally reduce demand over a sustained period, while geopolitical events and natural disasters tend to disrupt supplies on an acute basis.

This rigidly logical approach to evaluating the macroeconomic effects of oil and fuel price volatility does leave room for potentially exogenous factors to affect uncertainty. Oil "price uncertainty," conditioned "on macroeconomic uncertainty," might be a more complete and "suitable measure of uncertainty" than purely volatility-based measures [127] (p. 325). As a matter of broad theory, if not empirical precision, uncertainty may depend more heavily on the predictability of energy-related markets than on their volatility [127].

#### *2.4. Identifying Cyclicality and Critical Periods in Energy Markets, Finance, and the Real Economy*

Comprehensive financialization strengthens the connections linking commodities, capital markets, and the broader economy. These relationships reinforce other centrifugal tendencies throughout economics. For instance, asset pricing models should account for tangible assets and human capital as well as financial instruments [128]. The behavior of a firm is likewise influenced by that of its upstream suppliers, downstream purchasers, and competitors in geographically and technologically adjacent markets [129].

Appropriately enough, efforts to track economic cyclicality span stock markets and macroeconomic policymaking. These two domains, neither more than a single degree removed from commodity markets, have invited many efforts to define critical periods. Even though this article applies unsupervised machine language rather than conventional econometric methods, it is motivated by the same desire to trace economic cyclicality in commodity markets, particularly for crude oil and refined fuels.

Stock markets provide the narrower and methodologically simpler basis for comparison. Technical stock analysis typically defines bull and bear markets, respectively, as a market-wide price increase of at least 20 percent since the previous trough or a market-wide decrease of at least 20 percent since the previous peak [130–132]. A 10 percent decline is typically described as a "correction" [133]. Designations of bull and bear cycles within market trends can be made only in retrospect, and there is no justification for these arbitrary 10 and 20 percent thresholds beyond the conventions of technical analysis and financial journalism.

For its part, the Business Cycle Dating Committee of the National Bureau for Economic Research (NBER) tracks recessions and recoveries in the United States [134–137]. The NBER's methodology relies on a dynamic-factor, Markov-switching model that examines non-farm payroll employment, the index of industrial production, real personal income, and real manufacturing and trade sales [134,136].

Figure 1 describes the NBER's announcements regarding the arrival and departure of recessions in the United States [138,139]. It depicts smoothed recession probabilities as they rise and ebb. Notably, only two periods from 2000 through 2020 have exceeded 50 percent according to the NBER: the financial crisis of 2008–2009 and the COVID-19 pandemic. The "dot-com" crisis of 2001 approached but did not exceed a 50 percent probability of recession. As is evident in the shaded areas of Figure 1, however, the NBER did define March through November 2001 as a recession.

**Figure 1.** Smoothed U.S. recession probabilities [RECPROUSM156N], retrieved from FRED, Federal Reserve Bank of St. Louis [138].

One can also frame this problem as the mirror image of an event study [140,141]. An event study traces abnormal effects to determine the duration of a suspected market disturbance. Event studies of oil price shocks [142,143], for instance, have evaluated OPEC announcements [144,145] and storms [146]. Conversely, temporal clustering uses economic anomalies to extract events for further examination amid the flow of financial history.

The timing of recession announcements presents an economically significant issue in its own right [147]. By the NBER's own admission, its business cycle dating committee's "approach to determining the dates of turning points is retrospective" [148]. Before definitively identifying a peak, "the committee tends to wait to identify a peak until a number of months after it has actually occurred" [148]. Likewise, the committee does not immediately announce a trough. Rather, the committee "waits until it is confident that an expansion is underway" [148].

Under this methodology, announcements of recessions and recoveries are not aligned in time with actual economic activity [149]. In the three decades from 1980 to 2010, "the lag between the determined start of [a] recession" and the NBER's "peak announcement" has averaged 9 months [150] (p. 645). At a bit more than 15 months, the lag between a trough and its announcement is longer still [150].

The lag between actual macroeconomic phenomena and their announcements creates an opportunity for machine learning, artificial intelligence, and other automated methods for evaluating economic data. For instance, the United States publishes its official Consumer Price Index on a monthly basis, with a delay of several weeks between the gathering of price data by. the Bureau of Labor Statistics and the announcement of each new CPI reading [151]. By contrast, the Massachusetts Institute of Technology's Billion Prices Project reports a comparable price index on a daily basis [151].

This article develops a methodology for identifying critical periods in energy-related commodity markets. The literature on oil and fuel markets emphasizes volatility and the connectedness of oil and oil-based fuels with other commodities, other financial markets, and the macroeconomy. Instead of defining cycles akin to bull and bear markets or macroeconomic expansions and recessions, this article will try to distinguish between critical and normal periods of trading within markets for petroleum-related commodities. In seeking a crisis-based approach to understanding temporal shifts in these markets, this article aims at an intermediate level of mathematical rigor between the extremes represented by technical definitions of bull and bear markets and the NBER's recessionand-recovery methodology.

Qualitative distinctions between peaks and troughs, expansionary and recessionary cycles, and critical periods dissolve upon closer mathematical inspection. Critical points in calculus identify points within the domain of a function where the derivative or gradient is zero (assuming that the function is differentiable at those points). Peaks and troughs as maxima and minima constitute critical points in a univariate function. In a multidimensional space representing returns on more than one asset, critical points also include saddle points, where all slopes in orthogonal directions are zero, but no local extremum is attained. In this mathematically informed sense, the methods described and applied in this article cast a wider net than methods dedicated of finding peaks and troughs within a single time series.

The second derivative of logarithmic returns on a financial asset is related to volatility through the Taylor series expansion [152,153]. Points within the domain of a function where the second derivative is zero indicate inflection or undulation. Methods focusing on financial volatility may therefore find inflection and undulation points as well as critical points. These observations are not meant to sugges<sup>t</sup> that this article consciously seeks to find all critical and inflection points in a strictly mathematical sense. Rather, this analogy simply offers a conceptually helpful way of understanding similarities as well as meaningful differences between traditional peak-and-trough approaches and this article's clustering methods.

As with stock markets and the broader economy, cyclicality in commodity prices has drawn scholarly attention [154]. Efforts to sharpen forecasting and the understanding of the dependence structure in oil and adjacent markets have highlighted differences between normal trading and economic turmoil [155]. The question is whether existing and novel "econometric tools" can generate reliable volatility forecasts when "periods of heightened volatility in crude oil markets are recurrent" [156] (p. 622).

Conventional econometric tools include unit root tests [157,158]. Those tests aided the discovery of structural breaks in 1990 and 2008, coinciding with the first Gulf War and the global financial crisis [17]. Technical analysis inspired by conventional methods for identifying bull and bear cycles in equity markets [159] has aided the search for cyclical effects in oil-based markets, at higher [4] as well as lower frequencies [160].

Computational tools abound amid economic "big data" [151]. Although some sources have mined linguistic [161] and Internet search data [16,162] in search of novel insights, this article uses machine learning and artificial intelligence to answer a more fundamental question: Whether financial economics can detect oil price fluctuation and its impact on the relationship between risk and return [163].

This article applies unsupervised machine learning to conditional volatility in commodity markets over two decades. An ensemble of clustering methods can identify episodes in commodity markets (especially those related to energy) warranting closer examination. Some episodes, particularly the global financial crisis and the COVID-19 pandemic, reflect a broader, more durable demand shock. Other episodes may last mere days. Such acute events should be expected more often within a confined subset of commodities, such as crude oil and refined fuels. These acute events typically involve geopolitical or natural calamities that disrupt supplies of oil and its downstream derivatives.

#### **3. Materials and Methods**
