Financial Engineering 3

shoomoosh
Lecture08dmIntrotoPortfolioTheory.pdf

References: Villalobos, Luenberger, Faerber

Lecture 8

Introduction to Portfolio Theory: The Markowitz Model

Lecture Topics • Historical Data • Introduction to the Mean-Variance Portfolio Theory • Markowitz Portfolio Theory • Examples

Where to Find Historical Data?

Adjusted Closing Prices for Various Stocks

0

20

40

60

80

100

120

140

160

180

200

AAPL KO IBM AA YHOO MCD INTC

Change in Closing Prices for Various Stocks

Key Definitions • (Total) Return = Amount Received / Amount Invested

• Rate of Return = (amount received – amount invested)/amount invested

• Random Return is used when the rate of return of an asset is uncertain.

– It is modeled through the random variable r. – Can have negative numbers.

closing price at day Return closing price at day

t n t +

=

( )closing price at day - closing price at day Rate of Return closing price at day

t n t t

+ =

Daily Rate of Return %

-0.6000

-0.4000

-0.2000

0.0000

0.2000

0.4000

0.6000

0.8000

1.0000

1.2000

AAPL KO IBM AA YHOO MCD INTC

APPL Daily Rate of Return %

-0.6000

-0.4000

-0.2000

0.0000

0.2000

0.4000

0.6000

0.8000

1.0000

1.2000

APPL Rate of Return Histogram

0

500

1000

1500

2000

2500

3000

3500 -0

.2

-0 .1

8

-0 .1

6

-0 .1

4

-0 .1

2

-0 .1

-0 .0

8

-0 .0

6

-0 .0

4

-0 .0

2 0

0. 02

0. 04

0. 06

0. 08 0.

1

0. 12

0. 14

0. 16

0. 18 0.

2

Mean ROR and Std Dev of Stocks

-0.08 -0.06 -0.04 -0.02

0 0.02 0.04 0.06 0.08 0.1

0.12 0.14

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035

Standard Deviation

Da ily

R O

R

A KO ADM THC YHOO MCD IBM INTC AA GOOG JNJ 0.027337 0.079182 0.126393 -0.053588 -0.020479 0.106792 0.057243 -0.021191 0.043833 0.045769 0.016268 0.01744 0.008416 0.021003 0.028931 0.032257 0.012266 0.011866 0.018596 0.019935 0.019348 0.007366Standard Dev.

Average

The stocks giving the most return tend to have the highest risk (as measured by the standard deviation)

ADMKO MCD

JNJ

IBM

Ideally we want the average return to be as high as possible and the Std. Dev as small as possible what are the efficient investments?What about a mix (portfolio) of stocks ??

A (.01744,0.0273) Mean-Standard Deviation Diagram – A visual tool

to associate return and risk. It shows the relationship between the mean rate of return of an

asset and its standard deviation. The mean is represented in the Y axis and the standard

deviation in the X axis

Analysis • Can we reduce the risk (Standard Deviation) by having a mix

(portfolio) of stocks? – What do we know?

• From statistical probability classes, we know:

212121 , 222 2 XXXXXX σσσσ ++=+

[ ]1 2 1 2[ ] [ ]E X X E X E X+ = +

1 2 1 2X X X X µ µ µ+ = +

1 2 1w w+ =

1 1 2 2R w R w R= +• Let: – Where R is the return of a portfolio with two securities

having an weighted average return of the returns of R1, R2 – Weights of w1, w2 such that

Portfolio Theory • Let r be a portfolio with n assets, each with (random) rates of return

nrrr ,,, 21 

1 2, , , nr r r

nσσσ ,,, 21 

nwww ,,, 21 

nnrwrwrwr +++= 2211

with expected values (means)

standard deviations of

and weights of

• Then, the return of a portfolio is given by:

Portfolio Theory • Expected value is:

and the variance of the portfolio is

• Where σij is the covariance of assets i and j.

[ ] [ ] [ ] [ ] nrnrrrnn

wwwrEwrEwrEwrE µµµµ +++==+++=  21 212211

ijj n

ji ir ww σσ ∑ == 1,2

Portfolio Theory • The previous formula tells us the variance of the portfolio is

generally lower than the variance of all the individual components, such that the more assets in the portfolio the lower the variance.

• To better appreciate this concept, suppose that we build a portfolio with equal weights of n independent assets with the same variance and mean; therefore:

• The more assets you put in the portfolio, the lower the portfolio’s variance or variability.

– If we put an infinite number of assets the variability would be zero and we would know with absolute certainty the value of the return of our portfolio.

[ ] µµµµµ =  

  =

 

  ++

 

  +

 

  =

n n

nnn rE 111  ∑==

n

in rVar

1 2

2

