35
Financial Engineering and Risk Management Mean Variance Optimization Martin Haugh Garud Iyengar Columbia University Industrial Engineering and Operations Research

Lecture Slides-mean Variance

Embed Size (px)

DESCRIPTION

Variance

Citation preview

Page 1: Lecture Slides-mean Variance

Financial Engineering and Risk ManagementMean Variance Optimization

Martin Haugh Garud IyengarColumbia University

Industrial Engineering and Operations Research

Page 2: Lecture Slides-mean Variance

OverviewAssets and portfoliosQuantifying random asset and portfolio returns: mean and varianceMean-variance optimal portfoliosEfficient frontierSharpe ratio and Sharpe optimal portfoliosMarket portfolioCapital Asset Pricing Model

2

Page 3: Lecture Slides-mean Variance

Assets and portfoliosAsset ≡ 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 assetswi = dollar amount in asset i: wi > 0 ≡ long, wi < 0 ≡ shortNet return on a position w

rw(t) =∑d

i=1 Ri(t)wi −∑n

i=1 wi

W =∑d

i=1 ri(t)wi∑di=1 wi

=d∑

i=1ri(t) ·

wi

W︸︷︷︸xi

portfolio vector x = (x1, . . . , xd): each component can be +ve/-vexi = fraction invested in asset i ⇒

∑di=1 xi = 1

3

Page 4: Lecture Slides-mean Variance

How does one deal with randomness?Random net return on the portfolio rx =

∑di=1 rixi

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

Page 5: Lecture Slides-mean Variance

Random returns on assets and portfoliosParameters defining asset returns

Mean of asset returns: µi = E[ri(t)]Variance of asset returns: σ2

i = 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 returnsExpected return on a portfolio x = (x1, . . . , xd)>

µx = E[rx(t)] =d∑

i=1E[ri(t)]xi =

d∑i=1

µixi

Variance of the return on portfolio x:

σ2x = var(rx(t)) = var

( d∑i=1

rixi

)=

d∑i=1

d∑j=1

cov(ri(t), rj(t)

)xixj

5

Page 6: Lecture Slides-mean Variance

Exampled = 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

σ21 = var(r1) = 0.1 σ2

2 = var(r2) = 0.5σ12 = cov(r1, r2) = cor(r1, r2)σ1σ2 = −0.25

√0.05 = 0.0559

Portfolio: (x, 1− x)

µx =d∑

i=1µixi = x + 2(1− x)

σ2x =

d∑i,j=1

σijxixj =d∑

i=1σ2

i x2i + 2

∑j>i

σijxixj

= 0.1x2 + 0.5(1− x)2 + 2(0.0559)x(1− x)6

Page 7: Lecture Slides-mean Variance

Diversification reduces uncertaintyd assets each with µi ≡ µ, σi ≡ σ, ρij = 0 for all i 6= j

Two different portfoliosx = (1, 0, . . . , 0)>: everything invested in asset 1y = 1

d (1, 1, . . . , 1)>: equal investment in all assets.

Expected returns of the two portfoliosµx = E[

∑di=1 µixi ] = µ1 = µ

µy = E[∑d

i=1 µiyi ] = 1d∑d

i=1 µi = µ

Both have the same expected return!

Variance of returns of the two portfoliosσ2

x = var(∑d

i=1 rixi) = σ2

σ2y = var(

∑di=1 riyi) =

∑di=1 σ

2( 1d )2 = σ2

d

Diversified portfolio has a much lower variance!7

Page 8: Lecture Slides-mean Variance

Markowitz mean-variance portfolio selectionMarkowitz (1954) proposed that

“Return” of a portfolio ≡ Expected return µx“Risk” of a portfolio ≡ volatility σx

Efficient frontier

0 20 40 60 80 100 120 140 160 180−60

−40

−20

0

20

40

60

80

100

120

volatility (%)

return (%)

Efficient frontier ≡ max returnfor a given risk

How does one characterize theefficient frontier?

How does one compute effi-cient/optimal portfolios?

8

Page 9: Lecture Slides-mean Variance

Mean variance formulationsMinimize risk ensuring return ≥ target return

minx σ2x

s.t. µx ≥ r≡ minx

∑di=1∑d

j=1 σijxixj

s.t.∑d

i=1 µixi ≥ r∑di=1 xi = 1.

