Sei sulla pagina 1di 6

AN ALGORITHM FOR COMPUTING RISK PARITY WEIGHTS

FLORIN SPINU

Abstract. In this paper we introduce an algorithm for computing the solution to the risk budget allocation problem. The algorithm is based on Newtons method for self-concordant functions.

1. Introduction
T N For N 2 a positive integer, let RN + = {x = (x1 , . . . , xN ) R , xi > 0} the N positive cone, and S+ the set of symmetric, positive denite N N matrices. For x, y RN , xy := (x1 y1 , . . . , xN yN )T , and diag(x) is the diagonal N N matrix with 1 xi on the diagonal. For x RN := (1/x1 , . . . , 1/xN ) RN +, x + . We will also make 2 1 /2 use of the norms x 2 := ( i xi ) , x := maxi |xi |, and x C := (xT Cx)1/2 . N and b RN For a given C S+ + , we consider the following equation

(1)

Cx = bx1 ,

x RN + .

Theorem 1.1. The equation (1) has a unique solution x RN +. As a consequence, we have the following corollary (cf. [BR12]): Corollary 1.2. The vector x / (2) satisfying
N i

x i is the unique solution to the system bi N j =1 bj , 1iN ,

(Cx)i xi = xT Cx

(3)

xi > 0 ,
i=1

xi = 1 .

1.1. Financial interpretation. Given a set of N nancial assets with covariance matrix C , a long-only, fully invested portfolio in the N assets is determined by a set of allocations x = (x1 , . . . , xN )T satisfying (3). The risk of the portfolio is usually dened as the standard deviation of the portfolio returns (4) P (x) := xT Cx . As a homogeneous function of degree one, P (x) satises Eulers identity
N

(5)
i=1

1 P xi (x) = 1 . P xi

The ith summation term is sometimes considered to be the contribution of asset i to the risk of the total portfolio. Since (6) 1 P (Cx)i xi xi ( x) = T , P xi x Cx
1

FLORIN SPINU

equation (2) matches the risk contribution of asset i with the predetermined weight bi / j bj . For this reason, the solution to (2) is referred to as the risk budget allocation in [BR12]. When the weights bi are equal, the term risk parity was introduced earlier in [Q05]. The reader is referred to these papers for an in-depth discussion of the properties of portfolios constructed using these weights. 2. Proof of Theorem 1.1 The proof, as well as the choice of the function below, is similar to the one in [BR12]. Let (7) F (x) := 1 T x Cx bi log(xi ) . 2 i=1 2 F (x) = C + diag(bx2 ) .
N

The gradient and Hessian of F are given by, respectively, (8) F (x) = Cx bx1 ,

In particular, a solution to (1) is a critical point of F . Since F is strictly convex (2 F (x) C ), it has at most one critical point (this proves the uniqueness part of the Theorem). To prove that F has at least one critical point, it suces to show that F has a a point of global minimum x RN + . This is a consequence of the fact (see Lemma 4.1 in the Appendix). that F (x) + as x RN + 2.1. Proof of Corollary 1.2. If x satises (1), then Conversely, if x satises (2), 1 x satises (1), with
x satises (2) and (3). i xi (xT Cx)1/2 = ( bi )1/2 . This implies i

that 1 x = x , the unique solution to (1). Furthermore, the constraint (3) implies that = 1x , which determines x uniquely.
i i

3. Newtons algorithm 3.1. Simplifying assumptions. Let D the diagonal of C , and R = D1/2 CD1/2 the associated correlation matrix: R is positive denite with 1 on the diagonal. If x is the solution to (1), y := D1/2 x is the unique solution to the equation (9) Ry = by 1
N C S+ ,

Therefore, we may assume from now on that C is a correlation matrix: (10) Cii = 1 .

In particular, |Cij | 1, i, j , by the Cauchy-Schwartz inequality. The next observation is that if x satises (1) with weights bi , t1/2 x satises the same equation with bi replaced by tbi . Therefore we may rescale bi so that (11)
1iN

min bi = 1 .

In what follows, we refer to [N98, Chap.4] for the notion of self-concordant functions. The set of self-concordant functions is closed under addition and multiplication by a scalar greater than one, and it counts among its members all the quadratic functions, as well as the functions log(xi ). We conclude that Proposition 3.1. Under the assumptions (10) and (11), F (x) is self-concordant.