1][ σ

Two Asset Portfolio • The previous formula was for an uncorrelated portfolio with equal

weights, equal means, and variances. • For a two-asset portfolio (asset 1 and asset 2) suppose the weight of

asset 2 is α, and the weight of asset 1 is (1- α). – We want to know the relationship between the mean and the

standard of the portfolio and the original two assets. • The mean and the variance of the portfolio are:

For ρ (correlation) = 1

For ρ (correlation) = -1

When ρ = -1, the portfolio variance is zero at

[ ] ( ) 211 αµµα +−=rE

( ) ( ) ( )2 2 2 21 12 21 2 1σ α α σ α α σ α σ= − + − +

( ) ( )2 2 2 21 1 2 21 2 1α σ ρα α σ σ α σ= − + − +

1

1 2

σα σ σ

= +

( ) ( ) 211 ασσαασ −−=

( ) ( ) 211 ασσαασ +−=

12

1 2

σρ σ σ

=

Correlation Matrix for Stock Data A KO ADM THC YHOO MCD IBM INTC AA GOOG JNJ

A 1 KO 0.346594 1 ADM 0.19367 0.303081 1 THC 0.168864 0.229366 0.163343 1 YHOO 0.151749 0.252985 0.139808 0.108864 1 MCD 0.327527 0.361147 0.185131 0.124815 0.184524 1 IBM 0.413007 0.382186 0.252992 0.177568 0.225916 0.314534 1 INTC 0.401227 0.423773 0.26097 0.194977 0.303337 0.329691 0.518226 1 AA 0.329062 0.306511 0.399087 0.18076 0.246858 0.238539 0.282154 0.367546 1 GOOG 0.212262 0.341842 0.180249 0.13072 0.154604 0.212994 0.268248 0.317287 0.272848 1 JNJ 0.277274 0.435011 0.148192 0.141308 0.082107 0.242324 0.315683 0.235583 0.144234 0.149517 1

Portfolio Mean and Std Dev

-0.08

-0.06

-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035

A-ADM

Stocks

-0.08

-0.06

-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035

A-ADM

KO-ADM

Stocks

A-ADM Indep

-0.08

-0.06

-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035

Series3 A (.01744,0.0273)

KO ADM (0.126,0.021)

For correlation ρ =1 ( ) ( ) 211 ασσαασ +−=

Portfolio mean when ρ =-1, and

21

1 σσ

σα +=

For correlation ρ =-1 ( ) ( ) 211 ασσαασ −−=

Std. dev. for different α’s

( ) ( ) ( ) 22221212 121 σασσαρασαασ +−+−=Std. dev. when covariance is zero ( ) ( ) 2222121 σασαασ +−=

Feasible Set and Efficient Frontier Suppose that we have a large number of stocks from which you can invest. Since each stock has a mean and a standard deviation, combing all the portfolio possibilities you will get:

Suppose that you want to target a particular return

Or you want to target a particular std dev

Then you will get the efficient frontier

Efficient Frontier

Markowitz Model • To find a minimum variance portfolio, we can fix the mean value

at some arbitrary point r. • Then we can find the feasible portfolio of minimum variance

that has this mean. • The formulation of the problem is:

• This problem is solved with Lagrangian Multipliers. • We solve a series of equations to find the weights (amount to

invest) of the assets in a portfolio.

, 1

1

1

1Minimize 2

Subject to:

1

n i j iji j

n i ii

n ii

w w

w r r

w

σ =

=

=

=

=

∑ ∑

The Solution! • The Markowitz’ selection portfolio has a quadratic objective

function that is subject to linear constraints. – This type of problem can be solved by using Lagrangian

multipliers as follows:

• L is known as the Lagrangian of the original problem. • By differentiating L with respect to the decision variables, in

this case the weights of the assets in the portfolio, and setting these equations to zero and using the original linear constraints, results in a series of linear equations whose solution gives the optimal portfolio.

• If short selling is not allowed (the weights are not allowed to be negative), quadratic programming needs to be used.

• However, for simple cases Excel can be used.

( ) ( )1 2, 1 1 11 12 n n n

i j ij i i ii j i i L w w w r r wσ λ λ

= = = = − − − −∑ ∑ ∑

Example with Two Stocks and Shorting is Allowed • Objective function is to:

• With the following constraints:

• Introducing Lagrangian Multiplier to this problem we get:

( )22221212122121212 1 Minimize σσσσ wwwwww +++

rrwrw =+ 2211

121 =+ ww

( ) ( ) ( )2 2 2 21 1 1 2 12 2 1 12 2 2 1 1 1 2 2 2 1 21 12L w w w w w w w r w r r w wσ σ σ σ λ λ= + + + − + − − + −

• Taking derivatives with respect to the decision variables:

• For this particular example, we have four linear equations with four unknowns.

• Solving this will result in the weights of the portfolio!

211122 2 11

1 λλσσ −−+=

∂ ∂ rww w L

1 1 2 2 1

L w r w r r λ ∂

= + = ∂

221121 2 22

2 λλσσ −−+=

∂ ∂ rww w L

Example with Two Stocks and Shorting is Allowed

1 2 2

1L w w λ ∂

= + = ∂

Example • Find the right amount to invest between the stocks of Intel (r1 =

0.16103, σ1 = 0.4151) and IBM (r2 = 0.11791, σ2 = 0.2388, σ12 = 0.1032) if you have $100,000 to invest and the targeted return is a semi-annual 13% (the return and standard deviations are also in semi-annual basis).

( ) ( ) ( )( ) ( ) ( )( ) ( )

2 22 2 1 1 2 2

1 1 2 2 1 2

1L 0.4151 2 0.1032 0.2388 2

0.16103 0.1179 0.13 1

w w w w

w w w wλ λ

= + + −

+ − − + −

( ) ( ) ( ) 21221 1

16103.01032.04151.0L λλ −−+= ∂ ∂ ww w

( ) ( ) ( ) 21122 2

1179.01032.02388.0L λλ −−+= ∂ ∂ ww w

( ) ( ) 13.01179.016103.0L 21 1

+−−= ∂ ∂ ww λ

1L 21 2

+−−= ∂ ∂ ww λ

Example • Solving this system of four equations we get:

w1 = 0.28 w2 = 0.72

Analysis • Consider the following average returns and standard deviations

of several stocks:

• So, can we use the Markowitz Model to find an optimal portfolio with a desired return of 13%?

Semi-annual Avg Return Std Dev

AA 0.11176 0.27262 IBM 0.11791 0.23888

INTC 0.16103 0.41510 JNJ 0.06815 0.10048

MCD 0.02808 0.20174 YHOO 0.59845 1.24228 THC 0.05618 0.29198

Avg Index 0.10074 0.25596

Semi-annual Avg Return Std Dev

MCD 0.02808 0.20174 THC 0.05618 0.29198 JNJ 0.06815 0.10048

Avg Index 0.10074 0.25596 AA 0.11176 0.27262 IBM 0.11791 0.23888

INTC 0.16103 0.41510 YHOO 0.59845 1.24228

Application to the Stocks • If we use the data for daily return, std dev, covariance, and the

desired return of 13%, we can solve the system of equations that these values produced to get the weights, or relative amounts of each stock to acquire:

• Show Excel file if time permits.

w1 0.203083 w2 0.190351 w3 0.071021 w4 0.311239 w5 0.148525 w6 -0.00506 w7 0.080838 λ1 0.011874 λ2 0.000179

• This Negative value corresponds to “selling short a stock”.

• If we do not want to get negative values we need to use a technique called “Quadratic Programming”.

• Or, for this case, we could set this weight to zero and rebalance the remaining weights.

Assignments • Finish reading Luenberger Chapter 6, if you have not done so

already. • Build your spreadsheets for the Markowitz Model; see the

example in Excel. – Do you recall your matrix algebra and the solution to

simultaneous equations? – Can you set up Excel to manage matrices?

Portfolio Definition • The combined holdings of more than one stock, bond, money

market instrument, commodity, collectible, or real estate investment.

• An individual investor might have a portfolio that includes several of these investments, while the manager of an equity mutual fund will manage a portfolio that is primarily made up of stocks.

• Portfolios tend to consist of a variety of securities in order to minimize investment risk.

Useful Statistics

• If the xi are independent we have:

• If they are identical we have:

2

1 1 ( )

n n

i i i i i

Var a x a Var x = =

  =    ∑ ∑

( ) 1

n

i i

Var x nVar x =

  =    ∑ ( )

1

n

i i

Stdev x n Stdev x =

  =    ∑

2

1 1 , : ( ) 2 ( , )

n n

i i i i i j i j i i i j i j

Var a X a Var X a a Cov X X = = <

  = +    ∑ ∑ ∑

  • Slide Number 1
  • Lecture Topics
  • Where to Find Historical Data?
  • Adjusted Closing Prices for Various Stocks
  • Change in Closing Prices for Various Stocks
  • Key Definitions
  • Daily Rate of Return %
  • APPL Daily Rate of Return %
  • APPL Rate of Return Histogram
  • Mean ROR and Std Dev of Stocks
  • Analysis
  • Portfolio Theory
  • Portfolio Theory
  • Portfolio Theory
  • Two Asset Portfolio
  • Correlation Matrix for Stock Data
  • Portfolio Mean and Std Dev
  • Feasible Set and Efficient Frontier
  • Efficient Frontier
  • Markowitz Model
  • The Solution!
  • Example with Two Stocks and Shorting is Allowed
  • Example with Two Stocks and Shorting is Allowed
  • Example
  • Example
  • Analysis
  • Application to the Stocks
  • Assignments
  • Portfolio Definition
  • Useful Statistics