You are on page 1of 35

Financial Engineering and Risk Management

Mean Variance Optimization

Martin Haugh

Garud Iyengar

Columbia University
Industrial Engineering and Operations Research

Overview
Assets and portfolios
Quantifying random asset and portfolio returns: mean and variance
Mean-variance optimal portfolios
Efficient frontier
Sharpe ratio and Sharpe optimal portfolios
Market portfolio
Capital Asset Pricing Model

Assets and portfolios


Asset anything we can purchase
Random price P(t)
Random gross return R(t) =

P(t+1)
P(t)

Random net return: r(t) = R(t) 1 =

P(t+1)P(t)
P(t)

Total wealth W > 0 distributed over d assets


wi = dollar amount in asset i: wi > 0 long, wi < 0 short
Net return on a position w
Pd
rw (t) =

i=1

Ri (t)wi
W

Pn

i=1

wi

Pd
=

i=1 ri (t)wi

Pd

i=1

wi

d
X

ri (t)

i=1

wi
W
|{z}
xi

portfolio vector x = (x1 , . . . , xd ): each component can be +ve/-ve


Pd
xi = fraction invested in asset i

i=1

xi = 1

How does one deal with randomness?


Random net return on the portfolio rx =

Pd

i=1 ri xi

How does one quantify random returns ?


Maximize expected return E[rx ]?
Should one worry about spread around the mean?
How does one quantify the spread?

Random returns on assets and portfolios


Parameters defining asset returns
Mean of asset returns: i = E[ri (t)]
Variance of asset returns: i2 = var(ri (t))

Covariance of asset returns: ij = cov ri (t), rj (t) = ij i j

Correlation of asset returns ij = cor ri (t), rj (t)
All parameters assumed to be constant over time.
Parameters defining portfolio returns
Expected return on a portfolio x = (x1 , . . . , xd )>
x = E[rx (t)] =

d
X

E[ri (t)]xi =

i=1

d
X

i xi

i=1

Variance of the return on portfolio x:


d
d X
d
X
 X

x2 = var(rx (t)) = var
ri xi =
cov ri (t), rj (t) xi xj
i=1

i=1 j=1
5

Example
d = 2 assets with Normally distributed returns N (, 2 )
r1 N (1, 0.1)

r2 N (2, 0.5)

cor(r1 , r2 ) = 0.25

Parameters
1 = 1
12

12

2 = 2

22 = var(r2 ) = 0.5

= cov(r1 , r2 ) = cor(r1 , r2 )1 2 = 0.25 0.05 = 0.0559


= var(r1 ) = 0.1

Portfolio: (x, 1 x)
x =

d
X

i xi = x + 2(1 x)

i=1

x2

d
X
i,j=1

ij xi xj =

d
X
i=1

i2 xi2 + 2

ij xi xj

j>i

= 0.1x 2 + 0.5(1 x)2 + 2(0.0559)x(1 x)


6

Diversification reduces uncertainty


d assets each with i , i , ij = 0 for all i 6= j
Two different portfolios
x = (1, 0, . . . , 0)> : everything invested in asset 1
y = d1 (1, 1, . . . , 1)> : equal investment in all assets.
Expected returns of the two portfolios
Pd
x = E[ i=1 i xi ] = 1 =
Pd
Pd
y = E[ i=1 i yi ] = d1 i=1 i =
Both have the same expected return!
Variance of returns of the two portfolios
Pd
x2 = var( i=1 ri xi ) = 2
Pd
Pd
y2 = var( i=1 ri yi ) = i=1 2 ( d1 )2 =

2
d

Diversified portfolio has a much lower variance!


7

Markowitz mean-variance portfolio selection


Markowitz (1954) proposed that
Return of a portfolio Expected return x
Risk of a portfolio volatility x
Efficient frontier
Efficient frontier max return
for a given risk

120

100

80

How does one characterize the


efficient frontier?

return (%)

60

40

How does one compute efficient/optimal portfolios?

20

20

40

60

20

40

60

80

100

120

140

160

180

volatility (%)
8

Mean variance formulations


Minimize risk ensuring return target return
minx
s.t.

x2
x r

minx
s.t.

Pd Pd
j=1 ij xi xj
Pi=1
d
i xi r
Pi=1
d
i=1 xi = 1.

Maximize return ensuring risk risk budget


maxx
s.t.

x
x2
2

maxx
s.t.

Pd
x
Pdi=1 Pi di
2,
j=1 ij xi xj
Pi=1
d
i=1 xi = 1.

Maximize a risk-adjusted return


