A note on evolutionary stochastic portfolio optimization and
probabilistic constraints
Ronald Hochreiter

arXiv:1001.5421v1 [q-fin.PM] 29 Jan 2010

February 1, 2010
Abstract
In this note, we extend an evolutionary stochastic portfolio optimization framework to
include probabilistic constraints. Both the stochastic programming-based modeling environment as well as the evolutionary optimization environment are ideally suited for an
integration of various types of probabilistic constraints. We show an approach on how to
integrate these constraints. Numerical results using recent financial data substantiate the
applicability of the presented approach.

1

Introduction

Stochastic programming is a powerful method to solve optimization problems under uncertainty,
see Ruszczyński and Shapiro [2003] for theoretical properties and Wallace and Ziemba [2005]
for an overview of possible applications. One specific application area is portfolio optimization,
which was pioneered by H.M. Markowitz Markowitz [1952]. The advantage of using the stochastic
programming approach is that the optimization can be done without using a covariance matrix
of the assets, which is on one hard to estimate and on the other hand does not capture the
uncertainty in sufficient detail, especially if there are many assets.
Instead of using the asset means and the covariance matrix, a stochastic programming approach uses a set of scenarios, each weighted by a certain probability. In the specific portfolio
optimization context one scenario is a set of one possible asset return per asset under consideration - see below for more details or e.g. see Chapter 16 of Cornuejols and Tütüncü [2007].
This note is organized as follows: Section 2 summarizes the evolutionary approach, which
was used to solve the stochastic portfolio optimization problems. Section 3 adds probabilistic
constraints to the standard problem and shows an approach on how to integrate these type of
constraints Section 4 summarizes numerical results using recent financial data, while Section 5
concludes the note.

2

Evolutionary Stochastic Portfolio Optimization

We follow the approach taken by Hochreiter [2007] and Hochreiter [2008], which builds a stochastic programming-based environment on top of the general evolutionary portfolio optimization
findings reported by Streichert et al. [2003], Streichert et al. [2004a], and Streichert et al. [2004b].

1

2.1

Stochastic portfolio optimization

Let us define the stochastic portfolio optimization problem as follows. We consider a set of assets
(or asset categories) A with cardinality a. Furthermore, we base our decision on a scenario set
S, which contains a finite number s of scenarios each containing one uncertain
P return per asset.
Each scenario is equipped with a non-negative probability ps , such that
s∈S ps = 1. The
scenario set can be composed of historical data or might be the output of a scenario simulator.
For every portfolio x we can easily calculate the profit and loss distribution by multiplying
the scenario matrix with the portfolio weighted by the respective probability. Let us denote the
profit function of a certain portfolio x by π(x) and the loss function by `(x) = −π(x).
Every portfolio optimization procedure is a multi-objective optimization. In the traditional
case it is a trade-off between return and risk of the profit and loss function. We do not want
to employ an multi-objective approach such that we use the classical Markowitz approach and
use the Variance of the loss distribution for the risk dimension, which we want to minimize, and
the expectation of the profit function for the reward dimension, on which we want to set a lower
limit. Hence, the main optimization problem is shown in Eq. (1) below.
minimize
subject to

Variance(`x )
E(πx ) > µ

(1)

Furthermore we consider the classical constraints, i.e. budget normalization, as well as setting
an upper and lower limit on each asset position, as shown in Eq. (2). These are naturally fulfilled
by the evolutionary approach shown below, especially since we restrict short-selling in our case.
P
subject to
a∈A xa = 1
(2)
l ≤ xa ≤ u
∀a ∈ A

2.2

Evolutionary stochastic portfolio optimization

The evolutionary algorithm chosen is based on the commonly agreed standard as surveyed by
Blum and Roli [2003] and is based on the literature cited at the beginning of this Section.
We use the following genetic encoding of a portfolio. Each gene consists of of two parts:
One that determines the amount of budget to be distributed to each selected asset and one part
which determines in which assets to invest. The first part g1 consists of a predefined number b
of real values between 0 and 1 and the second part g2 is encoded as a bit-string of the size of the
amount of assets.
The following evolutionary operators have been implemented and used:
• Elitist selection. A certain number o1 of the best chromosomes will be used within the
next population.
• Crossover. A number o2 of crossovers will be added, both 1-point crossovers (g1 and g2 )
and intermediate crossovers (only g1 ).
• Mutation. o3 mutated chromosomes will be added.
• Random addition. Furthermore o4 randomly sampled chromosomes are added, which are
also used for creating the initial population.
The specific number of operators o = (o1 , o2 , o3 , o4 ) has to be determined for each concrete
number of assets a as well as the parameter b.

2

3

Probabilistic Constraints

The main advantage of the stochastic programming approach is that the complete distribution
is naturally available and can be used for optimization purposes by integrating these directly
into the constraint handling mechanism. In the most simplest case, we want to restrict that the
probability that the loss exceeds a certain value δ is lower than a specified probability ε. Given
our profit function πx , the constraint we want to add to our optimization model is given in Eq.
(3).
subject to P(πx ≤ δ) ≤ ε.
(3)
We will not treat probabilistic constraints as a hard constraint, but use the size of the violation
for adding a penalty to the objective function. Let the fitness value which we aim to minimizing
be f . We calculate the penalty p by
p = f × (P(πx ≤ δ) − ε) × γ,
where γ is a factor to control the penalization level. The fitness value used for evolutionary
optimization purposes is thus given by f 0 = f + p. Such a constraint can be implemented and
handled conveniently.

