Portfolio Optimization and Genetic Algorithms

Portfolio Optimization and Genetic Algorithms

F´elix Roudier Portfolio Optimization and Genetic Algorithms Master's Thesis Department of Management, Technology and Economics - DMTEC Chair of Entrepreneurial Risks - ER Swiss Federal Institute of Technology (ETH) Zurich Ecole Nationale des Ponts et Chauss´ees (ENPC) Paris Supervisors: Prof. Dr. Didier Sornette Prof. Dr. Bernard Lapeyre Zurich, May 17, 2007 To my office mates, who kindly let me make the coffee every morning... i Over the past few months, I've learned how to write decent code, changed my OS, read a bunch of theory and attended my first Nobel Lecture. Had I been a bit quicker on my feet and a lot better dressed, I might have squeezed a second one into the same day. With a little luck, I'll catch Joseph Stiglitz some other time. Complex systems, finance, economics, physics and even some math. The research areas approached in the team are pretty broad. I've spread my attention and time a bit wide, but that was the whole point. A large part of what I've learned doesn't fit into this report. The following pages are in no way an exhaustive review of portfolio theory. There are no proofs or theorems, no great results. This is just a summary of most of what I've done and what I would do if I had more time. ii Abstract Modern Portfolio Theory is based on Harry Markowitz's 1952 work on mean- variance portfolios. He stated that a rational investor should either maxi- mize his expected return for a given level of risk, or minimize his risk for a given expected return. These two principles lead to an efficient frontier of portfolios, among which the investor is free to choose. Fifty years on, there are no widely accepted practical implementations of mean-variance portfolio theory. The mean-variance approach puts excessive weights on assets with large excess returns, regardless of possible estimation errors. It yields unstable portfolios and extra gains don't make up for the excess transaction costs. The goal of this Master's Thesis is to develop robust portfolio optimiza- tion methods. We design a multi-factor objective function reflecting our investment preferences and solve the subsequent optimization problem us- ing a genetic algorithm. iii R´esum´e La th´eorie du portefeuille est fond´eesur la description de portefeuilles moyenne- variance, donn´eepar Harry Markowitz en 1952. Il propose qu'un investis- seur rationnel doit maximiser son rendement esp´er´epour un niveau de risque donn´e,ou minimiser son niveau de risque pour un rendement esp´er´edonn´e. Ces deux principes permettent de g´en´erer une fronti`ere de portefeuilles effi- cients, parmi lesquels l'investisseur peut choisir. Cinquante ans plus tard, la th´eorie n'a toujours pas ´et´emise en pra- tique de mani`ere fiable et reconnue. L'approche moyenne-variance g´en`ere des portefeuilles d´es´equilibr´es, surinvestis dans les titres `aforte esp´erance en rendement. On ne prend pas en compte l'incertitude des donn´ees. Les porte- feuilles construits sont instables et les frais de transaction suppl´ementaires ne sont pas compens´espar des gains. Le but de ce projet est de d´evelopper des m´ethodes d'optimisation ro- buste de portefeuilles. Nous d´efinissons une fonction objective de plusieurs facteurs, que nous optimisons `al'aide d'un algorithme g´en´etique. iv Contents List of Figures viii List of Tables x 1 Introduction 1 2 Foundations of Portfolio Theory 3 2.1 Asset prices and returns . .3 2.1.1 Stocks . .3 2.1.2 Prices and returns . .4 2.2 Mean-Variance Optimization . .5 2.2.1 Risk and Return . .8 2.2.2 The virtues of diversification . .9 2.2.3 Efficient frontiers and portfolio selection . .9 2.2.4 Closed-form solution of the Mean Variance Portfolio Problem . 11 2.2.5 Tracing the mean-variance efficient frontier . 11 2.2.6 Limits and problems . 14 2.2.7 Conclusion . 15 2.3 Risk measures for an efficient frontier . 15 2.3.1 Variance . 18 2.3.2 Semi-Variance . 18 2.3.3 Higher-order moments . 20 2.3.4 Value at Risk . 20 2.3.5 Expected Shortfall . 20 2.3.6 Drawdown measures . 20 2.4 Historical data and resampling methods . 21 2.4.1 Historical approach . 21 2.4.2 Fitting distributions . 21 2.4.3 Resampling methods . 22 2.5 Conclusion . 22 v CONTENTS vi 3 Genetic Algorithms 23 3.1 General information . 23 3.1.1 Principles of GAs . 23 3.1.2 Pseudo-code . 24 3.1.3 Constraints . 24 3.1.4 Stringing beads . 26 3.1.5 Another example . 29 3.2 Defining our problem . 29 3.2.1 Algorithm design and principles . 30 3.3 Calibrating the algorithm . 32 3.3.1 Objective function . 32 3.3.2 Minimum-Variance portfolio . 32 3.3.3 Computing-time and convergence . 32 3.4 Practical measures for implementing the GA in our framework 34 3.4.1 Generations and runs . 34 3.4.2 Convergence problems . 34 3.4.3 Dynamic optimization . 35 3.5 Conclusions . 35 4 Tests, framework and results 39 4.1 Framework . 39 4.1.1 Data . 39 4.1.2 Investment universe . 39 4.1.3 Backtesting procedure . 40 4.2 Performance measures . 40 4.2.1 Sharpe Ratio . 40 4.2.2 Calmar Ratio . 41 4.3 Objective functions . 41 4.3.1 Benchmarks . 41 4.3.2 Standard functions . 42 4.3.3 Multi-factor objective functions . 42 4.4 Procedure . 45 4.5 Results . 45 5 The illusion of control 50 5.1 How good ideas sometimes fail . 50 5.1.1 Simplicity ueber alles . 50 5.2 Starting from scratch: a simple test for an easy problem . 51 5.3 Room for improvement . 52 5.3.1 Estimating returns . 52 5.3.2 Estimating the covariance matrix . 53 5.3.3 Resampling methods . 53 5.3.4 Problems in the GA . 53 5.4 Le mot de la fin . 54 CONTENTS vii A Diversification Index 57 Bibliography 58 List of Figures 2.1 From top to bottom: daily, weekly and monthly prices of Starbucks stock (SBUX) from 1st of January 2002 to 1st of January 2007. .6 2.2 From top to bottom: daily, weekly and monthly returns of Starbucks stock (SBUX) from 1st of January 2002 to 1st of January 2007. .7 2.3 Efficient frontier for different values of ρ ............ 12 2.4 Efficient frontier for a 15-asset universe. Each dot represents an asset in the mean/standard deviation plane. The result- ing frontier stretches from a diversified low risk/low return portfolio to the maximum return portfolio (one asset portfolio) 13 2.5 Top: asset weights of the minimum variance portfolio over time in a 15-asset universe. Bottom: variance-adjusted equiv- alent number of assets in the minimum variance portfolio over time in the same 15-asset universe. 16 2.6 Top: evolution of the efficient frontier for a 15-asset uni- verse over 50 days, based on a 1 year rolling window. The shape of the frontier changes over time. Bottom: we choose a portfolio on the frontier and let it evolve over time in the mean/variance plane. Without readjustment, it drifts away from the frontier and is no longer optimal. The frontiers are drawn at one-month intervals, starting with the bottom curve at time 1. 17 2.7 Top: distribution of daily returns for Starbucks stock (SBUX) from January 1st 2002 to January 1st 2007. Bottom: Resam- pled normal distribution of returns drawn from a gaussian of same mean and variance. We see that the assumption of normality doesn't fit the data we have: the realized return distribution exhibits heavy tails and a slim waist, while the resampled distribution has no tails and a heavy middle. 19 viii LIST OF FIGURES ix 3.1 Top: We plot the average (red line) and best (blue line) scores inside the population for every generation. Bottom: We plot the individual score of all the population members over gen- erations. Each color is the evolution of one vector in the pop- ulation. Score is plotted along the y-axis, generation number is on the x-axis. 28 3.2 We plot the pairs of solutions (x1; x2) for different genera- tions. We see that each generation comes closer to the exact solution. We start out with a widespread cloud of points. Over time, this cloud gets more and more concentrated. At generation 50, all the pairs are very near the exact solution. 29 3.3 Top: Fitness of every member of the population over time. Bottom: Best and average scores in the population over time. At one point in time, the population has completely converged and we can stop the algorithm. Beyond this time step, we are just randomly searching the space around one point. Fitness is plotted along the y-axis, generation along the x-axis. 36 3.4 Computing-time (y axis) as a function of the number of assets D (x axis), in a lin-lin (top plot) and log-lin (lower plot). 37 3.5 Efficient frontier as computed with the closed form solution (continuous line) and with the GA (green points) . 38 4.1 Period 1: Sharpe and Calmar Ratio as a function of (λ, p).. 47 4.2 Period 2: Sharpe and Calmar Ratio as a function of (λ, p).. 48 4.3 Period 3: Sharpe and Calmar Ratio as a function of (λ, p).. 49 5.1 Asset weights over time, as given by the minimum variance solver.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    70 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us