# Portfolio Selection by Full-Scale Optimization and Differential Evolution (I/II)

Introduction
This blog entry introduces the theoretical framework for optimizing large portfolios with respect to expected utility by Full-Scale Optimization (FSO) and Differential Evolution (DE) before my next post will present the application and empirical results.

We will use the standard Mean-Variance (MV) optimization approach for portfolio analysis as a benchmark to the FSO framework. MV assumes normally distributed returns and investor preferences that can be well approximated by mean and variance while FSO identifies the optimal portfolio on any set of return distributions based on any description of investor preferences. This implies that no assumptions on the return distributions have to be made. Estimation errors prevail in the MV approach, where means and variances of all assets and the covariances of all asset pairs are to be estimated, as well as in the FSO, where the entire multivariate return distribution is estimated. Considering estimation errors we will need to test our in-sample results out of sample, e.g. by a bootstrapping procedure, which allows us another comparison between both approaches.

There are no limitations on the utility functions, which enables the implication of loss aversion and prospect theory. In FSO the portfolio allocations are then optimized to maximize the specified utility function over non-parameterized return distributions making it a semi-parametric approach. This means that no analytical solution can be achieved thus we need to implement adequate search algorithms to find the optimal portfolio allocation. For the case of one maximum this can be obtained via single-staged gradient-based techniques or a grid search, where all possible portfolio allocation solutions are tested to a specified level of detail. This is problematic for large portfolios as the number of possible solutions () drastically increases with the number of assets () under consideration and the level of detail () for the grid search

(1)

As the grid search for a portfolio that consists of many assets becomes too burdensome computationally, we calculate the optimal allocation by Differential Evolution, which is a heuristic search algorithm well suited for complex global non-convex optimization problems. Another reason for using DE is that the method is divisible, so the computation can be shared on parallel machines, which tackles the problem of computation time.

Portfolio selection
Generally, when we‘re selecting our portfolio with respect to utility functions, where utility is dependent on the expected portfolio return distributions, we can express this problem with assets as

(2)

with the utility function as the objective function and the vector of our portfolio weights with dimensions . is a matrix of different returns for each asset for different scenarios. Portfolio returns are then obtained as portfolio allocations multiplied by asset returns , which yields a vector of length and constitutes a probability distribution of portfolio returns of all scenarios considered. Portfolio weights are subject to constraints , which may include institutional restrictions, e.g. upper and lower bounds on allocations, borrowing restrictions and Value-at-Risk restrictions. The optimal vector of portfolio weights maximizes the utility function subject to the constraints specified in .

Full-Scale Optimization
We express the empirical returns over time period for assets as a return matrix . Returns are defined as with being the price of asset at time . To identify the scenarios mentioned above, we treat every column of the return matrix as a future scenario with probability . Again, utility is evaluated for each vector of portfolio weights and each scenario in the sample. The vector of portfolio weights with highest average utility across all scenarios is denoted as the optimal allocation combination

(3)

We are completely flexible in the formulation of utility functions and we do not make any simplifying assumptions on the return distribution. Literally any utility function can be implemented since the optimization is carried out numerically, allowing for complex investor preferences.

Differential Evolution
DE was first introduced by Storn and Price (1997) and belongs to a family of algorithms that applies self-learning techniques to find optima in large solution surfaces. The algorithm is described in a portfolio setting by Hagströmer and Binner (2009) as follows:

(1) Initialize population: Randomly generate a set of starting value vectors of length , where and being the population size, which equals one in the initialization phase.
(2) Mutation: Generate a second set of vectors of length by with as a difference vector scale factor, , and as randomly drawn numbers and and as stochastic elements (noise).
(3) Offspring: Generate a third set of vectors of length with crossover probability equalling and equalling . Then adjust these vectors to satisfy the set constraints using a function such that .
(4) Selection: Generate a fourth set of vectors of length consisting of the best solution vectors in sets 1 and 3 using .
(5) Iteration: Create a new vector generation by setting and repeat steps 2-4 until with as haltering criterion.
(6) Optimum: The optimum is obtained as .

As seen above, the number of technical parameters required is low. To prevent random starting values from affecting the DE optimum, the whole process is repeated multiple times. These independent restarts allow us to cut computation time by running it on many machines parallel to each other.

After having introduced the theoretical framework, my following blog post will show a possible implementation in a portfolio setting and discuss results.

References
Adler, T. and Kritzman, M. (2007). Mean-variance versus full-scale optimisation: In and out of sample. Journal of Asset Management (7), pp. 302-311.
Hagströmer, B. and Binner, J.M. (2009). Stock portfolio selection with full-scale optimization and differential evolution. Applied Financial Economics (19), pp. 1559-1571.
Hagströmer, B. et al. (2008). Mean-variance vs full-scale optimization: Broad evidence for the UK. Federal Reserve Bank of St. Louis, Working Paper No. 2007-016D.
Maringer, D. (2008). Risk preferences and loss aversion in portfolio optimization. Computational Methods in Financial Engineering (Eds) E. Kontoghiorghes, B. Rustem and P. Winkler, Springer, Berlin, Heidelberg, pp. 27-45.
Storn, P. and Price, K. (1997). Differential evolution – a simple and efficient heuristic for global optimization over continuous spaces. Journal of Global Optimization (11), pp. 341-359.

+ posts