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

2
Assets and portfolios
Asset ≡ anything we can purchase
Random price P(t)
P(t+1)
Random gross return R(t) = P(t)
P(t+1)−P(t)
Random net return: r(t) = R(t) − 1 = 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 Pn Pd d
i=1 Ri (t)wi − i=1 wi i=1 ri (t)wi
X wi
rw (t) = = Pd = ri (t) ·
W i=1 wi i=1
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

3
How does one deal with randomness?
Pd
Random net return on the portfolio rx = 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?

4
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 )>
d
X d
X
µx = E[rx (t)] = E[ri (t)]xi = µi xi
i=1 i=1

Variance of the return on portfolio x:


d
X  Xd X
d
σ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 µ2 = 2
σ12 = var(r1 ) = 0.1 σ22 = var(r2 ) = 0.5

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

Portfolio: (x, 1 − x)
d
X
µx = µi xi = x + 2(1 − x)
i=1

d
X d
X X
σx2 = σij xi xj = σi2 xi2 + 2 σij xi xj
i,j=1 i=1 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
σ2
Pd Pd
σy2 = var( i=1 ri yi ) = i=1 σ 2 ( d1 )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
120
Efficient frontier ≡ max return
100 for a given risk
80

How does one characterize the


60
efficient frontier?
return (%)

40

20 How does one compute effi-


0
cient/optimal portfolios?
−20

−40

−60
0 20 40 60 80 100 120 140 160 180
volatility (%)

8
Mean variance formulations
Minimize risk ensuring return ≥ target return
Pd Pd
minx σx2 ≡ minx j=1 σij xi xj
Pi=1
d
s.t. µx ≥ r s.t. µi xi ≥ r
Pi=1
d
i=1 xi = 1.

Maximize return ensuring risk ≤ risk budget


Pd
maxx µx ≡ maxx µx
Pdi=1 Pi di
s.t. σx2 ≤ σ̄ 2 s.t. 2
j=1 σij xi xj ≤ σ̄ ,
Pi=1
d
i=1 xi = 1.

Maximize a risk-adjusted return

Pd P 
d Pd
maxx µx − τ σx2 ≡ maxx i=1 µi xi − τ i=1 j=1 σij xi xj
Pd
s.t. i=1 xi = 1.

τ ≡ 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)
d
X
µx = µi xi = µ1 x + µ2 (1 − x)
i=1

d
X d
X X
σx2 = σij xi xj = σi2 xi2 + 2 σij xi xj
i,j=1 i=1 j>i

= σ12 x 2 + σ22 (1 − x)2 + 2ρσ1 σ2 x(1 − x)

2
Mean-variance for 2-asset market
Minimize risk formulation for the mean-variance portfolio selection problem

minx σ12 x 2 + σ22 (1 − x)2 + 2ρσ1 σ2 x(1 − x)


s.t. µ1 x + µ2 (1 − x) = r

r−µ2
Expected return constraint: x = µ1 −µ2

Variance:
 r − µ 2  µ − r 2  r − µ  µ − r 
2 1 2 1
σr2 = σ12 + σ22 + 2ρσ1 σ2
µ1 − µ2 µ1 − µ2 µ1 − µ2 µ1 − µ2
= ar 2 + br + c

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

3
Efficient frontier
12

10

Efficient
6
Inefficient
return (%)

4
rmin

−2

−4

−6
0 2 4 6 8 10 12 14
σmin 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
σ 2 (r) = minx σij xi xj
Pdi=1 j=1
s.t. µ i x i = r
Pdi=1
x
i=1 i = 1.
Form the Lagrangian with Lagrange multipliers u and v
d X d d
! d
!
X X X
L= σij xi xj − v µi xi − r − u xi − 1
i=1 j=1 i=1 i=1

∂L
Setting ∂xi = 0 for i = 1, . . . , d gives d equations
d
X
2 σij xj − vµi − 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
    
2σ11 2σ12 ... 2σ1d −µ1 −1 x1 0
2σ21
 2σ22 ... 2σ2d −µ2 −1  x2  0
   
 .. .. .. .. .. ..   ..   .. 
 .
 . . . . . 
  .  = .
   
2σd1
 2σd2 ... 2σdd −µd −1 

xd  0
  
 µ1 µ2 ... µd 0 0   v  r 
1 1 ... 1 0 0 u 1
| {z } |{z}
A b

Therefore  
x1
 x2 
 
 .. 
.
  = A−1 b
xd 
 
v
u

6
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


Choose β = rr−r 1
2 −r1

Consider the position: y = (1 − β)x (1) + βx (2)

y is a portfolio
d d d
(1) (2)
X X X
yi = (1 − β) xi +β xi = (1 − β) + β = 1
i=1 i=1 i=1

y is feasible for target return r


d d d
(1) (2)
X X X
µi yi = (1 − β) µi xi +β µi xi = (1 − β)r1 + βr2 = r
i=1 i=1 i=1

7
Two fund theorem (contd)
Set v = (1 − β)v1 + βv2 and u = (1 − β)u1 + βu2 .
d d
(1) (2)
X X
2 σij yj − vµi − u = 2σij ((1 − β)xj + βxj )
j=1 j=1
− µi ((1 − β)v1 + βv2 ) − ((1 − β)u1 + βu2 )
 X d 
