Rapport

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Evaluation of Automated

Portfolio Rebalancing
Algorithms

Mattias Lundahl, F-00


800408-3211
f00-mlu@f.kth.se

Master’s Thesis, 20 credits


Fall 2004

Kaupthing Bank Sverige AB


Supervisor Paul Odermalm

The Royal Institute of Technology


Supervisor Mattias Jonsson
Acknowledgements
I would like to thank my supervisor Paul Odermalm of Kaupthing Bank Sverige
AB for his valuable input on performance measuring methodology as well as for
help on selecting appropriate data for performance tests.

I would also like to thank my supervisor Mattias Jonsson of the Royal Institute
of Technology for help on understanding some of the content of the sources used
as well as helping me to choose material to present in my thesis.

1
Abstract

This thesis aims at implementing and evaluating four distinct algorithms (Uni-
versal Portfolio, Exponentiated Gradient, Anticor and Constant Proportion
Portfolio Insurance) for automated rebalancing of fixed-asset portfolios based
on the past performance of the individual assets included in the portfolio. The
algorithms are implemented according to the articles presenting them, and I
devise improvements to the algorithms.

I have shown that these algorithms are all able to yield higher returns than
more naïve investment strategies such as allocating equal amounts to all assets
included in the portfolio. While all algorithms but CPPI can handle portfolios
of any number of assets, I have shown that in reality, portfolios of two assets are
preferable to maximize return. Finally, especially EG and Anticor are able to
provide quite impressive returns under certain conditions, even after subtracting
trading costs.
Contents

1 Introduction 2

2 Description of the algorithms 4


2.1 Setup and general notation . . . . . . . . . . . . . . . . . . . . . 4
2.2 Universal Portfolio . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Exponentiated Gradient . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Anticor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 Constant Proportion Portfolio Insurance . . . . . . . . . . . . . . 12

3 Extensions of the algorithms 14


3.1 Side information . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Trading costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4 Implementing and testing the algorithms 16


4.1 Universal Portfolio . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2 Comparison between Universal Portfolio, Exponentiated Gradi-
ent and Anticor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3 CPPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5 Tuning of parameters 32

6 Conclusions 34

1
Chapter 1

Introduction

Automated portfolio rebalancing algorithms are used to determine investment


strategies. They use numerical information on financial assets, typically past
price quotes, to decide the future portfolio composition. The selection of assets
to be included in the portfolio is assumed to be given as input to the algorithms.
Within a certain time frame, prices of included assets are recorded, and, using
certain formulas, new portfolio weights are calculated using this numerical data.
Algorithms of this kind are interesting to study because of the possibilities to
obtain higher returns than what is possible to obtain using more naïve invest-
ment strategies such as buy-and-hold schemes.

Black and Jones [2] and Perold and Sharpe [13] introduced the Constant Propor-
tion Portfolio Insurance, or CPPI for short, as a means of providing a guaranteed
riskless minimum return while allowing investment in a risky asset capable of
providing excess returns. This algorithm is conceptually limited compared to
the other algorithms examined, since CPPI allows only two-asset portfolios. It
was extended by Bertrand and Prigent [1] and Boulier and Kanniganti [5].

Thomas Cover [6] introduced the Universal Portfolio algorithm, a rather com-
plicated algorithm to implement, but which guarantees an asymptotic return
better than any individual asset in the portfolio. This algorithm was elaborated
further in several articles co-written by Thomas Cover [7], [8], [12], [10], and
also by Kalai and Vempala [11] aiming to reduce implementation complexity.
Blum and Kalai [3] provided some further extensions of the Universal Portfolio.
The main idea of the Universal Portfolio algorithm is that the algorithm tries
to learn patterns for the compositions of the best portfolios in the past and to
use this information to decide the composition of future portfolios.

The Exponentiated Gradient algorithm, introduced by Helmbold et al [9], provides


weaker theoretical bounds but stronger performance on real asset price data. Its
main idea is similar to Universal Portfolio in that it tries to learn from the past
winners and reallocate so that a larger position is taken in these winning assets.

The final algorithm evaluated, Anticor, was introduced by Borodin et al [4]


and uses mean reversion and anticorrelation between assets to produce returns.
It is not quite similar to Universal Portfolio and Exponentiated Gradient since

2
it does not increase the positions in the most recent winners, but rather in-
creases the positions in the most recent losers if they are found to be negatively
correlated with the recent winners.

The purpose of this Master’s Thesis is to evaluate the above mentioned methods
for automatically rebalancing portfolios for which the asset selection decision has
already been made, using purely mathematical models on the time series of past
performance of the financial assets included in the portfolio. This thesis will ex-
amine the theoretical background and then evaluate certain algorithms created
for the purpose of automatically generating portfolio updates. The evaluation
will include identification of desired characteristics of the asset price time series
for the different algorithms, as well as attempts to fine-tune the values of the
algorithm parameters for maximum performance.

The concept of transaction costs will also be included, and the algorithms will
be judged based on their ability to yield higher returns than simple, naïve in-
vestment strategies after correcting for transaction costs.

The rest of the thesis is organized as follows: Chapter 2 introduces common


notation and provides the mathematical background for the Universal Port-
folio, Exponentiated Gradient, Anticor and CPPI algorithms. In Chapter 3,
a description of the extensions is presented, explaining the side information
policy and the trading cost model used. The algorithms are tested using simu-
lated stochastic processes as well as real asset price data in Chapter 4. Chapter
5 presents a discussion of the parameters used by the different algorithms and
some findings on what parameter values are reasonable for real usage. Finally,
conclusions are presented in Chapter 6.

3
Chapter 2

Description of the algorithms

2.1 Setup and general notation


The concept of wealth is defined as a real valued time series starting at the value
1. Later values in the series are the relative wealths compared to this starting
value. The investment universe is assumed to consist of a total of m assets.
These are assumed to have a price at each of the discrete points in time included
in the investment period. The investment period is thus assumed to be points
T
t in time such that t = 0, 1, 2, . . . , n. Let the vector xi = (xi1 , xi2 , . . . , xim )
denote the performance of the financial asset market from time i − 1 to i, where
si,j
xij = ,
si−1,j

and si,j is the price of asset j at time i. Thus, xij is the factor by which the price
of asset j increases at time from time i − 1 to i. Let bi P = (bi1 , bi2 , . . . , bim )T be
the weight vector for which it by definition holds that j bij = 1. Within this
thesis the additional restriction bij ≥ 0 will be enforced to ensure fair comparison
between the algorithms that by formulation cannot have negative weights and
the algorithms that theoretically allows this. Here, bij denotes the proportion
of total wealth invested in asset j at time i. Then, after one time period has
passed, the wealth obtained is S1 = b1 x11 + b2 x12 = bT 1 x1 , and at the end of the
investment horizon the wealth is given by the following expression, also known
as the total return factor :
Yn
Sn = bT
i xi (2.1)
i=1

is the factor by which wealth is increased after n trading times.

A constant rebalanced portfolio (CRP) is a portfolio where rebalancings are


only done to ensure that at all rebalancing times, the proportions invested in
each asset in the portfolio are unchanged. Thus, denoting
Qn this constant weight
vector b, this portfolio will obtain the wealth Sn = i=1 bT xi at the end of the
investment period.

The best constant rebalanced portfolio (BCRP) is the best possible portfolio
within the CRP class. At the end of the investment period, it provides a wealth

4
of
n
Y
Sn∗ = max b T xi .
b
i=1

The construction of this portfolio requires knowledge of actual stock price out-
comes and can thus only be determined in hindsight. This portfolio will asymp-
totically exceed the best individual stock as well as common indices, usually by
an exponential factor.

