the convex-concave algorithm applied to portfolio analysis

44
Delft University of Technology Faculty Electrical Engineering, Mathematics and Computer Science Delft Institute of Applied Mathematics The convex-concave algorithm applied to portfolio analysis Report for the Delft Institute of Applied Mathematics as part of obtaining the degree of BACHELOR OF SCIENCE in APPLIED MATHEMATICS by J. M. Zijdenbos Delft, the Netherlands June 2016 Copyright 2016 by Jacqueline Zijdenbos. All rights reserved.

Upload: others

Post on 23-Feb-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The convex-concave algorithm applied to portfolio analysis

Delft University of TechnologyFaculty Electrical Engineering, Mathematics

and Computer ScienceDelft Institute of Applied Mathematics

The convex-concave algorithmapplied to portfolio analysis

Report for theDelft Institute of Applied Mathematics

as part of obtaining

the degree of

BACHELOR OF SCIENCEin

APPLIED MATHEMATICS

by

J. M. Zijdenbos

Delft, the NetherlandsJune 2016

Copyright ©2016 by Jacqueline Zijdenbos. All rights reserved.

Page 2: The convex-concave algorithm applied to portfolio analysis
Page 3: The convex-concave algorithm applied to portfolio analysis

BSc report APPLIED MATHEMATICS

“The convex-concave algorithmapplied to portfolio analysis”

Jacqueline Madelinde Zijdenbos

Delft University of Technology

Thesis advisor

Prof.dr. E. de Klerk

Other members of the graduation committee

Drs. E.M van Elderen

Dr. D.C. Gijswijt

Dr. D. Kurowicka

June, 2016 Delft

Page 4: The convex-concave algorithm applied to portfolio analysis
Page 5: The convex-concave algorithm applied to portfolio analysis

Abstract

Mathematical computations are widely used to give some insight into thestock market. We investigate the convex-concave algorithm for nonlinearoptimization applied to portfolio analysis, one of its many applications. Wewill consider the Markowitz mean-variance model with higher order mo-ments added, and look at the preferences for the investor to his odd andeven moments. The nonlinear objective functions may not necessarily beconvex nor concave. We write the objective function as the sum of a convexand concave function. Using the fact that it is easy to minimize convex func-tions on convex compact sets (under some assumptions), and linearizing theconcave function at a fixed point, we optimize ‘easy’ convex sub-problemsat each iteration. This so-called convex-concave procedure is known to con-verge to a KKT point.

Page 6: The convex-concave algorithm applied to portfolio analysis

Preface

This research had been done as a final project for the Bachelor programof Applied Mathematics at Delft University of Technology, which has takenplace in the fourth period of the academic year of 2015/2016. Under super-vision of Etienne de Klerk of the optimization department at TU Delft, Iinquired several mathematical areas, such as convex analysis and statistics.The main component in this thesis is optimization.

First of all, I would like to acknowledge Georgina Hall, PhD-student atPrinceton University in New-Jersey, for making her research available. Also,Dr.ir. M.B. van Gijzen for always being patient and helpful. The completionof my project could not have been accomplished without the support andencouragement of my supervisor Prof.dr. E. de Klerk.

Jacqueline ZijdenbosDelft, June 2016

i

Page 7: The convex-concave algorithm applied to portfolio analysis

Table of contents

Preface i

Introduction 2

1 Convex Optimization 31.1 Convex sets and functions . . . . . . . . . . . . . . . . . . . . 31.2 Difference of convex functions . . . . . . . . . . . . . . . . . . 5

2 Convex-Concave Procedure 72.1 Convex-concave algorithm . . . . . . . . . . . . . . . . . . . . 72.2 Feasible points . . . . . . . . . . . . . . . . . . . . . . . . . . 92.3 Extending CCP if no feasible point is available . . . . . . . . 11

3 Decomposition 133.1 Difference of convex decomposition . . . . . . . . . . . . . . . 133.2 SOS-convexity . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4 Portfolio Analysis 17

5 Numerical Approach 195.1 Non-convexity . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.2 Optimal portfolio . . . . . . . . . . . . . . . . . . . . . . . . . 225.3 Comparing results . . . . . . . . . . . . . . . . . . . . . . . . 23

6 Conclusions and Recommendations 25

A Datasets 27

B Matlab Code 35B.1 GetData.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35B.2 CCP.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37B.3 calcmin.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

1

Page 8: The convex-concave algorithm applied to portfolio analysis

Introduction

With a world obsessed with money, and lower and lower interest rates, peo-ple are looking for different ways to make money. The stock market bringsa solution. But when you think about finance, you cannot help it but thinkabout the mathematics behind it too. Would it be possible to make smarterdecisions about where to invest your money?

Optimization algorithms are widely known and investigated. Many ap-plications rely on a special form of optimization, convex optimization, toensure that solutions exist. When an objective function is not necessarilyconvex or concave, we might not be able to use those algorithms. There-for, we will consider the convex-concave algorithm. It is a particular simpletechnique to solve nonlinear optimization problems. Applying the algorithmto portfolio analysis might give us new insights in investing.

Figure 1: Coca Cola Company stock certificate.1

In portfolio optimization we seek the best way to invest some capital ina set of n assets. We require that investments are nonnegative, i.e. no shortselling is allowed. We will consider the Markowitz mean-variance model withhigher moments added. We add skewness, the extend to which the data isnot symmetrical, and kurtosis, which indicates how the tails and peak of adistribution differ from the normal distribution.

Chapter 1 will give us a framework around convex optimization and someunderstanding about difference of convex functions. Chapter 2 will introducethe CCP algorithm, some of its advantages and characteristics. Chapter 3will show use how and why we can decompose functions into the sum ofa convex and a concave function, which is necessary for the algorithm. InChapters 4 and 5 we will explain the application of the algorithm, portfolioanalysis. We will work out some numerical results.

1Image retrieved fromhttp://aoghs.org/stocks/no-millionaire-from-old-oil-stock/.

2

Page 9: The convex-concave algorithm applied to portfolio analysis

Chapter 1

Convex Optimization

In this chapter we will discuss some basic theory about convex optimization[4], a special case of a standard optimization problem. When we definedconvex functions and sets, we can look at difference of convex functions andtheir characteristics. This chapter forms the theoretical basis for chaptertwo.

1.1 Convex sets and functions

A mathematical optimization problem has the form

minimize f0(x)

subject to fi(x) ≤ ci, i = 1, ...,m, (1.1)

where the vector x = (x1, ..., xn) is the optimization variable. The func-tion f0 : Rn → R is the objective function, the functions fi : Rn → R,i = 1, ...,m, are the constraint functions, and the constants c1, ..., cm are thebounds for the constraints.

A vector x∗ is called a solution of the problem (1.1), or optimal, if it hasthe smallest objective value among all vectors that satisfy the constraints.Hence, for any y ∈ Rn with f1(y) ≤ 0, ..., fm(y) ≤ 0, we have f0(y) ≥ f0(x∗).

The optimization problem (1.1) is called a linear program if the objectiveand constraint functions f0, ..., fm are linear, i.e. all x, y ∈ Rn and allα, β ∈ R satisfy

fi(αx+ βy) = αfi(x) + βfi(y). (1.2)

A set X is convex if the line segment between any two points in X liesin X, i.e. if for any x, y ∈ X and any λ with 0 ≤ λ ≤ 1, we have

λx+ (1− λ)y ∈ X. (1.3)

For instance, circles and ellipsoids are convex sets, while star-shaped orhorseshoe shaped objects are not. In Figure 1.1 we see an example of aconvex and a non-convex set in R2.

3

Page 10: The convex-concave algorithm applied to portfolio analysis

Figure 1.1: Example of a convex set (left)and a non-convex set (right).

Let X be a convex set in a real vector space and let f : X → R bea function. A function f is called convex if for any x, y ∈ X and λ ∈ [0, 1]

f(λx+ (1− λ)y) ≤ λf(x) + (1− λ)f(y). (1.4)

Let X be a convex set in a real vector space and let f : X → R bea function. A function f is called concave if −f is convex. Note that iff, g : X → R are convex, then the sum of f and g is also a convex function.In Figure 1.2 we can easily see that f(x) = x2 is convex and that f(x) = x3

is non-convex.

Figure 1.2: Example of a convex function (left)and a non-convex function (right).

Suppose f is a differentiable function, i.e. its gradient ∇f exists at eachpoint in dom(f). Then f is convex if and only if dom(f) is convex and

f(y) ≥ f(x) +∇f(x)T (y − x) (1.5)

holds for all x, y ∈ dom(f). This is called the first-order convexity condition.

4

Page 11: The convex-concave algorithm applied to portfolio analysis

1.2 Difference of convex functions

Many optimization problems rely on the use of convex optimization toensure that solutions exist and can be computed. In the case that a objectivefunction or constraints are not convex, the methods we know might notbe applicable anymore [4]. We will introduce Difference of Convex (DC)functions, which will make it possible to use some of the known methodsagain, such as interior-point methods.

Definition 1.1. A difference of convex programming problem is an opti-mization problem of the form

minimize g0(x)− h0(x)

subject to gi(x)− hi(x) ≤ 0, i = 1, ...,m, (1.6)

where x ∈ Rn is the optimization variable and gi : Rn → R, hi : Rn → Rare convex for i = 0, ...,m.

