CHAPTER 16: PORTFOLIO OPTIMIZATION USING …dorpjr/EMSE388/Session 8/Session 8B.pdf · Source:...
Transcript of CHAPTER 16: PORTFOLIO OPTIMIZATION USING …dorpjr/EMSE388/Session 8/Session 8B.pdf · Source:...
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 194 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CHAPTER 16: PORTFOLIO OPTIMIZATION USING SOLVER
PROBLEM DEFINITION: Given a set of investments (for example stocks) how do we find a portfolio that
has the lowest risk (i.e. lowest volatility or lowest variance) and yields an
acceptable expected return?
• Harry Markowitz solved the above problem in 1950’s. For this work and
other investment topics he received the Nobel Prize in Economics in 1991.
• Ideas discussed in this session are the basis for most methods of asset
allocation used by Wall Street firms.
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 195 Source: Financial Models Using Simulation and Optimization by Wayne Winston
WEIGTHED SUM OF RANDOM VARIABLES
• A fixed number of N investments (or Stocks) are available.
• iS : Random return during a calendar year on a dollar invested in investment
I, where i=1, …, N.
Examples:
• 0.10is = , dollar invested at the beginning of the years is worth $1.10 at the
end of the year
• 0.20is = − , dollar invested at the beginning of the years is worth $0.80 at the
end of the year
Definition:
• ix : the fraction of one dollar that is invested in investment i. Note that:
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 196 Source: Financial Models Using Simulation and Optimization by Wayne Winston
,11
=∑=
N
iix Nixi ,,1,0 =≥
• R : be the random annual return on our investments. Then
∑=
∗=n
iii SxR
1
Note that:
• Because the returns on our investments iS are random the annual return R
on our portfolio of investments, defined by ( )NSS ,,1 and the specified
weights ( )Nxx ,,1 is random as well.
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 197 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• The expected (or average) annual return for R can be calculated as:
][][1∑=
∗=n
iii SExRE
WHY?
• We know that if X is a random variable, a and b are constants and Y=a*X+b
that:
E[Y]=E[a*X+b]= a*E[X]+b
• We know that if X and Y are random variables and Z=X+Y that:
E[Z]=E[X+Y]=E[X]+E[Y]
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 198 Source: Financial Models Using Simulation and Optimization by Wayne Winston
WHAT ABOUT THE UNCERTAINTY IN OUR ANNUAL RETURN R?
(or What about the variance of our Annual Return R?)
• We know that if the returns on the investments iS are independent random
variables that
][)(][1
2∑=
∗=n
iii SVARxRVAR
WHY?
•
• We know that if X is a random variable, a and b are constants and Y=a*X+b
that:
VAR[Y]=VAR[a*X+b]= a2*VAR[X]
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 199 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• We know that if X and Y are independent random variables and Z=X+Y that:
VAR[Z]=VAR[X+Y]=VAR[X]+VAR[Y]
BUT?
Can we reasonably say that the annual return iS
are independent random variables?
Answer: NO!
• We know that if the market (e.g. Dow Jones Index) is in an upward trend,
that all stocks have a better chance of doing well.
• We know that if the market (e.g. Dow Jones Index) is in a downward trend,
that all stocks have a higher chance of doing worse.
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 200 Source: Financial Models Using Simulation and Optimization by Wayne Winston
SO WHAT IS THE CORRECT FORMULA FOR THE VARIANCE OF THE
ANNUAL RETURN R WHEN THE INVESTMENTS ARE DEPENDENT?
INTERMEZZO: COVARIANCE
Let X, Y be two random variables.
• If X and Y are independent there is no relationship between X and Y, and:
VAR(X+Y)=VAR(X) +VAR(Y)
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 201 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• If X and Y are positively dependent large values of X tend to be associated
with large values of Y
• If X and Y are positively dependent small values of X tend to be associated
with small values of Y
• If X and Y are negatively dependent large values of X tend to be associated
with small values of Y
• If X and Y are negatively dependent small values of X tend to be associated
with large values of Y.
WHAT IS THE SIMPLEST RELATIONSHIP
THAT YOU THINK OF BETWEEN X AND Y?
ANSWER: A Linear Relationship!
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 202 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Let X,Y be two random variables such that: Y=a*X+b
Y=a*X+b, a>0
X
Y
Large Values of X tend to be associated with Large Values of Y
Small Values of X tend to be associated with Small Values of Y
POSITIVE DEPENDENCE
Y=a*X+b, a<0
X
Y
Large Values of X tend to be associated with Small Values of Y
Small Values of X tend to be associated with Small Values of Y
NEGATIVE DEPENDENCE
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 203 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CAN WE THINK OF A MEASURE IN THE SAME LINE OF THINKING AS E[X]
AND VAR[X] THAT “MEASURES” POSITIVE DEPENDENCE OR NEGATIVE
DEPENDENCE? WHAT ABOUT : COV(X,Y) = E[(Y-E[Y])(X-E[X])]
E[X]
E[Y]
E[(Y-E[Y])(x-E[X])]
(-,-)= +
(+,+)= +
(+,-)= -
(-,+)= -
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 204 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CONCLUSION :
• Covariance is positive when there are more (+,+) points and (-,-) points then
(+,-) points and (-,+) points.
• Covariance is negative when there are more (+,-) points and (-,+) points then
(+,+) points and (-,-) points.
THEREFORE:
Covariance is a measure of positive dependence or negative dependence.
If Y=a*X+b, what is the relationship between COV(X,Y)
and the slope of the line a?
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 205 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• E[Y]=a*E[X]+b
• Y-E[Y]= a*X+b- a*E[X]-b=a*(X-E[X)
• Cov(X,Y)=E[(Y-E[Y])(X-E[X])] =
E[a*(X-E[X])(X-E[X])] = a
a*E[(X-E[X])(X-E[X])] = a*Var[X]
or
( , )( )
COV X YaVAR X
=
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 206 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Y=a*X+b, a>0
X
Y
Y=a*X+b, a>0
X
Y
^ ^
a = COV(X,Y)
VAR(X)
a = COV(X,Y)
VAR(X)
=
^^
^
∑=
−−−
n
iii xxxx
n 1
))((1
1
∑=
−−−
n
iii xxyy
n 1
))((1
1
PERFECT LINEAR RELATIONSHIP IMPERFECT LINEAR RELATIONSHIP
Best FitThroughLinear Regression
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 207 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CONCLUSION:
• If you have a set of points ),( ii yx , i=1,…,n you can estimate positive
dependence or negative dependence by calculating COV(X,Y).
• If you have a set of points ),( ii yx , i=1,…,n you can estimate the slope of the
“linear relationship” by calculating a .
HOW CAN WE DISTINGUISH BETWEEN A PERFECT LINEAR
RELATIONSHIP AND AN IMPERFECT LINEAR RELATIONSHIP
GIVEN THE SET OF POINTS ),( ii yx i=1,…,n?
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 208 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Let X,Y be two random variables such that
Y=a*X+b,
• Cov(X,Y)= a*Var[X]
• Var[Y]= a2*Var[X]
CORRELATION BETWEEN
TWO RANDOM VARIABLES
1)(**)(
)(*)(*)(
),(),(2
±===XVaraXVar
XVaraYVarXVar
YXCovYXCor
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 209 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Y=a*X+b, a>0
X
Y
Y=a*X+b, a>0
X
Y
^ ^
a = COV(X,Y)
VAR(X)
a = COV(X,Y)
VAR(X)
^^
^
PERFECT LINEAR RELATIONSHIP IMPERFECT LINEAR RELATIONSHIP
Best FitThroughLinear Regression
COR(X,Y) = 1
,VAR(Y)>^,VAR(Y)>^ a2 VAR(X)^
a2 VAR(X)^
COR(X,Y) = < 1 ^ COV(X,Y)
VAR(X)
^^
*VAR(Y)^
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 210 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• If X and Y are dependent random variables
VAR(X+Y) = VAR(X) + VAR(Y) + 2*COV(X,Y)
CONCLUSION :
• If X,Y are positive dependent variables the level of variation of X+Y is
amplified by the dependency.
• If X,Y are negative dependent variables the level of variation of X+Y is
reduced by the dependency (the random variables tend to “cancel each
other out”).
BACK TO OUR ORIGINAL PROBLEM
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 211 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• iS : Random returns during a calendar year on a dollar invested in
investment I, where i=1, …, N.
• Random returns iS are dependent random variables
• ix : the fraction of one dollar that is invested in investment i. Note that:
• R be the random annual return on our investments. Then
∑=
∗=n
iii SxR
1
11,
N
iix
=
=∑ 0, 1, ,ix i N≥ =
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 212 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• The expected (or average) annual return for R can be calculated as:
][][1∑=
∗=n
iii SExRE
• The variance of the annual return for R can be calculated as:
∑ ∑∑= ≠==
+∗=n
i
n
ijjjiji
n
iii SSCovxxSVarxRVar
1 ,11
2 ),(][][
or
2
1 1 1,[ ] [ ] ( , ) [ ] [ ]
n n n
i i i j i j i ji i j j i
Var R x Var S x x Cor S S Var S Var S= = = ≠
= ∗ +∑ ∑ ∑
EQUATIONS LOOK COMPLICATED!
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 213 Source: Financial Models Using Simulation and Optimization by Wayne Winston
INTERMEZZO: MATRIX - VECTOR MULTIPLICATION
M⋅N matrix:
=
−
−
nmNMM
NM
N
aaaa
aaaaa
A
,1,1,
,1
2,21,2
,12,11,1
M rows, N Columns
N-Vector (or N⋅1 matrix) :
=
Nx
xx
1
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 214 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Matrix-Vector Product:
=
=
∑
∑
∑
=
=
=
−
−
j
N
jjM
j
N
jj
j
N
jj
NnmNMM
NM
N
xa
xa
xa
x
x
aaaa
aaaaa
xA
1,
1,2
1,1
1
,1,1,
,1
2,21,2
,12,11,1
(M⋅N-Matrix)*(N-vector) =M-Vector
(M⋅N-Matrix)*(N⋅1-Matrix) =M⋅1-Matrix
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 215 Source: Financial Models Using Simulation and Optimization by Wayne Winston
EXAMPLE :
=
++++
=
3620
4*53*42*24*33*22*1
432
542321
VECTOR - MATRIX MULTIPLICATION
M⋅N matrix:
=
−
−
nmNMM
NM
N
aaaa
aaaaa
A
,1,1,
,1
2,21,2
,12,11,1
M rows, N Columns
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 216 Source: Financial Models Using Simulation and Optimization by Wayne Winston
TRANSPOSED M-Vector (or M⋅1 matrix) :
( )MT xxx 1=
Vector - Matrix Product:
( ) =
=
−
−
nmNMM
NM
N
MT
aaaa
aaaaa
xxAx
,1,1,
,1
2,21,2
,12,11,1
1
= ∑∑∑
===Nj
N
jj
N
jjj
N
jjj axaxax ,
112,
11,
(Transposed M –Vector)*(M⋅N-Matrix) =N-Vector
(1⋅M-Matrix)*(M⋅N-Matrix) =1⋅N-Matrix
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 217 Source: Financial Models Using Simulation and Optimization by Wayne Winston
EXAMPLE :
( ) =
542321
54
( ) =+++ 5*53*44*52*42*51*4
( )372814
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 218 Source: Financial Models Using Simulation and Optimization by Wayne Winston
MATRIX – MATRIX MULTIPLICATION: (M⋅N-Matrix)*(N⋅P-Matrix) =M⋅P-Matrix
1,1 1,2 1, 1,1 1,2 1,
2,1 2,2 2,1 2,2
1, 1,
,1 , 1 , ,1 , 1 ,
N P
M N N P
M M N M N N N P N P
a a a b b ba a b b
ABa b
a a a b b b− −
− −
=
1, ,1 1, ,2 1, ,1 1 1
2, ,1 2, ,21 1
1, ,1
, ,1 , , 1 , ,1 1 1
N N N
j j j j j j Pj j j
N N
j j j jj j
N
j j Pj
N N N
M j j M j j P M j j Pj j j
a b a b a b
a b a b
a b
a b a b a b
= = =
= =
=
−= = =
=
∑ ∑ ∑
∑ ∑
∑
∑ ∑ ∑
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 219 Source: Financial Models Using Simulation and Optimization by Wayne Winston
EXAMPLE:
=
654321
542321
=
++++++++
50392822
6*54*42*25*53*41*26*34*22*15*33*21*1
NOTE THAT:
(M⋅N-Matrix)*(N⋅P-Matrix) =M⋅P-Matrix
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 220 Source: Financial Models Using Simulation and Optimization by Wayne Winston
BACK TO OUR ORIGINAL PROBLEM:
2
1 1 1,[ ] [ ] ( , ) [ ] [ ]
n n n
i i i j i j i ji i j j i
Var R x Var S x x Cor S S Var S Var S= = = ≠
= ∗ +∑ ∑ ∑
HOWEVER INTRODUCING WEIGHT VECTOR:
=
Nx
xx
1
AND TRANSPOSE OF WEIGHT VECTOR;
( )n
T
N
T xxx
xx 1
1
=
=
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 221 Source: Financial Models Using Simulation and Optimization by Wayne Winston
AND VARIANCE – COVARIANCE MATRIX:
=
−
−∑
),(),(),(),(
),(),(),(),(),(
11
1
2212
12111
NNNNN
NN
N
SSCovSSCovSSCovSSCov
SSCovSSCovSSCovSSCovSSCov
AND REALIZING THAT: COV(Si,Si)=VAR(Si)
HOMEWORK: SHOW THAT ABOVE ASSERTION IS CORRECT!
2
1[ ] [ ]
n
i ii
Var R x Var S=
= ∗ +∑
1 1,( , ) [ ] [ ]
n nT
i j i j i ji j j i
x x Cor S S Var S Var S x x= = ≠
+ =∑ ∑ ∑
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 222 Source: Financial Models Using Simulation and Optimization by Wayne Winston
PROBLEM DEFINITION:
Given a set of investments (for example stocks) how do we find a portfolio that
has the lowest risk (i.e. lowest volatility or lowest variance) and yields an
acceptable expected return?
• iS : Random return during a calendar year on a dollar invested in investment
I, where i=1, …, N.
• ix : the fraction of one dollar that is invested in investment i. Note that:
11,
N
iix
=
=∑ 0, 1, ,ix i N≥ =
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 223 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• The expected (or average) annual return for R can be calculated as:
)(][][1
xgSExREn
iii =∗=∑
=
• The variance of the annual return for R can be calculated as:
)(][ xfxxRVar T == ∑
OPTIMIZATION PROBLEM:
Minimize : )(xf
Subject to: %)( rxg ≥
0, 1, ,ix i N≥ =1
1N
iix
=
=∑
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 224 Source: Financial Models Using Simulation and Optimization by Wayne Winston
WHAT TYPE OF OPTIMIZATION PROBLEM IS THIS?
• Variance – Covariance Matrix ∑ is known to be positive definite.
• Objective function is a multidimensional quadratic function. Hessian Matrix of
∑ xxT is: ∑
• Conclusion: Objective Function is Convex
• Constraint function %)( rxg − linear function (and thus convex)
• Constraint function 11
=∑=
N
iix can be rewritten as:
1,111
≤≥ ∑∑==
N
ii
N
ii xx
both of which are linear function ( and thus convex).
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 225 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CONCLUSION: OPTIMIZATION PROBLEM IS CONVEX OPTIMIZATION PROBLEM AND HAS A UNIQUE GLOBAL OPTIMUM.
EXAMPLE:
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 226 Source: Financial Models Using Simulation and Optimization by Wayne Winston
AFTER OPTIMIZATION
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 227 Source: Financial Models Using Simulation and Optimization by Wayne Winston
SUPPOSE WE INCREASE THE REQUIRED EXPECTED RETURN, WHAT
HAPPENS TO THE STANDARD DEVIATION OF THE PORTFOLIO?
Required Return Stock 1 Stock 2 Stock 3 Port stdev Exp return0.100 0 0 1 0.0800 0.100
0.105 1/8 0 7/8 0.0832 0.105
0.110 1/4 0 3/4 0.0922 0.110
0.115 3/8 0 5/8 0.1055 0.115
0.120 1/2 0 1/2 0.1217 0.120
0.125 5/8 0 3/8 0.1397 0.125
0.130 3/4 0 1/4 0.1591 0.130
0.135 7/8 0 1/8 0.1792 0.135
0.140 1 0 0 0.2000 0.140
EMSE 388 – Quantitative Methods in Cost Engineering
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 16 - Page 228 Source: Financial Models Using Simulation and Optimization by Wayne Winston
THE EFFICIENT FRONTIER
Efficient Frontier (Risk Versus Expected Return)
0.0500
0.1000
0.1500
0.2000
0.050 0.100 0.150 0.200
Expected Return
Stan
dard
Dev
iatio
n