Where are the Fat Tails?
[This article was first published on Timely Portfolio, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
In Crazy RUT, I started to explore why the moving average strategy has failed for the last 2 decades on the Russell 2000. I still do not have an answer, but I thought looking at skewness and kurtosis might help explain some of the challenge of beating this index. I think–but don’t have as much rigid objective evidence as I would like–that moving average systems work best when skew is negative and kurtosis is positive because that implies that the bad stuff happens below the mean when you would be out.
The Russell 2000 has been remarkably tame in terms of skewness and kurtosis even including 2008-2009.
![]() |
From TimelyPortfolio |
![]() |
From TimelyPortfolio |
R code from GIST (do raw for copy/paste):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(lattice) | |
require(latticeExtra) | |
require(directlabels) | |
require(reshape2) | |
require(quantmod) | |
require(PerformanceAnalytics) | |
#I will use a csv file of weekly returns to get more history | |
#but if you do not have access to that then use getSymbols for data to 1987 | |
#getSymbols("^RUT",from="1900-01-01") | |
#then get weekly ROC | |
#rut.return <- ROC(to.weekly(RUT)[,4],type="discrete",n=1) | |
RUT <- read.csv("rut.csv",stringsAsFactors=FALSE) | |
RUT <- as.xts(RUT[,2],order.by=as.Date(RUT[,1])) | |
rut.return <- ROC(RUT,type="discrete",n=1) | |
#get skewness for short and long rolling periods | |
skew.short <- apply.rolling(rut.return,FUN=skewness,width=20,trim=FALSE) | |
colnames(skew.short) <- "roll20w" | |
skew.long <- apply.rolling(rut.return,FUN=skewness,width=250,trim=FALSE) | |
colnames(skew.long) <- "roll250w" | |
#do the same for kurtosis | |
kurtosis.short <- apply.rolling(rut.return,FUN=kurtosis,width=20,trim=FALSE) | |
colnames(kurtosis.short) <- "roll20w" | |
kurtosis.long <- apply.rolling(rut.return,FUN=kurtosis,width=250,trim=FALSE) | |
colnames(kurtosis.long) <- "roll250w" | |
#combine into data frame so we can melt as plot with lattice | |
skew <- as.data.frame(cbind(index(skew.short),coredata(merge(skew.short,skew.long)))) | |
#melt to please lattice | |
skew.melt <- melt(skew,id.vars=1) | |
#clean up with good column names as properly formatted dates | |
colnames(skew.melt) <- c("date","measure","skew") | |
skew.melt[,"date"] <- as.Date(skew.melt[,"date"]) | |
direct.label(asTheEconomist(xyplot(skew~date,groups=measure,data=skew.melt,type="l",lwd=c(1,3), | |
main="Russell 2000 Rolling Skewness")),"last.qp") | |
#combine into data frame so we can melt as plot with lattice | |
kurtosis <- as.data.frame(cbind(index(kurtosis.short),coredata(merge(kurtosis.short,kurtosis.long)))) | |
#melt to please lattice | |
kurtosis.melt <- melt(kurtosis,id.vars=1) | |
#clean up with good column names as properly formatted dates | |
colnames(kurtosis.melt) <- c("date","measure","kurtosis") | |
kurtosis.melt[,"date"] <- as.Date(kurtosis.melt[,"date"]) | |
direct.label(asTheEconomist(xyplot(kurtosis~date,groups=measure,data=kurtosis.melt,type="l",lwd=c(1,3), | |
main="Russell 2000 Rolling Kurtosis")),"last.qp") |
To leave a comment for the author, please follow the link and comment on their blog: Timely Portfolio.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.