Modelling the volatility of commodities prices using a stochastic volatility model with random level shifts

We use the approach of Qu and Perron (Econom J 16(3):309–339, 2013) for the modeling and inference of volatility of a set of commodity prices in the presence of random level shifts of unknown timing, magnitude and frequency. Our approach contributes to the study of commodities in several aspects. First, we test for the presence of a genuine long-memory process in the volatility of commodities. Second, we determine that the random level shifts are certainly the main source of variation in the commodity price volatility. Finally, we estimate the volatility and its components as latent variables, thereby making it possible to evaluate their level of correlation with macroeconomic variables in small open economies such as Latin-American countries where the dependence on commodity price volatility is high. We use six commodity series: agriculture, livestock, gold, oil, industrial metals and a general commodity index. All series cover the period from January 1983 until December 2013 in daily frequency. The results show that although the occurrence of a level shift is rare, (about once every 1.5 or 1.8 years), this component clearly contributes most to the variation in the volatility. Furthermore, isolating the level shift component from the overall volatility indicates a strong relationship of this component with a set of business cycle indicators of several Latin American countries.


Introduction
The volatility of commodity prices such as oil or minerals is an important issue for small open economies that depend on raw materials. For example, in many Latin American countries, the volatility of commodities can affect the operating costs or investment schedules of businesses in the primary sector. At the macroeconomic level, high volatility in these markets can produce changes in the current account and in capital inflows, or, on the side of importers, increase uncertainty regarding production costs and inflation. Therefore, modeling volatility of commodity prices would be useful for private agents and policy makers. For the former, it gives valuable information for better options contracts that allow hedging under great uncertainty, while for the latter, it can aid in a better understanding of business cycles given the correlation between mineral price fluctuations, capital inflows, and investment expectations.
The empirical literature on the volatility of commodities has been extended as a result of its implications for the real economy, especially in those small open economies that depend heavily on the fluctuations of their terms of trade, such as the case of Latin American countries. Thus, studies like Ferderer (1997) find evidence of how oil price volatility affects economic growth through a general increase in uncertainty, which is a mechanism additional to the effect of an oil price increase on inflation. In that vein, Guo and Kliesen (2005) and Jacks et al. (2011) find that an increase in the volatility of commodities has a significant negative impact on economic growth, particularly in countries with a strong dependence on commodities in their export basket. This is important especially in Latin America where commodities represent a significant share of exports in the region. Thus, the volatility of commodities affects the terms of trade, which account for a significant portion of the variance of GDP in small open economies. 1 For instance, Cavalcanti et al. (2015) find negative effects of the volatility of commodities terms of trade on economic growth, that is explained by lower accumulation of human and physical capital given the increased uncertainty.
An important aspect of the commodities market is its similarity to the financial markets. There exist commodity stocks markets and commodity future markets where a high degree of speculation mixes with fundamentals. Thus, the pioneering work of Brennan and Schwartz (1985) analyzes the stochastic nature of natural resources prices and applies stochastic optimal control to the valuation of investment projects such as they were financial assets. Since then, a lot of work has been deployed using a financial approach to evaluate the behavior of commodity prices and in particular its volatility. Some relevant empirical works are Jaffe (1989), which highlights the role of gold or precious metals in diversified portfolios and Ankrim and Hensel (1993), which focuses on the similarities between commodity and real estate investment as inflation hedges. Moreover, Gorton and Rouwenhorst (2006) describe the financial properties of commodity-based financial instruments such as futures and find similar behavior to an equity risk premium and a negative correlation with other instruments. All these financial studies evaluate volatility dynamics as crucial for their results. Also, evaluation of volatility behavior alone is found in different studies such as that of Askari and Krichene (2008), who find that oil price is very volatile and sensitive to small shocks even though assumptions about market fundamentals hold. Further, Brunetti and Gilbert (1995) study the volatility of industrial metals from 1972 to 1995 and find that volatility does not increase during that period, which runs contrary to common opinion. All these findings suggest that commodity prices evolve quite similarly to other financial series.
One of the most important stylized facts in the study of volatility is the presence of persistence; namely, unforeseen shocks in these markets have long memory and end up being important many periods later. Therefore, a high volatility persistence generates a distortion in the perceptions of the agents and the pricing of commodity contingent claims. On the other hand, the level of uncertainty is amplified as well as the negative impacts on aggregate output, specially in those economies with a strong dependence on raw materials.
However, there is evidence that long-memory volatility of commodities can be affected if one takes into account structural breaks, as revealed by the work of Ewing and Malik (2010) and Vivian and Wohar (2012). In both cases, the authors apply a GARCH model to high frequency data with an iterated cumulative sums of squares to identify structural breaks in the volatility following the methodology of Inclan and Tiao (1994). The former find a drastic reduction of the volatility persistence of oil prices after including structural breaks. While, in the case of the latter, the results shows a reduction of volatility only for some commodities and the remaining of persistence in the short time for commodities strongly linked to financial markets such as energy or precious metals. From a long-term perspective, Calvo-González et al. (2010) use lower frequency data and find a central role of breaks to explain the increases and declines of commodity prices volatility, which are associated with periods of big crisis, wars or drastic changes in conditions of demand and supply of commodities. Thus, there is interesting evidence in favor of the presence of structural breaks that often have little probability of occurrence but generate a big impact on the volatility of commodity markets. Overall, the study of long memory and structural breaks is not unique to the commodity markets, but extends to various financial markets. 2 The evidence tends to suggest that the structural breaks, in the form of random level shifts, drive the process of the volatility of prices, while the property of long memory seems a case of spurious identification. 3 Our study is related to the literature aforementioned that analyze the volatility of commodity prices considering the existence of structural breaks in the form of random level shifts and long-memory process. We estimate a stochastic volatility (SV) model with random level shifts (RLS) as proposed by Qu and Perron (2013) that allows one to decompose the volatility into two unobservable components: a long-term component, which includes the random level shifts of the commodities markets, and a stationary short-term component modelled as an AR 1 ð Þ process that decays quickly over time. 4 Our approach contributes to the literature in several aspects. First, we use a test of spurious long memory proposed by Qu (2011) in order to contrast the presence of a genuine long-memory process in the volatility of commodities. Second, we estimate the two unobserved components as latent variables: a random level shift and a short-term component. Third, we evaluate the relative contribution of each component to the overall volatility and we can determine if the random level shifts are certainly the main source of variation in the commodity price volatility. Finally, having the two unobserved components, we may evaluate their level of correlation with macroeconomic variables in small open (Latin American) economies. Therefore, we can determine the comovements of each component with the business cycle fluctuations.
We focus on modeling the volatility of the overall commodities market and some sectors that have huge repercussions on the global economy (e.g. industrial metals, oil, gold). To this end, we study commodity markets indexes, in particular the Standard & Poors Goldman Sachs Commodity Index (hereinafter S&P GSCI). As documented in Indices (2014), the S&P GSCI is a benchmark for investment in the commodity markets and a measure of commodity market performance over time. It is also a tradable index that is readily accessible to market participants, so we take this index as the best approximation of commodity market performance. The composition of this index is dominated by energy commodities, where oil accounts for 66% of the total index. Other commodities make up far less of the total; for instance, industrial metal and precious metals represent only 7 and 3% of the index, respectively. For this reason, we analyze the volatility of the commodity index as a whole, and of certain indexes that compose it, such as the gold, oil, industrial metals, agriculture, and livestock indexes.
The estimation of the SV model with RLS produce interesting results respect to the behavior of volatility in commodity markets. First, we found that all series analyzed present an apparent long-memory process in volatility, but disappear after the inclusion of the random level shifts. This result contrasts with the persistence of long memory after structural breaks estimated in Vivian and Wohar (2012). Second, we find that random level shifts contribute in higher proportion to the overall volatility in comparison with the short-term component. Therefore, the estimation and identification of the random level shifts represents a valuable exercise to estimate the proper level of volatility in commodity markets. Third, this long-term component explains by far the transmission of volatility to business-cycle variables in economies with a strong dependence on commodities as the Latin-American countries.
Our work seeks to determine whether long memory exists in commodity-return volatility series, or whether a short-memory process with random level shifts applies. Commodity prices and volatilities affect portfolio decisions and business cycles, especially in Latin America countries which have a high dependence on commodities in the trade balance, 5 but little work has been done on modelling commodity prices series using econometric techniques. There are some studies relating to volatility in stock markets in Latin American countries such as De Santis et al. (1997), Aggarwal et al. (1999) and Abugri (2008). On the other hand, the commodities markets have been studied in the framework of boom and bust cycles like Gruss (2014). Our study is an attempt to fill a gap in this line of research by analyzing commodity volatilities.
Our findings are relevant for both private and public agents in the Latin American region. For example, the presence of random level shifts changes the traditional construction of a hedge. In the case of persistence of the volatility, the hedge faces more dispersion, because any shock over the risky commodity asset is expected to affect its future value for a long period. However, the identification of a level shift brings new information that allows adjustment to the expected volatility, while for the rest of the shocks are expected to have a short memory. Therefore, the dispersion is reduced.
The remainder of this document is structured as follows. Section 2 characterizes some features of the commodities volatility; Sect. 3 describes the applied methodology; Sect. 4 contains results for the overall index and for each kind of commodity, as well as an analysis of business cycle comovements. Finally, Sect. 5 presents the conclusions. An Online Appendix includes some additional Tables and Figures.

