# Articles by [email protected]

### The Kelly Criterion in Applied Portfolio Selection – Part 2

December 12, 2016 |

[This article was first published on databait, 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. Previous blog post on the Kelly CriterionAs pointed out in a previous blog post, the Kelly Criterion is an interesting option to decide on position sizing in portfolio selection. While the previous post looked at single stocks, I will today show how to optimize position sizes for a portfolio with multiple stocks. The core functionAt the core of my portfolio optimization is this function: 12345678910111213opt_portfolio <-function(shares, dpf, maxshare) { # calculate portfolios return vector exp_returns <- dpf%*%shares obj = -sum(log(1+exp_returns)) weight.penalty = 1000*(1-sum(shares))^2 # max share penalty: maxpen <- sum(shares[shares>maxshare])*1000 return(obj + weight.penalty + maxpen)} The function has three parameters. shares is the vector of shares (position size for each stock) that is going to be estimated by optimization. dpf is a matrix where each stock is a column and each line contains the daily stock price movements like e.g.: diff(stock)/lag(stock). The maxshare option can be used to restrict the position size of a single stock to a [...] [Read more...]

### The Kelly Criterion in Applied Portfolio Selection

December 10, 2016 |

The Kelly CriterionDerived by John L. Kelly (1956) the criterion recommends a certain fraction of a bankroll to be put on a bet with positive expectations. Kelly showed that $$\frac{p \cdot (b+1) - 1}{b}$$ optimizes the growth rate of wealth if the gam...