4

Numerical Results

The program code was implemented using MatLab 2008b without using any further toolboxes.
We use data from the 30 stocks of the Dow Jones Industrial Average at the beginning of
2010, i.e. the ticker symbols AA, AXP, BA, BAC, CAT, CSCO, CVX, DD, DIS, GE, HD, HPQ,
IBM, INTC, JNJ, JPM, KFT, KO, MCD, MMM, MRK, MSFT, PFE, PG, T, TRV, UTX, VZ,
WMT, XOM. Daily data from each trading day in 2009 has been used. Weekly returns have
been calculated.
We are using b = 100 buckets which are distributed to the respective asset picks, such that
each chromosome has a length of b + a = 130. The initial population consists of 1000 random
chromosomes. The operator structure defined in Section 2.2 is o = (100, 420, 210, 100), such that
each follow-up population has a size of 830. This number is due to the different combinations
between the crossovers and mutations of g1 and g2 .
First, we optimize without using the probabilistic constraints, i.e. the main optimization
problem given Eq. 1 using µ = 0.001. Then we add the probabilistic constraint shown in
Eq. 3 with δ = and ε = 0.1. These values have been chosen after analysing the resulting loss
distribution.
Fig. 1 shows the optimal portfolio without applying the probabilistic constraint P1 (left) and
the optimal one using the probabilistic constraint P2 (right). The allocation changed considerably. The diversification has not changed, i.e. three assets (KFT, VZ, XOM) are dropped from
the portfolio, and three others are picked (HPQ, MSFT, MMM). The resulting loss distributions
are shown in Fig. 2, where the impact of the probabilistic constraint is immediately visible.
Furthermore, the statistical properties of the portfolios are shown in Table 1. In this table, the
naive 1/N portfolio P3 has been added for comparison purposes. While P3 has the highest return, it is also the most risky one in terms of both risk parameters - standard deviation and the
probability to fall below the specified threshold. Another interesting fact is that the probabilistic
constrained portfolio yields a higher expected return than the standard optimal portfolio. This
is partly due to the fact that the lower level µ has been set to a level below the expected return
of the standard portfolio but is definitely another indicator that the plain classical Markowitz
approach should not be used for contemporary portfolio optimization purposes.
3

Figure 1: P1 without P constraint (left) and P2 with P constraint (right).

Figure 2: Loss distribution of P1 (left) and P2 (right).

Mean
Std.Dev.
Prob.

P1 (no P)
0.0024
0.02
0.1774

P2
0.0051
0.0225
0.1089

P3 (1/N )
0.0062
0.0398
0.2702

Table 1: Statistical properties of various portfolios.

4

5

Conclusion

In this note, an extension of an Evolutionary Stochastic Portfolio Optimization to include probabilistic constraints has been presented. It can be shown that the integration of such constraints
is straightforward as the underlying probability space is the main object considered for the optimization evaluation. Numerical results visualized the impact of using such constraints in the
area of financial engineering. Future extensions of this work include the integration of risk measures into the probabilistic constraint, e.g. constraining the maximum draw-down of the optimal
portfolio.

References
C. Blum and A. Roli. Metaheuristics in combinatorial optimization: Overview and conceptual
comparison. ACM Computing Surveys, 35(3):268–308, 2003.
Gerard Cornuejols and Reha Tütüncü. Optimization methods in finance. Mathematics, Finance
and Risk. Cambridge University Press, Cambridge, 2007.
R. Hochreiter. An evolutionary computation approach to scenario-based risk-return portfolio
optimization for general risk measures. In EvoWorkshops 2007, volume 4448 of Lecture Notes
in Computer Science, pages 199–207. Springer, 2007.
R. Hochreiter. Evolutionary stochastic portfolio optimization. In A. Brabazon and M. O’Neill,
editors, Natural Computing in Computational Finance, volume 100 of Studies in Computational
Intelligence, pages 67–87. Springer, 2008.
H. M. Markowitz. Portfolio selection. The Journal of Finance, 7(1):77–91, 1952.
A. Ruszczyński and A. Shapiro, editors. Stochastic programming, volume 10 of Handbooks in
Operations Research and Management Science. Elsevier Science B.V., Amsterdam, 2003.
F. Streichert, H. Ulmer, and A. Zell. Evolutionary algorithms and the cardinality constrained
portfolio selection problem. In Selected Papers of the International Conference on Operations
Research (OR 2003), pages 253–260. Springer, 2003.
F. Streichert, H. Ulmer, and A. Zell. Comparing discrete and continuous genotypes on the
constrained portfolio selection problem. In Kalyanmoy D. et al., editor, Genetic and Evolutionary Computation (GECCO 2004) - Proceedings, Part II, volume 3103 of Lecture Notes in
Computer Science, pages 1239–1250. Springer, 2004a.
F. Streichert, H. Ulmer, and A. Zell. Evaluating a hybrid encoding and three crossover operators on the constrained portfolio selection problem. In CEC2004. Congress on Evolutionary
Computation, 2004, volume 1, pages 932–939. IEEE Press, 2004b.
S. W. Wallace and W. T. Ziemba, editors. Applications of stochastic programming, volume 5 of
MPS/SIAM Series on Optimization. Society for Industrial and Applied Mathematics (SIAM),
2005.

5

