You can’t see this text!

Introduction to Computational Finance andFinancial Econometrics
Introduction to Portfolio Theory
Eric Zivot
Spring 2015

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

1 / 46

Outline
1 Portfolios of Two Risky Assets
2 Efficient Portfolios with Two Risky Asssets
3 Efficient Portfolios with a Risk-free Asset
4 Efficient Portfolios with Two Risky Assets and a Risk-free Asset

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

2 / 46Investment in Two Risky Assets
RA = simple return on asset A
RB = simple return on asset B
W0 = initial wealth
Assumptions:
RA and RB are described by the CER model:
Ri ∼ iid N (µi , σi2 ), i = A, B
cov(RA , RB ) = σAB , cor(RA , RB ) = ρAB
Investors like high E[Ri ] = µi
Investors dislike high var(Ri ) = σi2
Investment horizon is one period (e.g., one month or one year)
Note: Traditionally in portfolio theory, returns are simple and notcontinuously compounded
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

3 / 46

Portfolios
xA = share of wealth in asset A =$ in A
W0

xB = share of wealth in asset B =$ in B
W0

Long position:
xA , xB > 0
Short position:
xA < 0 or xB < 0
Assumption: Allocate all wealth between assets A and B:
xA + xB = 1
Portfolio return:Rp = xA RA + xB RB
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

4 / 46

Portfolios cont.
Portfolio Distribution:µp = E[Rp ] = xA µA + xB µB22σp2 = var(Rp ) = x2A σA+ x2B σB
+ 2xA xB σAB22= x2A σA
+ x2B σB
+ 2xA xB ρAB σA σB

Rp ∼ iid N (µp , σp2 )End of Period Wealth:W1 = W0 (1 + Rp ) = W0 (1 + xA RA + xB RB )W1 ∼ N (W0 (1 + µp ), σp2 W02 )Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

5 / 46

Portfolios cont.
Result: Portfolio SD is not a weighted average of asset SD unlessρAB = 1:22
σp = x2A σA+ x2B σB
+ 2xA xB ρAB σA σB

1/2

6= xA σA + xB σB for ρAB 6= 1
If ρAB = 1 then:σAB = ρAB σA σB = σA σB
and,22
σp2 = x2A σA+ x2B σB
+ 2xA xB σA σB= (xA σA + xB σB )2⇒ σp = xA σA + xB σBEric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

6 / 46

Example data

µA = 0.175, µB = 0.055
22
σA= 0.067, σB= 0.013σA = 0.258, σB = 0.115
σAB = −0.004875,
ρAB =

σAB
= −0.164σA σB

Note: Asset A has higher expected return and risk than asset B.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

7 / 46

Example
Example: Long only two asset portfolio
Consider an equally weighted portfolio with xA = xB = 0.5. The
expected return, variance and volatility are:µp = (0.5) · (0.175) + (0.5) · (0.055) = 0.115
σp2 = (0.5)2 · (0.067) + (0.5)2 · (0.013)+ 2 · (0.5)(0.5)(−0.004875) = 0.01751√
σp = 0.01751 = 0.1323
This portfolio has expected return half-way between the expected
returns on assets A and B, but the portfolio standard deviation is lessthan half-way between the asset standard deviations. This reflects risk
reduction via diversification.
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

8 / 46

Example
Example: Long-Short two asset portfolio
Next, consider a long-short portfolio with xA = 1.5 and xB = −0.5. In
this portfolio, asset B is sold short and the proceeds of the short saleare used to leverage the investment in asset A. The portfolio
characteristics areµp = (1.5) · (0.175) + (−0.5) · (0.055) = 0.235
σp2 = (1.5)2 · (0.067) + (−0.5)2 · (0.013)+ 2 · (1.5)(−0.5)(−0.004875) = 0.1604√
σp = 0.01751 = 0.4005
This portfolio has both a higher expected return and standard
deviation than asset A.
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

9 / 46

Portfolio Value-at-Risk

Assume an initial investment of $W0 in the portfolio of assets A
and B.
Given that the simple return Rp ∼ N (µp , σp2 ). For α ∈ (0, 1), theα × 100% portfolio value-at-risk isR
W0
VaRp,α = qp,α= (µp + σp qαz ) W0
R is the α quantile of the distribution of R and q z = αwhere qp,αp
αquantile of Z ∼ N (0, 1).

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

10 / 46

Relationship between Portfolio VaR and Individual
Asset VaR
Result: Portfolio VaR is not a weighted average of asset VaR:
VaRp,α 6= xA VaRA,α + xB VaRB,αunless ρAB = 1.
Asset VaRs for A and B are:RA
VaRA,α = q0.05
W0 = (µA + σA qαz )W0RB
VaRB,α = q0.05
W0 = (µB + σB qαz )W0

