Visit my blog at http://thequantinvestor.blogspot.com/
Oil, oil, oil...has it made you a fortune in the last two weeks, or are you ready for US energy to go green and your portfolio to follow suit?
For my first quantitative study, I'll demonstrate how a relatively simple analysis may lead you to rethink your portfolio. Correlation (or covariance, roughly) is a common measure used across science, economics, and various other disciplines. In short, it measures how accurately the change in one variable (stock price X, say) mimics the change in another variable (stock price Y, say). Correlation maxes out at 1, and the higher the correlation the more X mimics Y. Alternatively if the correlation is -1, it means X does the exact opposite of Y, and vise versa. A correlation of 0 indicates no real relationship between the two.
We can take this one step further and, for example, look at how stock price X, 5 days ago, correlates to stock price Y, today. One can imagine that if there is some correlation between a previous value of X, and a current value of Y, then X would make a fine (potentially profitable) predictor of Y.
For simplicity purposes we will substitute the actual oil commodity for a liquid, commonly tradable alternative, The United States Oil Fund USO. So lets take a look now at 2 years of data from USO (red) and the Dow Jones Industrial Average (blue).
To the naked eye one might see a little bit of similarity, but definitely nothing to justify 20 hours of airtime on CNBC right?
Well, lets delve deeper....
Above, we have the correlation coefficients between the price of USO and the DJIA, calculated over 250 days, for different lags of USO. Anything above 0.2 or below -0.2 is statistically significant... so basically nothing. Somewhat surprisingly, the market seems to do better for a few days following a rise in oil prices, but falls a week or so after. None of these values are significant however, so we're really pulling at straws here.
So how exactly can you invest on this? What it indicates is that the absolute price of oil really doesn't tell you at all where the market is headed. If the economy is booming, and the traders are paying a lot for oil, then both may go up in coincidence. Alternatively, much like recent events, some international conflict may be causing the price of oil to rise, and the market to concurrently fall. The figure below is the correlation of USO on the DJIA over the past 50 days. It even suggests that as oil goes up so does the market!
So if you want to play the market vs. oil, or have a well diversified portfolio containing oil, it might just be best to avoid reading the market section of the WSJ, and to stick to the front page.
Disclosure: I have no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours.