Gold Prices: Driven by Inflation, Volatility, or Treasury Yields?

By: Aviral Agarwal

Introduction

Gold is one of the most hotly traded commodities in world. There are three main theories around what controls gold prices. As an asset that does not provide a yield, it is assumed to grow in value when the return on assets that do provide yields decreases. The first theory claims that yields do not directly have an impact on gold prices, instead inflation is what leads to the direct impact on gold price which is indirectly reflected in yields. The second group believes that real yields (real means adjusted for inflation) tend to be what controls gold prices. Recently, there has been a rise of an entirely different third theory on gold prices. When there is an increase in uncertainty or volatility in the global political and economic climate, that leads to an increase in gold prices, as gold has acted as a store of value for thousands of years.

In this tutorial, we attempt to explore the impact of inflation, volatility, and treasury yields on gold prices. We hope to determine which of the above theories has the most historical backing.

Data Gathering

We need to gather historical data on gold prices, inflation, volatility, and treasury yields.

Gold Prices can be best found through historical data on the futures contracts that are used to trade mass amounts of gold in the open market. Historical data can be found in the Wiki Continuous Futures database from NASDAQ’s data repository platform, Quandl, at https://www.quandl.com/data/CHRIS-Wiki-Continuous-Futures. The following code will allow us to gather daily prices on the gold continuous contract in the front from December 31st, 1974 to December 18th, 2020. Gold futures contracts tend to have a set date on which they expire on which a transaction for gold purchases will take place. As this data tracks the continuous contract in front, it will automatically provide data on the contract closest to expiry that has not yet expired.

This data contains 9 columns which are:

Date: Date for the current datapoint
Open: Opening price of the contract for that day
High: The highest price of contracts traded that day
Low: The lowest price of contracts traded that day
Last: The price of the last contract traded that day
Change: The dollar change in contract price from the previous day
Settle: The closing price of the contract for that day
Volume: The number of contracts that were traded that day
Previous Day Open Interest: The number of outstanding contracts that have yet to have their transaction completed

We can gather data on inflation by using monthly values of the Consumer Price Index (CPI), a well-known index used to track inflation. This can be found by downloading and then importing a CSV from the economic data provided by the Federal Reserve Bank of St. Louis at https://fred.stlouisfed.org/series/CPIAUCSL. The data provided is from January 1947 to November 2020.

This data contains two columns:

Date: Date for the current datapoint
CPIAUCSL: Cost of a basket of consumer goods in a specific month that costed 21.48 in January 1947

We can gather data on volatility using the Chicago Board Options Exchange's CBOE Volatility Index (VIX). This is a very popular index that tracks the stock market's expectation of volatility based on the options of stocks included in the S&P 500 index. Daily data from January 1st, 1990 to Dec 18th, 2020 on this can be found by downloading historical data from Yahoo Finance’s website at https://finance.yahoo.com/quote/%5EVIX/history?p=%5EVIX

This data contains seven columns:

Date: Date for the current datapoint
Open: Opening value of the VIX index on that specific day
High: Highest value of the VIX index on that specific day
Low: Lowest value of the VIX index on that specific day
Close: Closing value of the VIX index on that specific day
Adj Close: Adjusted closing value of the VIX index on that specific day based on stock splits and dividends
Volume: the number of transactions that took place of the VIX index (0 everyday as an index is not tradable)

We can also gather daily data on the Yield of the 10 Year Treasury Bond from January 1st, 1962 to December 18th, 2020 from Yahoo Finance at https://finance.yahoo.com/quote/%5ETNX/history?p=%5ETNX

This data contains seven columns:
Date: Date for the current datapoint
Open: Opening Treasury Yield on that specific day
High: Highest Treasury Yield on that specific day
Low: Lowest Treasury Yield on that specific day
Close: Closing Treasury Yield on that specific day
Adj Close: Adjusted Treasury Yield on that specific day
Volume: the number of transactions that took place of the Treasury Yield (0 everyday as an yield is simply a number, the bond itself is what is traded)

