Commodity Index Estimators

May 2, 2011

(This article was first published on Timely Portfolio, and kindly contributed to R-bloggers)

In this post I will show my first try at a commodity index substitute.  Regular readers know my frustration with proprietary data as I try to demonstrate various techniques to users who might not have the resources to pay for the data.  I have substituted US 10y Treasury Total Returns series as my bond proxy with good results, but I have so far been unable to find a free and readily available substitute for commodity indexes.

PPI is not real-time, but might offer one good 1-month lagged proxy for commodity indexes.  If we use PPI data from the St. Louis Federal Reserve FRED system, I can get close, but unsure if it will be close enough until further system testing.

From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio

R code:


#getSymbols(“NAPMPRI”,src=”FRED”) #load ISM Manufacturing Price
getSymbols(“PPIACO”,src=”FRED”) #load PPI All Commodities
getSymbols(“PPICRM”,src=”FRED”) #load PPI Crude for Further Processing
getSymbols(“PPIIDC”,src=”FRED”) #load PPI Industrial

#unfortunately cannot get substitute for proprietary CRB data
#get data series from csv file
#my CRB data is end of month; could change but more fun to do in R


#combine all Rate of Change series with CRB lag 1 month (moved forward) to account for PPI delay
colnames(CRBandPPI)<-c(“CRB”,”PPI All Comm”,”PPI Crude for Further”,”PPI Industrial”)

chart.CumReturns(CRBandPPI,main=”CRB Estimators through PPI”,legend.loc=”topleft”)
chart.CumReturns(CRBandPPI[“1990::”],main=”CRB Estimators through PPI since 1990″,legend.loc=”topleft”)

chart.Correlation(CRBandPPI,main=”CRB Estimators through PPI”)
chart.Correlation(CRBandPPI[“1990::”],main=”CRB Estimators through PPI since 1990″)

To leave a comment for the author, please follow the link and comment on their blog: Timely Portfolio. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: ,

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)