Monday, April 19, 2010

US Debt vs. Gold Price linear regression

WARNING: This is not financial advice, just a fun project for me.

A chart at Jesse's Cafe Americain inspired me to crunch the debt numbers on my own. That chart compares US debt to the gold price and showed a very high correlation (R-squared of 0.93).

I downloaded monthly public debt data from the Treasury starting in 2001 and historical gold prices from Kitco, then ran my own linear regression using the open source R program. The R-squared was was 0.9288, confirming the value from the chart at Jesse's site. This is the regression chart for the 2001-2010 data:



The linear regression formula (without the error term) is:
GOLD PRICE (nominal) = -522.86 + (.1334 * US-debt-in-billions)

If we take the Obama administration estimates of $1 trillion dollar deficits for the foreseeable future, the model makes this prediction (with 95% confidence):

June 1, 2016: US debt = $19 trillion
price of gold (nominal) = 1849.42 (low), 2011.84 (best fit), 2174.27 (high)

Now, some caveats. Below is an annual regression from 1971 which still has a good correlation (0.5564), but predicts lower prices. Correlation is not causation, and I suspect there are many other factors that weigh on the gold price, both positive and negative.

After confirming the original chart, I went back to Treasury and gathered annual debt numbers as back to 1971 when the final dollar link to gold was broken. The R-squared for the larger data set is 0.5564. This is the regression chart for the 1971-2010 data:



The linear regression formula (without the error term) is:
GOLD PRICE (nominal) = 181.46 + (0.0518 * US-debt-in-billions)

And this is what the updated model predicts (with 95% confidence):

June 1, 2016: US debt = $19 trillion
price of gold (nominal) = 780.95 (low), 1165.66 (best fit), 1549.94 (high)

7 comments:

  1. So if the debt gets paid off, the intrinsic value of gold is negative?

    ReplyDelete
    Replies
    1. If the debt gets paid off, then there will be LESS dollars floating around, so the price will drop. However, when there are more dollars floating around (i.e. QE 1,2,3) the price of gold goes up in dollars. This is because the VALUE of gold remains the same, the change is the value of the paper we call currency. When the dollar index goes down the price goes up, when the dollar becomes strong and has a high index, the price goes down. see chart : http://media.resourceinvestor.com/resourceinvestor/historical/News/2011/4/PublishingImages/4-29-11-ft-GoldSkyHigh-042811.gif

      Delete
    2. It is hard to directly compare the dollar index, which is the value of a dollar against other fiat currencies, against gold. It is more of an indirect relationship. You don't have to look further than the price of gold in dollars. When the price goes up, the value of a dollar is down (against gold), and the inverse is true. Same with dollars and the price of oil.

      Delete
  2. No, the price of gold would not be negative. The negative coefficient just reflects the starting position of the linear regression line.

    ReplyDelete
  3. hi i really need to know how to draw that line through the predicted values on R. Do you happen to know how to do that

    ReplyDelete
  4. Jessica,

    Using R, let's say your data is in set "dataset", then you create a linear model using lm function, for example, dataset.lm = lm(var2~var1, data=dataset).

    Then, plot the data with plot(dataset), and add the best fit line with abline(dataset.lm). The abline function in R will only draw a line on an existing plot.

    There are some good R tutorials online. You can also use Excel to draw the line for you in an Excel chart, and it is much less involved than using R.

    ReplyDelete
  5. "So if the debt gets paid off, the intrinsic value of gold is negative?"

    yup right after the flying pigs deliver the baby unicorns to us..

    paid off, that's a funny one :)

    ReplyDelete