Theorem 1.1. The function f is convex if and only if the Hessian H(x) ispositive semi-definite for every x in the convex domain of f . This is calledthe second-order convexity condition.

A function f defined on a convex set D is a difference of convex functionsat a point x∗ of D if there exists an ε > 0 such that f is DC on B(x∗, ε)∩D.When a function is DC at every point of x in D, it is said to be locally DCon D.

Theorem 1.2 (Hartman [5], 1959). Let D be a convex set in anm−dimensional Euclidean space and let D be either open or closed. Let fbe locally DC on D. Then f is DC on D.

The group of DC functions is very broad, but not all functions are DC.We will give a few examples that are useful for our research. First of all,it is clear that every convex function itself can be written as a difference ofconvex functions. From Hartman it follows that functions f ∈ C2, wherethe derivatives f ′ and f ′′ exist and are continuous, are DC too.

Corollary 1.1. Every function f ∈ C2 can be expressed as the difference ofconvex functions.

Proof. Let f : Rn → R have a continuous Hessian and ε > 0. Let x∗ be apoint in the convex domain of f . We construct functions g and h, such thatthey are convex on B(x∗, ε) and f = g − h.

There exists an 0 < M ∈ R such that for all x ∈ B(x∗, ε)

1

2H(x) + 2MI positive semi-definite and (1.7)

5

Page 12: The convex-concave algorithm applied to portfolio analysis

2MI − 1

2H(x) positive semi-definite. (1.8)

Note that the expression in (1.7) is the Hessian at x of

g(x) =1

2f(x) +M‖x‖2

and (1.8) is the Hessian at x of

h(x) = M‖x‖2 − 1

2f(x).

By Theorem 1.1 we find that g and h are convex on B(x∗, ε). We have

f(x) =1

2f(x) +M‖x‖2 −

(M‖x‖2 − 1

2f(x)

)= g(x)− h(x). (1.9)

Hence, f = g − h is locally DC and from Theorem 1.2, it follows thatf is DC.

In particular, it follows that polynomials are DC. In the application ofportfolio analysis we only use polynomials. Hence, we will always be ableto write our optimization problem in the form (1.6).

6

Page 13: The convex-concave algorithm applied to portfolio analysis

Chapter 2

Convex-Concave ProcedureWe will take a look at nonlinear optimization. We will investigate the basicconvex-concave procedure (CCP), an algorithm to find a local optimum of(1.6) quickly. We use that so we can solve convex optimization problemsefficiently. Writing each nonlinear function as the sum of a convex andconcave function (or equivalently, the difference of convex functions), givesus an easy to solve convex part. The concave function can be linearizedat a fixed point. This will give us an approximate solution to the originalproblem.

2.1 Convex-concave algorithm

Since global methods for solving DC problems are often slow in practice, wewill look at local heuristics that can find solutions rapidly. CCP is an at-tractive algorithm because of its simplicity. An advantage of CCP is that allof the information from the convex component of each term can be retained.

DC problems have been studied for several decades and turn out to behard to solve in general [9]. The entire set of DC programming problemsis NP-hard. Recall that a decision problem K is NP-hard when for everyproblem L in NP, there is a polynomial-time reduction from L to K. Tosee this, we will write the Boolean linear program (LP) as a DC program.Boolean LP can represent problems that are thought to be NP-hard, likethe traveling salesman problem. Let x ∈ Rn be the optimization variable,and let c ∈ Rn, A ∈ Rm×n and b ∈ Rm be problem data. Then

minimize cTx

subject to xi ∈ {0, 1}, i = 1, ..., n

Ax ≤ b,(2.1)

can be casted as a DC problem of the form (1.6)

minimize cTx

subject to x2i − xi ≤ 0, i = 1, ..., n

xi − x2i ≤ 0, i = 1, ..., n

Ax− b ≤ 0.

(2.2)

7

Page 14: The convex-concave algorithm applied to portfolio analysis

Hence, the Boolean LP (2.1) is a subclass of DC programs (1.6). Thus,DC problems are NP-hard to solve in general.

For the ease of notation we will assume that all of the gi and hi aredifferentiable. By replacing the gradient in a point with the subgradient inthat point, we can also work with non-differentiable functions.

The CCP algorithm relies on a stopping criterion. A reasonable stoppingcriterion [1],[9] is that the improvement in the objective value is less thansome δ > 0, i.e.

0 < (g0(xk)− h0(xk))− (g0(xk+1)− h0(xk+1)) ≤ δ. (2.3)

Another criterion would be that the norm of the gradient of g0 gets small.

Algorithm 1. Basic CCP algorithm.

given an initial feasible point x0.k ← 0.repeat

1. Convexify. Form hi(x;xk) := hi(xk) +∇hi(xk)T (x− xk)for i = 0, ...,m.

2. Solve. Set the value of xk+1 to a solution of the convex problem

minimize g0(x)− h0(x;xk)

subject to gi(x)− hi(x;xk) ≤ 0, i = 1, ...,m.(2.4)

3. Update iteration. k ← k + 1.

until stopping criterion is satisfied.

Proposition 2.1. The iterates xk from Algorithm 1 are feasible for all k.

Proof. The algorithm requires an initial feasible point, so gi(x0)−hi(x0) ≤ 0for i = 1, ...,m. Now let xk be a feasible point for our DC problem (1.6),i.e. gi(xk) − hi(xk) ≤ 0 for i = 1, ...,m. It must be then shown thatgi(xk+1)− hi(xk+1) ≤ 0 for all i = 1, ..,m.

Since, gi(xk)− hi(xk;xk) = gi(xk)−hi(xk), it follows that xk is a feasiblepoint for the convexified subproblem (2.4).

From the definition of hi it follows that

hi(x;xk) ≤ hi(x) ∀x, so,

gi(x)− hi(x) ≤ gi(x)− hi(x;xk).

8

Page 15: The convex-concave algorithm applied to portfolio analysis

Combining all results, and let x = xk+1, we see that xk+1 is a feasible pointfor our DC programming problem (1.6),

gi(xk+1)− hi(xk+1) ≤ gi(xk+1)− hi(xk+1;xk) ≤ 0,

since xk+1 is a feasible point for the convexified subproblem (2.4). By math-ematical induction, all iterates are feasible.

Proposition 2.2. The basic CCP Algorithm 1 is a descent algorithm.

Proof. Recall that a descent algorithm is an algorithm were the objectivevalue, g0(xk) − h0(xk), is a monotonically non-increasing sequence w.r.t.k = 0, 1, . . . . Let fk = g0(xk)− h0(xk). Then

fk = g0(xk)− h0(xk) = g0(xk)− h0(xk;xk) ≥ g0(xk+1)− h0(xk+1;xk).

Note that the last inequality follows from the fact that at each iteration kwe minimize the value of g0(x)− h0(x;xk). Now choosing xk+1 = xk we find

fk ≥ g0(xk+1)− h0(xk+1;xk) ≥ fk+1.

Hence, the sequence {fi}∞i=0 is monotonically non-increasing.

2.2 Feasible points

If we begin with an initial feasible point, all points will be feasible, so thatthe objective value decreases. But CCP gives us a local heuristic, and thefinal point found may depend on the initial point x0, which is not necessarilya local minimum. We will give an step-by-step example. Let

f(x) = g(x)− h(x) = x4 − x2. (2.5)

Figure 2.1: f(x) = x4 − x2.

9

Page 16: The convex-concave algorithm applied to portfolio analysis

It is clear that g(x) = x4 and h(x) = x2 are both convex. From basicalgebra it follows that we have minimum value −0.25 at x = ± 1√

2. From

inspection we see that we have a local maximum at x = 0. We will applyAlgorithm 1 with an initial feasible point that gives us a local (and global)minimum, and an initial feasible point that gives us the local maximum.

Let x0 = 1. Apply the Basic CCP algorithm. Let k = 0. We want toconvexify the concave part of f , which is h. Note that ∇h(xk) = 2xk and

h(x;xk) = h(xk) +∇h(xk)T (x− xk) = 2xxk − x2

k. (2.6)

Setting xk+1 to a solution of the convexified subproblem

minimize x4 − 2xxk + x2k

gives us the following results.

xk x4k − x2

k − (x4k+1 − x2

k+1) x4k − x2

k

x1 = 0.7937 0.2331 −0.233x2 = 0.7349 0.0153 −0.248x3 = 0.7162 0.0014 −0.249x4 = 0.7101 0.0002 −0.250

Hence, we see that the algorithm converges to the local minimum, withvalue −0.25 and x = 1√

2≈ 0.7071.

Now let x0 = 0. Execute the algorithm. Form

h(x;x0) = h(x0) +∇h(x0)T (x− x0) = x20 + 2x0(x− x0) = 0. (2.7)

We set x1 to a solution of the convex subproblem

minimize g(x)− h(x;x0). (2.8)

Which is equivalent to minimizing g(x) = x4. Hence x1 = 0. We have

g(x0)− h(x0)− (g(x1)− h(x1)) = x40 − x2

0 − (x41 − x2

1) = 0. (2.9)

Thus xk = 0 for all k. Now x = 0 gives us the optimal value of 0, which isa local maximum as seen in Figure (2.1).

10

Page 17: The convex-concave algorithm applied to portfolio analysis

2.3 Extending CCP if no feasible point is available