Data Cleaning

Now we would like to clean up our data

For the inflation data, we are interested in the percent inflation rather than the values of the basket of goods so we should calculate the monthly inflation and the yearly inflation and add that to the data. Also we should convert Date from strings to datetime objects.

Let us drop change, settle, volume, and previous day open interest columns from the gold price table as we will not need them. Then lets change the prices in the table so that they are inflation adjusted.

For the volatility data, we are not interested in the volume or adjusted close columns so we can drop them. We should also once again convert the date to datetime objects.

For the Treasury Yield data, we are not interested in the volume or adjusted close columns so we can drop them. We also are more interested in real yields instead of nominal yields so we should convert all the data to be inflation adjusted.

Exploratory Data Analysis

Lets start by making a graph of gold prices over time.

Based on the chart for the nominal gold prices we see there are three main bull markets for gold, first in the early 1980s, second after the dotcom crash in 2000 to 2013, and third from about 2018 to now. It seems that the post dotcom crash bull market for gold was strongest. However before making a judgement, lets make this graph again but using inflation adjusted prices.

Looking at the real gold prices after adjusting for inflation we see a different picture. The true bull market for gold was in the 1980s. The peak price that gold hit back then has never ever been hit again. However, the speed at which there is an increase in gold prices in 1980 seems to look like that of a bubble where prices began to up vertically and then crashed back vertically as well.

Lets create similar charts for inflation, VIX, and bond yields as well to see how their values have changed over time

This chart for inflation shows that inflation was very high back in the 1980s, however, there has been a steady decline since then.

This chart shows that volatility has been low since 1990 except for the two major peaks in 2009 and 2020 when the entire stock market crashed.

This chart shows almost an inverse of the inflation chart early on till the late 1980s. However, after the 1980s, inflation and real bond yields seem to both trend downward together.

Linear Regressions for Gold vs Inflation, Bond Yield, and Volatility

Lets start with inflation first as historically, gold has been most accepted to be an inflation hedge.

At first glance the chart looks like that there is no correlation between inflation and gold prices. However, when inflation goes above 10% then there is a clear increase in gold prices. So there might be a slight positive relationship between gold prices and inflation. This seems to be matched up with the coefficient of 2.4 which shows a positive relationship, while the low R^2 of 0.006 shows that this correlation between inflation and gold prices is very weak.

Then lets take a look at bond yields and their relationship with gold prices.

This chart seems to have a much stronger relationship than the one we previously looked at. There is a clear negative relationship between real bond yields and gold prices. As the real bond yield increases then the price of gold decreases. This is backed up once again by the coefficient of -14.09 and the R^2 value of 0.165 which is low but could be due to the possibility that a different curve would better fit the data instead of a line.

Finally lets look at Volatility

This chart shows the worst relationship, there is no visible correlation here whatsoever between gold prices and volatility. This is completely at odds with what we saw before with the spikes in volatility in 2009 and 2020 coinciding with the increases in gold prices. This is also seen in the R^2 value which is almost zero at 0.00047.

Conclusion

Based on the linear regressions done, it seems that Gold Prices have a weak relationship with treasury bond yields and no relationship to inflation and volatility. This is highly surprising as for a long-time people have believe in inflation being the main driving factor behind gold prices, yet the data shows that this is clearly not true.

It might also be valuable to try to look at specific time periods and see the effects that each of these had on gold prices. Like specifically, the 1980s seemed to have very high inflation which is when gold prices were at their highest. It might very well be possible that the extremely high inflation of the time may have led to such high gold prices for that specific era.

Additional Resources

To read more about the VIX: https://www.investopedia.com/terms/v/vix.asp
To read more about Futures Contracts: https://www.investopedia.com/terms/f/futurescontract.asp
To read more about Treasury Bonds: https://www.investopedia.com/terms/t/treasurybond.asp
To read more about Consumer Price Index: https://www.investopedia.com/terms/c/consumerpriceindex.asp