Portfolio VaR is:
VaRp,α = (µp + σp qαz ) W0=h2 +x2 σ 2 +2x x σ(xA µA +xB µB )+(x2A σA
A B AB )B B

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

1/2 z
qα

i

W0
11 / 46

Relationship between Portfolio VaR and Individual
Asset VaR cont.
Portfolio weighted asset VaR is:
xA VaRA,α + xB VaRB,α = xA (µA + σA qαz )W0 + xB (µB + σB qαz )W0= [(xA µA + xB µB ) + (xA σA + xB σB ) qαz ] W06= (µp + σp qαz ) W0 = VaRp,αprovided ρAB 6= 1.
If ρAB = 1 then σAB = ρAB σA σB = σA σB and:22
σp2 = x2A σA+ x2B σB
+ 2xA xB σA σB = (xA σA + xB σB )2⇒ σp = xA σA + xB σB
and so,xA VaRA,α + xB VaRB,α = VaRp,αEric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

12 / 46

Example
Example: Portfolio VaR and Individual Asset VaRConsider an initial investment of W0 =$100,000. The 5% VaRs on
assets A and B are:RA
W0 = (0.175 + 0.258(−1.645)) · 100, 000 = −24, 937,
VaRA,0.05 = q0.05
RB
W0 = (0.055 + 0.115(−1.645)) · 100, 000 = −13, 416.
VaRB,0.05 = q0.05

The 5% VaR on the equal weighted portfolio with xA = xB = 0.5 is:Rp
VaRp,0.05 = q0.05
W0 = (0.115+0.1323(−1.645))·100, 000 = −10, 268,

and the weighted average of the individual asset VaRs is,
xA VaRA,0.05 +xB VaRB,0.05 =0.5(−24,937)+0.5(−13,416)=−19,177.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

13 / 46

Outline
1 Portfolios of Two Risky Assets
2 Efficient Portfolios with Two Risky Asssets
3 Efficient Portfolios with a Risk-free Asset
4 Efficient Portfolios with Two Risky Assets and a Risk-free Asset

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

14 / 46

Portfolio Frontier

Vary investment shares xA and xB and compute resulting values of µp
and σp2 . Plot µp against σp as functions of xA and xB .
Shape of portfolio frontier depends on correlation between assets
A and B
If ρAB = −1 then there exists portfolio shares xA and xB suchthat σp2 = 0
If ρAB = 1 then there is no benefit from diversification
Diversification is beneficial even if 0 < ρAB < 1

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

15 / 46

Efficient Portfolios
Definition: Portfolios with the highest expected return for a given
level of risk, as measured by portfolio standard deviation, are efficient
portfolios.
If investors like portfolios with high expected returns and dislike
portfolios with high return standard deviations then they will
want to hold efficient portfolios
Which efficient portfolio an investor will hold depends on their risk
preferences
Very risk averse investors dislike volatility and will hold portfolios
near the global minimum variance portfolio. They sacrifice expected
return for the safety of low volatility.
Risk tolerant investors don’t mind volatility and will hold portfoliosthat have high expected returns. They gain expected return bytaking on more volatility.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

16 / 46

Globabl Minimum Variance Portfolio

The portfolio with the smallest possible variance is called theglobal minimum variance portfolio.
This portfolio is chosen by the most risk averse individuals
To find this portfolio, one has to solve the following constrained
minimization problem
22+ x2B σB
+ 2xA xB σABmin σp2 = x2A σAxA ,xBs.t. xA + xB = 1

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

17 / 46

Review of Optimization Techniques: Constrained
Optimization
Example: Finding the minimum of a bivariate function subject to alinear constrainty = f (x, z) = x2 + z 2
min y = f (x, z)x,zs.t. x + z = 1
Solution methods:
Substitution
Lagrange multipliers

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

18 / 46

Method of Substitution
Substitute z = x − 1 in f (x, z) and solve univariate minimization:y = f (x, x − 1) = x2 + (1 − x)2
min f (x, x − 1)xFirst order conditions:0=d 2(x + (1 − x)) = 2x + 2(1 − x)(−1)
dx= 4x − 2⇒ x = 0.5
Solving for z:z = 1 − 0.5 = 0.5
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

19 / 46

Method of Lagrange Multipliers
Idea: Augment function to be minimized with extra terms to impose
constraints.
1

Put constraints in homogeneous form:
x+z =1⇒x+z−1=02

Form Lagrangian function:
L(x, z, λ) = x2 + z 2 + λ(x + z − 1)
λ = Lagrange multiplier

3

Minimize Lagrangian function:
min L(x, z, λ)x,z,λEric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

20 / 46

