Recently, friend of my, got investment advise from his broker – long gas, because the price of gas is very low compared to oil. The broker didn’t indicate neither profit target or stop loss…
I got hooked on the idea.
First of all, I ran linear regression on monthly prices of oil and gas from 01-12-1993 to 01-09-2009. I was skeptical about ‘oil vs gas’ idea, but after seeing this graph it became interesting. R-Square is high 0.7385. Check this out: (the prices are adjusted with log())
The spread between oil and gas indicates, that it was very high back in September.
Finally, I took two funds: USO (oil’s ETF) and UNG (gas’s ETF) to see how does it look on real time (ok ok daily) data. As we can see, in late September the spread reached a new high. The problem is, that data set is very limited and we can see only ~3 years.

And the last one – green stands for oil’s log(price) and blue one for gas’s log(price).
R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series,ecdf, trading) and more...




Zero Inflated Models and Generalized Linear Mixed Models with R.
Zuur, Saveliev, Ieno (2012).