We have seen that for the basic CCP algorithm we need an initial feasiblepoint. The final point found may depend on the initial point x0. In casethat no feasible point can be found, we want to work with an extension ofthe algorithm, that does not require the initial point to be feasible. As oftenused in optimization, we will make use of slack variables. Adding the slackvariables to the constraints and approaching the sum of the violations.

Algorithm 2. Penalty CCP.

given an initial point x0, τ0 > 0, τmax, and µ > 1.k ← 0.repeat

1. Convexify. Form hi(x;xk) := hi(xk) +∇hi(xk)T (x− xk)for i = 0, ...,m.

2. Solve. Set the value of xk+1 to a solution of the convex problem

minimize g0(x)− h0(x;xk) + τk

m∑i=1

si

subject to gi(x)− hi(x;xk) ≤ si, i = 1, ...,m.

si ≥ 0, i = 1, ...,m.

(2.10)

3. Update τ . τk+1 := min(µτk, τmax).

4. Update iteration. k ← k + 1.

until stopping criterion is satisfied.

11

Page 18: The convex-concave algorithm applied to portfolio analysis

12

Page 19: The convex-concave algorithm applied to portfolio analysis

Chapter 3

Decomposition

To use the Basic CCP algorithm, we need our functions to be in the form of(1.6). Many problems will be in this form already, but such a decompositionmight not be available in all cases.

3.1 Difference of convex decomposition

Definition 3.1. A polynomial g is a difference of convex decomposition(DCD) of a polynomial f if g is convex and g − f is convex.

Note that if we let h = g − f , the function f is indeed a difference ofconvex functions f = g−h as defined before. We want to determine whetherone can compute a difference of convex decomposition of a given function.Once we find one, we see that these DC decompositions are not unique, youcan find infinitely many others. If f = g − h, with g and h convex, thenevery convex function p gives us a new DCD, f = (g + p)− (h+ p).

But what is a good decomposition? To answer this question, we willintroduce undominated DC decompositions for polynomials.

Definition 3.2. Let g be a DCD of f . A DCD g′ of f is said to dominate gif g− g′ is convex and non-affine. A DCD g of f is undominated if no DCDof f dominates g.

We have seen in Corollary 1.1 that any polynomial f has a DCD g.Unfortunately, it is not easy to check whether a function g is a DCD of f .

Proposition 3.1 (Ahmadi & Hall [1], 2015). Given two n−variate polyno-mials f and g of degree 4, with f 6= g, it is strongly NP-hard to determinewhether g is a DCD of f , i.e. not even a pseudo-polynomial time algorithmcan exist unless P = NP .

Proposition 3.2. Let g and g′ be two DCDs of f . Define the convex func-tions h := g − f and h′ := g′ − f , and assume that g′ dominates g. For apoint x0 in Rn, define the convexified versions of f

fg(x) := g(x)− (h(x0) +∇h(x0)T (x− x0)),

fg′(x) := g′(x)− (h′(x0) +∇h′(x0)T (x− x0)).

13

Page 20: The convex-concave algorithm applied to portfolio analysis

Then, we havefg′(x) ≤ fg(x) ∀x.

Proof. As g′ dominates g, there exists a non-affine convex polynomial c suchthat c = g − g′. We then have g′ = g − c and h′ = h− c, and

fg′(x) = g(x)− c(x)− (h(x0)− c(x0) +∇h(x0)T (x− x0)−∇c(x0)T (x− x0))

= fg(x)− (c(x)− c(x0)−∇c(x0)T (x− x0)).

The first-order condition of convexity of c then gives us

fg′(x) ≤ fg(x) ∀x.

Essentially, Proposition 3.2 shows us that if we start with an initial pointand apply one iteration of the CCP Algorithm 2.4, the solution obtained us-ing a DC decomposition g would always beat an iterate obtained using aDCD dominated by g [3]. Hence, it is preferable to minimize the undomi-nated function fg′ to fg.

We now know that we can always find DCDs for our optimization prob-lem, but the question remains whether we can construct these decomposi-tions in an acceptable time frame. The next theorem shows that the optimalsolution to the following optimization problem will always give an undomi-nated DCD. Let Hn,2d denote the set of n-variate polynomials of degree atmost 2d. Let Sn−1 denote the unit sphere in Rn, Γ the gamma function andσ the rotation invariant probability measure on Sn−1.

Theorem 3.1 (Ahmadi & Hall [1], 2015). Let f ∈ Hn,2d and consider theoptimization problem

ming∈Hn,2d

1

An

∫Sn−1

Tr (Hg) dσ

s.t. g convex,

g − f convex,

(3.1)

where A = 2πn/2

Γ(n/2) is a normalization constant which equals the area of Sn−1.

Then, an optimal solution to (3.1) exists and any optimal solution is anundominated DCD of f . Here, Hg is the Hessian of g.

The integral of the polynomial over a sphere conveniently correspondsto a linear combination of its coefficients. Unfortunately, some basic tasksrelated to DC decompositions are computationally intractable. The inter-ested reader is referred to [1], where three subsets of convex polynomials areintroduced that lend themselves to polynomial-time algorithms. We onlyreview the set of SOS-convex polynomials.

14

Page 21: The convex-concave algorithm applied to portfolio analysis

3.2 SOS-convexity

Denote the set of nonnegative polynomials in n variables and of degree d byPSDn,d.

Definition 3.3. A polynomial p is a sum of squares (SOS) if it can bewritten as p(x) =

∑ri=1 q

2i (x) for some polynomials q1, ..., qr. The set of

SOS polynomials in n variables and of degree d is denoted by SOSn,d.

It follows that we now have the inclusion SOSn,d ⊆ PSDn,d.

Definition 3.4. Let y = (y1, ..., yn)T be a vector of variables. A polynomialp := p(x) is said to be SOS-convex if yTHp(x)y =

∑ri=1 q

2i (x, y) is SOS in

the variables (x, y) for some polynomials qi : R2n → R, i = 1, ..., r.

In particular, a polynomial p of degree 2d is SOS if and only if it canbe written as p(x) = zTn,d(x)Qzn,d(x), for some positive semi-definite matrixQ. Later, we will see that we only use polynomials with degree 4, so we canimpose SOS-convexity.

Proposition 3.3 (Ahmadi & Hall [1], 2015). Consider a vector space Eand a full-dimensional cone K ⊆ E. Then, any v ∈ E can be written asv = k1 − k2, where k1, k2 ∈ K.

In our particular case, let E be the set of all polynomials and let K bethe SOS-convex cone, containing all SOS-convex polynomials, as visualizedin Figure 3.1. Then we can write any polynomial as the difference of twoSOS-convex polynomials. This leads to the following theorem.

Figure 3.1: Illustration decomposing a polynomialas difference of two SOS-convex polynomials in K.

Theorem 3.2 (Ahmadi & Hall [1], 2015). Any polynomial p can be writtenas the difference of two SOS-convex polynomials.

15

Page 22: The convex-concave algorithm applied to portfolio analysis

An SOS optimization problem is the problem of minimizing a linearfunction over the intersection of the convex cone SOSn,d with an affine sub-space. Such problems may be solved efficiently for fixed d [8].

If we replace the convexity constraints in problem (3.1) with the com-putationally tractable condition

f = g − h, g, h SOS-convex,

we find that any optimal solution is not dominated by any SOS-convex de-composition.

Using semidefinite programming tools, MOSEK1 and SPOT [11], wedecompose f = g − h. Here g SOS-convex, h SOS-convex and f is theundominated decomposition, which is always possible by Theorem 3.2.

Since we can always decompose the objective function, we can createthe convexified subproblem. Leonid Khachiyan proved that these convexproblems can be solved in polynomial time, using the ellipsoid method [2].

1Latest version available at http://www.mosek.com.

16

Page 23: The convex-concave algorithm applied to portfolio analysis

Chapter 4

Portfolio Analysis

We will use our convex-concave algorithm on practical nonlinear optimiza-tion problems. An interesting problem in finance is portfolio optimization.The problem of selecting portfolios has been studied for several decades.As seen in [10], Markowitz introduced the classical mean-variance portfoliooptimization model. We will consider the expanded model from Klenati andRustem [7, 6], who incorporated skewness and kurtosis to the classical model.

Now, the investor wants to maximize the expected return and the skew-ness of the portfolio and minimize its risk and kurtosis, subject to budgetand no short selling constraints. Here, the expected return is the mean, therisk is the variance, skewness is the third central moment and kurtosis is thefourth central moment.

We will introduce some notation. N is the total number of returns onasset i, where i = 1, ..., n with n the number of assets. Rit denotes thereturn on asset i at time t. Let the stochastic variable Ri express the returnon asset i. Note that we see Rit as a realization of Ri. To calculate theasset return, we need data. In our case, historical stock prices. Denote twohistorical closing stock prices as Pi,t and Pi,t+T , where T is a time period(day/month/year) and t = 1, ..., N + 1. Then

Rit =Pi,t+T − Pi,t

Pi,t. (4.1)

Let µi be the mean of Ri and σij be the covariance between Ri and Rj .Let sijk be the coskewness of Ri, Rj and Rk and kijkl the cokurtosis of Ri,Rj , Rk and Rl. The formula for the asset statistics are as seen in Table (4.1).Note that we use the terms skewness and kurtosis in an informal way.

17

Page 24: The convex-concave algorithm applied to portfolio analysis

Moment Definition Statistical estimator

µi E[Ri]1N