Method of Lagrange Multipliers cont.
First order conditions:0=∂L(x, z, λ)=2·x+λ∂x

0=∂L(x, z, λ)=2·z+λ∂z

0=∂L(x, z, λ)=x+z−1∂λWe have three linear equations in three unknowns. Solving gives:
2x = 2z = −λ ⇒ x = z
2z − 1 = 0 ⇒ z = 0.5, x = 0.5

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

21 / 46

Example

Example: Finding the Global Minimum Variance Portfolio
Two methods for solution:
Analytic solution using Calculus
Numerical solution
use the Solver in Excel
use R function solve.QP() in package quadprog for quadratic
optimization problems with equality and inequality constraints

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

22 / 46

Calculus Solution
Minimization problem:22min σp2 = x2A σA+ x2B σB
+ 2xA xB σABxA ,xBs.t. xA + xB = 1
Use substitution method with:
xB = 1 − xA
to give the univariate minimization,2
2
min σp2 = x2A σA+ (1 − xA )2 σB+ 2xA (1 − xA )σABxA

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

23 / 46

Calculus Solution cont.

First order conditions:
0=


d 2
d  2 22σp =xA σA + (1 − xA )2 σB+ 2xA (1 − xA )σAB
dxA
dxA

2
2
= 2xA σA
− 2(1 − xA )σB+ 2σAB (1 − 2xA )⇒ xmin
A =

2 −σ
σB
AB
min
, xminB = 1 − xA
2 + σ 2 − 2σσAABBEric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

24 / 46

Excel Solver Solution

The Solver is an Excel add-in, that can be used to numerically solve
general linear and nonlinear optimization problems subject to equality
or inequality constraints.
The solver is made by FrontLine Systems and is provided with
Excel
The solver add-in may not be installed in a “default installation”
of ExcelTools/Add-Ins and check the Solver Add-In box
If Solver Add-In box is not available, the Solver Add-In must be
installed from original Excel installation CD

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

25 / 46

Outline
1 Portfolios of Two Risky Assets
2 Efficient Portfolios with Two Risky Asssets
3 Efficient Portfolios with a Risk-free Asset
4 Efficient Portfolios with Two Risky Assets and a Risk-free Asset

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

26 / 46

Portfolios with a Risk Free Asset

Risk Free Asset:
Asset with fixed and known rate of return over investment horizon
Usually use U.S. government T-Bill rate (horizons < 1 year) or
T-Note rate (horizon > 1 year)
T-Bill or T-Note rate is only nominally risk free

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

27 / 46

Properties of Risk-Free Asset
Rf = return on risk-free asset
E[Rf ] = rf = constantvar(Rf ) = 0
cov(Rf , Ri ) = 0, Ri = return on any asset
Portfolios of Risky Asset and Risk Free Asset:
xf = share of wealth in T-BillsxB = share of wealth in asset B
xf + xB = 1
xf = 1 − xB
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

28 / 46

Properties of Risk-Free Asset cont.
Portfolio return:Rp = xf rf + xB RB= (1 − xB )rf + xB RB= rf + xB (RB − rf )Portfolio excess return:Rp − rf = xB (RB − rf )Portfolio Distribution:µp = E[Rp ] = rf + xB (µB − rf )2
σp2 = var(Rp ) = x2B σB

σp = xB σB
Rp ∼ N (µp , σp2 )Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

29 / 46

Risk PremiumµB − rf = excess expected return on asset B= expected return on risky asset over return on safe asset
For the portfolio of T-Bills and asset B:µp − rf = xB (µB − rf )= expected portfolio return over T-Bill
The risk premia is an increasing function of the amount invested in
asset B.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

30 / 46

Leveraged Investment

xf < 0, xB > 1
Borrow at T-Bill rate to buy more of asset B.
Result: Leverage increases portfolio expected return and risk.
µp = rf + xB (µB − rf )σp = xB σB
xB ↑ ⇒ µ p & σp ↑Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

31 / 46

Determining Portfolio Frontier
Goal: Plot µp vs. σp .
σp = xB σB ⇒ xB =σpσBµp = rf + xB (µB − rf )= rf +

σp(µB − rf )σB= rf +

µB − rfσBµB − rfσBσpwhere,= SRB = Asset B Sharpe Ratio= excess expected return per unit risk
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

32 / 46

Determining Portfolio Frontier cont.

Remarks:
The Sharpe Ratio (SR) is commonly used to rank assets.
Assets with high Sharpe Ratios are preferred to assets with low
Sharpe Ratios

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

33 / 46

Outline
1 Portfolios of Two Risky Assets
2 Efficient Portfolios with Two Risky Asssets
3 Efficient Portfolios with a Risk-free Asset
4 Efficient Portfolios with Two Risky Assets and a Risk-free Asset

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