The common goal for all algorithms examined in this thesis is to maximize
Sn , the total wealth obtained over the entire investment period, using different
means of learning from the past performance of individual assets, while impos-
ing certain restrictions on the possible reallocations, such as allowing only a
part of the available wealth to be invested in a risky asset as is the case for the
CPPI algorithm.

2.2 Universal Portfolio


Introduced by Thomas Cover [6], the Universal Portfolio algorithm calculates
portfolio weights in a manner that ensures asymptotic performance comparable
to the performance of the BCRP.

Let x1 , x2 , . . . be an arbitrary sequence of stock performance vectors as defined


above. Then, the portfolio weights in the Universal Portfolio algorithm are
determined by R Qk−1 T
b i=1 b xi dµ (b)
b̂k = R Qk−1 , (2.2)
T
i=1 b xi dµ (b)
where µ (b) is any probability measure deemed reasonable for the distribution
of BCRP weights. Thus, intuitively, the Universal Portfolio algorithm calcu-
lates its weights as the weighted average of all possible weight allocations, using
the constant rebalanced portfolio performance as weight function. For the pur-
poses of this thesis, the Dirichlet distribution will be used, mainly for reasons of
computational feasibility. Also, because of the algorithm’s complexity of imple-
mentation and computation for portfolios consisting of more than two assets,
this thesis will only consider Universal Portfolio implementations of two-asset
portfolios. In this case, the distribution becomes the two-variable Dirichlet dis-
tribution. To introduce this distribution, first define the Gamma function
Z ∞
Γ(t) = xt−1 e−x dx, t ≥ 0
0

and the Beta function


Γ(t)Γ(u)
B(t, u) = , t, u ≥ 0
Γ(t + u)
The two-variable Dirichlet distribution has two parameters α1 and α2 and is
characterised by the probability density function
P 
2
Γ i=1 αi 1
f (b) = Q2 bα
1
1 −1 α2 −1
b2 = bα
1
1 −1 α2 −1
b2 .
i=1 Γ (α i ) B(α 1 , α 2 )

5
Here, b1 + b2 = 1 and 0 ≤ b1 , b2 ≤ 1, meaning that the domain is the one-
dimensional simplex ∆1 .

Using α1 = α2 = 1 gives

Γ (1 + 1) Γ (2)
f (b) = 2 b11−1 b21−1 = 0 0
2 b1 b2 = 1,
Γ (1) Γ (1)

i.e. the bivariate uniform distribution over a unit sized domain (since Γ(2) =
1 · Γ(1) = 1 · 1 = 1). Using α1 = α2 = 1/2 gives

Γ (1/2 + 1/2) 1/2−1 1/2−1 Γ (1) −1/2 −1/2 1 −1/2 −1/2


f (b) = b1 b2 = 2 b1 b2 = b b2
Γ (1/2)
2
Γ (1/2) π 1

since Γ(1/2) = π and Γ(1) = 1.

Next, a derivation of a closed form solution of the obtained total return factor,
Ŝn , will be performed, since it is contained in the expression for the Universal
Portfolio weights (2.2).

In order to explicitly calculate these weights and the total return in the two
asset portfolio case, it is necessary to find a closed form solution to the integrals
contained in the expression for the weights (2.2). Firstly, as a step to determine
Ŝn , note that the total return factor for a CRP after n rebalancings is
n
Y n
Y X n
Y
Sn (xn , b) = b T xi = (b1 xi1 + b2 xi2 ) = bji xiji =
i=1 i=1 J∈{1,2}n i=1

 
n
X n
X Y
bl1 b2n−l  xiji  ,
l=0 J∈Tn (l) i=1

where Tn (l) is the set of all sequences J ∈ {1, 2}n with l 1’s and (n − l) 2’s.
Now, let
X Y n
Xn (l) = xiji , (2.3)
J∈Tn (l) i=1

giving
n
X
Sn (xn , b) = bl1 b2n−l Xn (l).
l=0

In order to calculate the integrals in the expression for the portfolio weights (2.2)
and the realized total return factor of the universal portfolio, this is integrated
over the probability measure assumed for the weights.
n
Z X n
X Z
n
Ŝn (x ) = bl1 b2n−l Xn (l) dµ (b) = Xn (l) bl1 b2n−l dµ (b) .
l=0 l=0

Now, introducing the notation


Z
Cn (l) = bl1 b2n−l dµ (b) , (2.4)

6
the above can be written
n
X
Ŝn (xn ) = Xn (l)Cn (l).
l=0

Using the above, it is possible to derive a closed form expression for the Universal
Portfolio weights and realized total return factor at time n. Since
R Qn−1 T  R Qn−1 T 
i=1 b xi b dµ (b) 1 b1 i=1 b xi dµ (b)
b̂n = = R Qn−1 T ,
Ŝn−1 (xn−1 ) Ŝn−1 (xn−1 ) b2 i=1 b xi dµ (b)

the weights are calculated through a procedure very similar to the Universal
Portfolio return. It is readily seen that
 Pn−1
Xn−1 (l) bl+1 bn−1−l
R 
1 l=0 1 2 dµ (b)
b̂n = P n−1 R l n−l =
Ŝn−1 (xn−1 ) l=0 Xn−1 (l) b1 b2 dµ (b)
 Pn−1 
1 l=0 Xn−1 (l)Cn (l + 1)
= Pn−1 . (2.5)
Ŝn−1 (xn−1 ) l=0 Xn−1 (l)Cn (l)

In order to obtain efficiently implementable formulas, the integrals (2.4) need to


be evaluated. This is where the choice of the Dirichlet density proves valuable.
Since the density function is given by
1
f (b) = bα1 −1 bα 2 −1
,
B(α1 , α2 ) 1 2

the type of integrals arising above (2.4) have a closed form solution that can
easily be found. Note that
Z 1
1
Z
l n−l
Cn (l) = b1 b2 dµ (b) = bl1 b2n−l bα
1
1 −1 α2 −1
b2 db1 ,
0 B(α 1 , α 2 )
where b2 = 1 − b1 .

Now, taking the constant outside the integral, this can be written as
Z 1
1
Cn (l) = bl+α1 −1 bn−l+α 2 −1
db1 .
B(α1 , α2 ) 0 1 2

Noting that the integrand is basically a Dirichlet density function, missing only a
constant factor consisting of suitable gamma functions, identify its parameters.
Call the identified parameters γ1 and γ2 . These are related to α1 and α2 as
follows:
γ1 = l + α 1 ,
γ2 = n − l + α 2 .
Now, since by the general definition of a probability measure
Z
dµ (b) = 1,

the Cn (l) integrals (2.4) can be evaluated in closed form as

B(γ1 , γ2 ) 1 1
Z
Cn (l) = bγ1 −1 bγ22 −1 db1 =
B(α1 , α2 ) 0 B(γ1 , γ2 ) 1

7
1
B(γ1 , γ2 ) B(γ1 , γ2 )
Z
= dµ (b) = .
B(α1 , α2 ) 0 B(α1 , α2 )
Now, substitute back the expressions for γ1 and γ2 to obtain
B(l + α1 , n − l + α2 ) 1 Γ (l + α1 ) Γ (n − l + α2 )
Cn (l) = = .
B(α1 , α2 ) B(α1 , α2 ) Γ (n + α1 + α2 )
R
Note (using e.g. (2.4)) that C0 (0) = dµ (b) = 1 regardless of the choices of α1
and α2 . Since Γ(N + 1) = N Γ(N ), it is now possible to give two recursions for
Cn (l) depending on the values of α1 and α2 .
l + α1 − 1
Cn (l) = Cn−1 (l − 1)
n + α1 + α2 − 1
n − l + α2 − 1
Cn (l) = Cn−1 (l)
n + α1 + α2 − 1
For Xn (l) (2.3), the following recursion applies when 1 ≤ l ≤ n − 1:

Xn (l) = xn1 Xn−1 (l − 1) + xn2 Xn−1 (l),

and at the endpoints


Xn (0) = xn2 Xn−1 (0)
Xn (n) = xn1 Xn−1 (n − 1).
It is important to also note that in the expressions (2.5) for the Universal Port-
folio weights and its realized total return factor, only products of the Xn (l) and
Cn (l) quantities occur. Thus, it is convenient to introduce

Qn (l) = Xn (l)Cn (l),

giving the following expression for the Universal Portfolio realized total return
factor after n rebalancings:
n
X
Ŝn (xn ) = Qn (l).
l=0

Furthermore, even the quantities Cn (l + 1)Xn−1 (l) and Cn (l)Xn−1 (l), occuring
in the expression (2.5) for the Universal Portfolio weights, can be expressed
using the Qn (l) quantities, after first using the separate Cn (l) recursions:
l + 1 + α1 − 1
Cn (l + 1)Xn−1 (l) = Cn−1 (l + 1 − 1)Xn−1 (l) =
n + α1 + α2 − 1
l + α1
= Qn−1 (l),
n + α1 + α2 − 1
n − l + α2 − 1
Cn (l)Xn−1 (l) = Cn−1 (l)Xn−1 (l) =
n + α1 + α2 − 1
n − l + α2 − 1
= Qn−1 (l).
n + α1 + α2 − 1
Inserting into (2.5), this gives the simplified Universal Portfolio weight expres-
sion " P #
n−1 l+α1
1 l=0 n+α +α −1 Qn−1 (l)
b̂n = Pn−1 1
Pn−1 n−l+α2 −1 2
.
l=0 Qn−1 (l) l=0 n+α1 +α2 −1 Qn−1 (l)

8
Using the fact that C0 (0) = X0 (0) = 1 gives Q0 (0) = 1, and the recursion
for Qn (l) is given by combining the Cn (l) and Xn (l) recursions. This gives for
Qn (l)
l + α1 − 1 n − l + α2 − 1
Qn (l) = xn1 Qn−1 (l − 1) + xn2 Qn−1 (l)
n + α1 + α2 − 1 n + α1 + α2 − 1
for 1 ≤ l ≤ n − 1, and the corresponding endpoint recursions are
n + α2 − 1
Qn (0) = xn2 Qn−1 (0),
n + α1 + α2 − 1
n + α1 − 1
Qn (n) = xn1 Qn−1 (n − 1),
n + α1 + α2 − 1
completely specifying the Universal Portfolio algorithm for general values of α 1
and α2 .

To summarize this derivation, the Universal Portfolio weights are calculated


according to the following scheme:

• Assume the Dirichlet distribution for the BCRP weights


• Fix α1 and α2
• Assume the relative price quotes xij are calculated for all times i =
1, 2, . . . , n and all assets j = 1, 2, . . . , m
• Calculate the Qn (l) matrix for l = 0, 1, 2, . . . , n
• Calculate the weight vectors for all times i = 1, 2, . . . , n

From this point, the total return factor is easily calculated according to (2.1).

The theoretical bounds on the Universal Portfolio guarantees that if Sn∗ denotes
BCRP performance and Ŝn denotes Universal Portfolio performance, then
 ∗
1 Sn
lim ln =0
n→∞ n Ŝn
which means that asymptotically in time, the Universal Portfolio achieves the
same exponential growth rate as the BCRP.

2.3 Exponentiated Gradient


Introduced by David Helmbold et al [9], this algorithm has weaker theoretical
lower bounds than the Universal Portfolio, with
 ∗ r 
1 Sn m
lim ln = ln
n→∞ n Ŝn 2r2
where m as before denotes the number of assets in the portfolio and r is a lower
bound on the relative price changes between trading days, which can in reality
be arbitrarily close to zero.

9
Only a modified version with significantly increased computational complex-
ity achieves the same bounds as Universal Portfolio. According to its inventors
however, Exponentiated Gradient provides better real life performance, quite
often coming very close to BCRP performance.

Let xi and bi denote asset performance and portfolio weights as before. Fur-
thermore, let η denote the learning rate of the algorithm. This parameter will
be held constant, although this is not strictly a requirement. A higher value
means faster reallocation reaction to relative overperformance of a particular as-
set compared to other assets in the portfolio. For the Exponentiated Gradient
(EG) algorithm, the future portfolio weights are determined according to
 
ηx
bi,j exp bTijx
i
bi+1,j = P  .
m ηxik
k=1 b i,k exp T
b x
i

As can be seen from the above formula, the weights used by this algorithm can
easily be calculated in vector form, facilitating implementation in e.g. Matlab
and enabling efficient testing of performance of portfolios consisting of more than
two assets. The calculation of weights and performance of the EG algorithm
is straightforward. The actual performance of portfolios consisting of more
than two assets needs to be evaluated to judge whether the complexity-imposed
restriction on Universal Portfolio significantly limits its efficiency. If EG proves
to provide as good or better returns for two-asset portfolios as for portfolios
consisting of more than two assets, then, heuristically, Universal Portfolio could
be assumed to follow this behavior, since it is basically similar in structure to
EG.

2.4 Anticor
The Anticor algorithm was introduced by Borodin et al [4] and is based on the
theory of mean-reverting asset prices. It is parameterized by the length of the
window, which is a time period over which the portfolio assets’ correlations are
determined and used to calculate the weights for the following subperiod. Its
name stems from the fact that it assumes anticorrelated assets (i.e. assets with
negative correlation).

Let w be the integer length of the window, measured in number of trading times.
Define the growth rate of an asset over the length of the window as the product
of relative prices during this window. For Anticor to transfer investments from
asset i to asset j, two conditions must be fulfilled.

• Asset i must have had a higher growth rate than asset j over the most
recent window
• Asset i over the second most recent window must be positively correlated
with asset j over the most recent window.

Under the assumption of mean-reverting and equally well performing assets over
longer time periods, these two conditions together indicate that asset j should
outperform asset i over the next window.

10
For a more formal description of the Anticor algorithm, define
T T
LX1i = [log(xi−2w+1 ), . . . , log(xi−w )] , LX2i = [log(xi−w+1 ), . . . , log(xi )]