N∑t=1

Rit

σij E[(Ri − µi)(Rj − µj)] 1N−1

N∑t=1

(Rit − µi)(Rjt − µj)

sijk E[(Ri − µi)(Rj − µj)(Rk − µk)] 1N

N∑t=1

(Rit − µi)(Rjt − µj)(Rkt − µk)

kijkl E[(Ri − µi)(Rj − µj)(Rk − µk)(Rl − µl)] 1N

N∑t=1

(Rit − µi)(Rjt − µj)(Rkt − µk)(Rlt − µl)

Table 4.1: Formula asset statistics.

For a portfolio consisting of n assets the vector µ ∈ Rn is formed by thecollection of mean estimates µ1, ..., µn. The covariance estimates form thematrix Σ = (σij). The coskewness and the cokurtosis estimates form thesymmetric tensors S = (sijk) and K = (kijkl), respectively.

We will need input parameters, so we can express what the preference isfrom the investor towards the importance of his odd moments and his evenmoments. Here, λi is nonnegative for all i = 1, ..., 4 and they sum up to one.The percentage of the total amount invested on each asset is represented byxi. We exclude short sales, so xi ≥ 0 for all i. We have a set of feasibleportfolios,

X =

{x ∈ Rn

∣∣∣ n∑i=1

xi = 1, x ≥ 0

}. (4.2)

Note that X is a simplex. If we know (µi), (σij), (sijk) and (kijkl)exactly, we can formulate the optimization problem for portfolio analysis:

maxx∈X

λ1

n∑i=1

µixi − λ2

n∑i,j=1

σijxixj + λ3

n∑i,j,k=1

sijkxixjxk − λ4

n∑i,j,k,l=1

kijklxixjxkxl.

(4.3)

Notice that (4.3) is a polynomial optimization problem and therefor afunction in C2. By Corollary 1.1 it follows that we can write this functionsas the difference of convex functions.

In practice, we do not know (µi), (σij), (sijk) and (kijkl) and replacethem in (4.3) by their estimates from Table 4.1.

Once we find an optimal solution for this problem, we can calculate theexpected return on the total portfolio,

R =

n∑i=1

xiRi. (4.4)

18

Page 25: The convex-concave algorithm applied to portfolio analysis

Chapter 5

Numerical Approach

In this chapter we will apply the convex-concave algorithm 1 to (4.3) toderive some results. We use historical stock prices that form the DowJones Industrial Average, or Dow 30, as in [7]. We obtain the data fromuk.finance.yahoo.com that cover the period between 2 April 1990 and 3May 2006 on a monthly basis. All of our numerical examples and results wereobtained using MATLAB and the polynomial optimization library SPOT[11].

To use the CCP algorithm 1 we need a stopping criterion. Since we havea descent algorithm, we will use the stopping criterion as in (2.3), that theimprovement in the objective value is less than some δ. Let δ = 1e-08.

For arbitrary investor’s preferences (λ1, λ2, λ3, λ4), as seen in Table 5.3,and for several combinations of stocks we created a number of models basedon (4.3). The portfolio of 3 assets includes the AT&T, Bank of America andWalt Disney stocks. The portfolio of six assets includes the Alcoa, Amex,Caterpillar, Cisco, General Electric and Hewlett-Packard stocks.

The moments used are available in Tables 5.1 and 5.2. For a convenientpresentation, the covariance, coskewness and cokurtosis are not presented.The entire dataset is available in Appendix A.

Assets µi σii siii kiiiiAT&T 0.000338955848914 0.007354290695073 −0.000897037620023 0.000612744028175

Bank of America 0.006629423509432 0.009473444702364 −0.001022868903926 0.000812542429723Walt Disney 0.001455380192568 0.011475667281834 −0.003587946235393 0.002772831656928

Table 5.1: Moments of portfolio with 3 assets used.

Assets µi σii siii kiiiiAlcoa 0.003997153373401 0.012500347505193 −0.001288201911778 0.001573831375441Amex 0.008431540201041 0.008026839508638 −0.001686956194991 0.001056381663556

Caterpillar 0.007622706357170 0.011084493273140 −0.001483902952310 0.001165851483582Cisco 0.014924957519103 0.026577924125927 −0.003974833291967 0.003437508903021

General Electric 0.002714474033557 0.008719923355633 −0.002490121001584 0.001596776126619Hewlett-Packard 0.007824794974228 0.016366681577515 −0.001859392555523 0.001691961456330

Table 5.2: Moments of portfolio with 6 assets used.

19

Page 26: The convex-concave algorithm applied to portfolio analysis

Model λ1 λ2 λ3 λ4

1 0.267 0.256 0.252 0.2252 0.464 0.101 0.427 0.0083 0.430 0.123 0.114 0.3334 0.049 0.489 0.021 0.4415 0.243 0.301 0.295 0.1616 0.025 0.171 0.784 0.0207 1.000 0.000 0.000 0.0008 0.000 1.000 0.000 0.0009 0.000 0.000 1.000 0.00010 0.000 0.000 0.000 1.000

Table 5.3: Investor’s preferences towards four portfolio moments.

From here on, let CCPi n denote our optimization problem instance,where we use the CCP algorithm, i denotes the model number and n denotesthe number of assets used. Analogously, fminconi n denotes the probleminstance solved by fmincon.

5.1 Non-convexity

Now that we have seen what the convex-concave algorithm is, we still havenot answered the question why we need this algorithm. We use the Matlabfunction fmincon, a function that can find the minimum of a constrainednonlinear multivariable function. Why wouldn’t this function solve (4.3)directly without the need for the CCP algorithm? We will provide you withsome examples of non-convex and non-concave functions to show the use ofthe convex-concave algorithm.

We know by Theorem 1.1 that we can prove convexity, or non-convexityby looking at the Hessian. To show a problem is not convex, we have to finda portfolio, x∗, such that the Hessian H(x∗) is not positive semi-definite.

Proposition 5.1. If a symmetric matrix A = (aij) is positive semi-definite,then all the diagonal elements are non-negative.

Proof. Let A be a symmetric, positive semi-definite matrix. Let aii < 0 forsome i. Let ei be the ith standard unit vector. Then eTi Aei = aii < 0. SoA is not positive semi-definite, which gives a contradiction.

Analogously, a negative semi-definite Hessian at a point x implies thatthe diagonal elements are all non-positive. Hence, it suffices to work outsome examples where the Hessian has both positive and negative diagonalelements. First, we will calculate those diagonal elements for the model with

20

Page 27: The convex-concave algorithm applied to portfolio analysis

3 assets, (λ1, λ2, λ3, λ4) and portfolio x∗ = (x1, x2, x3) as seen below.

∂2f∂x21

= λ2 ·(0.014709

)− λ3 ·

((0.0053822) · x1 + (3.178e-05) · x2 + (−0.00054246) · x3

)+ λ4 ·

((0.007353) · x2

1 + (0.00052526) · x22 + (0.00071742) · x2

3

+(0.00074046) · x2 · x1 + (−0.00038598) · x3 · x1 + (0.0002497) · x3 · x2

)∂2f∂x22

= λ2 ·(0.018947

)− λ3 ·

((−0.00058662) · x1 + (0.0061374) · x2 + (0.0005973) · x3

)+ λ4 ·

((0.00052526) · x2

1 + (0.0097506) · x22 + (0.00091256) · x2

3

+(−0.00065016) · x2 · x1 + (0.000247) · x3 · x1 + (0.0028278) · x3 · x2

)∂2f∂x23

= λ2 ·(0.022952

)− λ3 ·

((−2.1224e-05) · x1 + (0.00052002) · x2 + (0.021528) · x3

)+ λ4 ·

((0.00071742) · x2

1 + (0.00091256) · x22 + (0.033273) · x2

3

+(0.00040632) · x2 · x1 + (0.00094056) · x3 · x1 + (0.0016685) · x3 · x2

)Note that the value of λ1 is irrelevant for the convexity of a function.

The covariance elements are always positive, so increasing λ2 will only in-crease the values of the positive constants added.

Lets take a look at Model 9. We observe that if we only have to considerthe terms that belong to λ3, we can easily find a non-convex, non-concavefunction. Let x∗ =

(0, 1

2 ,12

). Then

∂2f∂x21

(x∗) = 0.00025534 ∂2f∂x22

(x∗) = −0.00336735 ∂2f∂x23

(x∗) = −0.01102401.

Hence, the function is not convex, since the Hessian has a negative di-agonal element, and the function is not concave, since the Hessian has apositive diagonal element.

Using the same arguments for Model 9, (λ1, λ2, λ3, λ4) = (0, 0, 1, 0), with6 assets we find for x∗ =

(12 ,

12 , 0, 0, 0, 0

)∂2f∂x21

(x∗) = 0.00321790 ∂2f∂x22

(x∗) = 0.00597990 ∂2f∂x23

(x∗) = −0.00296085

∂2f∂x24

(x∗) = −0.00198055 ∂2f∂x24

(x∗) = 0.00493272 ∂2f∂x26

(x∗) = −0.00056285.

Again, it is easy to see that we can have non-convex and non-concavefunctions. This leads to the following Corollary.

Corollary 5.1. Problem (4.3) is non-convex in general.

We will show that our CCP algorithm 1 works for convex instances andnon-convex instances.

21

Page 28: The convex-concave algorithm applied to portfolio analysis