maxx

x x2

maxx
s.t.

Pd

i=1 i xi
Pd
i=1 xi = 1.

P

d
i=1

Pd

j=1

ij xi xj

risk-aversion parameter
9

Financial Engineering and Risk Management


Efficient frontier

Martin Haugh

Garud Iyengar

Columbia University
Industrial Engineering and Operations Research

Mean-variance for 2-asset market


d = 2 assets
Asset 1: mean return 1 and variance 12
Asset 2: mean return 2 and variance 22
Correlation between asset returns
Portfolio: (x, 1 x)
x =

d
X

i xi = 1 x + 2 (1 x)

i=1

x2

d
X
i,j=1

ij xi xj =

d
X
i=1

i2 xi2 + 2

ij xi xj

j>i

12 x 2 + 22 (1 x)2 + 21 2 x(1 x)

Mean-variance for 2-asset market


Minimize risk formulation for the mean-variance portfolio selection problem
minx
s.t.

12 x 2 + 22 (1 x)2 + 21 2 x(1 x)
1 x + 2 (1 x) = r

Expected return constraint: x =

r2
1 2

Variance:
r2

 r 2
 r  r 
 r 2
1
2
2
1
+ 22
+ 21 2
1 2
1 2
1 2 1 2
= ar 2 + br + c

= 12

Explicit expression for the variance as a function of target return r.

Efficient frontier
12

10

Efficient
Inefficient

return (%)

rmin
2

min

10

12

14

volatility (%)

Only the top half is efficient! why did we get the bottom?
How does one solve the d asset problem?
4

Computing the optimal portfolio


Mean-variance portfolio selection problem
Pd Pd
ij xi xj
2 (r) = minx
Pdi=1 j=1

x
=
r
s.t.
i
i
Pdi=1
x
=
1.
i=1 i
Form the Lagrangian with Lagrange multipliers u and v
!
d X
d
d
X
X
L=
ij xi xj v
i xi r u
i=1 j=1

Setting

L
xi

i=1

d
X

!
xi 1

i=1

= 0 for i = 1, . . . , d gives d equations


2

d
X

ij xj vi u = 0,

for all i = 1, . . . d

()

j=1

Can solve the d + 2 equations in d + 2 variables: x1 , . . . , xd , u and v.


Theorem. A portfolio x is mean-variance optimal if, and only if, it is feasible and
there exists u and v satisfying ().
5

Computing the optimal portfolio


Matrix formulation

211
221

..
.

2d1

1
1
|
Therefore

212
222
..
.

...
...
..
.

21d
22d
..
.

1
2
..
.

2d2
2
1

...
...
...

2dd
d
1

d
0
0

{z
A


1
x1
0

1
x2 0
.. .. ..

.
. = .

1
xd 0
0 v r
u
0
1
}
|{z}
b


x1
x2

..
.
= A1 b
xd

v
u

Two fund theorem


Fix two different target returns: r1 6= r2
Suppose
(1)
(1)
x (1) = (x1 , . . . , xd )> optimal for r1 : Lagrange multipliers (v1 , u1 )
(2)
(2)
x (2) = (x1 , . . . , xd )> optimal for r2 : Lagrange multipliers (v2 , u2 )
Consider any other return r
1
Choose = rrr
2 r1
Consider the position: y = (1 )x (1) + x (2)
y is a portfolio
d
X

yi = (1 )

i=1

d
X

(1)

xi

d
X

i=1

(2)

xi

= (1 ) + = 1

i=1

y is feasible for target return r


d
X
i=1

i yi = (1 )

d
X
i=1

(1)

i xi

d
X

(2)

i xi

= (1 )r1 + r2 = r

i=1
7

Two fund theorem (contd)


Set v = (1 )v1 + v2 and u = (1 )u1 + u2 .
2

d
X

ij yj vi u

j=1

d
X

(1)

2ij ((1 )xj

(2)

+ xj )

j=1

i ((1 )v1 + v2 ) ((1 )u1 + u2 )


d
 X

(1)
(1 ) 2
ij xj v1 i u1
j=1
d
 X

(2)
+ 2
ij xj v2 i u2 = 0
j=1

y is optimal for target return r!


Theorem All efficient portfolios can be constructed by diversifying between any
two efficient portfolios with different expected returns.
Why are there so many funds in the market?
8

Efficient frontier
The optimal portfolio for target return r
 r r 
 r r 
2
1
y =
x (1) +
x (2)
r2 r1
r2 r1
 (2)
 