AN ALGORITHM FOR COMPUTING RISK PARITY WEIGHTS

3.2. Convex optimization. We remarked in Section 2 that the solution to (1) is the global minimum of the convex function F , dened at (7) (12) x = argminxRN F (x) . +

Let x := (2 F (x))1 F (x) the iteration step in Newtons algorithm. If x0 is close enough to x , the sequence (13) xk+1 = xk + xk , k 0,

converges quadratically to x . A diculty arises when an appropriate choice of the initial point x0 is not available. Since F is self-concordant, this issue can be dealt with as in [N98, Chap 4.]. Let F (x) := (x)T F (x). As long as 3 5 k > := 2 , the above step is replaced with the damped iteration (14) xk+1 = xk + 1 xk , 1 + k k := F (xk ) .

This step is guided by the key inequality [N98, Thm 4.10] (15) F (xk+1 ) F (xk ) (k ),

where (t) := t log(1 + t). This ensures a decrease in the objective function of )F (x ) at least ( ) per iteration. In particular, less than F (x0 damped iterations ( ) are required to arrive at k < , at which point the quadratic phase (13) sets in. Moreover, we can signicantly reduce the number of damped iterations by exploiting the explicit form of F . The following theorem is proved in the Appendix. Theorem 3.2. For x RN + , let := max1iN (16)
|(x)i | xi .

With h =

1 1+ ,

we have

2 F (x + h x) F (x) (2 F (x)/ ) ( ) .

Consequently, we may replace the iteration (14) with (17) xk+1 = xk + 1 x k , 1 + k k := xk /xk

This step is greater than (14), since k < k . On the other hand, the decrease in 2 the objective function is as good as (15) since (2 k /k ) (k ) (k ), by Lemma T 4.3 in the Appendix. Let u1 := (1, . . . , 1) and S := i bi . We conclude with Theorem 3.3. Let x0 :=
S uT 1 C u1

u1 , := 0.95

3 5 2 ,

and T ol > 0 a termina-

tion threshold. Consider the following algorithm: for k 0, Compute 1 uk := F (xk ) = Cxk bx k 2 Hk := 2 F (xk ) = C + diag(bx k ) 1 xk := Hk uk k := xk /xk 1 (Damped Phase) While k > , do xk+1 = xk + 1+ k xk . (Quadratic Phase) While k > T ol, do xk+1 = xk + xk . The number of iterations is less than 9.4 S log(C N ) in the damped phase, and (log2 log2 (1/T ol) + 2.6) in the quadratic phase, with C the condition number of C . T ol The terminal value xend of the algorithm satises xend x C 1 T ol .

FLORIN SPINU

Proof. The bound on the number of iterations of the quadratic phase is standard, and can be derived from [N98, Thm 4.1.12]. To bound the number of damped )F (x ) iterations, we start from the upper bound F (x0 . First, we remark that ( ) T T x0 Cx0 = (x ) Cx = S . Let 1 and N be the smallest and the largest eigenvalues 1 S 1/2 1 2 of C . Since uT 1 C u1 N u1 2 = N N , F (x0 ) = 2 S S log( (uT C u1 )1/2 ) 2 S
S T 2 log( N N ). On the other hand, S = (x ) Cx 1 x 2 . This implies xi 1 1 S S/1 , i, hence F (x ) 2 S 2 S log( 1 ). Taking the dierence, we obtain N 1 F (x0 ) F (x ) 1 2 S log(C N ), where C = 1 . Finally 2 ( ) = 9.385 < 9.4. The T ol last term satises xk x C xk x xk 1 T ol (cf. [N98, Thm 4.1.11]). 1 2S
1

3.3. Practical Implementation. a) For N = 50 and T ol = 106 , the theoretical upper bound for the number of quadratic iterations is 8, while the stated upper bound for the number of damped iterations can be quite large (depending on S ). We nd in practice however that the total number of iterations is signicantly lower than that: for each of the 107 trials with random weights b (uniform distribution) and random covariance matrix C (Wishart distribution), the algorithm terminated after less than 16 iterations. b) We have also tested the algorithm on the risk parity problem in dimension N = 1400. That is, bi = 1/N and T ol = 106 . We found that the number of iterations required was less than 6 for each of 2 105 trials with random covariance matrix C . 4. Appendix Lemma 4.1. F (x) tends to + as x approaches the boundary of RN +: (18)
x RN +