where log(xk ) denotes [log(xk (1)), . . . , log(xk (m))]T and m is the number of as-
sets included in the portfolio. Consequently, LX1i and LX2i are w × m matrices
containing log-relative prices of assets over the second most recent and most re-
cent window respectively. Let the jth column of LXli be denoted LXli (j).
Furthermore, let µl = [µl (1), . . . , µl (m)] and σl = [σl (1), . . . , σl (m)] be the vec-
tors of averages and standard deviations of the columns of LXli respectively.
The cross-correlation matrix is then given by
1
Mcov,i (j, k) = (LX1i (j) − µ1 (j))T (LX2i (k) − µ2 (k))
w−1
(
Mcov,i (j,k)
σ1 (j)σ2 (k) if σ1 (j), σ2 (k) 6= 0
Mcor,i (j, k) =
0 otherwise.
Now, Mcor (j, k) measures the correlation between log-relative prices of asset j
over the first window with those of asset k over the second window. If σ1 (j)
or σ2 (k) is zero over some window, then there is constant growth of the corres-
ponding asset over that window. In this case, no transfer is made between the
two assets in the portfolio.

Next, the claim matrix is calculated, claimi (j, k) denoting the extent to which
the algorithm wants to transfer wealth from asset j to asset k.

Mcor,i (j, k) + Ai (j) + Ai (k) if µ2 (j) > µ2 (k) and Mcor,i (j, k) > 0
claimi (j, k) =
0 otherwise.

Here, the Ai (h) quantity is calculated as



|Mcor,i (h, h)| if Mcor,i (h, h) < 0
Ai (h) =
0 otherwise.

Intuitively, Mcor,i (j, k) > 0 could be interpreted to mean that assets j and k
are correlated in consecutive windows and Mcor,i (h, h) < 0 predicts negative
autocorrelation of asset h in consecutive windows.

The actual transfers between assets are calculated through the expression
(
bi (j) Pclaim i (j,k)
P
if k claimi (j, k) 6= 0
transferi (j, k) = k claimi (j,k)
0 otherwise.

Finally, the portfolio weights at time i + 1 are given relative to the weights at
time i through the following relation:
X
bi+1 = bi + [transferi (k, j) − transferi (j, k)] .
k6=j

11
2.5 Constant Proportion Portfolio Insurance
Introduced by Black and Jones [2] and Perold and Sharpe [13] and later de-
scribed by Bertrand and Prigent [1], the Constant Proportion Portfolio Insur-
ance (CPPI) algorithm is commonly used for insurance purposes. It combines
one risky asset with a risk free asset that increases in value at an exponential
risk free rate r.

The CPPI algorithm in its base form is constrained to portfolios consisting


of two assets, of which one is the risk free asset and the other is a risky asset,
which may in reality be a portfolio of several risky assets. Let V0 denote the ini-
tial portfolio value and let F0 denote the initial floor. The floor is conceptually
supposed to be interpreted as a lower tolerance bound for the portfolio’s value
at a particular time, and it is set to grow exponentially at the risk free rate r,
i.e. to follow the (deterministic) differential equation dFt = rFt dt. Initially, one
must have F0 < V0 . At all times i, let Ci denote the so-called cushion, defined
through
Ci = V i − F i .
Using this concept, the total investment in the risky asset, called the exposure,
is denoted by Ei and is calculated through

Ei = mCi ,

where m is a constant called the multiple. Letting m > 1 makes the payoff func-
tion convex, but simultaneously, the floor is no longer a guaranteed absolute
minimum at all times. If on the other hand m ≤ 1, it is clear that the exposure
is at no time larger than the total portfolio wealth less the value of the floor
since the exposure in this case is at the most equal to the cushion.

In its standard form, assuming that the risky asset behaves like a geometric
Brownian motion, the CPPI algorithm wealth at the end of the investment
period can be expressed in closed form. The solution is
 m
−km ST
VT = V 0 + C 0 e ,
S0
where
mσ 2
 
km = (m − 1) +r
2
The CPPI algorithm can be extended in several ways, as presented by Boulier
and Kanniganti [5]. One way is to implement a moving floor, that besides the
risk free rate growth can make leaps upwards following exceptionally quick and
large gains from the risky asset, limiting the exposure to the risky asset to pro-
tect the portfolio from subsequent falls in the price of the risky asset, but also
obviously limiting the possibility to fully capture sustained risky asset price in-
creases over extended periods of time.

The moving floor strategy suggested introduces a new parameter called p, which
denotes the maximum fraction of wealth to be invested in the risky asset. To
make the floor a deterministiccally guaranteed minimum value, p should be set
to be 1 − f , where f is the minimum desired floor expressed as a fraction of
portfolio wealth, i.e. f = (F/V )min .

12
Enforcing the maximum relative exposure determined by p transfers the excess
cushion to the floor. This excess cushion is given by
mCi − pVi m(Vi − Fi ) − pVi m−p
= = Vi − F i
m m m
Thus, the floor is changed according to
 m−p
Finew = m Vi if mCi > pVi
Fiold otherwise.

It is easily seen that this can simply be interpreted as ’If the suggested exposure
is too large as a fraction of portfolio wealth, move the floor up until the exposure
is exactly the maximum fraction of portfolio wealth allowed’, since if mCi > pVi ,
we set
m−p
Fi = Vi ,
m
giving
 
m−p  p 
Ei = mCi = m(Vi − Fi ) = m Vi − Vi = m Vi − V i + Vi =
m m
p
m Vi = pVi .
m
In this case, there exists no closed form solution for the portfolio wealth, but
the SDE can be expressed as

 rVt dt if Vt ≤ Ft
m
dVt = (Vt − Ft )dZt + rFt dt if Ft < Vt < m−p Ft
m
Vt dXt if Vt ≥ m−p Ft .

Here,
dZt = (m(µ − r) + r)dt + mσdWt ,
dXt = (p(µ − r) + r)dt + pσdWt .
Another strategy instead focuses on not letting the exposure to the risky asset
grow too small in the case of a decline of the value of the risky asset, noting
that a CPPI portfolio will follow the floor if it ever reaches it and behave un-
predictably in the case of aggressive investing leading to a portfolio value below
the floor.

Denote the initial margin M0 . Also, define Ei∗ as a lower limit for the exposure
at any time i. The margin version of CPPI states that, whenever Ei < Ei∗ /2,
Mi
Finew = Fiold − ,
2
Miold
Minew = ,
2
Einew = mCi = m(Vi − Finew ).
The lower limit can be set in several fashions. I will use a certain proportion of
the portfolio wealth at each time when evaluating this version of CPPI, i.e. I
will use Ei∗ = pVi for all times i.

13
Chapter 3

Extensions of the algorithms

3.1 Side information


Not an algorithm on its own, the idea of side information was introduced by
Cover and Ordentlich [8] and used by Helmbold et al [9]. It is a general frame-
work for allowing any type of additional information about the market in gen-
eral, or the assets included in a portfolio in particular, to modify the algorithm’s
suggested portfolio weights. Changes are made to exploit opportunities of extra
return not captured by the original algorithms themselves. It should be noted
that when including side information to modify portfolio weights, the BCRP is
in the general case no longer a theoretical upper bound on portfolio perform-
ance, since side information rebalancing need not fundamentally strive towards
a constant rebalanced strategy as the basic algorithms do.

In this thesis, side information is implemented by averaging over a certain re-


cent window of price information, finding the best and worst performer of the
assets included in the portfolio and making a small, fixed transfer of portfolio
weight from the worst performer to the best performer for the next investment
subperiod. The average performance is calculated as a geometric average, since
it is best suited for assessing past performance, and several values for the side
information window length as well as the portfolio weight change size are tested
to find a policy that provides the best improvements in general.

3.2 Trading costs


Trading in portfolios, changing the relative investment in the different indi-
vidual assets has additional costs besides the actual purchase prices, affected by
relative price changes of the assets. Even for financial institutions, the actual
trading in itself bears a cost, which is most often a certain fraction of the total
amount traded. (See e.g. Blum and Kalai [3] or Black and Jones [2]). This
clearly will affect algorithms that make large changes in relative investments
when rebalancing.

In this thesis, trading costs are implemented as a reduction of a certain number

14
of basis points (hundredths of percents) of the total value of the volume of as-
sets traded. I will be using trading costs between 2 and 8 basis points, based on
information from experienced traders, to test the robustness of the algorithms
in the sense of their ability to provide satisfactory returns even when the usual
assumption of absence of trading costs is removed.

15
Chapter 4

Implementing and testing the


algorithms

The testing will include testing the algorithms’ performance on simulated Geo-
metric Brownian Motion (GBM) data as well as their performance on real asset
price data, to find out what the optimal patterns are for the scalable algorithms
(e.g. if it seems preferrable to use a particular number of assets) and to find
evidence of the dependence of algorithms on the different parameters of the
assets used.

4.1 Universal Portfolio


Firstly, consider the Universal Portfolio algorithm. Its only parameters are the
parameters of the probability distribution assumed for the BCRP weights. Us-
ing the Dirichlet distributions, it might be interesting to see whether there are
significant differences in performance using the Dirichlet(1/2,1/2) and the Di-
richlet(1,1) distributions.

Dir(1/2,1/2) Dir(1,1)
250 250

200 200

150 150
Frequency

Frequency

100 100

50 50

0 0
−0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 0.02 0.04 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 0.02 0.04
S−0.5(S1+S2) S−0.5(S1+S2)

Figure 4.1: Comparison of Universal Portfolio algorithm using Dirich-


let(1/2,1/2) (left) and Dirichlet(1,1) measures (right)

16
It is quite obvious that, having settled for the Dirichlet class of probability
measures, the actual choice of its parameters is not very relevant. Only small
changes in the ’width’ of the distribution can be seen. This conclusion is also
confirmed by other tests. Also, some of the sources used for this thesis also
tests the Universal Portfolio algorithm with respect to sensitivity to the choice
of probability measure, reaching the same conclusion. Henceforth, this thesis
shall exclusively use the Dirichlet(1/2,1/2) probability measure for the Univer-
sal Portfolio algorithm.

Secondly, to evaluate the performance of the algorithms, running large scale


simulations of the algorithms on generated GBM series provides basic insight
into the algorithms’ capacity to generate higher returns than simpler strategies.
For each simulation, 1000 pairs of geometric Brownian motions are generated,
and the performance of the universal portfolio is related to suitable performance
measures. Below are presented a few histograms of these simulations. Note that
the arithmetic average portfolio is simply the portfolio obtained by investing an
equal amount of the starting capital in each of the assets included in the port-
folio. In these graphs, trading costs are not yet included.

Parameters used are


µ1 = 0.04, µ2 = 0.07, σ1 = 0.15, σ2 = 0.20.

Performance for universal portfolio of two stocks compared to their arithmetic average performance
400

350

300

250
Frequency

200

150

100

50

0
−0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 0.02
S−0.5(S1+S2)

Figure 4.2: Histogram of performance of Universal Portfolio algorithm over two


years, rebalancing twice a month

In this figure, S is the Universal Portfolio total return factor and S1 and S2
are relative prices of asset 1 and 2 respectively. As can be seen, the algorithm
does seem to have an ability to outperform the arithmetic average portfolio in a
rather large share of all cases. Also, it seems the distribution has a heavier left
tail and a lighter right tail, indicating that when the universal portfolio is un-
successful, it underperforms the arithmetic average portfolio by larger amounts
than the amounts by which it outperforms the arithmetic average when it is

17
successful. The mean difference however is insignificantly different from zero,
as is the median difference.

Next, it should be interesting to compare the performance of the universal


portfolio resulting when rebalancing on a daily basis to the performance when
rebalancing twice a month. Below is presented the histogram for the former
case. Note that trading costs are still not implemented, meaning that results
have to be better by a certain margin to be comparable after correcting for
trading costs. The GBM parameters are

µ1 = 0.04, µ2 = 0.07, σ1 = 0.15, σ2 = 0.20.

Performance for universal portfolio of two stocks compared to their arithmetic average performance
350

300

250
Frequency

200

150

100

50

0
−0.1 −0.08 −0.06 −0.04 −0.02 0 0.02
S−0.5(S1+S2)

Figure 4.3: Histogram of performance of Universal Portfolio algorithm over two


years, rebalancing every day

Rebalancing every day seems to make no significant difference on the outcome


of the universal portfolio, disregarding trading costs. Including trading costs
will likely make the actual returns lower in this case however. To evaluate the
Universal algorithm more fairly, deciding on optimal rebalancing policy, it must
be tested on actual asset data that might not be perfectly represented by sim-
ulated geometric Brownian motions.

A test was also done to see how the algorithm reacts to higher volatility for
the GBM:s. Below are presented histograms for the high volatility tests. The
leftmost one uses two assets, each with an annual volatility of 80% and the
rightmost one uses two assets, each with an annual volatility of 150%.

18
Performance for universal portfolio of two stocks compared to their arithmetic average performance
700 Performance for universal portfolio of two stocks compared to their arithmetic average performance
900

600 800

700
500
600
Frequency

400

Frequency
500

300 400

300
200
200
100
100

0 0
−5 −4 −3 −2 −1 0 1 −25 −20 −15 −10 −5 0 5
S−0.5(S1+S2) S−0.5(S1+S2)

Figure 4.4: Histograms of performance of Universal Portfolio algorithm over two


years, higher volatility

As is to be expected, the probability of extreme outcomes increases when asset


volatility increases.

It seems that the Universal algorithm has a tendency to underperform the arith-
metic average portfolio by large amounts in some cases. In order to distinguish
a pattern, a test was done to determine common traits of situations where Uni-
versal underperforms.

Universal Portfolio total return factor less average total return factor Average total return factor for two stock portfolios
0.04 2.2

2
0.02

1.8
0

1.6
S−0.5(S1+S2)

−0.02
0.5(S1+S2)

1.4

−0.04
1.2

−0.06
1

−0.08
0.8

−0.1
0 100 200 300 400 500 600 700 800 900 1000 0 100 200 300 400 500 600 700 800 900 1000
Simulation number Simulation number

Figure 4.5: Performance of Universal Portfolio algorithm compared with arith-


metic average portfolio performance

19
Scatterplot of Universal excess total return factor against average portfolio performance
0.04

Universal Portfolio excess return factor 0.02

−0.02

−0.04

−0.06

−0.08

−0.1
0.8 1 1.2 1.4 1.6 1.8 2 2.2
Arithmetic average portfolio return factor

Figure 4.6: Scatterplot of Universal Portfolio excess total return factor against
arithmetic average portfolio total return factor

It is important to note that the low peaks of the left figure coincide with high
peaks in the right figure, which can be interpreted to mean that the Universal
algorithm is not able to fully capture very high returns of the individual assets.
Note however that the total return of the Universal algorithm is still signific-
antly positive, even in the negative peak simulations in the left figure, since this
figure shows the actual return factor less the arithmetic average return factor.
For comparison, see the scatterplot which shows that negative excess perform-
ance in most cases coexists with high arithmetic average portfolio performance.
In conclusion, it still appears reasonable to apply the Universal algorithm, since
disregarding the negative peaks in the left figure, corresponding to quite satis-
factory returns, the Universal algorithm on average outperforms the arithmetic
average portfolio. Only in a few cases does the algorithm underperform an
already poor arithmetic average portfolio. In order to better judge the real re-
turn capabilities of the Universal Portfolio algorithm, actual price data should
be used instead.

The first real price data test of the Universal algorithm used monthly actual
asset price data. The comparison with the arithmetic average portfolio gave the
following result. The horizontal axis shows integers corresponding to the looping
over the different assets. In total, there were nine assets to choose from, making
the total number of portfolios 92 = 36. Note that the Universal algorithm


seems to be able to outperform the arithmetic average portfolio in some cases,


but mostly performs as well as the arithmetic average.

20
Universal portfolio and arithmetic average portfolio performance
1.5
Universal portfolio
Arithmetic average portfolio

1.4

1.3
Total return factor

1.2

1.1

0.9
0 5 10 15 20 25 30 35 40
Assets combined

Figure 4.7: Comparisons of Universal Portfolio and arithmetic average portfolio


performance using real, monthly rebalanced assets

4.2 Comparison between Universal Portfolio, Ex-


ponentiated Gradient and Anticor
To see the dependence of the algorithms on the parameters of assets in the
portfolio, GBM simulations were done for Universal, EG and Anticor. (Note
that since CPPI requires a riskfree asset, it cannot be compared with these
algorithms directly.) The parameters used were the expected rates of return,
annual volatilities and the correlation between the assets included in the port-
folio. Simulations were run keeping all but one of the parameters constant.
Because of the symmetry of the two asset portfolios, only one asset’s expected
rate of return and volatility was changed. For each parameter value in each
figure, the total return factor is averaged over 100 GBM-simulations.

21
Performance of Universal, EG and Anticor depending on second asset expected return
1.18
Universal
EG
1.16
Anticor

1.14

Final total return factor, Sn


1.12

1.1

1.08

1.06

1.04

1.02
0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
µ2

Figure 4.8: Algorithm performance depending on second asset expected return,


using µ1 = 0.04, σ1 = 0.15, σ2 = 0.20, ρ = 0

Performance of Universal, EG and Anticor depending on second asset volatility


1.4
Universal
1.35 EG
Anticor
1.3
Final total return factor, Sn

1.25

1.2

1.15

1.1

1.05

0.95

0.9
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
σ2

Figure 4.9: Algorithm performance depending on second asset volatility, using


µ1 = 0.04, µ2 = 0.07, σ1 = 0.15, ρ = 0

22
Performance of Universal, EG and Anticor depending on correlation between assets
1.09
Universal
EG
1.08
Anticor

1.07

Final total return factor, Sn


1.06

1.05

1.04

1.03

1.02

1.01
−1 −0.5 0 0.5 1
ρ

Figure 4.10: Algorithm performance depending on correlation between assets,


using µ1 = 0.04, µ2 = 0.07, σ1 = 0.15, σ2 = 0.20

The results are not very surprising. Higher expected return leads to better
algorithm performance for all three algorithms, indicating that they are all ba-
sically capable of capturing return from individual assets, even though earlier
tests showed that they might not be able to fully capture unusually high re-
turns. Higher volatility increases uncertainty about portfolio performance, en-
abling outcomes of higher as well as lower total return than using assets with
lower volatility. What might be considered unexpected is the inconclusive de-
pendence on asset correlation. Especially Anticor might be expected to perform
significantly better for negatively correlated assets than for positively correlated
assets, but there is no clear evidence that this is in fact the case. However, there
appears to be a small peak for Anticor for correlations around -0.4.

Since the EG algorithm is able to handle any number of assets in one port-
folio with computational complexity being only linear in the number of assets
as compared to Universal’s exponential behavior, tests were performed to see
how EG performed for different numbers of assets in each portfolio. The hori-
zontal axis shows the loop number for the portfolio. To ensure the testing of
all possible asset combinations, the loop in each step creates a binary string
representing a choice vector, where 0 represents not including the asset and 1
represents including it. Assuming a data set of time series for N assets, this
means creating N -bit strings, where the last string, corresponding to including
all assets and thus having 1 in all positions, is equivalent to the number 2N − 1.
Thus, the loop goes up to 2N − 1, converting the loop index to a binary number
and using the binary string to single out the assets to be used in the partic-
ular portfolio examined at the current stage of the loop, discarding the cases
where the binary string has zero or one occurence of 1, since these correspond
to uninteresting zero- and one-asset portfolios, respectively.

23
Performance of EG portfolio compared to best individual asset
0.05

−0.05

−0.1

−0.15
S−Smax

−0.2

−0.25

−0.3

−0.35

−0.4
0 100 200 300 400 500 600
Portfolio composition number

Figure 4.11: Performance of EG algorithm over seven years, rebalancing annu-


ally

Finding the portfolio compositions of the top performers shows that top per-
formers are without exception made up of only two assets, a result also valid
using more frequent rebalancings as well as when using other sets of data. It is
also found to be valid for the Anticor algorithm. Intuitively, this is merely a case
of high risk, high return. The potential return is increased by not diversifying in
several assets and thus having a relatively high risk in the general case. Thus,
it seems reasonable to restrict the further analysis to portfolios consisting of
only two assets. Apart from restricting computational complexity significantly
through removing the need to test most possible portfolio combinations, this
also has the advantage of enabling fair comparisons between the algorithms,
trying to establish a ranking between the algorithms. This fairness is due to the
CPPI algorithm restriction to two-asset portfolios by definition and the imposed
restriction of the Universal Portfolio algorithm used in this thesis.

In table 4.2 is presented results using the exponentiated gradient (EG) portfolio
rebalancing algorithm as well as the universal portfolio algorithm on monthly
quoted asset prices over a seven year period. The percentages given are the per-
centages of BCRP performance realized by the algorithms. The final column,
b1 , presents the BCRP weight for the first asset. Note that in 34 out of 36
cases, the BCRP is obtained by investing the full wealth in one of the assets in
the portfolio (indicated by b1 being exactly 0 or 1), further explaining the weak
performance of Universal and EG on this data set. Also, BCRP performance
is less than impressive for all portfolios presented here. Finally, note that there
are no significant differences between Universal Portfolio and EG total return
factors for any of these portfolios.

24
Table 4.1: Performance of EG and Universal portfolios compared to BCRP. The
rightmost column shows the first asset’s weight in the BCRP.
Assets BCRP EG (%) Universal (%) b1
OMX, Hedge 1.5236 1.2216 (80.1791) 1.2155 (79.7793) 0.0000
OMX, MSCI 0.9264 0.9240 (99.7379) 0.9156 (98.8322) 0.3192
OMX, Tbond 1.4105 1.1917 (84.4867) 1.1723 (83.1130) 0.0000
OMX, Tbill 1.2718 1.1267 (88.5878) 1.1051 (86.8921) 0.0000
OMX, Mort 1.4233 1.1943 (83.9107) 1.1768 (82.6817) 0.0000
OMX, Real 1.5284 1.2440 (81.3946) 1.2280 (80.3448) 0.0000
OMX, danska_b 1.4974 1.2245 (81.7718) 1.2104 (80.8355) 0.0000
OMX, eur_gov 1.4152 1.1967 (84.5597) 1.1760 (83.0966) 0.0000
Hedge, MSCI 1.5236 1.2034 (78.9856) 1.2124 (79.5744) 1.0000
Hedge, Tbond 1.5236 1.4734 (96.7069) 1.4703 (96.5004) 1.0000
Hedge, Tbill 1.5236 1.3981 (91.7655) 1.3979 (91.7513) 1.0000
Hedge, Mort 1.5236 1.4792 (97.0858) 1.4764 (96.8992) 1.0000
Hedge, Real 1.5344 1.5342 (99.9838) 1.5301 (99.7220) 0.4262
Hedge, danska_b 1.5236 1.5166 (99.5390) 1.5136 (99.3431) 1.0000
Hedge, eur_gov 1.5236 1.4764 (96.9037) 1.4730 (96.6757) 1.0000
MSCI, Tbond 1.4105 1.1652 (82.6099) 1.1651 (82.6007) 0.0000
MSCI, Tbill 1.2718 1.1043 (86.8264) 1.0999 (86.4873) 0.0000
MSCI, Mort 1.4233 1.1690 (82.1357) 1.1702 (82.2157) 0.0000
MSCI, Real 1.5284 1.2157 (79.5408) 1.2198 (79.8082) 0.0000
MSCI, danska_b 1.4974 1.1990 (80.0703) 1.2037 (80.3835) 0.0000
MSCI, eur_gov 1.4152 1.1695 (82.6406) 1.1684 (82.5622) 0.0000
Tbond, Tbill 1.4105 1.3404 (95.0333) 1.3408 (95.0572) 1.0000
Tbond, Mort 1.4233 1.4172 (99.5695) 1.4170 (99.5593) 0.0000
Tbond, Real 1.5284 1.4696 (96.1555) 1.4696 (96.1498) 0.0000
Tbond, danska_b 1.4974 1.4540 (97.1030) 1.4540 (97.1014) 0.0000
Tbond, eur_gov 1.4152 1.4131 (99.8526) 1.4130 (99.8427) 0.0000
Tbill, Mort 1.4233 1.3458 (94.5554) 1.3466 (94.6146) 0.0000
Tbill, Real 1.5284 1.3966 (91.3790) 1.3983 (91.4910) 0.0000
Tbill, danska_b 1.4974 1.3810 (92.2236) 1.3828 (92.3441) 0.0000
Tbill, eur_gov 1.4152 1.3427 (94.8754) 1.3431 (94.9029) 0.0000
Mort, Real 1.5284 1.4765 (96.6074) 1.4762 (96.5848) 0.0000
Mort, danska_b 1.4974 1.4604 (97.5269) 1.4604 (97.5265) 0.0000
Mort, eur_gov 1.4233 1.4198 (99.7519) 1.4195 (99.7327) 1.0000
Real, danska_b 1.5284 1.5146 (99.0998) 1.5138 (99.0448) 1.0000
Real, eur_gov 1.5284 1.4723 (96.3285) 1.4720 (96.3129) 1.0000
danska_b, eur_gov 1.4974 1.4565 (97.2716) 1.4564 (97.2638) 1.0000

In table 4.2 is presented results using the exponentiated gradient (EG) portfolio
rebalancing algorithm as well as the universal portfolio algorithm on another
data set containing daily quoted asset prices. Note that EG outperforms Uni-
versal in all ten cases, which also corresponds to the findings of Helmbold et al
[9]. Also note that for this data set, the BCRP is obtained by investing com-
pletely in one asset in only two out of ten cases, although three more cases are
close to this situation, showing that the potential for the algorithms presented
to obtain higher returns should be larger than for the data set examined in the
above table.

25
Table 4.2: Performance of EG and Universal portfolios on daily data, compared
to BCRP. The rightmost column shows the first asset’s weight in the BCRP.
Assets BCRP EG (%) Universal (%) b1
sur37005, com20350 4.9233 4.0469 (82.1983) 3.5691 (72.4935) 0.8390
sur37005, com20440 6.3865 6.1462 (96.2377) 4.8782 (76.3824) 0.6248
sur37005, swe38000 4.7297 3.5031 (74.0665) 3.2424 (68.5551) 0.9472
sur37005, swe14332 4.7949 3.7101 (77.3751) 3.3579 (70.0301) 0.8960
com20350, com20440 2.7501 2.3932 (87.0223) 2.2570 (82.0699) 0.0466
com20350, swe38000 1.5113 1.4652 (96.9483) 1.4168 (93.7444) 0.8208
com20350, swe14332 1.4971 1.4213 (94.9365) 1.4100 (94.1840) 1.0000
com20440, swe38000 2.7479 2.2725 (82.7009) 2.1324 (77.6004) 0.9724
com20440, swe14332 2.7461 2.2125 (80.5697) 2.1182 (77.1339) 1.0000
swe38000, swe14332 1.3385 1.3341 (99.6678) 1.3020 (97.2724) 0.3808

In figure 4.2 is presented a graph where the constant rebalanced portfolio per-
formance for the assets in table 4.2 is plotted as a function of the weight of the
first asset listed for each portfolio in the daily quotes data. The maximum of
each curve obviously corresponds to the BCRP. As already seen, the BCRP for
pairs of these time series is still in two cases out of ten obtained by investing
the full wealth in one of the assets in the portfolio. Looking at the results in the
above table, it is clear that these assets are better suited for usage with these
algorithms, with EG and Universal outperforming both the individual assets in
some of these portfolios.

sur37005, com20350 sur37005, com20440 sur37005, swe38000 sur37005, swe14332


5 10 5 5

0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
b1 b1 b1 b1
com20350, com20440 com20350, swe38000 com20350, swe14332
3 1.6 1.5

2 1.4 1.4

1 1.3
0 0.5 1 0 0.5 1 0 0.5 1
b1 b1 b1
com20440, swe38000 com20440, swe14332
3 3

2 2

1 1
0 0.5 1 0 0.5 1
b1 b1
swe38000, swe14332
1.4

1.3

0 0.5 1
b1

Figure 4.12: Constant rebalanced portfolio performance as function of b1

26
The performance of Anticor proved to be rather dependent on the choice of the
window length parameter, w. Using low values of w gives highly unpredictable
behavior, while values of about 20 and above seems to stabilize performance.
Below are presented some examples of Anticor performance for two-asset port-
folios. A test completely analogous to that made for EG above was also made
for Anticor, showing that the performance of Anticor also tends to be best for
two-asset portfolios.

Evaluation of Anticor algorithm on com20350 and com20440 rebalancing each 1 days


4
Anticor portfolio
3.5 com20350
com20440

3
Total return factor

2.5

1.5

0.5
0 200 400 600 800 1000 1200 1400 1600 1800
Rebalancing number

Figure 4.13: Performance of Anticor portfolio on com20350 (gold) and com20440


(oil)

Evaluation of Anticor algorithm on com20440 and swe14332 rebalancing each 1 days


3.5
Anticor portfolio
com20440
3 swe14332

2.5
Total return factor

1.5

0.5
0 200 400 600 800 1000 1200 1400 1600 1800
Rebalancing number

Figure 4.14: Performance of Anticor portfolio on com20440 (oil) and swe14332


(OMRX)

The above figures show performance using daily rebalancings. When the re-

27
balancing frequency was lowered, bahavior tended to change more for Anticor
than for the other algorithms, indicating that this algorithm is not quite robust.
Below are presented some examples of monthly rebalanced Anticor portfolios.

Evaluation of Anticor algorithm on sur37005 and com20350 rebalancing each 20 days


5
Anticor portfolio
4.5 sur37005
com20350
4

3.5
Total return factor

2.5

1.5

0.5

0
0 10 20 30 40 50 60 70 80 90
Rebalancing number

Figure 4.15: Performance of Anticor portfolio on sur37005 (Russia fund) and


com20350 (gold)

Evaluation of Anticor algorithm on sur37005 and com20440 rebalancing each 20 days


5
Anticor portfolio
4.5 sur37005
com20440
4

3.5
Total return factor

2.5

1.5

0.5

0
0 10 20 30 40 50 60 70 80 90
Rebalancing number

Figure 4.16: Performance of Anticor portfolio on sur37005 (Russia fund) and


com20440 (oil)

28
Evaluation of Anticor algorithm on sur37005 and com20440 rebalancing each 20 days
5
Anticor portfolio
4.5 sur37005
com20440
4

3.5
Total return factor

2.5

1.5

0.5

0
0 10 20 30 40 50 60 70 80 90
Rebalancing number

Figure 4.17: Performance of Anticor portfolio on com20440 (oil) and swe14332


(OMRX)

4.3 CPPI
The CPPI algorithm differs from the other algorithms in that it is restricted to
two-asset portfolios, where one asset should be riskfree and the other should be
risky. However, it should be noted that the risky asset in itself may in reality
very well be a portfolio of assets, for instance a portfolio whose internal com-
position is determined by Universal, EG or Anticor.

Firstly, the performance of real one-risky-asset CPPI portfolios was tested. Be-
low is presented a graph of one such portfolio’s value process over time.

29
Evaluation of CPPI algorithm on sur37005, rebalancing each 20 days
5
CPPI
4.5 CPPI with margin
sur37005
4 Floor without margin
Floor with margin
3.5

Total return factor


3

2.5

1.5

0.5

0
0 10 20 30 40 50 60 70 80 90
Rebalancing time

Figure 4.18: Performance of CPPI portfolio on sur37005 (Russia fund), using


SWE14332 (OMRX) as riskless asset

Secondly, there is nothing to restrict the CPPI algorithm from using a portfolio
of risky assets as its risky asset. Thus, to try to improve CPPI performance,
tests were performed on some of the best portfolios for the EG and Anticor
algorithms.

Evaluation of CPPI algorithm on sur37005,com20440, rebalancing each 20 days


15
CPPI
CPPI with margin
sur37005,com20440
Floor without margin
Floor with margin
10
Total return factor

0
0 10 20 30 40 50 60 70 80 90
Rebalancing time

Figure 4.19: Performance of CPPI portfolio on EG portfolio of sur37005 (Russia


fund) and com20440 (oil), using SWE14332 (OMRX) as riskless asset

30
Evaluation of CPPI algorithm on sur37005,com20350, rebalancing each 20 days
8
CPPI
7 CPPI with margin
sur37005,com20350
Floor without margin
6
Floor with margin

Total return factor


5

0
0 10 20 30 40 50 60 70 80 90
Rebalancing time

Figure 4.20: Performance of CPPI portfolio on EG portfolio of sur37005 (Russia


fund) and com20350 (gold), using SWE14332 (OMRX) as riskless asset

31
Chapter 5

Tuning of parameters

To use the algorithms for real portfolios, it is also necessary to fine-tune the
parameters of the different methods. This includes the learning rate of EG, the
window length of Anticor and the floor level of CPPI. Additionally, the length
of the side information window and the size of the weight changes that the side
information suggests must be investigated.

The Universal Portfolio algorithm only depends on the choice of probability


measure assumed for the BCRP portfolio weights. Restricting the analysis to
the Dirichlet class of probability measures has already shown that the choice of
parameters for this particular distribution is largely irrelevant. The Universal
Portfolio algorithm is thus for all practical purposes a parameter free algorithm.

For the EG algorithm, the data sets used all benefitted from selecting a low
value of the algorithm’s only parameter, the learning rate η. The inventors of
the EG algorithm found that a value of 0.05 was usually preferrable. I was not
able to reproduce this result, finding that η = 0.01 was optimal in more than
90% of all cases.

The Anticor algorithm also has only one parameter, namely the length of the
window. As could be understood intuitively, very short windows spanning over
only a few days of past price information provides unpredictable, volatile per-
formance of the algorithm, with very high returns being mixed with very low
returns even for the same portfolios, making only small changes to the window
length between consecutive tests. A value of about w = 20 would stabilize per-
formance, with only insignificant changes of investment period total return if
the window was increased further.

Finally, the CPPI algorithm has several parameters. The choice of the mul-
tiple is arguably the most important, deciding how strictly the floor guarantee
is enforced. Keeping m ≤ 1 strictly enforces the floor at all times, allowing only
the cushion itself to be used for investing in the risky asset. The p and F0 para-
meters are at least philosophically strongly linked to one another, both denoting
limits to the investment in the two assets included in the CPPI portfolio. I used
p = 1 − F0 /V0 to ensure consistency between the desired relative guarantee and
the desired maximal relative risky asset investment. Introducing the moving

32
floor by letting p < 1 proved preferrable on the average, providing higher re-
turns while also limiting downside risk by continuously securing realized profits.
Optimum was obtained for p ∈ [0.15, 0.30] for all but a few portfolios. It should
also be noted that by setting a low p, one can still provide decent returns with
a lower m.

The margin version of the CPPI algorithm proved to be somewhat redundant,


being comparable to the moving floor version in terms of performance while re-
laxing the generally desirable requirement that the floor is an absolute minimum
of the portfolio wealth at all times. Optimum was obtained for M0 ∈ [0.15, 0.30],
i.e. the same interval as was observed for p in the moving floor version of CPPI.

33
Chapter 6

Conclusions

This thesis has evaluated four different algorithms used for automatic portfo-
lio rebalancing, to test their ability to produce higher returns than more naïve
investment strategies such as buy-and-hold or an equally weighted constant re-
balanced portfolio. All algorithms have proven ability to provide higher returns
than these benchmarks in a majority of cases, with different algorithms having
slightly different requirements on asset price time series characteristics desirable
for optimal results.

All algorithms naturally benefit from higher expected return for the individual
assets. Increased volatility has the effect of allowing for higher returns but also
naturally increases uncertainty of final outcome, allowing for worse outcomes
as well as better. Using different correlations does not seem to affect algorithm
performance for any of the algorithms when geometric Brownian motions are
used to simulate asset price processes. That this holds even for the Anticor
algorithm which is supposed to benefit from anticorrelated assets is not quite as
surprising as one might believe, since the geometric Brownian motion does not
satisfy the mean reversion criterion that Anticor also imposes.

Three of the algorithms, namely Universal Portfolio, Exponentiated Gradient


and Anticor, have the ability to use any number of assets in a portfolio. For two
of these, namely Exponentiated Gradient, this ability has been put to test, and
it has been shown that they both benefit from limiting the number of assets to
two in each portfolio. For Universal Portfolio, complexity of implementation and
computation limited the feasibility of portfolios of more than two assets, since
the computational complexity is exponential in the number of assets. Besides
limiting portfolio choices and thus computational complexity in evaluating al-
gorithm performance significantly, the finding that the Exponentiated Gradient
and Anticor algorithms actually benefit from restriction to two-asset portfolios
also allows more fair comparison of the different algorithms, comparing the dif-
ferent algorithms’ performance on portfolios containing the exact same pair of
assets.

The performance on real life data has proven to be quite impressive at times,
especially when using the concept of side information to improve the standard
algorithm weight calculations. Several portfolios could provide fifteenfold in-

34
creases of capital invested over an investment window of six to seven years. On
average over a large amount of tests, the algorithms perform in the order (best
to worst) EG, Anticor, Universal Portfolio, CPPI, but for certain choices of as-
sets especially adapted to the mean reversion and anticorrelation assumptions
of the algorithm, the Anticor algorithm outperforms all the other algorithms.

35
Bibliography

[1] P. Bertrand and J.-L.Prigent, Portfolio Insurance Strategies: OBPI versus


CPPI, Working Paper, Université de Cergy, 2002.
[2] F. Black and R. Jones, Simplifying Portfolio Insurance, The Journal of
Portfolio Management, 1987 48-51.
[3] A. Blum and A. Kalai, Universal Portfolios With and Without Transac-
tion Costs, Annual Workshop on Computational Learning Theory, Carne-
gie Mellon University, May 1997.
[4] A. Borodin et al, Can We Learn to Beat the Best Stock, Journal of Artificial
Intelligence Research 21 (2004) 579-594.
[5] J.-F. Boulier and A. Kanniganti, Expected Performance and Risks of Vari-
ous Portfolio Insurance Strategies, 5th AFIR International Colloquium.
[6] T.M. Cover, Universal Portfolios, Mathematical Finance, 1(1): 1-29, Janu-
ary 1991. Updated: Stanford University, October 1996.
[7] T.M. Cover and D. Julian, Performance of Universal Portfolios in the
Stock Market, Proceedings of IEEE International Symposium on Informa-
tion Theory, Sorrento, Italy, June 2000.
[8] T.M. Cover and E. Ordentlich, Universal Portfolios with Side Information,
IEEE Transactions on Information Theory, vol. 42, no. 2, March 1996.
[9] D.P. Helmbold et al, On-Line Portfolio Selection Using Multiplicative Up-
dates, Mathematical Finance, 8(4):325-347, 1998.
[10] G.N. Iyengar and T.M. Cover, Growth Optimal Investment in Horse Race
Markets with Costs, IEEE Transactions on Information Theory, vol. 46, no.
7, November 2000.
[11] A. Kalai and S. Vempala, Efficient Algorithms for Universal Portfolios,
Journal of Machine Learning Research 3 (2002) 423-440.
[12] E. Ordentlich and T.M. Cover, The Cost of Achieving the Best Portfolio in
Hindsight, Mathematics of Operations Research, 23(4):960-982, November
1998.
[13] A. Perold and W.F. Sharpe, Dynamic Strategies for Asset Allocation, Fin-
ancial Analysts Journal, January-February 1988 16-27.

36

You might also like