x x (1)
r2 x (1) r1 x (2)
= r
+
r2 r1
r2 r1
|
{z
} |
{z
}
g

yi

rgi + hi ,

i = 1, . . . , d.

Therefore
2

(r)

d X
d
X

ij (rgi + hi )(rgj + hj )

i=1 j=1

= r2

d X
d
X
i=1 j=1

d X
d
d X
d

X
 X

ij gi gj + 2r
ij gi hj +
ij hi hj
i=1 j=1

i=1 j=1

The d-asset frontier has the same structure as the 2-asset frontier.
9

Efficient frontier
12

10

Efficient
Inefficient

return (%)

rmin
2

min

10

12

14

volatility (%)

10

Financial Engineering and Risk Management


Mean-variance with a risk-free asset

Martin Haugh

Garud Iyengar

Columbia University
Industrial Engineering and Operations Research

Mean Variance with a risk-free asset


New asset: pays net return rf with no risk (deterministic return)
x0 = fraction invested in the risk-free asset
Mean-variance problem: x0 does not contribute to risk.

P

Pd
Pd
d

x
x
max rf x0 + i=1 i xi
j=1 ij i j
i=1
Pd
s. t. x0 + i=1 xi = 1.
Only meaningful for r rf
Substituting x0 = 1

Pd

max rf +

i=1 xi

Pd

we get

i=1 (i

rf )xi

P

d
i=1

Pd

j=1

ij xi xj

i = i rf = excess return of asset i


2

Mean-variance optimal portfolio


Taking derivatives we get

i 2

d
X

ij xj = 0,

i = 1, . . . , d.

j=1

Matrix formulation

11 12
21 22

2 .
..
..
.
d1
|



x1
1d

2d x2 .1
.. .. = ..
. .

d
xd
d2 . . . dd
| {z }
{z
}

...
...
..
.

x( ) =

1 1

V
2

The family of frontier portfolios as a function of :


(
)
d


X
1
xi ( ), x( ) : 0
i=1
3

One-fund theorem
The positions in the risky assets in the frontier portfolio
x=

1 1

V
2

do not add up to 1.
Define a portfolio of risky assets by dividing x by the sum of its components.
!
!
1

1
1
1

V
s = Pd
x=