34 / 46

Efficient Portfolios with 2 Risky Assets and a Risk Free
Asset
Investment in 2 Risky Assets and T-Bill:
RA = simple return on asset A
RB = simple return on asset B
Rf = rf = return on T-Bill
Assumptions:
RA and RB are described by the CER model:
Ri ∼ iid N (µi , σi2 ), i = A, B
cov(RA , RB ) = σAB , corr(RA , RB ) = ρAB

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

35 / 46

Efficient Portfolios with 2 Risky Assets and a Risk Free
Asset cont.

Results:
The best portfolio of two risky assets and T-Bills is the one withthe highest Sharpe Ratio
Graphically, this portfolio occurs at the tangency point of a line
drawn from Rf to the risky asset only frontier
The maximum Sharpe Ratio portfolio is called the “tangency
portfolio”

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

36 / 46

Mutual Fund Separation Theorem

Efficient portfolios are combinations of two portfolios (mutual funds):
T-Bill portfolio
Tangency portfolio - portfolio of assets A and B that has the
maximum Shape ratio
Implication: All investors hold assets A and B according to their
proportions in the tangency portfolio regardless of their risk
preferences.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

37 / 46

Finding the tangency portfolio

max SRp =xA , x Bµp − rf
subject toσpµ p = x A µA + x B µB22σp2 = x2A σA+ x2B σB
+ 2xA xB σAB

1 = xA + xB
Solution can be found analytically or numerically (e.g., using solver in
Excel).

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

38 / 46

Finding the tangency portfolio cont.
Using the substitution method it can be shown that:xtan
A =2 − (µ − r )σ(µA − rf )σB
B
f AB
2
2
(µA − rf )σB + (µB − rf )σA − (µA − rf + µB − rf )σABtanxtan
B = 1 − xA

Portfolio characteristics:
tan
tan
µtan
p = x A µ A + x B µB



σptan

2



= xtanA

2

Eric Zivot (Copyright © 2015)

2
σA+ xtan
B

2

2
tan
σB
+ 2xtan
A xB σAB

Introduction to Portfolio Theory

39 / 46

Efficient Portfolios: tangency portfolio plus T-Bills

xtan = share of wealth in tangency portfolio
xf = share of wealth in T-bills
xtan + xf = 1µep = rf + xtan (µtanp − rf )σpe = xtan σptan
Result: The weights xtan and xf are determined by an investor’s risk
preferences
Risk averse investors hold mostly T-Bills
Risk tolerant investors hold mostly tangency portfolio
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

40 / 46

Example
For the two asset example, the tangency portfolio is:tanxtan
A = .46, xB = 0.54µtan
p = (.46)(.175) + (.54)(.055) = 0.11


σptan

2

= (.46)2 (.067) + (.54)2 (.013)+ 2(.46)(.54)(−.005)= 0.015√
σptan = .015 = 0.124
Efficient portfolios have the following characteristics:µep = rf + xtan (µtanp − rf )= 0.03 + xtan (0.11 − 0.03)
Eric Zivot© 2015)e (Copyright tan

Introduction to Portfolio Theory

41 / 46

ProblemFind the efficient portfolio that has the same risk (SD) as asset B?
That is, determine xtan and xf such that
σpe = σB = 0.114 = target risk.
Note: The efficient portfolio will have a higher expected return thanasset B.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

42 / 46

Solution.114 = σpe = xtan σptan= xtan (.124)⇒ xtan =

.114
= .92
.124

xf = 1 − xtan = .08
Efficient portfolio with same risk as asset B has:(.92)(.46) = .42 in asset A(.92)(.54) = .50 in asset B.08 in T-BillsIf rf = 0.03, then expected Return on efficient portfolio is:µep = .03 + (.92)(.11 − 0.03) = .104.
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

43 / 46

Problem

Assume that rf = 0.03. Find the efficient portfolio that has the same
expected return as asset B. That is, determine xtan and xf such that:µep = µB = 0.055 = target expected return.
Note: The efficient portfolio will have a lower SD than asset B.

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

44 / 46

Solution
0.055 = µep = 0.03 + xtan (.11 − .03)
xtan =

0.055 − 0.03
= .31
.11 − .03

xf = 1 − xtan = .69
Efficient portfolio with same expected return as asset B has:(.31)(.46) = .14 in asset A(.31)(.54) = .17 in asset B.69 in T-Bills
The SD of the efficient portfolio is:
σpe = .31(.124) = .038.
Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

45 / 46

You can’t see this text!

faculty.washington.edu/ezivot/

Eric Zivot (Copyright © 2015)

Introduction to Portfolio Theory

46 / 46