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 I am unsure if it will be close enough until further system testing.
From TimelyPortfolio |
From TimelyPortfolio |
From TimelyPortfolio |
From TimelyPortfolio |
require(PerformanceAnalytics)
require(quantmod)
#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
CRB<-as.xts(read.csv("spxcrbndrbond.csv",row.names=1))[,2]
#my CRB data is end of month; could change but more fun to do in R
CRB<-to.monthly(CRB)[,4]
index(CRB)<-as.Date(index(CRB))
#NAPMPRI_change<-ROC(NAPMPRI,1)
PPIACO_change<-ROC(PPIACO,1)
PPICRM_change<-ROC(PPICRM,1)
PPIIDC_change<-ROC(PPIIDC,1)
#combine all Rate of Change series with CRB lag 1 month (moved forward) to account for PPI delay
CRBandPPI<-merge(lag(CRB,k=1),PPIACO_change,PPICRM_change,PPIIDC_change)
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")
How about the National Agricultural Statistics Service (NASS)? Looks like they have information for prices received back to 1908 for many agricultural goods (http://www.nass.usda.gov/).
ReplyDeleteGreat idea. I have not been there in a very long time. After a couple of hour of struggle, I still cannot find how to get the entire data series in any form much less into R. I will keep trying.
ReplyDelete