Maximize return ensuring risk ≤ risk budget

maxx µxs.t. σ2

x ≤ σ̄2≡ maxx

∑di=1 µixi

s.t.∑d

i=1∑d

j=1 σijxixj ≤ σ̄2,∑di=1 xi = 1.

Maximize a risk-adjusted return

maxx µx − τσ2x ≡ maxx

∑di=1 µixi − τ

(∑di=1∑d

j=1 σijxixj

)s.t.

∑di=1 xi = 1.

τ ≡ risk-aversion parameter

9

Page 10: Lecture Slides-mean Variance

Financial Engineering and Risk ManagementEfficient frontier

Martin Haugh Garud IyengarColumbia University

Industrial Engineering and Operations Research

Page 11: Lecture Slides-mean Variance

Mean-variance for 2-asset marketd = 2 assets

Asset 1: mean return µ1 and variance σ21

Asset 2: mean return µ2 and variance σ22

Correlation between asset returns ρ

Portfolio: (x, 1− x)

µx =d∑

i=1µixi = µ1x + µ2(1− x)

σ2x =

d∑i,j=1

σijxixj =d∑

i=1σ2

i x2i + 2

∑j>i

σijxixj

= σ21x2 + σ2

2(1− x)2 + 2ρσ1σ2x(1− x)

2

Page 12: Lecture Slides-mean Variance

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

minx σ21x2 + σ2

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

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

Variance:

σ2r = σ2

1

( r − µ2

µ1 − µ2

)2+ σ2

2

( µ1 − rµ1 − µ2

)2+ 2ρσ1σ2

( r − µ2

µ1 − µ2

)( µ1 − rµ1 − µ2

)= ar2 + br + c

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

3

Page 13: Lecture Slides-mean Variance

Efficient frontier

0 2 4 6 8 10 12 14−6

−4

−2

0

2

4

6

8

10

12

volatility (%)

return (%)

σmin

rmin

Efficient

Inefficient

Only the top half is efficient! why did we get the bottom?

How does one solve the d asset problem?4

Page 14: Lecture Slides-mean Variance

Computing the optimal portfolioMean-variance portfolio selection problem

σ2(r) = minx∑d

i=1∑d

j=1 σijxixj

s.t.∑d

i=1 µixi = r∑di=1 xi = 1.

Form the Lagrangian with Lagrange multipliers u and v

L =d∑

i=1

d∑j=1

σijxixj − v( d∑

i=1µixi − r

)− u

( d∑i=1

xi − 1)

Setting ∂L∂xi

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

2d∑

j=1σijxj − vµi − u = 0, for all i = 1, . . . d (∗)

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 andthere exists u and v satisfying (∗).

5

Page 15: Lecture Slides-mean Variance

Computing the optimal portfolioMatrix formulation

2σ11 2σ12 . . . 2σ1d −µ1 −12σ21 2σ22 . . . 2σ2d −µ2 −1

......

. . ....

......

2σd1 2σd2 . . . 2σdd −µd −1µ1 µ2 . . . µd 0 01 1 . . . 1 0 0

︸ ︷︷ ︸

A

x1x2...

xdvu

=

00...0r1

︸︷︷︸

b

Therefore

x1x2...

xdvu

= A−1b

6

Page 16: Lecture Slides-mean Variance

Two fund theoremFix two different target returns: r1 6= r2

Supposex(1) = (x(1)

1 , . . . , x(1)d )> optimal for r1: Lagrange multipliers (v1, u1)

x(2) = (x(2)1 , . . . , x(2)

d )> optimal for r2: Lagrange multipliers (v2, u2)

Consider any other return rChoose β = r−r1

r2−r1

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

y is a portfoliod∑

i=1yi = (1− β)

d∑i=1

x(1)i + β

d∑i=1

x(2)i = (1− β) + β = 1

y is feasible for target return rd∑

i=1µiyi = (1− β)

d∑i=1

µix(1)i + β

d∑i=1

µix(2)i = (1− β)r1 + βr2 = r

7

Page 17: Lecture Slides-mean Variance

Two fund theorem (contd)Set v = (1− β)v1 + βv2 and u = (1− β)u1 + βu2.

2d∑

j=1σijyj − vµi − u =

d∑j=1

2σij((1− β)x(1)j + βx(2)

j )

− µi((1− β)v1 + βv2)− ((1− β)u1 + βu2)