P
d
1
1
2
i
)
i=1 xi
i=1 (V
2
The portfolio s is independent of ! Since

Pd

i=1 xi

= 1 x0 , x = (1 x0 )s .

Family of frontier portfolios = {(x0 , (1 x0 )s ) : x0 R}


Theorem All efficient portfolios in a market with a risk-free asset can be
constructed by diversifying between the risk-less asset and the single portfolio s .

Efficient frontier with risk-free asset


Return and risk of portfolio s : s =

Pd

i=1 i si ,

s =

qP

d
i=1

j=1

ij2 si sj

Return on a generic frontier portfolio: x0 in risk-free and (1 x0 ) in s


x = x0 rf + (1 x0 )s

x = (1 x0 )s

Efficient Frontier
Straight line with an intercept rf
at = 0 and slope

10

m=

s rf
s

return (%)

How does this relate to the frontier with only risky assets?

(s , s ) s

Does the portfolio s have an


economic interpretation?

(0, rf ) risk-free asset

10

volatility (%)

Efficient frontier with risk-free asset


9

s must be an efficient risky portfolio

return (%)

The efficient frontier with a risk-free


asset must be tangent to the efficient
frontier with only risky assets.

(s , s ) s
5

rf
1

volatility (%)

The portfolio s maximizes the angle or equivalently


Pd
i xi rf
expected excess return
tan() = qP i=1P
=
d
d
volatility
i=1
j=1 ij xi xj

Sharpe Ratio
Definition. The Sharpe ratio of a portfolio or an asset is the ratio of the
expected excess return to the volatility. The Sharpe optimal portfolio is a
portfolio that maximizes the Sharpe ratio.
The portfolio s is a Sharpe optimal portfolio


x rf

s = P
argmax
x
d
x:
x =1
i=1

Investors diversify between the risk-free asset and the Sharpe optimal portfolio.
The investment in the various risky assets are in fixed proportions ...
prices/returns should be correlated! This insight leads to the Capital Asset
Pricing Model.

Financial Engineering and Risk Management


Capital Asset Pricing Model

Martin Haugh

Garud Iyengar

Columbia University
Industrial Engineering and Operations Research

Market Portfolio
Definition. Let Ci , i = 1, . . . , d, denote the market capitalization of the d
assets. Then the market portfolio x (m) is defined as follows.
(m)

xi

Ci
= Pd

j=1

Cj

i = 1, . . . , d.

Let m denote the expected net rate of return on the market portfolio, and let
m denote the volatility of the market portfolio.
Suppose all investors in the market are mean-variance optimizers. Then all of
them invest in the Sharpe optimal portfolio s . Let
w (k)

wealth of the k-th investor

(k)
x0

fraction of wealth of the k-investor in the risk-free asset

Then
Ci =

(k)

w (k) (1 x0 )si

The market portfolio x (m) = Sharpe optimal portfolio s !


2

Capital Market Line


Capital market line is another name for the efficient frontier with risk-free asset
Recall: Efficient frontier = line though the points (0, rf ) and (m , m )
Slope of the capital market line
mCML =

m rf
= maximum achievable Sharpe ratio
m

mCML is frequently called the price of risk. It is used to compare projects.


Example. Suppose the price of a share of an oil pipeline venture is $875. It is
expected to yield $1000 in one year, but the volatility = 40%. The current
interest rate rf = 5%, the expected rate of return on the market portfolio
m = 17% and the volatility of the market m = 12%. Is the oil pipeline worth
considering?
 r 
1000
m
f
= 45%
1 = 14%  r = rf +
875
m
Not worth considering!
roil =

Inferring asset returns from market returns


An asset is a portfolio: asset j x (j) = (0, . . . , 1, . . . , 0)> , 1 in the j-th position.
Diversify between x (j) and market portfolio x (m) : x (j) + (1 )x (m)
return = j + (1 )m
q
2 + 2 (1 )
volatility = 2 j2 + (1 )2 m
jm
9
Efficient frontier with riskfree
Efficient frontier w/o riskfree
Efficient frontier of market + asset 2

return (%)

(m , m ) x(m)
5

risk-free asset (0, rf )


1

volatility (%)

All three curves are tangent at (m , rm )


Slope of the capital market line
mCML =

m rf
m

Slope of the frontier generated by asset j and market portfolio x (m)


d
d

d
d

=
=0

d
d
d
d

j m
2 +(1)
j2 (1)m
jm
jm

2 +2 (1)
2 j2 +(1)2 m
jm

j m
2
jm m
m

Equating slopes at = 0 we get the following result:


 
jm
j rf =
(m rf )
2
m
| {z }
beta of asset j

This pricing formula is called the Capital Asset Pricing Model (CAPM).
5

Connecting CAPM to regression


Regress the excess return rj rf of asset j on the excess market return rm rf
(rj rf ) = + (rm rf ) + j
Parameter estimates
cov(rj rf ,rm rf )

= jm
coefficient j = var(r
2
m rf )
m
intercept j = (E[rj ] rf ) (E[rm ] rf ) = (j rf ) (m rf ).
residuals j and (rm rf ) are uncorrelated, i.e. cor(j , rm rf ) = 0.
CAPM implies that j = 0 for all assets.
Effective relation: rj rf = j (rm rf ) + j
Decomposition of risk
var(rj rf )

j2

j2 var(rm rf ) + var()
2
j2 m
+ var()
| {z }
| {z }

market risk

residual risk

Only compensated for taking on market risk and not residual risk
6

Security Market Line


Plot of the historical returns on an asset vs rf + (m rf )
Security market line
4
1

return (%)

2
4

8
6
3
5

8
2

1.5

0.5

0.5

beta

The assets are labeled in the order they appears in the spreadsheet.
All assets should lie on the security line if CAPM holds. So why the discrepancy?
7

Assumptions underlying CAPM


All investors have identical information about the uncertain returns.
All investors are mean-variance optimizers (or the returns are Normal)
The markets are in equilibrium.
Leveraging deviations from the security market line
Jensens index or alpha
= (
j rf ) j (
m rf )
hold long if positive, short otherwise
Sharpe ratio of a stock
sj =

j rf

hold long if > mMCM , short otherwise.

CAPM as a pricing formula


Suppose the payoff from an investment in 1yr is X . What is the fair price for this
investment.
Let rX =

X
P

1 denote the net rate of return on X . The beta of X is given by


X =

cov(rX , rm )
1 cov(X , rm )
=
2
2
m
P
m

Suppose CAPM holds. Then X = E[rX ] must lie on the security market line, i.e.
X
E[X ]
1
P

=
=

rf + X (rm rf )
1 cov(X , rm )
rf +
(m rf )
P var(rm )

Rearranging terms:
P=

E[X ]
cov(X , rm )

(m rf )
1 + rf
(1 + rf )var(rm )
9

You might also like