(1)
= (1 − β) 2 σij xj − v1 µi − u1
j=1
 Xd 
(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 h
yi∗ = rgi + hi , i = 1, . . . , d.

Therefore
d X
X d
2
σ (r) = σij (rgi + hi )(rgj + hj )
i=1 j=1
d X
X d  d X
X d d X
 X d 
= r2 σij gi gj + 2r σij gi hj + σij hi hj
i=1 j=1 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
6
Inefficient
return (%)

4
rmin

−2

−4

−6
0 2 4 6 8 10 12 14
σmin 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.


Pd P 
 d Pd
max rf x0 + i=1 µi xi − τ i=1 σ x x
j=1 ij i j
Pd
s. t. x0 + i=1 xi = 1.

Only meaningful for r ≥ rf


Pd
Substituting x0 = 1 − i=1 xi we get
Pd P 
d Pd
max rf + i=1 (µi − rf )xi − τ i=1 j=1 σij xi xj

µ̂i = µi − rf = excess return of asset i

2
Mean-variance optimal portfolio
Taking derivatives we get
d
X
µ̂i − 2τ σij xj = 0, i = 1, . . . , d.
j=1

Matrix formulation
  
σ11 σ12 ...σ1d x1  
µ̂
σ21 σ22 ...σ2d  x2   .1 
   1 −1
2τ  . ..   ..  =  ..  ⇒ x(τ ) = V µ̂

.. ..
 .. . . .  .  2τ
µ̂d
σd1 σd2 . . . σdd xd | {z }
µ̂
| {z }
V

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
1 −1
x= V µ̂

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

s = Pd x= d −1
V µ̂
1 2τ
P
i=1 xi 2τ i=1 (V µ̂)i
Pd
The portfolio s∗ is independent of τ ! Since 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∗ .

4
Efficient frontier with risk-free asset
Pd qP
d
Return and risk of portfolio s∗ : µ∗s = ∗
σs∗ = σij2 si∗ sj∗
P
i=1 µi si , i=1 j=1

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
10
Straight line with an intercept rf
9
at σ = 0 and slope
8
µs − rf
7 m=
σs
6
return (%)

5
(σs∗ , µ∗s ) ≡ s∗
How does this relate to the fron-
4 tier with only risky assets?
3

2 Does the portfolio s∗ have an


1
(0, rf ) ≡ risk-free asset economic interpretation?
0
0 1 2 3 4 5 6 7 8 9 10

volatility (%)

5
Efficient frontier with risk-free asset
9

8 s∗ must be an efficient risky portfolio


7

The efficient frontier with a risk-free


return (%)

(σs∗ , µ∗s ) ≡ s∗ asset must be tangent to the efficient


5
frontier with only risky assets.
4

2 θ
rf
1
0 1 2 3 4 5 6 7 8 9
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

6
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 =1
σx
i
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.

7
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) Ci
xi = Pd , i = 1, . . . , d.
j=1 Cj

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
(k)
X
Ci = w (k) (1 − x0 )si∗
k

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


µm − rf
mCML = = 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?

1000 µ − r 
m f
roil = − 1 = 14%  r̄ = rf + σ = 45%
875 σm
Not worth considering!
3
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
volatility σγ = γ 2 σj2 + (1 − γ)2 σm
2 + 2σ γ(1 − γ)
jm

Efficient frontier with risk−free


Efficient frontier w/o risk−free
8 Efficient frontier of market + asset 2

6
return (%)

(σm , µm ) ≡ x(m)
5

risk-free asset ≡ (0, rf )


1
0 1 2 3 4 5 6 7 8 9
volatility (%)

4
All three curves are tangent at (σm , rm )
Slope of the capital market line
µm − rf
mCML =
σm

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


dµγ
dµγ dγ µj − µm
= dσγ
= γσj2 −(1−γ)σm
2 +(1−γ)σ −γσ
dσγ √ jm jm

γ 2 σj2 +(1−γ)2 σm
2 +2σ γ(1−γ)
jm

dµγ µj − µm
= 2
σjm −σm
dσγ γ=0 σm

Equating slopes at γ = 0 we get the following result:


σ 
jm
µj − rf = 2
(µm − rf )
σ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 ) σ
coefficient βj = var(r m −rf )
= σjm
2
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 var(rm − rf ) + var()
σj2 = βj2 σm
2
+ 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

2
2

0
6
return (%)

−2

−4

−6
3
5 7

−8
−2 −1.5 −1 −0.5 0 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


Jensen’s index or alpha

α = (µ̂j − rf ) − βj (µ̂m − rf )

hold long if positive, short otherwise


Sharpe ratio of a stock
µ̂j − rf
sj =
σ̂j
hold long if > mMCM , short otherwise.

8
CAPM as a pricing formula
Suppose the payoff from an investment in 1yr is X . What is the fair price for this
investment.
X
Let rX = P − 1 denote the net rate of return on X . The beta of X is given by

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

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

µX = rf + βX (rm − rf )
E[X ] 1 cov(X , rm )
−1 = rf + (µm − rf )
P P var(rm )

Rearranging terms:
E[X ] cov(X , rm )
P= − (µm − rf )
1 + rf (1 + rf )var(rm )

You might also like