= (1− β)(

2d∑

j=1σijx(1)

j − v1µi − u1

)

+ β(

2d∑

j=1σijx(2)

j − v2µi − u2

)= 0

y is optimal for target return r!

Theorem All efficient portfolios can be constructed by diversifying between anytwo efficient portfolios with different expected returns.

Why are there so many funds in the market?8

Page 18: Lecture Slides-mean Variance

Efficient frontierThe optimal portfolio for target return r

y∗ =( r2 − r

r2 − r1

)x(1) +

( r − r1

r2 − r1

)x(2)

= r(

x(2) − x(1)

r2 − r1

)︸ ︷︷ ︸

g

+(

r2x(1) − r1x(2)

r2 − r1

)︸ ︷︷ ︸

h

y∗i = rgi + hi , i = 1, . . . , d.

Therefore

σ2(r) =d∑

i=1

d∑j=1

σij(rgi + hi)(rgj + hj)

= r2( d∑

i=1

d∑j=1

σijgigj

)+ 2r

( d∑i=1

d∑j=1

σijgihj

)+( d∑

i=1

d∑j=1

σijhihj

)

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

Page 19: Lecture Slides-mean Variance

Efficient frontier

0 2 4 6 8 10 12 14−6

−4

−2

0

2

4

6

8

10

12

volatility (%)

return (%)

σmin

rmin

Efficient

Inefficient

10

Page 20: Lecture Slides-mean Variance

Financial Engineering and Risk ManagementMean-variance with a risk-free asset

Martin Haugh Garud IyengarColumbia University

Industrial Engineering and Operations Research

Page 21: Lecture Slides-mean Variance

Mean Variance with a risk-free assetNew 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.

max(rf x0 +

∑di=1 µixi

)− τ(∑d

i=1∑d

j=1 σijxixj

)s. t. x0 +

∑di=1 xi = 1.

Only meaningful for r ≥ rf

Substituting x0 = 1−∑d

i=1 xi we get

max rf +∑d

i=1(µi − rf )xi − τ(∑d

i=1∑d

j=1 σijxixj

)

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

2

Page 22: Lecture Slides-mean Variance

Mean-variance optimal portfolioTaking derivatives we get

µ̂i − 2τd∑

j=1σijxj = 0, i = 1, . . . , d.

Matrix formulation

σ11 σ12 . . . σ1dσ21 σ22 . . . σ2d...

.... . .

...σd1 σd2 . . . σdd

︸ ︷︷ ︸

V

x1x2...

xd

=

µ̂1...µ̂d

︸ ︷︷ ︸

µ̂

⇒ x(τ) = 12τ V−1µ̂

The family of frontier portfolios as a function of τ :{(1−

d∑i=1

xi(τ), x(τ))

: τ ≥ 0}

3

Page 23: Lecture Slides-mean Variance

One-fund theoremThe positions in the risky assets in the frontier portfolio

x = 12τ V−1µ̂

do not add up to 1.

Define a portfolio of risky assets by dividing x by the sum of its components.

s∗ =(

1∑di=1 xi

)x =

(1

12τ∑d

i=1(V−1µ̂)i

)( 12τ V−1µ̂

)The portfolio s∗ is independent of τ ! Since

∑di=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 beconstructed by diversifying between the risk-less asset and the single portfolio s∗.

4

Page 24: Lecture Slides-mean Variance

Efficient frontier with risk-free assetReturn and risk of portfolio s∗: µ∗s =

∑di=1 µis∗i , σ∗s =

√∑di=1∑

j=1 σ2ijs∗i s∗j

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

µx = x0rf + (1− x0)µ∗s σx = (1− x0)σ∗s

Efficient Frontier

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

5

6

7

8

9

10

(0, rf )≡ risk-free asset

volatility (%)

return (%

)

(σ∗

s ,µ∗

s)≡ s∗

Straight line with an intercept rfat σ = 0 and slope

m = µs − rf

σs

How does this relate to the fron-tier with only risky assets?

Does the portfolio s∗ have aneconomic interpretation?

5

Page 25: Lecture Slides-mean Variance

Efficient frontier with risk-free asset

0 1 2 3 4 5 6 7 8 91

2

3

4

5

6

7

8

9

volatility (%)

return (%)

θ

(σ∗

s ,µ∗

s) ≡ s∗