5.2 Optimal portfolio

After calculating the asset returns from the historical stock prices using(4.1), we can compute the assets statistics (µi), (σij), (sijk) and (kijkl)from Table 4.1 for all i, j, k, l = 1, ..., n. Table 5.4 and Table 5.5 representthe optimal portfolios for each model with 3 and 6 assets respectively1.Thelast column in both tables shows how many iterations the algorithm used.We use initial points x0 =

[13 ,

13 ,

13

]and x0 =

[16 ,

16 ,

16 ,

16 ,

16 ,

16

]. In that case,

we intent to invest the same amount in each asset.

Model CCP Portfolio #Iterates

CCP1 3 (0.3256, 0.5313, 0.1431) 1CCP2 3 (0.3885, 0.4326, 0.1789) 4CCP3 3 (0.0540, 0.9460, 0.0000) 4CCP4 3 (0.4478, 0.3369, 0.2153) 1CCP5 3 (0.3531, 0.4886, 0.1584) 1CCP6 3 (0.4361, 0.3613, 0.2026) 3CCP7 3 (0.0000, 1.0000, 0.0000) 1CCP8 3 (0.4661, 0.3100, 0.2239) 1CCP9 3 (0.4251, 0.3807, 0.1940) 5CCP10 3 (0.4180, 0.3571, 0.2248) 1

Table 5.4: Portfolio weights 3 assets.

We note that instances with a, relative to λ2 and λ4, higher value of λ3

use more iterations and appear to be non-convex. This corresponds to ourfindings in the last section, where Model 9 was non-convex and non-concavefor certain values of the portfolio x. When the objective function is convex,we see that the algorithm only needs one iteration to solve the problem.

Model CCP Portfolio #Iterates

CCP1 6 (0.0000, 0.3669, 0.3138, 0.2403, 0.0000, 0.0790) 1CCP2 6 (0.0934, 0.2538, 0.3402, 0.1880, 0.0000, 0.1247) 4CCP3 6 (0.0000, 0.3202, 0.2129, 0.4669, 0.0000, 0.0000) 2CCP4 6 (0.1007, 0.2518, 0.2757, 0.0897, 0.1922, 0.0898) 1CCP5 6 (0.0000, 0.3736, 0.3220, 0.2120, 0.0000, 0.0924) 1CCP6 6 (0.1800, 0.1938, 0.3217, 0.1059, 0.0712, 0.1274) 4CCP7 6 (0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 0.0000) 1CCP8 6 (0.1152, 0.2312, 0.2560, 0.0638, 0.2478, 0.0815) 1CCP9 6 (0.3808, 0.0000, 0.4155, 0.0000, 0.0000, 0.2037) 6CCP10 6 (0.1295, 0.0437, 0.3271, 0.1189, 0.2141, 0.1667) 1

Table 5.5: Portfolio weights 6 assets.1Note that the optimal portfolio results sum up to one, but due to rounding may not

appear to do so.

22

Page 29: The convex-concave algorithm applied to portfolio analysis

5.3 Comparing results

To find out whether we can really apply the CCP algorithm to portfolioanalysis, we have to compare the data to other known solvers. We use theMatlab function fmincon to solve the convexified subproblem in each iter-ation, but we can let it solve the objective function as well. In AppendixA, Tables A.1 and A.2, we can find the calculated optimal portfolio weightswith 3 and 6 assets respectively. The portfolio values from the CCP algo-rithm and fmincon appear to be quite different in most cases.

In Table 5.6 we compare the results from our CCP algorithm 1 and thefunction fmincon. The bold data implies that the value of the objectivefunction is more optimal (maximal). For some problems, our algorithm out-performs fmincon, which results in more profit for the investor, but theobserved difference in the objective value is small. In the case with 3 assets,the non-convex instances are more optimal. The data in the case with 6assets is less conclusive.

3 assets 6 assets

Model CCP fmincon CCP fmincon

1 −0.00015737 −0.00015737 0.00114487 0.001144872 -0.00030109 −0.00030110 0.00007301 0.000073013 0.00168526 0.00168525 0.00370453 0.003704534 −0.00175909 −0.00175909 −0.00181248 −0.001812485 −0.00043948 −0.00043948 0.00067815 0.000678146 -0.00068368 −0.00068369 −0.00066257 −0.000662577 0.00662940 0.00662940 0.01492500 0.014925008 −0.00379630 −0.00379630 −0.00427973 −0.004279739 -0.00012559 −0.00012560 0.00007519 0.0000751910 −0.00006255 −0.00006255 −0.00008402 −0.00008402

Table 5.6: CCP algorithm compared to fmincon.

Let us consider the four moments, when the optimal portfolios are cal-culated by the CCP algorithm 1 and fmincon. First, we will look at aproblem instance with 3 assets, model 3.

CCP3 3 fmincon3 3

Mean 0.00628974 0.00628778Variance 0.00855713 0.00855290Skewness −8.519619e-4 −8.509578e-4Kurtosis 6.465000e-4 6.455659e-4

Table 5.7: Comparison optimal values of the four moments.

23

Page 30: The convex-concave algorithm applied to portfolio analysis

The mean in Table 5.7 shows us that the CCP algorithm gives an higherexpected return, as seen in (4.4). Then again, the variance is also higherthan that of fmincon, which gives us the impression that the risk of thisportfolio choice is higher too. The difference in skewness and kurtosis isonly small.

Now, consider the problem instance with 6 assets, model 7. Our CCPalgorithm does not appear to be any better or worse than applying fminconon (4.3), since the objective values are the same.

CCP6 7 fmincon6 7

Mean 0.01492496 0.01492496Variance 0.02657792 0.02657792Skewness −0.00397483 −0.00397483Kurtosis 0.00343751 0.00343751

Table 5.8: Comparison optimal values of the four moments.

In Table 5.8 we see that, as expected, the CCP algorithm gives the samefour portfolio moments as fmincon does. This implies that the algorithmworks for convex functions, but also for non-convex functions as seen before.

Hence, depending on the decisions an investor makes, the CCP algorithmis able to increase the expected return, by choosing a more optimal portfolio.

24

Page 31: The convex-concave algorithm applied to portfolio analysis

Chapter 6

Conclusions and

RecommendationsWe have seen that the Convex-concave Algorithm 1 is an easy to implement,descent algorithm. When we start our optimization problem with an initialfeasible point, it will result in a feasible solution. It is always possible todecompose the objective function into a convex and a concave function suchthat the DCD is undominated. From Chapter 5 we can conclude that theCCP algorithm is applicable to portfolio analysis.

In general (4.3) is not convex. When the objective function is convex,the algorithm needs only one iteration to solve the problem. Non-convexityis mostly related to λ3. For some problems, our algorithm outperformsfmincon, which results in more profit for the investor, but the observeddifference in the objective value is small. However, the portfolio values arequite different in some cases.

For further research one can consider comparing the optimal portfoliosto a global solver, such as BARON. It might be promising to apply thedifference of convex decomposition at every iteration. Our examples considerrelatively small assets sets, it will be interesting to know how many assetscan be solved efficiently by our procedure.

25

Page 32: The convex-concave algorithm applied to portfolio analysis

Bibliography

[1] Ahmadi, A. A., & Hall, G. (2015). DC Decomposition of NonconvexPolynomials with Algebraic Techniques. arXiv:1510.01518 [math.OC]

[2] Bland,R. G., Goldfarb, D., & Todd, M. J. (1981). The ellipsoid method:A survey. Operations Research, 29(6), 10391091.

[3] Bomze, I., & Locatelli, M. (2002). Undominated d.c. Decompositionsof Quadratic Functions and Applications to Branch-and-Bound Ap-proaches. Computational Optimization and Applications, 28(2), 227-245.

[4] Boyd, S. & Vandenberghe, L. (2004). Convex Optimization, CambridgeUniversity Press.

[5] Hartman, P. (1959). On functions representable as a difference of convexfunctions., Pacific J. Math., 9(3), 707-713.

[6] Harvey, C. R., Liechty, J. C., Liechty, M. W., & Peter Muller, P. (2001).Portfolio selection with higher moments. Quantitative Finance, 10(5),469-485.

[7] Kleniati, P. M., & Rustem, B. (2009). Portfolio Decisions with HigherOrder Moments., COMISEF Working Papers Series, WPS-021.

[8] Kojima, M., & Muramatsu, M. (2009). A note on sparse SOS and SDPrelaxations for polynomial optimization problems over symmetric cones.Computational Optimization and Applications, 42(1), 31-41.

[9] Lipp, T., & Boyd, S. (2015). Variations and Extension of the Convex-Concave Procedure. Optimization and Engineering. Retrieved fromhttps://web.stanford.edu/~boyd/papers/pdf/cvx_ccv.pdf

[10] Markowitz, H. (1952). Portfolio Selection. The Journal of Finance,7(1), 77-91.

[11] Megretski, A. (2010). SPOT (Systems Polynomial Optimiza-tion Tools) Manual. Retrieved from http://web.mit.edu/ameg/www/

images/spot_manual.pdf

26

Page 33: The convex-concave algorithm applied to portfolio analysis

Appendix A

Datasets

Model fmincon Portfolio

