(This article was first published on

**Speaking Statistically**, and kindly contributed to R-bloggers)For an integer programming class, Andrew and I were interested in seeing if some ideas from modern portfolio theory could be used to “beat the market.”

In particular, our

**goals**were the following:- For a particular time period, compute the covariances between all stocks in the Russell 1000 index.
- Use optimization to construct a portfolio with a given return with minimum covariance.
- Hold that portfolio for some time and see if the strategy is helpful.

Before going into a discussion about our results, here are a few interesting plots about stock returns. Our main results and conclusion will be in (Part 2) of this post.

Here, we plot the variance of individual stocks in different indices against the returns of the stocks. The time period is between 1990-2010. The results are as expected – large cap stocks (SP100) have lower variance for a given return than midcap (SP400) and smallcap (SP600) stocks.

Observed Return and Variances in Different Stock Indices Between 1990 and 2010. |

Stock returns over this period of time are (somewhat) normally distributed. A few examples are shown here. Of course, this isn’t necessarily true for all stocks and there are too many observations outside the normal distribution peak to be considered really normally distributed.

Histogram of Returns for Selected Stocks Between 1990 and 2010. The stock returns resemble a normal distribution but have heavier tails. |

Modern portfolio theory allows us to create “efficient frontiers.” This frontier is a line that is created by choosing the portfolio with the lowest variance for a given return. We constructed these efficient frontier for a few different universes of stocks. The results are as expected in the sense that the indices with highest variance for a given return are the smallcap and midcap ones. The largecap, SP500 and Russell 1000 indices have lower variance for a given return.

Efficient Frontiers for Different Indices. The large cap indices have lower variance for given return than the small cap indices. |

To

**leave a comment**for the author, please follow the link and comment on their blog:**Speaking Statistically**.R-bloggers.com 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...