Please see http://timelyportfolio.blogspot.com/search/label/horizonplot for all horizon plot posts.
Once more thanks to Ken French for his data, we can accomplish something I think is fairly amazing. In 640x800, we can see 250 day rollling returns for 48 U.S. industries since 1963.
From TimelyPortfolio |
I have noticed a small issue with your script, perhaps you are developing on Windows but in Linux and other *NIX systems, that path does not work with those slashes but needs to be /
ReplyDeleteSo, instead of:
#this will be the temp file set up for the zip file
my.tempfile<-paste(tempdir(),"\\frenchindustry.zip",sep="")
#my.usefile is the name of the txt file with the data
my.usefile<-paste(tempdir(),"\\48_Industry_Portfolios_daily.txt",sep="")
It should be this for support on other platforms like Linux and OS X etc:
#this will be the temp file set up for the zip file
my.tempfile<-paste(tempdir(),"/frenchindustry.zip",sep="")
#my.usefile is the name of the txt file with the data
my.usefile<-paste(tempdir(),"/48_Industry_Portfolios_daily.txt",sep="")
Thanks for the useful guide
Cheers,
Mohomed
thanks so much for pointing this out in your helpful comment. thanks for reading.
ReplyDeleteI think it would be interesting to see the industries ordered by some sort of similarity of returns.
ReplyDeleteI agree so I did in this post http://timelyportfolio.blogspot.com/2012/08/48-industries-dendrogram-ordered-over.html
DeleteWhile running this line:
ReplyDeletefrench_industry_xts <- as.xts(french_industry[,1:NCOL(french_industry)], order.by=as.Date(datestoformat,format="%Y-%m-%d"))
I get this error:
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
I changed it to
Deletefrench_industry_xts <- as.xts(french_industry[,1:NCOL(french_industry)],
as.POSIXct(datestoformat,format="%Y-%m-%d"))
and it's all OK.