lim F (x) = + .
i

Proof. Let 1 the lowest eigenvalue of C . Since xT Cx 1 (19) F ( x) 1 ( 1 x2 i bi log(xi )) =: 2 i=1


N N

x2 i , we have

gi (xi ) ,
i=1

1 with gi (t) = 2 1 t2 bi log(t). The function gi is convex when t > 0, has a global minimum at ti = bi /1 , and satises

(20)

t+

lim gi (t) = lim gi (t) = + .


t0+

Therefore for each i, F (x) gi (xi )+ j =i gj (t j ). Let B > 0 an arbitrary threshold. By (20) there exist i > i > 0 (depending on B ) such that (21) xi / [i , i ] F (x) B .
N i=1 [i , i ],

Therefore F (x) B outside the box Lemma 4.2. (x) >


x 2(x+1) ,
2

which proves the Lemma.

when x > 0.
2

x Proof. Let f (x) := (x) 2(x +1) . Since f (x) = Therefore f (x) > f (0) = 0, when x > 0.

x2 2(x+1)2

> 0, f is increasing.

Lemma 4.3. The function Proof.


d (x) dx ( x2 )

(x) x2

is decreasing on (0, ).

2 x x3 [ 2(x+1)

(x)] < 0, by Lemma 4.2.

AN ALGORITHM FOR COMPUTING RISK PARITY WEIGHTS

4.1. Proof of Theorem 3.2. We follow the argument in [N98, Chap.4] and adapt it to our situation. From there, we borrow the notations (22) u
x

:= (uT 2 F (x)u)1/2 ,

F (x) := x

The starting point is the second order Taylor expansion, valid when x, x + u RN +
1 1

(23)

F (x + u) F (x) uT F (x) =
0 0

t uT 2 F (x + t u)u d dt .

1 Consider the case u := hx. To ensure x + hx RN + , we need 0 < h < , where

(24)

:= max

1iN

|(x)i | . xi

With := F (x), uT F (x) = h2 and (23) is re-written as


1 1

(25)

F (x + hx) F (x) + 2 h =
0 0 x2 i i bi x2 i

h2 t x and
N

2 x+ht x

d dt .

We note that 2 = (x)T C (x) + x


2 x+hx

= (x)T C (x) +
i=1

bi

1 x 2 i . x i 2 x2 (1 + h i x )
i

xi Since |1 + h xi | 1 h , it follows that

2 x+hx

2 , (1 h )2

0<h<

1 .

Using this estimate, the right-hand side of (25) is less than


1 0 0 1

2 h2 t2 d dt = (h ), (1 ht )2 2

where (cf. [N98]) (t) := t log(1 t) . Hence (25) yields (26) F (x) F (x + hx) 2 h 2 (h ), 2 1 h (0, ) .

Let Q(h) denote the function on the right-hand side of the above inequality. Since Q (h) = 2 (1 h ), 1 h Q (h) = 2 <0, (1 h )2

if follows that Q is concave on (0, 1 ) and achieves its maximum at the critical point (27) h := 1 . 1+

Finally, one can check that Q(h ) = (2 / 2 ) ( ). We conclude that F (x) F (x + h x) Q(h ) = (2 / 2 ) ( ) .

FLORIN SPINU

References
[BV04] S. Boyd, L. Vandenberghe, Convex Optimization, Cambridge University Press, Seventh printing with corrections, 2009. [BR12] B. Bruder, T. Roncalli, Managing Risk Exposures using the Risk Budgeting Approach, 2012, http://mpra.ub.uni-muenchen.de/37749 (online). [N98] Yu. Nesterov, Introductory Lectures on Convex Programming, Volume I: Basic course, 1998 (online). [Q05] E.Qian, Risk Parity Portfolios, research paper, PanAgora, 2005. OMERS Capital Markets, 200 Bay St., Toronto, ON M5J 2J2, Canada E-mail address : fspinu@gmail.com

Potrebbero piacerti anche