fmincon1 3 (0.3256, 0.5313, 0.1431)fmincon2 3 (0.3885, 0.4326, 0.1789)fmincon3 3 (0.0531, 0.9454, 0.0016)fmincon4 3 (0.4478, 0.3369, 0.2153)fmincon5 3 (0.3531, 0.4886, 0.1584)fmincon6 3 (0.4361, 0.3613, 0.2026)fmincon7 3 (0.0001, 0.9998, 0.0001)fmincon8 3 (0.4661, 0.3100, 0.2239)fmincon9 3 (0.4250, 0.3808, 0.1942)fmincon10 3 (0.4180, 0.3571, 0.2249)

Table A.1: Portfolio weights 3 assets calculated with fmincon.

Model fmincon Portfolio

fmincon1 6 (0.0010, 0.3660, 0.3133, 0.2401, 0.0004, 0.0793)fmincon2 6 (0.0940, 0.2525, 0.3396, 0.1877, 0.0013, 0.1248)fmincon3 6 (0.0003, 0.3188, 0.2123, 0.4664, 0.0002, 0.0021)fmincon4 6 (0.1009, 0.2516, 0.2755, 0.0898, 0.1922, 0.0899)fmincon5 6 (0.0023, 0.3722, 0.3210, 0.2117, 0.0007, 0.0922)fmincon6 6 (0.1799, 0.1924, 0.3214, 0.1058, 0.0728, 0.1276)fmincon7 6 (0.0000, 0.0001, 0.0001, 0.9997, 0.0000, 0.0001)fmincon8 6 (0.1152, 0.2312, 0.2559, 0.0684, 0.2477, 0.0816)fmincon9 6 (0.3773, 0.0089, 0.4124, 0.0016, 0.0009, 0.1990)fmincon10 6 (0.1285, 0.0557, 0.3265, 0.1213, 0.2038, 0.1641)

Table A.2: Portfolio weights 6 assets calculated with fmincon.

The next pages provide the datasets for the historical stock prices used.The portfolio of 3 assets includes the AT&T, Bank of America (BoA) andWalt Disney stocks. The portfolio of 6 assets consist of Alcoa, Amex, Cater-pillar, Cisco, General Electric and Hewlett-Packard.

27

Page 34: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP2/04/90 54.625 38 110.500038 62 27.12505 61.375038 23.75136 63.999962 43.4999961/05/90 58.375 38.75 129.000031 66 29.250038 67 24.750721 68.874962 47.7499961/06/90 53.875 37.5 128.249985 63.75 30.750055 52.624962 26.49888 69.249962 47.2499962/07/90 54.375 35.875 117.625015 69.5 29.125019 48.875038 25.499521 71.625 43.1249621/08/90 49 32.625 102.374977 64.375038 24.125015 43 24.750721 62.000038 34.8750344/09/90 52.375 21.375 90.624954 62.624962 21.125021 42.25 22.49856 54.500038 33.4999961/10/90 54.5 17.25 90.999969 53.124962 18.875015 40.75 29.49984 51.999962 25.9999981/11/90 55.125 24 99.625015 54.875038 20.500011 41.124962 39.499203 54.75 303/12/90 56 22.875 101.499977 57.624962 20.625027 47 44.87616 57.375 31.875042/01/91 52.25 28.125 108.250053 64.375038 22.750017 49.75 58.498558 63.999962 38.8750381/02/91 53.75 29.25 123.375008 64.124962 24.000036 54.624962 55.998722 68.000038 46.6249621/03/91 56.125 34.625 119 65.5 28.875025 47.875038 24.37488 69.624962 501/04/91 53.375 36.875 115.124985 67.5 25.000023 47.624962 29.750399 70.749962 51.1249581/05/91 51.75 42.125 115.999985 71.124962 25.625032 51.75 32.25024 77.25 54.2499963/06/91 53.5 35.75 111.500008 67.5 22.500019 49.375038 30.500639 74.000038 50.7499961/07/91 54 34.75 120.75 70.624962 25.375036 49.124962 39.250084 73.250038 53.751/08/91 55 38.625 118.749947 69.25 26.500038 47.5 45.374401 74.874962 52.8750383/09/91 55.875 35.625 114.000053 63.875038 25.625032 44.624962 40.99968 69.375 49.51/10/91 60.125 37.375 118.749947 63.375038 19.000032 48 48.74976 69 50.3750341/11/91 57.75 34.375 104.750061 58.5 19.000032 41.25 49.5 64.749962 48.1249582/12/91 64.625 40.625 114.500031 64.375038 20.500011 43.875038 66.250084 76.5 572/01/92 60.375 43.875 136.500015 64.5 20.625027 46.75 75.124802 75.249962 59.2499963/02/92 60.375 47.5 153.749985 69.375038 21.000042 48.875038 81.49968 78.624962 72.9999922/03/92 57.5 45.5 151.624969 70.5 22.875032 50 39.499916 75.75 80.4999921/04/92 62.375 47.75 145.750015 77.375038 22.500019 56.124962 36.49968 76.625038 79.9999921/05/92 60.25 46.5 37.999996 77.624962 22.750017 60.375038 45.75024 76.374962 75.9999921/06/92 61 47.625 36.125 75.875038 23.250008 53.75 47.00016 77.750038 68.8750381/07/92 65.875 46 36.000004 73.75 23.000013 55.25 53.375042 76.5 73.4999923/08/92 66.5 42.875 34.499992 64.624962 20.875025 48.25 46.874882 74.000038 57.25

28

Page 35: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP1/09/92 68.5 44.375 36.249992 66.25 21.87501 52.124962 52.875359 78.249962 55.7499961/10/92 66.75 46.25 39.375011 69.75 21.375017 52.25 59.99976 76.749962 56.8750382/11/92 69.375 50.375 42.187489 70.124962 22.875032 56.75 74.74968 83.25 66.4999921/12/92 74 51.375 43.000008 71.624962 24.875044 53.624962 78.624725 85.5 69.8750314/01/93 68.875 53.75 45.625011 74.375038 23.250008 56.124962 88.500237 86.124962 721/02/93 74.5 53.5 44.374992 70.124962 24.500031 58 87.75 84.125038 73.7499921/03/93 78.125 54.625 44.499989 64.5 27.12505 59.124962 44.75016 89.124962 76.1249621/04/93 77.25 49.625 40.749992 66.124962 28.000017 69.25 41.249882 90.624962 74.8750383/05/93 38.375 47.125 44.000008 67.5 28.750046 71.624962 54 92.750038 83.3750311/06/93 38.75 49.625 40.749992 70 32.250031 74.875038 54.749882 95.750038 80.9999921/07/93 40.5 50.375 37.500011 71.25 32.625046 76.875038 51.874916 98.499962 722/08/93 45.5 51.5 39.250015 75.124962 32.500031 82.25 47.750042 98.25 74.1249621/09/93 43 51.5 37.750004 67.124962 35.875038 79 50.000042 95.874962 68.3750381/10/93 44.25 46.625 43.000008 68 32.250031 91.5 51.249958 96.999962 73.6249621/11/93 42.5 47.125 39.874992 69.25 31.375025 85.25 56.25 98.375038 73.7499921/12/93 41.5 49 42.624992 69.375038 30.875034 89 64.625038 104.874962 793/01/94 41.875 50.75 47.249989 79.124962 32.625046 104.124962 72.500038 107.750038 85.251/02/94 39.125 48.875 47.999992 75.25 29.250038 108.375038 73.749962 105.375 90.6249621/03/94 40.375 45.75 42.000011 71.624962 27.750021 112.375038 34.250042 99.999962 82.1249624/04/94 41.5 52.25 42.499996 68 29.625053 109.875038 30.312542 95.25 80.2499922/05/94 41.125 55.375 43.374996 70.624962 27.625017 106.875038 24.75 49.750019 78.51/06/94 43.5 51.375 41.624992 73.124962 25.750023 100 23.374979 46.624981 75.2499921/07/94 42 55.75 42.375 78.25 26.500042 108.375038 21.000059 50.374981 77.6249541/08/94 41.375 55.75 41.250008 84 28.12504 115.375038 24.812458 49.750019 89.9999921/09/94 42.5 49 38.75 84.75 30.375023 54.125 27.374941 48.124981 87.3750383/10/94 41.875 49.5 39.500008 85.25 30.875048 59.75 30.124979 48.874981 97.8750311/11/94 41.375 44.875 43.499992 81.624962 29.625042 54.125 32.250061 46.000019 97.7499921/12/94 40.375 45.125 46 86.624962 29.500042 55.125 35.125019 51 99.8750313/01/95 42.625 46.625 50.874985 78.624962 31.500034 51.375 33.375061 51.499981 100.5

29