Features of commodity volatility
In this paper we focus on commodity-price volatility because this variable is relevant to private and public agents in Latin American countries. However, before estimating this volatility, it is worth analyzing some features of the series and justifying the method that would best fit the volatility of these series. First of all, we use the S&P GSCI as the approximation of commodity market performance. This index includes all eligible contracts that represent transactions of a physical commodity, and is built from the weighted sum of contracts of different commodities. We have chosen to analyze the entire commodity market and its components given possible differences between markets that may influence volatility. Thus, we study the commodity index, industrial metals, oil, gold, the agriculture index, and the livestock index 6 .
In Fig. 1 we can see the evolution of daily returns of commodities from January 1983 to December 2013. A first feature of all series is their volatility, which grows in certain periods. These periods of high volatility may be common to all series, as occurred between 2008 and 2009, which was associated with the international financial crisis; or to a particular commodity, as in late 1990 and early 1991, which was marked by high volatility in oil prices associated with the Gulf War. In general, we observe that the series behaves similarly to any given high-frequency financial asset, such as stock returns. Therefore, it is valid to use financial modeling techniques to analyze the volatility of commodity markets. A second feature, also linked to the volatility of the series, is the difference in behavior between markets. For example, variations in returns are larger in oil and industrial metals than in agricultural goods or livestock. In addition, these goods have different paths of volatility. For example, gold underwent a period of volatility during late 2000 and early 2001, possibly associated with the dot-com crisis in the United States; industrial metals were subject to a period of high volatility between 2005 and 2008, which was probably caused by high demand in developing countries such as China; while agricultural goods witnessed a high volatility period in the late '90s due to the fall of the Soviet block, which was a major crop producer in the world market. Each of these periods of high volatility for a certain commodity have not been replicated by other markets. Therefore, while analysis of a set of commodities is useful at the aggregate level, it is important to analyze each market separately given the intrinsic characteristics that influence their level of volatility.
Motivating our focus, the long memory is a characteristic that has taken on increased relevance in the literature on volatility of commodities. A simple way to detect whether the volatility of a series has long memory is by estimating the autocorrelation function (ACF) of the logarithm of its squared returns. If long memory exists, then the ACF will slowly decay to zero. As shown in Fig. 2, commodities decay slowly to zero after 1500 days, on average. Moreover, after reaching zero, the ACF fluctuates around zero up to the maximum number of lags 7 .
The assumption of long memory must be carefully analyzed. The empirical evidence (see, for example, Perron and Qu 2010) suggests that the long-memory phenomenon can be confused with a process that has rare discrete level changes (random level shifts) which alters the levels of volatility in the long run. A first 6 We separate oil and gold from their respective subindexes due to the individual importance of these commodities to the global economy. 7 According to Qu and Perron (2013) a process has long memory if c z s ð Þ ¼ g s ð Þs 2dÀ1 as s ! 1; where z t is a stationary time series, c z s ð Þ its autocorrelation function, d [ 0 and g s ð Þ is a slowly varying function as s ! 1: The ACF decreases to zero at a hyperbolic rate, in contrast to the fast geometric rate observed for short-memory processes with d 2 0; 1=2 ð Þ : approach to assessing whether a process has long memory is by estimating the parameter d using the log-periodogram, as proposed by Geweke and Porter-Hudak (1983). The results of this estimation are shown in Fig. 3. Each frame shows the estimation of the parameter memory, d, for each commodity, which is on the y axis, while the frequency of the data is on the x axis. If the process is long memory then the parameter d should be the same for all sizes of frequency. However, we observe that the parameter of long memory tends to decay the higher the frequency is. The vertical lines crossing each of the figures represent the T 1=3 , T 1=2 and T 2=3 frequencies for a sample of T ¼ 7818. Thus, for low frequencies (between T 1=3 and T 1=2 ) the parameter d is greater than 0.5, on average, while higher frequencies tend to decline, which continues even for frequencies greater than T 2=3 . The results found in the log-periodogram are similar to those found by Perron and Qu (2010), who analyze the volatility of the returns of the S&P 500. According to these authors, the fall in the long-memory parameter with increasing frequency is due to the existence of two components in volatility: a first component, short-run, presents throughout the entire series; and another component, level shifts, that cause jumps in volatility levels that resemble long-memory processes 8 . The latter component is dominant at low frequencies, but as the number of frequencies increases, the short-term component is dominant and hence the parameter d tends to decline.
A second approach to assess long-memory processes is to rule whether or not they are spurious. For this, we use the test of Qu (2011), whereby, under the null hypothesis, the process has long memory, while under the alternative hypothesis, the 8 As noted by Perron (1989), a time series with the presence of breaks or level shifts resembles the behavior of a non-stationary time series, which is equivalent to a very persistent process.
The log periodogram estimate of fractional parameter d as a function of m process is one of short memory with random or sporadic level shifts. Rejection of the null hypothesis implies that the evidence of long memory is spurious. The results of the test applied to the volatility of commodities are presented in Table 1. Following Qu (2011), we use the local Whittle estimator of d. The first column shows this estimate for T ¼ 0:7, that is, to a frequency which is slightly right of T 2=3 . There is none of the estimated d exceeding 0.5, which is consistent with the literature. On the other hand, the next two columns show the test statistics for two types of trimming as recommended by Qu (2011). All volatilities of commodity returns reject the null hypothesis of long memory with a significance level of 1%. This would indicate that commodity volatilities present discrete steps or random level shifts that can be interpreted as structural breaks or strong shocks that permanently alter the level of volatility, simulating apparent long memory. In summary, after analyzing the series of commodity prices, we observe: (1) the high volatility of the series, accompanied by volatility clustering and high persistence, similar to that found in financial series; (2) certain differences between the commodities markets, suggesting a separate analysis for each series; and (3) the apparent long memory of the series is actually caused by discrete jumps (random level shifts) in volatility, the occurrence of which is relatively low. In view of this evidence, it is reasonable to model the volatility of commodity returns using an econometric model of volatility including the possibility of level shifts. In the econometric literature, the SV models have been improved to include random level shifts; for example, in the work done by Qu and Perron (2013). One advantage of this model is that volatility can be easily represented as the aggregation of two latent variables, one short term and one long term, the latter with random level jumps, and both components can be estimated.

Methodology
The SV model with random level shifts follows the estimation method and inference using Bayesian analysis of Qu and Perron (2013). The objective is to model volatilities of the returns of principal commodities exported by Latin American H 0 series is a stationary long-memory process, H 1 series is a short-memory process affected by regime change or a smoothly varying trend a Statistical significance at 1% level countries split in two components: a short-memory component and random level shifts component, respectively.

The model
First, the process of the returns is mean corrected and is expressed by where the error term t is an i.i.d. standard Normal random variable. The term h t gives us the stochastic volatility, while the second term l t expresses the random level shifts component. The volatility h t is explained by a stationary AR(1) process with v t as a Normal standardized error term: On the other hand, the random level shifts component is given by the random Bernoulli variable d t that takes value 1 with probability p. Also, the size of the shift is stochastic and is given by the Normal standardized random variable g t : The random variables i ; v j ; d k ; g l are mutually independent for all 1 6 i; j; k; l 6 n. The level-shifts component allows us to have different sized random shifts. In allowing for this characteristic of the process, we can determine the component h t as a short-memory process for the variables analyzed.
Our proxy for volatility is given by the log-squared mean-corrected returns log x 2 t , so our model can be expressed by the following form: log Because t is Normally distributed, the model is a partial non-Gaussian state space model. The way of addressing this problem is by filtering, as in Kim et al. (1998) with approximation of the term log 2 t by a mixture of Normals. A new error process is defined by Ã t as Ã t ¼ log 2 t À Eðlog 2 t Þ. Following Kim et al. (1998), the distribution of this new process is approximated using a mixture of Normals given by: Ã t $ P K i¼1 q i Nðm i ; r 2 i Þ, where the parameters K; q i ; m i ; r 2 i that describe the distribution can be found in the work mentioned. We identify w t ¼ j; where w t is assigned that value if Ã t is a realization of the j th component of the mixture of Normals. This way of threatening the nonlinearity of log 2 t allows us to puts all the models in a Gaussian state-space model conditioned on the mixture.
Finally, to complete the specification of the model we address the problem of return values close to zero that distorts the results of the estimations. We define another variable y t by y t ¼ logðx 2 t þ cÞ À Eðlog 2 t Þ, where c is a small number that renders the number inside the logarithm far away from the value of zero. This specification was first used by Fuller (1996) on the literature on stochastic volatility. The ''offset'' value c is 0.001, as in Qu and Perron (2013). At last, we have the model expressed by: with initial conditions ðh 0 ; l 0 Þ ¼ 0 and ðh 1 ; l 1 Þ 0 $ Nð0; PÞ.

Sampling procedure
We express variables and parameters in vector notations following Qu and Perron (2013). Let The location of shifts is related to the variable d; whereas d; R and a 1 jointly give the stochastic volatility process. Sampling from the joint posterior distribution f h; a 1 ; R; d; xjy ð Þ is equivalent to sampling from the following four blocks: and (iv) f xjh; a 1 ; R; d; y ð Þ : Each of these blocks generates draws using the Gibbs sampling procedure.

Specification of priors
We use the prior distribution of Kim et al. (1998). For /, we have p / ð Þ / implying a prior mean of 0.86. For the parameter r m , we use the Inverse-Gamma distribution so r 2 t $ IG r r =2; S r =2 ð Þwith r r ¼ 5 and S r ¼ 0:01 Â r r : In the case of p and r g , we use the prior distribution of Qu and Perron (2013) which are the Beta and the Inverse-Gamma, respectively. For p $ Beta c 1 ; c 2 ð Þ with c 1 ¼ 1 and c 2 ¼ 40; which implies a prior mean of 1 / 41 or a shift each 41 days. For which implies a prior mean of 3.33 and a variance of 1.39. For the initial conditional state, we use diffuse priors with h 1 ; l 1 ð Þ$N 0; P ð Þ with P ¼ diag 1 Â 10 6 ; 1 Â 10 6 À Á .

Filtering
In the filtering process we seek to recursively obtain a sample of draws from a t jX t ; h ð Þfor t ¼ 1; . . .; T and where a t ¼ h t ; l t ð Þ. Then we use a particle filter like that of Kim et al. (1998), which, for a given sample of M, a by drawing from f ½a tþ1 ja j ð Þ t ; X tþ1 ; h, and they are reweighted using f ½a tþ1 ja Þ depends on whether a shift occurs at time t and is given by a tþ1 j½a The associated weights are given by x

Results
We apply the methodology to six indexes of the S&P GSCI: agriculture, livestock, gold, oil, industrial metals, and a general commodity index. The data are daily frequency over the period of January 1983 to December 2013. The products analyzed are the most representative of Latin America trade balance and, in many cases, their behavior has a big impact on the business cycles of the real economies. The analysis of commodity volatility is useful for both private and public agents. For the former, commodity volatility gives insights about risk management, while for the latter, it provides a better understanding of the business cycles. We intend to describe the results in a comprehensive way, starting with a description of the posterior distribution results of each commodity, followed by an analysis of the contributions of the level-shift component over all volatility, and, finally, an analysis of the possible comovements between volatility and several indicators related to the business cycle from Peru, Colombia, Chile and Mexico.

Posterior distributions results
The estimates of volatility parameters are shown in Table 2. A first interesting result is the level of the probability of the random level shifts. This probability is small; without taking into account gold, a break occurs between 300 and 1000 days which means that they are rare. Another interesting result is the big differences between the variance of the random level shifts r 2 g and the variance of the short-memory component r 2 m . The former are higher than the latter ones. These findings are consistent with the theoretical proposal of Qu and Perron (2013) that level shifts are uncommon events caused by structural breaks or big shocks that change the level of volatility abruptly and explain most of it. With respect to the size of the persistence of volatility, measured by the / parameter, for most commodities the value of / is between 0.93 and 0.98, which indicates that volatility shocks on average have a half-life from 9 to 30 days, depending on the market analyzed. These findings are consistent with Qu and Perron (2013), who obtains similar stock index results when random level shifts are accounted, and runs counter to studies that hold longmemory assumptions; for example Vivian and Wohar (2012) estimate a half-life of between 90 and 300 days for commodity volatility shocks.

Commodity index
As proposed above, we estimate a SV model for commodity prices as a whole. The model captures major shifts associated with huge shocks in the commodity markets. Figure 4b shows the level shifts component, the line with discrete changes, and the log volatility which is an overall measure of volatility that fluctuates around the level shifts. Some major jumps are associated with important events in commodities markets. For example, the jump that occurred in the beginning of 1986 was related to a crash in the oil markets. This crisis was a consequence of the ''oil glut'' in the first half of the 1980s. After a large expansion in oil production and a resultant surplus, oil prices fell by over 50% in 1986. The next major jump occurred during the Gulf War in response to fears of drastic cutbacks in oil production, from 1990 to 1991. The sequence of events and the evolution of volatility can be seen in the Table below. First, the posterior mean of the level-shift variable l t is held low even  coalition force attacked on January 17, 1991, then it decreased progressively to reach 1.42 at the end of January, when Iraq forces withdrew from Kuwait. After that, the level shift component fell to its previous levels of À0:44. After the war, the level of l t decreased and remained at these magnitudes for about three years. This result is consistent with the findings of Jacks et al. (2011) that point to high volatility periods in commodities during wars.
On the other hand, two important increases in volatility were reported before the financial crisis of 2008: one at the beginning of 1996, and another in 2000, both were linked to the United States economic performance, but in opposing ways. The first was associated with a fall in the gold price due to a strong dollar, while the second one owed to the dot-com crash and the subsequent recession in the United States. Finally, the international financial crisis of 2008 caused a jump in volatility in several markets (oil, gold, and industrial metals). However, the jump in volatility occurred two months before the crash in September 2008, and the level stayed high for much longer than in previous crises. As we can see in the Table below, log volatility increased progressively from 1.33 in April 2008 to 1.65 in July 2008, and then jumped very slightly to 1.72 and remained at that level for nine months. For this phenomenon, we venture some explanations. First, the increase in volatility was progressive and anticipated the crash due to a bad news sequence 10 . Therefore, the crash did not represent a great jump in volatility. Some studies, such as Cashin and McDermott (2002) and Vivian and Wohar (2012), highlight that commodity markets are always volatile and the last financial crisis did not necessarily represent a large increase in volatility over historical records. This fact is supported by our estimations in the sense that (for example) the level of volatility was higher during the Gulf War. However, on the other hand, our study provides new evidence of the duration of periods of high volatility, whereby volatility during the 2008 crisis remained high for a long time (nine months), more than in previous crises. Thereby, the magnitude of a crisis could be an important source of both the magnitude and the duration of the volatility. The method applied reproduces level shifts that are coherent with commodity market evolution and have permanent effects on the level of volatility 11 . An interesting result of the estimation is that shifts are uncommon. According to the posterior distributions reported in Online Appendix Figure 1 (see also Table 2), the probability of level shifts, p, has a posterior mean of 0.00149, which implies that a jump occurs each 671 days, roughly every 2.8 years. This makes a lot of of sense if we see jumps as being caused by rare and unexpected events with a big impact on commodity markets, such as wars, market crashes, recessions, or financial turmoil. In addition, we obtain the posterior density of the short-memory parameter / with a mean of 0.948 and a 95% confidence interval of 0.913, 0.971. This value indicates a persistence of the log volatility that is consistent with the theory, but it is less than in the long-memory process that reports autoregressive coefficients very close to 1. With respect to variances in volatility components, we find that level-shift variance has a posterior mean of 1.649, while the short-memory component has a posterior mean of 0.145. That is, perturbations on the permanent component, despite being rare, have a major impact on the volatility of the series. As we analyze in the next section, this component is key to explain the changes in the volatility of commodities. The remaining panels in Online Appendix Figure 1 show the correlograms of the parameters. In general, these Figures indicate that the Bayesian estimation has no problems related to autocorrelations, and therefore that the estimation is correct.
The estimation of parameters is robust to different priors. In Online Appendix Table 1 we report the posterior means of commodity volatility under different priors. For example, we choose a range of prior of p from 0.0167 to 0.001, which implies level shifts of between 60 and 960 days. The results are not sensitive to this specification; the posterior mean of p are between 0.0013 and 0.0021, or a time occurrence of level shifts between 462 and 763 days that is consistent with our estimation of 671 days. The rest of the parameters remain unchanged. For example, the short-memory component has / ¼ 0:95, while the variance of the level shifts component (r g ) is at least ten times higher than the variance of the short-memory component (r m ). We also change the prior of the variance of the level-shift component with very similar results. We repeat this exercise for the remaining commodities and find that posterior means and volatility components are not sensitive to prior specification. However, prior distributions do affect the level of autocorrelation of posterior distributions.

Industrial metals
Now we turn our attention to the industrial metal index which includes copper, aluminium, lead, nickel and zinc. Copper is the most important export of Peru and Chile; it accounted for 23% and 52% of all exports, respectively for each country in 2013. The filtered volatility series and the shift levels are found in Fig. 5b, c. We can analyze whether the model identifies shifts that coincide with special events for this index. Specifically, the model identifies relevant positive shifts for 1987, 2006 and 2008. The Table below shows the evolution of the level shifts component (l t ) during 1987 and over the following three years. In the first four months of 1987, the level shift component was À0:79 on average, which was related to a slightly increase in the index price of 0.63% per month. Then, on April 20, the market was subject to a level shift that increased volatility and held it for six months. This period of high volatility coincides with a sharp increase in prices at a rate of 5% per Modelling the volatility of commodities prices using a… 87 month. The major shift occurred on October 20, a day after ''Black Monday'' 12 , when volatility jumped from 0.55 to 2.28. Prices remained very volatile for the next six months, increased 70% in the first three months, to fall again to previous levels just two months later. After the crash, volatility dropped progressively and by the end of January 1991 a new level shift pushed down volatility to À0:72. This period coincided with the end of the Gulf War.
It is important to highlight that the volatility of industrial metals in 1987-1991 is explained mainly by supply and demand fundamentals. Even during the stock crash, the demand side would have been the channel of the impact of volatility on expectations, i.e. expectations of the agents or uncertainty about the United Sates economy. This argument is in the line with Brunetti and Gilbert (1995) where the high volatility in 1987-1990 is associated with tight demand. According to these authors, it was not until 1994 that industrial metals attracted hedge funds and investment institutions. They argue also that the participation of financial institutions in the metals market did not increase volatility relative to historical levels. This argument is examined in the next Table, where we display the level-shift volatility component from 2006 to 2009, a period of huge financial speculation in commodity markets and interrupted by the financial crisis. The level shifts stayed low for more than ten years, from 1991 to mid-2006. However, on February 2006, a major shift occurred (the l t component jumped from 0.36 to 1.32). In this case the period of high volatility is explained by a mix of fundamentals and speculation. A commodity boom was caused mainly by high demand in developing countries, especially China, but market speculation contributed to a price rise of 50% in just six months. After this period, a new plateau was reached in which volatility fluctuated around one. Then, during the financial crash, volatility jumped to 1.51 and increased progressively for three months, coinciding with a collapse of 50% in price levels. Both periods, though highly volatile, did not reach the levels reported in 1988. This behavior is also highlighted by Vivian and Wohar (2012), but in the case of copper they do not find a significant difference between high volatility in recent years versus volatility in the 1980s. Posteriors distributions and correlograms of the draws are found in Online Appendix Figure 2 (see also Table 2). The probability p has a posterior mean of 0.00292 which is higher than the value of p for the commodity index. This value of p implies that we have a shift occurring every 342 days, and this is still higher than our initial prior of every 41 days. The parameter / has a mean value of 0.932, which implies a half-life cycle of 10 days, a very short-memory process. With respect to variances in volatility components, such as in the previous case, the level shifts component has a variance ten times that of the short-memory component. The jumps or the level shifts in volatility are caused by unusually big shocks, whereas small and regular shocks determine the stationary dynamic of volatility in the short term. In panels (f) to (i) we report the ACF for the posterior draws. The ACF decays around zero between the period 100 and 200, while the ACF is slightly out of the confidence bands for the parameters / and r v .

Gold
Gold volatility has some characteristics that are different from the other commodities. First, it has averaged more jumps than other commodities, which can be clearly seen in Fig. 6b, c. Second, many of the periods identified as level shifts are not necessarily common to all commodities, such as breaks in the mid-90s, early 2000s, or late 2011. Third, if we look at the posterior distributions in Online Appendix Figure 3, the autoregressive component parameter median is about 0.1; i.e. very quickly converges to the average. Fourth, the difference between the size of the variance of the long-term and the short-term component is less than in other commodities. This would indicate that the volatility in gold has very short memory, and the past has little to do with this volatility. The long-term impacts are not very large and the frequency is relatively higher. This finding is consistent with studies by Hammoudeh and Yuan (2008) and Batten et al. (2010) which show that gold is susceptible to various shocks such as economic crises, wars, changes in interest rates, or supply shocks and is generally more volatile than other metals. Another feature of gold is its dual role as a financial instrument and as a hedge against inflationary periods. This means that during periods of uncertainty, gold volatility can increase sharply, as in systems with high inflation expectations. The Table below shows this behavior through the presence of jumps from level to the mid-90s. First, from April 1993 until September of that year, an increase occurred in the component of level shifts in volatility due to inflation expectations for the United States economy. Later, after interest rates increased throughout 1994, volatility fell instead of rising because Central Bankers had already adjusted interest rates. A similar phenomenon occurred prior to the dot-com crisis in 2000; uncertainty about a possible bubble led to greater demand for gold among investors seeking a safehaven asset. This entailed a rapid increase in volatility months before the crisis, and when the crisis erupted, the volatility of gold dropped instead of increasing, as most agents already had positions in this asset.
From the above, it appears that gold level jumps seem to anticipate periods of crisis, in contrast to the volatility of other commodities which react primarily during periods of crisis. This idea is reinforced in the following Table, for the periods prior Higher volatility is observed during the periods preceding these crises. This would indicate that the largely private operators, while not anticipating the crisis, did perceive a scenario of high-risk to their financial positions and therefore chose to use gold as a safe-haven asset, causing a sudden increase in its price and thus in the level of volatility. This pattern is repeated in the three crisis periods analyzed; that is, the level-shifts component anticipates periods of crisis. A study of this component as a predictor of the business cycle is beyond the scope of this research, but an interesting advantage of the method used is that it enables better analysis of the changes in volatility in relation to periods of crisis.
In Online Appendix Figure 3 (see also Table 2), we find posterior distributions and the correlograms for the draws. This index has a particular result in the parameter / because its posterior mean is 0.078. This is the lowest value for the parameter / and is close to zero, so the short-memory component has no persistence at all. Also, the volatility of the gold index has the largest probability of shifts of our six indexes. Posterior mean of p is 0.00684 or in terms of duration of the shift, it occurs every 146 days; this is the reason why we found so many shifts in this series. Another important result is that related to the parameter r m that has the posterior mean value of 0.822, very high compared to the rest which have maximums of 0.15. This parameter gives us the variance of the shock to the short-memory component, so it implies that this component is very volatile for gold. In Fig. 6, we find that gold undergoes many shifts during our period of analysis. Also, we report the ACF of posterior draws, where it can be seen that almost all parameters do not have autocorrelation problems with the exception of p, which falls to zero very slowly. We find that the ACF of p is sensitive to prior specification. For example, we explore a sensitivity analysis for the gold index, similar to that reported in Online Appendix Table 1 for the commodity index, and for some prior values the ACF converges rapidly to zero, while for others it does not.

Oil
In panel (a) of Fig. 7 we show the series of oil price returns, and the level-shift component and the log volatility are represented in panel (b). The results are close to the ones obtained for the commodity index, which is to be expected because oil is the main component of the general index. There have been three major level shifts in the evolution of oil volatility: first, the jump in volatility due to the ''oil glut '' of 1985 to 1986; second, the jump related to the Gulf War of 1990 to 1991; and finally, the period of high volatility during the international financial crisis of 2008. Just as we reviewed the impact of the Gulf War period in our analysis of the commodity index, now we look at the oil glut of the mid-1980s as well as the last financial turmoil. As regards the former, the Table below shows the behavior of the levelshift component l t from 1985 to 1986. Almost right throughout 1985, the level of volatility remained low (around 0.16). In parallel, many negotiations between OPEC members were carried out in order to regulate overproduction. However, these negotiations failed and in December of 1985 a price war began, causing prices to fall by more than 50% over the next three months. High volatility was exacerbated In Online Appendix Figure 4 (see also Table 2) we show the posterior distributions of parameters. The posterior mean of probability p has a value of 0.00178, which implies a shift every 562 days. That is to say, level shifts are rare events, but when it happens, its variance r 2 g is ten times higher than the variance of the short-memory volatility component r 2 v . Another important feature is the autoregressive estimator /, which is 0.942, implying a half-life cycle of 12 days, very close to the cycle of industrial metals. As with other commodities, persistence of volatility is manifested through high values of /, but lower than 1. These findings are the opposite of Vivian and Wohar (2012) who assume a long-memory process, but in accordance with Charles and Darné (2014) who include structural changes in the behavior of volatility. The ACF reported in panels (f) to (i) present some autocorrelation problems. Similarly to the case of gold, the ACF is sensitive to prior specification, but this does not affect the estimation of volatility.

Agriculture
The agriculture index is constructed with information on the following commodities: wheat, corn, soybeans, coffee, sugar, cocoa, and cotton. From these products, coffee is an important export of Mexico, Colombia and Peru.
In Fig. 8, we can observe that shifts are rare and the model identifies three major shifts that increased volatility, which coincides with the specific context of agriculture commodities. In 1988, the volatility of the index increased dramatically between May and August of that year. This volatile period is related to the drought conditions in the United States, which caused an increase in the prices of wheat, corn and soybeans produced in that country. The increases in volatility are identified by the level shifts component of the model, which rose from À0:52 to 1.18 in May of 1988 and stayed there for three months before dropping to À0:46 at the end of August of that year, as observed in the In 2007, the model identified two major shifts coinciding with the world foodprice crisis, marked by prices increases of these commodities for different reasons, such as financial speculation and the use of food for fuel. On In Online Appendix Figure 5 (see also Table 2), we can find the posteriors distributions and correlograms of the draws for the 4 parameters. The probability p has a posterior mean of 0.00099 which is very different from the prior of 1/41 and indicates that the probability of shifts is very low. This implies that on average a shift occurs every 1010 days. Also, we find that parameter / is 0.973 where the implicitly half-life cycle of short-memory component is 25 days, doubling the size of industrial or oil volatilities. As to the variances of volatility components, we find a posterior mean of r g equal to 1.65, and for r m the posterior mean is 0.12. Similarly to other indexes, the variance of the level shifts component is ten times higher than the variance of the short-memory component. In general, estimators behave according to expectations, as do draws of posterior distributions do not present problems of serial correlation. As shown in panels (f) to (i), the ACF decays to zero in a maximum of 50 periods for all parameters.

Livestock
Finally, the analysis of Livestock volatility is not so exhaustive because it is not of central importance to the external trade of Latin American Countries. The results can be found in Online Appendix Figure 6, where it is observed that livestock volatility stays constant in perfectly identified regimes of volatility. Livestock volatility exhibits the lowest number of shifts in volatility. The posterior parameters can be found in Online Appendix Figure 7 and in Table 2 and reinforce the results observed in the evolution of the series. We find that the posterior mean of p is 0.00081, which is the lowest value for all of the probabilities of shifts in our series. What is more, the lowest value of the confidence interval of probabilities p is 0.00016, which is very close to zero. On average, a shift is expected every 1234 days, so shifts are very rare. Also, the parameter / has a value of 0.977; thus we have more persistence for the short-memory component of the volatility than for other commodities, with an implicit half-life cycle of 30 days. In this case, the shortmemory component has the lowest variance (r v ¼ 0:076) in comparison with other indexes, while the variance of the level shifts component is twenty times higher. Although level shifts are very uncommon events, they impregnate high variation in volatility.

Contributions to the overall variation in volatility
The model has the particular feature of splitting the global volatility in two components: a level shifts and a short-memory component. If we contend that this model can replicate empirical features of the data, we must analyze whether this decomposition is significant. To this end, we divide the contributions of each component to overall volatility following Qu and Perron (2013): s t ¼ l t þ h t with s t being the overall volatility, l t and h t are the level shifts and the short-memory components, respectively. If we denote the sample means of the correspondent processes by s, l and h, then we obtain ðs t À sÞ ¼ ðl t À lÞ þ ðh t À hÞ, so the following ratios P n i¼1 ðl t À lÞ 2 P n i¼1 ðs t À sÞ 2 and P n i¼1 ðh t À hÞ 2 P n i¼1 ðs t À sÞ 2 ; give us the contributions of l t and h t to the global variation in volatility of our indicators. Qu and Perron (2013) find that the level-shifts component is more important than the short-memory component in explaining the variations in volatility of the S&P 500 and Nasdaq daily returns. Table 3 outlines our results for the six indexes and finds similar results to Qu and Perron (2013) for all cases except for livestock volatility. The level-shifts component goes a long way to explaining the variation in overall volatility. The maximum contribution of the level shifts component to volatility is 0.84, and corresponds to industrial metals. The gold index and commodities index level-shifts components closely follows industrial metals in contribution to the overall variation in volatility. Those volatilities have different evolutions as observed in Sect. 4.1, but what they have in common is that accounting for level shifts components is relevant for volatility modelling. The agriculture level-shifts component accounts for 54% of the variation in volatility, which is significant but less than the others. This is similar to what is observed for livestock volatility, and these are the cases where the level shifts component explains the lower variation in volatility. However, as seen before, it explains more than 50% percent of volatility with not many shifts. Finally, the oil index has the same results as the commodities index because it is the main component thereof and has many shifts, though less than gold.
With this measurement, we can conclude that variation in volatility may be better predicted with the level-shifts component; this is less volatile than the short-memory component, which is a more volatile process. Therefore, commodities volatilities can be better predicted and analyzed with a level-shifts framework instead of a longmemory analysis.

Business cycle comovements
An important aspect of commodities index volatility is the presence of comovements with business cycle indicators in small and commodity-exporting economies like Latin American countries such as Peru, Chile, Colombia and Mexico. We estimate the correlation between components of commodity-return volatility and some indicators of these economies using common regressions. The indicators used are electricity production, economic activity indicator 13 , expectations of the economy, and money supply, because these are observed constantly by private and government analysts.
The data are obtained from the Central Banks and Statistics Institutes from Peru, Chile, Colombia and Mexico in monthly frequencies. Thus, we take monthly averages of the level-shifts component, short-memory component, and the overall volatility of the series. After the transformation of frequency, we get the correlations with the interannual variation of the business cycle indicators. The results are presented in Table 4. First, when we analyze the correlations for the two components, we find that the short-memory component h t has no correlation at all with the indicators of the business cycle for all the countries. The level-shifts component accounts for all the correlation that the volatility of commodities index has with economic activity indicators. These could be interpreted as meaning that the level-shifts component captures macroeconomic drivers behind volatility, while the short-memory component accounts for the noise of daily activity in commodities markets.
The level-shifts component of all commodity-price volatilities are correlated with business cycle indicators, but not in the same direction. Industrial minerals and oil volatility present a positive correlation, and gold a negative one. This may be explained by the correlation between financial markets and gold volatility, while some periods of high volatility in industrial minerals or oil have been linked to the commodities boom. Second, only gold is a significant variable in explaining economy expectations for Peru, Chile and Mexico, which suggests the relevance of gold volatility as an indicator of financial stability and therefore of outcome performance in the future. 13 In the case of Peru, this indicator is the Gross Domestic Product (GDP). In the other countries, direct information on GDP is not available. However, there exists an indicator constructed in order to measure the level of economic activity based on other variables of the economy. In fact, for Chile, Colombia and Mexico, such indicators are named IMACEC, IMACO and IGAE, respectively. We use these indicators in Table 4. Because we have more access to Peruvian data, we also estimate the correlations between volatility components of every commodity index with more business cycle indicators from Peru. The additional indicators used are cement consumption and sectorial gross domestic product (GDP), where the sectors analyzed are agriculture, mining, construction, and manufacture. Online Appendix Table 2 presents the results of these regressions.
The cement consumption in Peru is highly correlated with industrial metals and oil volatilities. Also, we get some spurious correlations of the agriculture and livestock indexes volatilities with those indicators because they are not expected to affect or to be affected by the Peruvian business cycle. In addition, we obtain some correlations with GDP indicators. Agriculture volatility is correlated positively with total and agriculture GDP. Moreover, Industrial metals and oil volatilities are highly correlated with total, manufacturing, and construction GDP, while the correlations with mining GDP are not high but still significant. Gold volatility does not present a correlation with total and mining GDP. Finally, the volatility of the total commodity index shows correlations with total and all-sector GDPs because it is mainly composed of oil and industrial metal indexes. Similar to the first indicators, the correlation of these additional Peruvian indicators with the volatilities of commodities is due to the level shifts component. The short memory component has no correlation with any business cycle indicator from Peru.

Analysis of residuals
One way of observing whether the model fits our analysis of the data well is by studying the behavior of residuals. From Eq. (1) we find that x t ¼ expðl t =2 þ h t =2Þ t and the series x t , h t and l t are outputs from the estimation and filtering. Hence, b t could be extracted directly from our results as an estimation of t . The assumptions are that t is i.i.d. with Normal distribution. Therefore, we can observe whether the standardized estimated residuals b t behave as Gaussian and are independent by applying some well known graphical analysis.
The QQ plots are used to ensure that our residuals approximate a random variable with Normal distribution. To analyze independence in estimated residuals we can study the ACF of residuals and squared residuals. However, as the returns do not exhibit autocorrelations, we only need to determine whether our measurements of volatility of the residuals present autocorrelations. The results presented include the Figures of the ACFs obtained from the log-squared residuals t . Figure 9 and Online Appendix Figure 8 present the results of the residual analyses of Commodity, Industrial metals, gold, oil, agriculture, and livestock indexes, respectively. All of the series have the characteristic that their estimated residuals b t do not exhibit significant autocorrelation in their log-squared and absolute values 14 . The values of the autocorrelation are in general less than 0.05, and are inside the Bartlett windows.
On the other hand (see Online Appendix Figure 8), each of the series do not have the same QQ plot results. Estimated standardized residuals for Agriculture and Livestock present the best QQ-plots results in the sense that their estimated distribution approximates the standard Normal distribution more. However, Gold index residuals do not have the same behavior. They exhibit large fat tails that indicate the presence of large shocks, even though we include the level-shifts component. This is not in fact surprising, because the gold index is the most volatile of all the six indices analyzed. Finally, industrial metal, oil, and overall commodities indices exhibit reasonable QQ-plots results.

Conclusions
This study models the volatility of the commodities indexes of the S&P GSCI following the methodology proposed by Qu and Perron (2013), which includes random level shifts in the SV model of Kim et al. (1998).
Our approach contributes to the literature in several aspects. First, we use a statistic to tests for of spurious long memory in order to contrast the presence of a genuine long-memory process or the presence of a short-memory component affected by random level shifts in the market of commodities. The main results seem to confirm the relevance of the random level shifts in the volatility of the studied series. After considering these level shifts, the alleged long memory disappears and volatility converges to its mean in a short period of time. On the other hand, the persistence of the short-memory component is lower than one so the average life of a shock reduces compared to standard SV models or long memory models. However, the exception is the livestock index, which presents extremely rare shifts, and these shifts do not explain variations in volatility. Moreover, the persistence of its noise component is close to one. Despite these results, the livestock index is not so important to Latin American trade. Likewise, the gold index has different results because it exhibits so many shifts and the parameter of persistence is close to zero. The analysis of residuals of the SV model with RLS shows that autocorrelation in the log-squared and absolute-value of standardized residuals disappears. This means that the model captures all of the second-moment autocorrelations of the series. The QQ plot gives us similar results, with the standardized residuals being close to the Normal distribution as assumed by the model, with the exception of the gold index which has fat tails.
Second, the present study shows that the random level shifts contribute in higher proportion to the overall volatility than the short-term component. Therefore, the estimation and identification of the level shifts represents a valuable exercise to estimate properly the level of volatility in commodity markets. This pattern is presented for all commodities analyzed, it is not important that gold has more shifts than industrial metals or oil more than agriculture; in all cases, the level shifts component is significant in volatility modelling.
Finally, we find that the components of random level shifts in the volatility of commodity prices are strongly correlated with indicators of the Latin America economic cycles, such as expectations of the economy, electricity production, economic activity indicator and money supply. The volatility is still highly correlated with interannual variations of these indicators. Thus, level shifts component explains by far the transmission of volatility to business-cycle variables in economies with a strong dependence of commodities, such as Latin America countries. However, livestock index and agriculture index are the exception, as they do not account for much of the international trade of the region.
These findings are relevant for both private and public agents in the region. For example, the presence of random level shifts changes the traditional construction of a hedge. In the case of persistence of the volatility, the hedge faces more dispersion, because any shock over the risky commodity asset is expected to affect its future value for a long period. However, the identification of a level shift brings new information that allows adjustment to the expected volatility, while the rest of the shocks are expected to have a short memory. Therefore, the dispersion is reduced.
On the other hand, the high correlation between level shifts in volatility and business cycle variables in Latin American countries suggests that big external shocks have to be the main concern of policy makers. Therefore, the governments could implement special funds or precautionary policies to respond to counter the negative effect of the big shocks in the commodity markets.