An Evolutionary Optimization Approach to Risk Parity Portfolio Selection
AAn Evolutionary Optimization Approach to Risk ParityPortfolio Selection
Ronald HochreiterJanuary 2015
Abstract
In this paper we present an evolutionary optimization approach to solve the risk parityportfolio selection problem. While there exist convex optimization approaches to solve thisproblem when long-only portfolios are considered, the optimization problem becomes non-trivial in the long-short case. To solve this problem, we propose a genetic algorithm aswell as a local search heuristic. This algorithmic framework is able to compute solutionssuccessfully. Numerical results using real-world data substantiate the practicability of theapproach presented in this paper.
The portfolio selection problem is concerned with finding an optimal portfolio x of assets from agiven set of n risky assets out of a pre-specified asset universe such that the requirements of therespective investor are met. In general, investors seek to optimize their portfolio in regard of thetrade-off between return and risk, such that the meta optimization problem can be formulatedas shown in Eq. (1). minimize Risk ( x )maximize Return ( x ) (1)This bi-criteria optimization problem is commonly reduced to a single-criteria problem by justfocusing on the risk and constraining the required mean, i.e. the investor sets a lower expectedreturn target µ , which is shown in Eq. (2).minimize Risk ( x )subject to Return ( x ) ≥ µ (2)Markowitz [12] pioneered the idea of risk-return optimal portfolios using the standard devia-tion of the portfolios profit and loss function as risk measure. In this case, the optimal portfolio x is computed by solving the quadratic optimization problem shown in Eq. 3. The investorneeds to estimate a vector of expected returns r of the assets under consideration as well as thecovariance matrix C . Finally the minimum return target µ has to be defined. Any standardquadratic programming solver can be used to solve this problem numerically.1 a r X i v : . [ q -f i n . P M ] J a n inimize x T C x subject to r × x ≥ µ (cid:80) x = 1 (3)While this formulation has been successfully applied for a long time, criticism has sparkedrecently. This is especially due to the problem of estimating the mean vector. To overcome thisproblem one seeks optimization model formulations that solely depend on the covariance matrix.Sometimes even simpler approaches are favored, e.g. the 1-over-N portfolio, which equally weightsevery asset under consideration. It has been shown that there are cases, where this simple strategyoutperforms clever optimization strategies, see e.g. DeMiguel et al. [7].Of course, the Markowitz problem can be simplified to a model without using returns easilyby dropping the minimum return constraint. In this case one receives the Minimum VariancePortfolio (MVP), which is overly risk-averse.One important technique used for practical portfolio purposes are risk-parity portfolios, wherethe assets are weighted such that they equally contribute risk to the overall risk of the portfolio.The properties of such portfolios are discussed by Maillard et al. [11] and alternative solutionapproaches are shown by Chaves et al., see [5] and [6], as well as Bai et al. [1].In this paper, an evolutionary optimization approach to compute optimal risk parity portfolioswill be presented. Evolutionary optimization approaches have been shown to be useful for solvinga wide range of different portfolio optimization problems, see e.g. [15] or [8] and the referencestherein. See also the series of books on Natural Computing in Finance for more examples [2],[3], [4].This paper is organized as follows. Section 2 describes the risk-parity problem in detail,Section 3 presents the evolutionary algorithm developed for solving the problem, and Section 4presents numerical results. Finally, Section 5 concludes the paper. The type of risk-parity portfolios discussed in this paper are also called Equal Risk Contribution(ERC) portfolios. The idea is to find a portfolio where the assets are weighted such that theyequally contribute risk to the overall risk of the portfolio.We follow Maillard et al. [11] in their definition of risk contribution, i.e. reconsider the abovementioned portfolio x = ( x , x , . . . , x n ) of n risky assets. Let C be the covariance matrix, σ i the variance of asset i , and σ ij the covariance between asset i and j . Let σ ( x ) be the risk(i.e. standard deviation) of the portfolio as defined in Eq. (4). σ ( x ) = √ x T C x = (cid:88) i x i σ i + (cid:88) i (cid:88) j (cid:54) = i x i x j σ ij . (4)Then the marginal risk contributions ∂ x i σ ( x ) of each asset i are defined as follows ∂ x i σ ( x ) = ∂σ ( x ) ∂x i = x i σ i + (cid:80) j (cid:54) = i x j σ ij σ ( x ) . If we are considering long-only portfolios then the optimal solution can be written as anoptimization problem containing a logarithmic barrier term which is shown in Eq. (5) and where c is an arbitrary positive constant. See e.g. also [16] for an alternative formulation. In thislong-only case, a singular optimal solution can be computed.2inimize x T C x − c (cid:80) ni =1 ln x i subject to x i > . (5)However, if we want to include short positions then we need to find solutions in other orthantsthan in the non-negative orthant. See Bai et al. [1] for a log-barrier approach in this case, whichis shown in Eq. (6). minimize x T C x − c (cid:80) ni =1 ln β i x i subject to β i x i > , (6)where β = ( β , β , . . . , β n ) ∈ {− , } n defines the orthant where the solution should becomputed. For each choice of β the above optimization problem is convex and can be solvedoptimally. However, as shown in [1] there are 2 n different solutions. Investors may add additionalconstraints to specify their needs, however this cannot be modeled as one convex optimizationproblem, which is why an evolutionary approach is presented here. The general formulation ofthe long-short risk parity portfolio problem can be formulated as Eq. (7) as shown in [11].minimize (cid:80) ni =1 ,j =1 ( x i ( C x ) i − x j ( C x ) j ) subject to a i ≤ x i ≤ b i , (cid:80) ni =1 x i = 1 . (7) The solution is computed in two steps. First, a genetic algorithm will be employed and afterwardsa local search algorithm will be applied.
We are using a standard genetic algorithm to compute risk-parity optimal portfolios. The algo-rithm was implemented using the statistical computing language R [13].The fitness definition in the risk-parity setting is given by the deviance of each risk contribu-tion from the mean of all risk contributions. Let us use the shorthand notation of ∆ i = ∂ x i σ ( x ),so we compute the expectation ∆ = E (∆ i ) and define the fitness f as the sum of the quadraticdistance of each risk contribution from the mean. This non-negative fitness value f has to beminimized, where f = (cid:88) i (∆ i − ∆) We use a genotype-phenotype equivalent formulation, i.e. we use chromosomes of length n which contain the specific portfolio weights of the n risky assets. Thus, an important operatoris the repair operator, i.e. the sum of the portfolio is normalized to 1 after each operation.The genetic operators used in the algorithm can be summarized as follows: Elitist selection:
The best n ES chromosomes of each population are kept in the population.3 utation: A random selection of n M chromosomes of the parent population will be mutated.Up to a number of 15% of the length of the respective chromosome will be changed to a randomvalue between the portfolio bounds. Let (cid:96) be the length of the chromosome. First, a randomnumber between 0 and 0.15 is drawn. This number is multiplied by (cid:96) and rounded up to thenext integer value. This value represents the number of genes to be mutated. The mutationpositions will be chosen randomly. Afterwards the randomly selected positions will be replacedwith a random value between the upper and the lower investment limit of the respective asset. Random addition: n R new and completely random chromosomes are added to each newpopulation. Intermediate crossover:
Two chromosomes from the parent population will be randomlyselected for an intermediate crossover. The mixing parameter between the two chromosomeswill also be chosen randomly. n IC crossover children will be added to the next population. Letthe mixing parameter be α and the two randomly chosen parent chromosomes p and p withgenes p , , . . . , p ,(cid:96) and p , , . . . , p ,(cid:96) respectively, where (cid:96) is the length of the chromosome. Anintermediate crossover will result in a child chromosome c where the genes are set to c i = αp ,i + (1 − α ) p ,i ∀ i = 1 , . . . , (cid:96). In a second step, a local search algorithm is applied to the best solution of the genetic algorithm.Thereby, within each iteration of the algorithm each asset weight of the n assets of the portfolio isincreased or decreased by a factor ε . Each of these (2 × n ) new portfolios is normalized and if oneexhibits a lower fitness value then this new portfolio will be used subsequently. The algorithmterminates if no local improvement is possible anymore or the maximum number of iterationshas been reached. In this section the above described algorithm will be applied to real-world financial data to obtailnumerical results, which can be used for practical portfolio optimization purposes. The first testusing stock data from the DJIA index is described in Section 4.1 and both the long-only case(Section 4.2) as well as the long-short case (Section 4.3) is discussed. To check for scalability thealgorithm is tested on all stocks of the S&P 100 index in Section 4.4 afterwards.
We use data from all stocks from the Dow Jones Industrial Average (DJIA) index using thecomposition of September 20, 2013, i.e. using the stocks with the ticker symbols AXP, BA, CAT,CSCO, CVX, DD, DIS, GE, GS, HD, IBM, INTC, JNJ, JPM, KO, MCD, MMM, MRK, MSFT,NKE, PFE, PG, T, TRV, UNH, UTX, V, VZ, WMT, XOM.Using the R package quantmod [14] we obtain daily adjusted closing data from Yahoo! Fi-nance. We use data from the beginning of 2010 until the beginning of November 2014 to computethe Variance-Covariance matrix, i.e. the matrix is entirely based on historical data. The data issolely used for comparison purposes such that a clever approximation algorithm for the Variance-Covariance matrix like those presented e.g. by [9] and [10] is not necessary for the purpose of4able 1: Parameters for the Genetic Algorithm.
Parameter Value
Initial population size 200Maximum iterations 300Elitist selection 10 top chromosomes from parent populationRandom addition 50 new chromosomesMutation 100 chromosomes from parent populationIntermediate crossover 100 pairs of chromosomes from parent population . . . . . . Iteration O p t i m a l f i t ne ss . . . Iteration M ean ( f i t ne ss ) o f popu l a t i on Figure 1: Convergence of the genetic algorithm in the long-only case, i.e. the best (left) and themean (right) fitness value of each iteration along with the 5% as well as the 95% quantile of 100instances.this study. However it should be noted that the matrix is the important input parameter for thecalculation.The parameters used for the genetic algorithm are shown in Table 1. The local searchalgorithm was started twice, once with ε = 0 .
01 and subsequently with ε = 0 . First, we compute a set if various long-only portfolios without using expected returns, i.e. theMinimum Variance Portfolio (MVP), the 1/N portfolio as well as the risk-parity portfolio usingthe algorithm developed in this paper and described above. The results is shown in Table 2.Please note that the risk contribution has been normalized to 1. The fitness of the 1/N portfoliois 0 . . . . . . . . . . Iteration O p t i m a l f i t ne ss . . . . . Iteration M ean ( f i t ne ss ) o f popu l a t i on Figure 2: Convergence of the genetic algorithm in the long-short case, i.e. the best (left) andthe mean (right) fitness value of each iteration along with the 5% as well as the 95% quantile of100 instances.optimal portfolio in all cases. However, the optimal solution of the genetic algorithm neededsignificantly less iterations compared to starting from random solutions. A statistical t-testreturned t = − . df = 183 . In the long-short case, a random multi-start local search heuristic does not return any usefulresult. However, the evolutionary approach works well. The long-short result with a lowerbound of − . To test for scalability of the algorithm, we used stocks from the S&P 100 index as of March 21,2014. Again, we use historical data from the beginning of 2010 until the beginning of November2014 to compute our Variance-Covariance matrix. Four stocks have been excluded due to dataissues, i.e. ABBV, FB, GM, and GOOG, such that the stocks with the following ticker symbolshave been considered: AAPL, ABT, ACN, AIG, ALL, AMGN, AMZN, APA, APC, AXP, BA,7 &P 100 assets P o r tf o li o w e i gh t − . . . . . S&P 100 assets R i sk c on t r i bu t i on 0 . . . . . . . Figure 3: S&P 100 - portfolio (left) and risk contribution (right).BAC, BAX, BIIB, BK, BMY, BRK.B, C, CAT, CL, CMCSA, COF, COP, COST, CSCO, CVS,CVX, DD, DIS, DOW, DVN, EBAY, EMC, EMR, EXC, F, FCX, FDX, FOXA, GD, GE, GILD,GS, HAL, HD, HON, HPQ, IBM, INTC, JNJ, JPM, KO, LLY, LMT, LOW, MA, MCD, MDLZ,MDT, MET, MMM, MO, MON, MRK, MS, MSFT, NKE, NOV, NSC, ORCL, OXY, PEP, PFE,PG, PM, QCOM, RTN, SBUX, SLB, SO, SPG, T, TGT, TWX, TXN, UNH, UNP, UPS, USB,UTX, V, VZ, WAG, WFC, WMT, XOM.The lower bound was set to − .
2. Fig. 3 shows the resulting portfolio as well as the riskcontribution of the assets. It can be seen that the algorithm arrives at a solution, which exhibitsa rather exact risk parity solution with only slight differences from a perfect solution, which canbe observed in the right plot of Fig. 3. To get a more detailed picture on the scalability, aclearer analysis of the proportion between the contribution of the evolutionary solution as wellas the local search to the final solution would have to be accomplished, but this will be left outfor future research. From an investor’s perspective the optimal portfolio solution exhibits quitea few number of assets, which would have to be shorted. To make the solution more realistic atleast a net exposure constraint would have to be added. A cardinality constraint on the numberof shorted assets would also be an option. Both constraints can be integrated rather easily in theevolutionary context, see e.g. [19], [17], and [18]. However, such constraints would disable thepossiblity to obtain a perfect risk parity solution, which was the aim of the algorithm presentedin this paper.
In this paper, we presented an evolutionary approach to compute optimal risk parity portfolios.This algorithm was designed to overcome the problem that only the long-only case can be solvedconveniently using convex optimization models. A two-step approach using a genetic algorithmas well as a local search technique proved to be successful, especially in the long-short case.Another advantage is that further constraints can be integrated directly into the algorithm andthis approach can be extended to other risk measures as well.8 eferences [1] X. Bai, K. Scheinberg, and R. Tutuncu. Least-squares approach to risk parity in portfolioselection. Available at SSRN: http://dx.doi.org/10.2139/ssrn.2343406 (October 23, 2013),2013.[2] A. Brabazon and M. O’Neill, editors.
Natural Computing in Computational Finance , volume100 of
Studies in Computational Intelligence . Springer, 2008.[3] A. Brabazon and M. O’Neill, editors.
Natural Computing in Computational Finance, Volume2 , volume 185 of
Studies in Computational Intelligence . Springer, 2009.[4] A. Brabazon, M. O’Neill, and D. Maringer, editors.
Natural Computing in ComputationalFinance, Volume 3 , volume 293 of
Studies in Computational Intelligence . Springer, 2010.[5] D.B. Chaves, J.C. Hsu, F. Li, and O. Shakernia. Risk parity portfolio vs. other assetallocation heuristic portfolios.
Journal of Investing , 20(1):108–118, 2011.[6] D.B. Chaves, J.C. Hsu, F. Li, and O. Shakernia. Efficient algorithms for computing riskparity portfolio weights.
Journal of Investing , 21(3):150–163, 2012.[7] V. DeMiguel, L. Garlappi, and R. Uppal. Optimal versus naive diversification: How ineffi-cient is the 1/n portfolio strategy?
Review of Financial Studies , 22(5):1915–1953, 2009.[8] R. Hochreiter. Evolutionary stochastic portfolio optimization. In A. Brabazon andM. O’Neill, editors,
Natural Computing in Computational Finance , volume 100 of
Studiesin Computational Intelligence , pages 67–87. Springer, 2008.[9] O. Ledoit and M. Wolf. Improved estimation of the covariance matrix of stock returns withan application to portfolio selection.
Journal of Empirical Finance , 10(5):603–621, 2003.[10] O. Ledoit and M. Wolf. Honey, I shrunk the sample covariance matrix.
The Journal ofPortfolio Management , 30(4):110–119, 2004.[11] S. Maillard, T. Roncalli, and J. Teiletche. The properties of equally weighted risk contribu-tion portfolios.
The Journal of Portfolio Management , 36(4):60–70, 2010.[12] H. Markowitz. Portfolio selection.
The Journal of Finance , 7(1):77–91, 1952.[13] R Core Team.
R: A Language and Environment for Statistical Computing . R Foundationfor Statistical Computing, Vienna, Austria, 2014. URL .[14] J. A. Ryan. quantmod: Quantitative Financial Modelling Framework , 2014. URL http://CRAN.R-project.org/package=quantmod . R package version 0.4-2.[15] B. Sharma, R. K. Thulasiram, and P. Thulasiraman. Portfolio management using particleswarm optimization on gpu. In , pages 103–110. IEEE, 2012.[16] F. Spinu. An algorithm for computing risk parity weights. Available at SSRN:http://dx.doi.org/10.2139/ssrn.2297383 (July 30, 2013), 2013.[17] F. Streichert, H. Ulmer, and A. Zell. Comparing discrete and continuous genotypes on theconstrained portfolio selection problem. In
Genetic and Evolutionary Computation (GECCO2004) , pages 1239–1250. Springer, 2004. 918] F. Streichert, H. Ulmer, and A. Zell. Evaluating a hybrid encoding and three crossoveroperators on the constrained portfolio selection problem. In
Congress on Evolutionary Com-putation (CEC 2004) , volume 1, pages 932–939. IEEE, 2004.[19] F. Streichert, H. Ulmer, and A. Zell. Evolutionary algorithms and the cardinality constrainedportfolio optimization problem. In