Page 36: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP1/02/95 41.625 49.875 53.374996 39 33.625023 51.625 33.75 54.75 114.9999921/03/95 42 50.75 53.499992 41.5 34.875031 55.5 38.125084 54 120.3750313/04/95 44.125 50 55.374985 44.875 34.750034 58.5 39.875042 55.999981 66.1249921/05/95 45 56.625 55.500011 46.5 35.500053 60.25 43.750084 58.000019 65.9999921/06/95 47.625 53.625 55.500011 50.125 35.250023 64.25 50.562542 56.374981 74.4999923/07/95 48.125 56.125 58.625 57 38.500053 70.375 55.749958 58.999981 77.8751/08/95 50.625 61.375 56.249985 57.125 40.375046 67.125 65.624939 58.875 79.9999921/09/95 55 67.25 57.375011 52.875 44.375065 56.875 68.999939 63.75 83.3752/10/95 55.875 65.75 57.625004 51 40.625042 56.75 77.500084 63.250019 92.6251/11/95 54.125 71.5 60.125008 58.5 42.500034 61.375 84.124985 67.125 82.9999921/12/95 57.25 69.625 58.874992 52.875 41.375061 58.75 74.624939 72 83.752/01/96 56.625 69.875 64.249992 55.5 46.000065 64.375 83.25 76.750015 84.751/02/96 54.875 73.75 65.500015 56.875 45.875065 66.75 47.500019 75.499985 100.751/03/96 52.625 80.125 63.875004 62.625 49.375057 68 46.375019 77.875015 94.1249921/04/96 50.125 79.875 62.000008 62.375 48.500042 64.125 51.875008 77.25 105.8751/05/96 49.375 81.125 60.749985 61.625 45.750065 65.625 54.749969 82.750015 106.53/06/96 49.25 82.625 62.875008 57.375 44.625057 67.75 56.625031 86.749985 99.6251/07/96 48.875 86 55.625008 58 43.750042 65.875 51.75 82.249985 43.9999961/08/96 46.625 85.125 56.999996 62.125 43.750042 68.875 52.749992 83.125015 43.7499963/09/96 48.125 86.875 63.249996 59 46.250057 75.375 62.062469 91.000015 48.7499961/10/96 48.625 94.25 65.875 58.625 47.000042 68.625 61.875 96.75 44.1249961/11/96 52.625 103.625 73.875 63.625 52.250065 79.125 67.875031 103.999985 53.8752/12/96 51.875 97.75 69.749985 63.75 56.500072 75.25 63.624958 98.875015 50.252/01/97 55 108.125 72.875008 69 62.125053 77.625 69.75 103.5 52.6253/02/97 57.5 60 74.249985 71.25 65.625084 78.25 55.625042 102.874985 56.1249963/03/97 52.5 55.5 72.875008 68 59.875069 80.25 48.124981 99.250015 53.251/04/97 55.5 60.375 81.750008 69.875 65.750084 89 51.75 111 52.4999961/05/97 58.5 58.875 81.875008 73.625 69.500069 97.625 67.750023 60.375 51.4999962/06/97 61.875 64.5625 80.25 75.375 74.500092 107.375 67.124969 65.000008 55.999996

30

Page 37: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP1/07/97 59.1875 71.1875 80.8125 88.5 83.750099 56 79.562515 70.125 69.9999921/08/97 54.375 59.75 76.812508 82.25 77.750092 58.0625 75.375 62.562508 61.4999962/09/97 61.4375 61.875 80.624992 82 81.875099 53.9375 73.062538 68.0625 69.5624921/10/97 63.625 59.8125 82.374985 73 78.000084 51.25 82.031219 64.625008 61.6249963/11/97 72.625 60.0625 94.937508 67.25 78.875099 47.9375 86.249969 73.875 61.1249961/12/97 73.25 60.8125 99.000008 70.375 89.250114 48.5 55.750019 73.374992 62.3749962/01/98 77.75 59.875 106.875015 76.375 83.687576 48 63.062519 77.499992 60.1252/02/98 75.625 68.5 111.937515 73.375 90.062614 54.5625 65.875015 77.750008 66.9999922/03/98 43.359379 72.9375 106.749992 68.812477 91.812614 55.0625 68.374985 86.187508 63.3749961/04/98 41.4375 76 124.562515 77.5 102.18763 56.9375 73.249985 85.187492 75.3749921/05/98 38.875 75.5 113.250015 69.375 102.625099 54.9375 75.625015 83.375008 62.3124961/06/98 40 76.6875 105.0625 65.937523 113.750137 52.906239 92.0625 90.875008 59.8751/07/98 40.9375 79.75 34.4375 69.312477 110.375137 48.5 95.749985 89.4375 55.4999963/08/98 38.0625 57.5 27.437502 59.875 78.000084 42 81.874985 80.000008 48.5624961/09/98 44.375 53.5 25.374996 71 77.625092 44.5 61.812481 79.562492 52.93751/10/98 46.3125 57.5 26.9375 79.25 88.093849 44.9375 63 87.500008 60.252/11/98 47.9375 65.1875 32.187504 74.25 100.062607 49.4375 75.375 90.375 62.5624961/12/98 53.625 60.125 30.000004 74.562477 102.500099 46 92.812477 102 68.31254/01/99 54 66.875 33.000004 83.562477 102.875122 43.3125 111.562477 104.874985 78.3751/02/99 52.875 65.3125 35.187504 40.5 108.500107 45.5625 97.812477 100.3125 66.4374921/03/99 47.1875 70.625 31.125006 41.1875 117.750145 45.9375 109.562477 110.625 67.81251/04/99 55.75 71.5625 31.750004 62.25 130.687653 64.375 114.062477 105.375 78.8753/05/99 51.125 64.6875 29.125002 55 121.062622 54.875 109 101.687485 94.31251/06/99 58 73.3125 30.8125 61.875 130.125153 60 64.4375 113.000015 100.51/07/99 57.125 66.375 27.562498 59.875 131.750153 58.625 62.125 108.999985 104.6874922/08/99 48.0625 60.5 27.749996 64.5625 137.500168 56.625 67.8125 112.3125 105.3751/09/99 51.0625 55.6875 26.000006 62.0625 135.000153 54.8125 68.5625 118.562485 90.751/10/99 52.75 64.4375 26.5 60.75 154.000183 55.3125 74 135.500015 74.18751/11/99 52.640621 58.609379 27.875004 65.5 151.093918 46.375 89.1875 130.125 94.874992

31

Page 38: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP1/12/99 48.75 50.1875 29.249998 83 166.250183 47.0625 107.125 154.749985 113.753/01/00 42.875 48.4375 36.312496 69.6875 164.750198 42.4375 109.5 134.000015 108.2499921/02/00 37.75 46 34 68.5 134.187653 35.0625 132.1875 132.375 134.51/03/00 42.125 52.4375 41.25 70.25 148.937683 39.4375 77.3125 155.625 132.56253/04/00 43.8125 49 43.625 64.875 149.500183 39.4375 69.328117 157.250015 1351/05/00 43.6875 55.4375 42.187504 58.4375 54.000217 38.25 56.9375 52.625 120.1874921/06/00 44 43 38.812504 29 52.125206 33.875 63.5625 53 124.8749923/07/00 42.5625 47.375 38.562504 30.25 56.687725 34.0625 65.4375 51.6875 109.2499921/08/00 41.765621 53.578121 38.953125 33.265621 59.015865 36.765621 68.625 58.625 120.640611/09/00 49.875 52.375 38.25 25.3125 60.750248 31 55.25 57.8125 96.9999922/10/00 57.6875 48.0625 35.812504 28.6875 60.00024 35.0625 53.875 54.8125 46.51/11/00 54.9375 39.9375 28.937502 28.1875 54.937714 39.3125 47.875 49.5625 31.6249981/12/00 47.75 45.875 28.937502 33.5 54.937714 47.3125 38.25 47.9375 31.5624982/01/01 48.349998 53.82 30.450006 36.740002 47.100189 44.220001 37.4375 45.98 36.8499951/02/01 47.700001 50.700001 30.949999 35.759998 43.880173 41.599998 23.6875 46.5 28.8499981/03/01 44.630001 54.75 28.600002 35.950001 41.300167 44.380001 15.8125 41.860001 31.2699992/04/01 41.25 56 30.250004 41.400002 42.44017 50.200001 16.98 48.529999 28.4299981/05/01 43.049999 59.25 31.619999 43.150002 42.120174 54.16 19.26 49 29.3199981/06/01 40.060001 60.029999 28.889997 40 38.800156 50.049999 18.200001 49 28.5999982/07/01 45.029999 63.619999 26.349998 39.23 40.330162 55.099998 19.219999 43.5 24.6599981/08/01 40.91 61.5 25.430006 38.119999 36.420151 50 16.33 40.900002 23.2099994/09/01 47.119999 58.400002 18.620003 31.01 29.060118 44.799999 12.18 37.200001 16.0499991/10/01 38.110001 58.990002 18.589998 32.27 29.430119 44.720001 16.92 36.41 16.8299981/11/01 37.380001 61.380001 20.470005 38.599998 32.91013 47.419998 20.440001 38.5 21.9899983/12/01 39.169998 62.950001 20.720005 35.549999 35.690147 52.25 18.110001 40.080002 20.5399992/01/02 37.450001 63.029999 21.059999 35.849998 35.850151 50.279999 19.799999 37.150002 22.1100011/02/02 37.84 63.950001 23.000006 37.57 36.45015 55.509998 14.27 38.5 20.1200011/03/02 37.439999 68.019997 23.08 37.740002 40.960167 56.849998 16.93 37.400002 17.9400011/04/02 31.059999 72.480003 23.180002 34.029999 41.010159 54.619999 14.65 31.549999 17.1

32

