More on higher moments: rolling skewness of S&P 500 daily returns

October 15, 2011

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

In this post, Portfolio Probe explores a way to decide whether market kurtosis and skewness are predictable.

Market skewness, in naive financial modeling, is some kind of measure of (as-)symmetrical distribution of (daily) returns around the average market return. A higher skewness would tend to indicate a denser distribution of higher returns, compared to lower or negative returns.

In the cited example, skewness was estimated based on even partition of years since 2008. While is this is a neat idea, it seems like a good idea to study the evolution of a rolling skewness (skewness of returns of the preceding n days).

Below is a quick piece of R code to describe the distribution / fluctuation of a 30-day rolling skewness of the S&P 500 daily returns since 1980.

Surprisingly, the skewness is rather volatile, with sudden high negative values. The distribution of rolling skewness is negatively skewed as well.

getSymbols(c("^GSPC"), from="1980-01-01")
part <- function(i) GSPC[i:(i+30)]
part2 <- function(i) skewness(Return.calculate(Cl(part(i))))
skews <- unlist(lapply(1:(length(GSPC)/6-30), part2))
plot(ts(skews), col='blue')
hist(skews, breaks=50, col='cyan')

Photograph used with permission from

To leave a comment for the author, please follow the link and comment on their blog: » R. 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...

Comments are closed.


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)