rf

s∗ must be an efficient risky portfolio

The efficient frontier with a risk-freeasset must be tangent to the efficientfrontier with only risky assets.

The portfolio s∗ maximizes the angle θ or equivalently

tan(θ) =∑d

i=1 µixi − rf√∑di=1∑d

j=1 σijxixj

= expected excess returnvolatility

6

Page 26: Lecture Slides-mean Variance

Sharpe RatioDefinition. The Sharpe ratio of a portfolio or an asset is the ratio of theexpected excess return to the volatility. The Sharpe optimal portfolio is aportfolio that maximizes the Sharpe ratio.

The portfolio s∗ is a Sharpe optimal portfolio

s∗ = argmax{x:∑d

i=1xi=1

}{µx − rf

σx

}

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 AssetPricing Model.

7

Page 27: Lecture Slides-mean Variance

Financial Engineering and Risk ManagementCapital Asset Pricing Model

Martin Haugh Garud IyengarColumbia University

Industrial Engineering and Operations Research

Page 28: Lecture Slides-mean Variance

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

x(m)i = Ci∑d

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 ofthem invest in the Sharpe optimal portfolio s∗. Let

w(k) = wealth of the k-th investorx(k)

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

ThenCi =

∑k

w(k)(1− x(k)0 )s∗i

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

Page 29: Lecture Slides-mean Variance

Capital Market LineCapital 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

σm= maximum achievable Sharpe ratio

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 isexpected to yield $1000 in one year, but the volatility σ = 40%. The currentinterest 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 worthconsidering?

roil = 1000875 − 1 = 14%� r̄ = rf +

(µm − rf

σm

)σ = 45%

Not worth considering!3

Page 30: Lecture Slides-mean Variance

Inferring asset returns from market returnsAn 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

volatility σγ =√γ2σ2

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

0 1 2 3 4 5 6 7 8 91

2

3

4

5

6

7

8

9

volatility (%)

return (%)

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

risk-free asset ≡ (0, rf )

Efficient frontier with risk−freeEfficient frontier w/o risk−freeEfficient frontier of market + asset 2

4

Page 31: Lecture Slides-mean Variance

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γdσγ

= µj − µmγσ2

j −(1−γ)σ2m+(1−γ)σjm−γσjm√

γ2σ2j +(1−γ)2σ2

m+2σjmγ(1−γ)

dµγdσγ

∣∣∣∣γ=0

= µj − µmσjm−σ2

mσm

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

µj − rf =(σjm

σ2m

)︸ ︷︷ ︸

beta of asset j

(µm − rf )

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

Page 32: Lecture Slides-mean Variance

Connecting CAPM to regressionRegress the excess return rj − rf of asset j on the excess market return rm − rf

(rj − rf ) = α+ β(rm − rf ) + εj

Parameter estimatescoefficient βj = cov(rj−rf ,rm−rf )

var(rm−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 ) = β2j var(rm − rf ) + var(ε)

σ2j = β2

j σ2m︸ ︷︷ ︸

market risk

+ var(ε)︸ ︷︷ ︸residual risk

Only compensated for taking on market risk and not residual risk6

Page 33: Lecture Slides-mean Variance

Security Market LinePlot of the historical returns on an asset vs rf + β(µm − rf )

−2 −1.5 −1 −0.5 0 0.5−8

−6

−4

−2

0

2

4

1

2

3

4

5

6

7

8

Security market line

beta

retu

rn (

%)

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

Page 34: Lecture Slides-mean Variance

Assumptions underlying CAPMAll 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 lineJensen’s index or alpha

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

hold long if positive, short otherwiseSharpe ratio of a stock

sj = µ̂j − rf

σ̂j

hold long if > mMCM, short otherwise.

8

Page 35: Lecture Slides-mean Variance

CAPM as a pricing formulaSuppose the payoff from an investment in 1yr is X . What is the fair price for thisinvestment.

Let rX = XP − 1 denote the net rate of return on X . The beta of X is given by

βX = cov(rX , rm)σ2

m= 1

Pcov(X , rm)

σ2m

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

µX = rf + βX(rm − rf )E[X ]

P − 1 = rf + 1P

cov(X , rm)var(rm) (µm − rf )

Rearranging terms:

P = E[X ]1 + rf

− cov(X , rm)(1 + rf )var(rm) (µm − rf )

9