Page 39: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP1/05/02 34.290001 75.809998 22.910004 34.98 42.510166 52.27 15.78 31.139999 19.093/06/02 30.5 70.360001 18.899998 33.150002 36.320148 48.950001 13.95 29.049999 15.2799991/07/02 27.66 66.5 17.730005 27.049999 35.260143 44.700001 13.19 32.200001 14.1499991/08/02 24.74 70.080002 15.679999 25.09 36.060146 43.639999 13.82 30.15 13.4299993/09/02 20.1 63.799999 15.140005 19.299999 31.180119 37.220001 10.48 24.65 11.6699991/10/02 25.66 69.800003 16.700005 22.059999 36.370144 40.849998 11.18 25.25 15.7999991/11/02 28.5 70.080002 19.82 25.549999 38.930161 49.900002 14.92 27.120001 19.482/12/02 27.110001 69.57 16.309999 22.780001 35.350147 45.720001 13.1 24.35 17.3600012/01/03 24.440001 70.050003 17.5 19.77 35.530144 43.98 13.37 23.139999 17.413/02/03 20.799999 69.239998 17.060003 20.5 33.580132 47 13.98 24.049999 15.8499993/03/03 20.059999 66.839996 17.02 19.379999 33.230133 49.200001 12.98 25.5 15.551/04/03 23.360001 74.050003 18.660006 22.93 37.860153 52.599998 15 29.450001 16.2999971/05/03 25.459999 74.199997 19.650003 24.610001 41.660168 52.150002 16.41 28.700001 19.52/06/03 25.549999 79.029999 19.750004 25.5 41.810165 55.66 16.790001 28.68 21.2999991/07/03 23.360001 82.57 21.920004 27.77 44.170174 67.470001 19.49 28.440001 21.1699981/08/03 22.459999 79.25 20.5 28.559999 45.050186 71.830002 19.139999 29.57 19.932/09/03 22.25 78.040001 20.170002 26.16 45.060184 68.839996 19.59 29.809999 19.3599991/10/03 23.98 75.730003 22.640005 31.57 46.930191 73.279999 20.93 29.01 22.3099993/11/03 23.280001 75.43 23.089998 32.810001 45.710178 76.050003 22.700001 28.67 21.741/12/03 26.07 80.43 23.330002 38 48.230194 83.019997 24.23 30.98 22.9699992/01/04 25.5 81.459999 24.000002 34.18 51.840202 78.129997 25.709999 33.630001 23.7899992/02/04 24.01 81.919998 26.530003 37.470001 53.420216 75.75 23.16 32.52 22.7099971/03/04 24.540001 80.980003 24.990002 34.689999 51.850201 79.07 23.57 30.52 22.841/04/04 24.9 80.489998 23.030001 30.75 48.950188 77.730003 20.91 29.950001 19.7000013/05/04 23.700001 83.129997 23.470005 31.299999 50.700199 75.349998 22.370001 31.120001 21.241/06/04 24.25 84.620003 25.490004 33.029999 51.380203 79.440002 23.700001 32.400002 21.0999981/07/04 25.34 85.010002 23.089998 32.029999 50.250206 73.489998 20.92 33.25 20.152/08/04 25.790001 44.98 22.450001 32.380001 50.020203 72.699997 18.76 32.790001 17.8899971/09/04 25.950001 43.330002 22.550003 33.59 51.460205 80.449997 18.1 33.580002 18.749998

33

Page 40: The convex-concave algorithm applied to portfolio analysis

Date AT&T BoA Disney Alcoa Amex Caterpillar Cisco GE HP1/10/04 25.26 44.790001 25.219995 32.5 53.070213 80.540001 19.209999 34.119999 18.661/11/04 25.17 46.27 26.880007 33.98 55.710217 91.550003 18.75 35.360001 19.9999981/12/04 25.77 46.990002 27.799997 31.41 56.370224 97.510002 19.32 36.5 20.9699973/01/05 23.76 46.369999 28.629999 29.51 53.350208 89.099998 18.040001 36.130001 19.5899981/02/05 24.059999 46.650002 27.940001 32.119999 54.150211 95.050003 17.42 35.200001 20.7999991/03/05 23.690001 44.099998 28.729998 30.389999 51.370205 91.440002 17.889999 36.060001 21.9400011/04/05 23.799999 45.040001 26.399998 29.02 52.700211 88.050003 17.27 36.200001 20.4699972/05/05 23.379999 46.32 27.439997 27.1 53.85022 94.110001 19.4 36.48 22.5099981/06/05 23.75 45.610001 25.180004 26.129999 53.230213 95.309998 19.08 34.650002 23.5099981/07/05 24.450001 43.599998 25.640005 28.049999 55.000217 53.91 19.15 34.5 24.6199991/08/05 24.08 43.029999 25.190002 26.790001 55.240219 55.490002 17.620001 33.610001 27.7599981/09/05 23.969999 42.099998 24.129997 24.42 57.440228 58.75 17.92 33.669998 29.1999993/10/05 23.85 43.740002 24.370001 24.290001 49.77 52.59 17.450001 33.91 28.0400011/11/05 24.91 45.889999 24.930002 27.41 51.419998 57.779999 17.540001 35.720001 29.6699981/12/05 24.49 46.150002 23.969997 29.57 51.459999 57.77 17.120001 35.049999 28.6299973/01/06 25.950001 44.23 25.309999 31.5 52.450001 67.900002 18.57 32.75 31.1799981/02/06 27.59 45.849998 27.990002 29.32 53.880001 73.080002 20.24 32.869999 32.8099981/03/06 27.040001 45.189999 27.890001 30.559999 52.549999 71.809998 21.67 34.779999 32.9000023/04/06 26.209999 49.919998 27.959997 33.779999 53.810001 75.739998 20.950001 34.59 32.4700011/05/06 25.99 49.299999 28.109997 33.720001 52.380001 78.099998 21.49 34.400002 32.839996

Table A.4: Historical stock prices used.

34

Page 41: The convex-concave algorithm applied to portfolio analysis

Appendix B

Matlab Code

B.1 GetData.m

function [ n, mu, sig, S, K ] = GetData( )%This function calculates four moments as seen in Table 4.1.% It return the number of assets n and the four moments.

%Read historical prices dataset.%Period between 2 April 1990 and 3 May 2006.A = xlsread('SixAssets.csv');

%P(i,t) corresponds to the historical price of asset i%at time period t.P = A';

[n,m] = size(P); %n number of assets. m number of prices.N = m−1; %N total number of returns on asset i.

%Calculate the asset return R(i,t) corresponding to asset i%and time period tR = [n,N];for i = 1:n

for t=1:NR(i,t) = (P(i,t+1)−P(i,t))/P(i,t);

endend

%Calculate the vector of means mu in Rˆnmu = (1/N)*sum(R,2);

%Calculate the covariance matrix sigma in Rˆnxnsig = zeros(n,n);B = zeros(1,N);for i=1:n

for j=1:nfor t = 1:N

B(t) = (R(i,t)−mu(i))*(R(j,t)−mu(j));endsig(i,j) = (1/(N−1))*sum(B,2);

endend

%Calculate the coskewness tensor S in Rˆnxnˆ2S = zeros(n,n,n);

35

Page 42: The convex-concave algorithm applied to portfolio analysis

for i=1:nfor j=1:n

for k=1:nfor t = 1:NB(t) = (R(i,t)−mu(i))*(R(j,t)−mu(j))*(R(k,t)−mu(k));

endS(i,j,k) = (1/N)*sum(B,2);

endend

end

%Calculate the cokurtosis tensor K in Rˆnxnˆ3%K = [n,n,n,n];K = zeros(n,n,n,n);for i=1:n

for j=1:nfor k=1:n

for l=1:nfor t = 1:NB(t) = (R(i,t)−mu(i))*(R(j,t)−mu(j))*...(R(k,t)−mu(k))*(R(l,t)−mu(l));

endK(i,j,k,l) = (1/N)*sum(B,2);

endend

endend

end

36

Page 43: The convex-concave algorithm applied to portfolio analysis

B.2 CCP.m

The program CCP.m calls DiffSOS.m, the Matlab file for decomposing theobjective function. Due to copyright it will not be possible to provide theDiffSOS.m code.

%DiffSOS calculates the decomposition, f=gf−hf.DiffSOS;

%Input here the maximum number of iterates.nber iterates=10;x=msspoly('x',n);

%Input here the value of delta for the stopping criterion.delta = 1e−08;y = zeros(nber iterates,n);

k=1;%Input here the initial point.x0(:,1) = [1/6;1/6;1/6;1/6;1/6;1/6];

f = 1;%Makes sure the algorithm runs at least one time.

while((k<nber iterates) && double(f) > delta )

%convexify & solvex0(:,k+1) = calcmin(x0(:,k));

%updatef = (subs(gf,x,x0(:,k)) − subs(hf,x,x0(:,k))) ...

− (subs(gf,x,x0(:,k+1)) − subs(hf,x,x0(:,k+1)));k = k+1;

end

37

Page 44: The convex-concave algorithm applied to portfolio analysis

B.3 calcmin.m

function [ opt ] = calcmin( xk )%Calculates the minimum of the convex subproblem% with starting point xk.

sym x;n=6;

function hf = h i(x)hf = %insert hf from DiffSOS.m.

end

function diff h = grad h(x)diff h = %insert diff h(i) = diff(hf,x(i)).

end

function y = h convexify(x)y = h i(xk) + grad h(xk)*(x−xk);

end

gf = @(x) %insert gf from DiffSOS.m.

h hat = @h convexify;

fun = @(x) gf(x) − h hat(x);

Aeq = ones(1,n);beq=1;

opt = fmincon(fun, xk ,[],[],Aeq,beq,zeros(1,n),ones(1,n));

end

38