Kelly criterion for multivariate portfolios: a modelfree approach Vasily Nekrasov University of Duisburg-Essen Chair for Energy Trading and Finance Hirschegg/Kleinwalsertal, March 10, 2014
In order to make profits on the market an investor must have a trading system with a positive expectation. However, a positive expectation of a trading system is though necessarily but not sufficient!!! Moreover, what is optimal in the short term is not necessarily optimal in the long run.
Motivating Example I Assume a gambler starts with initial capital X and makes a series of n bets. After each bet he loses or doubles the money at stake. Further assume that he wins with the probability p > 0.5 and fully invests his capital at each bet. This strategy maximizes the expected capital, indeed after n bets the expected capital is However, this would be little comfort, since by each bet there is a risk to lose everything and as n goes to infinity, the gambler is definitely broke. This paradoxal situation is due to the fact that the only lucky path is the n wins by n trials. The capital by this path grows faster than the probability of this path decreases (2p > 1 since p > 0.5, so ) but this is hardly a consolation for a bankrupt trader. (2p) n! 1 E[X n ] = X(2 n p n ) = X(2p) n Thus maximizing the expected capital is actually a bad idea and we need another criterion. (Note: if one does not re-invest winnings but bets a constant absolute amount of money, e.g. 100 per week, then it is still optimal to maximize the expected capital).
Motivating Example II Assume we have a stock whose return is with probability 1/2 either 170% or -70% (e.g. for Nokia or solar energy stocks it is not unrealistic). If we just buy and hold then in case of a typical scenario (number of trades with profit = those with losses) we have by big n [(1 + 1:7)(1 0:7)] n = [0:81] n! 0 But if we rebalance our capital and hold only 42% in stock then: [(1 + 1:7 0:42)(1 0:7 0:42)] n = [1:210] n! 1 What an improvement just by means of the money management!
Motivating Example II, cont.
Kelly Criterion Also known as Fortunes Formula One should optimize not the expected terminal wealth but the expected growth rate!
Edward Thorp, a math Professor who has first beaten the dealer and then the market. Main apologist of Kelly criterion Claude Shannon, the father of Information Theory and a cofather of Kelly criterion photo from http://roulettebettors.com/edwardthorp.htm photo from http://dennisdjones.wordpress.com/
Claude Shannon and John Kelly discovered the formula at Bell Labs, in 1956. Athough Poundstone seems to be convinced that the formula is the product of a genuine collaboration, the original paper on the subject was written by Kelly alone. An earlier version, which spoke openly of bookies and insider information, had been declared unacceptable by AT&T management, which was never keen to advertise the fact that bookies long represented an embarrassingly large fraction of the firm s customer base. As a result, Shannon found himself serving as an anonymous in-house referee, helping Kelly to prepare a suitably sanitized version of what both considered joint research, for publication in the firm s own Bell System Technical Journal. (from http://www.siam.org/pdf/news/930.pdf)
Paul Samuelson, Nobel price winner Prominent apologist of efficient markets, main antagonist of Kelly formula, and a shareholder of Berkshire Hathaway (http://www.economicpolicyjournal.com/2011/01/howpaul-samuelson-really-got-rich.html) Harry Markowitz, Nobel price winner The scientist, known to everyone who studied [quantitative] finance as the father of portfolio optimization theory. Less is he known as a hedge fund manager, who dropped out (http://www.edwardothorp.com/sitebuildercontent/ sitebuilderfiles/kellycriterion2007.pdf p.35). (photo from http://www.nobelprize.org/nobel_prizes/economics/l aureates/1970/samuelson-bio.html) (photo from http://www.nobelprize.org/nobel_prizes/economics /laureates/1990/markowitz-autobio.html)
Optimization of expected growth rate is equivalent to the optimization of the logarithm of the terminal wealth. Still, is there something special with logutility?! Yes! 1. Let X* be the Kelly strategy and X any other strategy. Then E[X=X ] 1 (Breiman(1961)) 2. (Under fairly general conditions) Kelly criterion maximizes the median of terminal wealth (and median is often preferred to the mean in case of highly skewed distributions, Ether(2004)) 3. Log-utility is myopic, i.e. one optimizes each bet (trade), as if it were the last one! Thus the optimal solution does not depend on the number of bets.
Kelly and multivariate markets For the lognormal market ds i (t) = S i (t) Ã ¹ i dt +! nx ¾ ij dw j (t) j=1 i = 1; : : : ; n the problem is solved by Merton: optimal portfolio, which maximizes the logarithm of terminal wealth, is given by ~u = (HH T ) 1 (~¹ ~1r) where H is the Cholesky decomposition of the covariance matrix and r is the risk free interest rate
Non-Lognormal Multivariate market In general, no analytic solution, but an efficient numerical approximation via Taylor series (Maslov&Zhang(1998), Nekrasov(2013)) u k Let us invest fraction of our capital in S k and the residual capital (not invested in risky assets), i.e. 1 - P n k=1 u k is invested in bonds. W.l.o.g. let our capital be equal to 1
Then in future we yield Ã! nx nx u k (1 + r k ) + (1 + r) 1 u k k=1 = (1 + r) + nx u k (r k r) k=1 Thus we need to maximize " Ã E ln (1 + r) + nx k=1 k=1 u k (r k r)!#
Expand it to Taylor series about " nx u k (r k r) E ln(1 + r) + 1 nx 1 + r 2 Or in matrix notation E k=1 ~u = (0; ::; 0) This is a quadratic form for which one can easily find the maximum: And we need to know merely the expected returns and the matrix of second mixed moments (can be estimated analogous to correlation matrix). k=1 We just need a fairly general assumption on the distribution of returns: not too heavy tails nx j=1 ln(1 + r) + 1 1 + r ~ut (~r ~1r) 1 2 u k u j (r k r)(r j r) (1 + r) 2 1 (1 + r) 2~uT ~u ~u = (1 + r)(^ ) 1 (^~r ~1r) #
The simplest example: riskfree rate is zero and r = 50% or r = -35%, both with p = 0.5
More concretely: assume that the returns are floored/capped (e.g. by SL and TP) at +/-20%. This is not implausible for BlueChips in midterm. Let also assume no leverage & no short selling. Then the error of Taylor approximation l is less than 0.007 Note, whether 0.007 = 0.7% is small or not, depends on the [max.] expected growth rate. If it is about 7% (like e.g. by DAX) then l is negligible. If the expected growth rate is about 1% then not but probably in this case the trading is not worth the effords?!
Sketch of proof: consider the univariate case ln(1 + t) - taylor[ln(1+t), t, 3]
And then reduce the multivariate cases to the univariate one! f := ln(1 + ax) ft := taylor(f; x; 3) = ax {z} :=t 1 2 a2 x 2 {z} =t 2 g := ln(1 + ax + by) gt := mtaylor(g; [x; y]; 3) = ax + by {z } :=t 1 2 (ax + by)2 {z } =t 2
Two numerical examples for an optimist Source code in R: http://www.yetanotherquant.de/kelly/kelly4journal.r
A numerical example for a pessimist Returns are normally distributed with ¹ = 0:08 0:10 = 0:09 0:06 0:06 0:16 We solve the optimization problem with Merton formula, then via Taylor approximation with true parameters and finally simulate the market with true parameters, draw 100 elements, estimate the parameters from this sample and solve via Taylor approximation with estimated parameters. (We repeat the last step 3 times) r = 0:02
The solutions are respectively 0:44 0:43 u = 0:33 ~u = 0:32 0:39 0:28 0:79 ~u 1 = 0:07 ~u 2 = 0:03 ~u 3 = 0:40 (after the normalization of components sum to 1.0) ~u 3 so that its ~u norm 3 = 0:66 0:34
Solving with true mean returns and estimated covmatrix yields better results: ~u 1 = 0:45 0:17 ~u 2 = 0:42 0:23 General problem: multivariate Kelly approach is often sensitive to the errors of parameters estimation (not only mean returns, for larger portfolios the estimation of covmatrix gets critical too). Rule of thumb: if doubt, better underbet (decrease fractions in doubt) as overbet! ~u 3 = 0:44 0:35
If returns are heavier-tailed than +/-20% the Taylor approximation may be poor. Still it is no problem (as long as we can simulate returns). Here comes the Monte-Carlo gradient algo:.0 0.8... in the 2nd stock 0.6 0.4 0.2 wealth fraction invested in the 1st stock terminal wealth 0 10 20 30 40 50 0.0 0.2 0.4 0.6 0.8 1.0
Fractional Kelly strategies Everything more aggressive than the maximization of the expected log-utility is an overbetting, but the log-utility as such is aggressive too. That s why fractional Kelly strategies (better underbet) are popular among practitioners. For the lognormal market there is an interesting relation
Merton optimal portfolio for log-utility ~u = (HH T ) 1 (~¹ ~1r) and for negative power utility ~u = 1 1 (HHT ) 1 (~¹ ~1r) Which is nothing else but a fractional Kelly! Note: for a positive gamma the Kelly fraction is more than one, which means overbetting and thus an investor with positive power utility will eventually go bankrupt!
Code in R findoptimalfractions<-function(vectorofmeanreturns, riskfreereturn, covmatrix ) { n_riskyassets=length(vectorofmeanreturns) #min(-d^t b + 1/2 b^t D b with constrains A^T b >= b0) dvec = (vectorofmeanreturns - riskfreereturn) / (1 + riskfreereturn) Dmat = covmatrix / ((1+riskFreeReturn)^2) Amat = matrix(0, (n_riskyassets), n_riskyassets) diag(amat) <- 1 Amat=t(Amat) bvec=vector("numeric", (n_riskyassets)) solution = solve.qp(dmat, dvec,amat,bvec=bvec) fractionvector=as.vector(solution$solution) result = fractionvector #/ sum(fractionvector) #NB!Normalization return(result) } estimatecovariancematrix<-function(insamplereturns, riskfreereturn) { n_assets = (dim(insamplereturns))[1] n_observations = (dim(insamplereturns))[2] covmatrix = array(0, dim=c(n_assets,n_assets)) for(k in 1:n_assets) { for(j in 1:n_assets) { covmatrix[k,j] = mean( (insamplereturns[k,] - riskfreereturn)*(insamplereturns[j,] - riskfreereturn) ) } } return(covmatrix) }
library(quadprog) library(mass) riskfreereturn = 0.02 vectorofmeanreturns=c(0.08,0.10) s1 = 0.09 s2 = 0.16 rho = 0.5 Sigma <- matrix(c(s1, sqrt(s1*s2)*rho, sqrt(s1*s2)*rho, s2),2,2) #theoretical - merton formula H=chol(Sigma) ginv(t(h)%*%(h)) %*% (vectorofmeanreturns - riskfreereturn) #Approx. with true param we take a BIG sample, so estimated covmatrix converge fortrueparameters = mvrnorm(n=10000000, vectorofmeanreturns, Sigma) covmatrix<-estimatecovariancematrix(t(fortrueparameters), riskfreereturn) of=findoptimalfractions(vectorofmeanreturns, riskfreereturn, covmatrix ) print(of) print(covmatrix) #approx. solution with estimated parameters form limited sample insamplereturns = mvrnorm(n=100, vectorofmeanreturns, Sigma) covmatrix<-estimatecovariancematrix(t(insamplereturns), riskfreereturn) r1est = mean(insamplereturns[,1]) r2est = mean(insamplereturns[,2]) of=findoptimalfractions(c(r1est, r2est), riskfreereturn, covmatrix ) print(of) print(covmatrix) #approx. solution with true mean returns estimated covmatrix form limited sample insamplereturns = mvrnorm(n=100, vectorofmeanreturns, Sigma) covmatrix<-estimatecovariancematrix(t(insamplereturns), riskfreereturn) of=findoptimalfractions(vectorofmeanreturns, riskfreereturn, covmatrix ) print(of) print(covmatrix)
Thank you for your attention!