Professional Documents
Culture Documents
Stephen Boyd
EE103
Stanford University
December 8, 2017
Outline
Portfolio investment
Portfolio optimization
60
50
40
Prices
30
20
10
0
0 500 1000 1500 2000 2500
Days
zoomed in to 10 weeks
70
KO
BP
60
50
40
Prices
30
20
10
0
1600 1605 1610 1615 1620 1625 1630 1635 1640 1645 1650
Days
0.1
0.05
Returns
−0.05
−0.1
−0.15
−0.2
1600 1605 1610 1615 1620 1625 1630 1635 1640 1645 1650
Days
SBUX
20
GS
Annualized Return
15
BRCM
MMM
10
USDOLLAR
0
0 10 20 30 40 50 60
Annualized Risk
Portfolio investment
Portfolio optimization
Portfolio investment 11
Portfolio of assets
I n assets
I 1T wt = 1
Portfolio investment 12
Examples
Portfolio investment 13
Portfolio return and risk
Vt+1 − Vt Vt (1 + r̃tT wt ) − Vt
= = r̃tT wt
Vt Vt
I rt = r̃tT wt is called portfolio return in period t
I r is T -vector of portfolio returns
I avg(r) is portfolio return (over periods t = 1, . . . , T )
I std(r) is portfolio risk (over periods t = 1, . . . , T )
Portfolio investment 14
Compounding and re-investment
I VT +1 = V1 (1 + r1 )(1 + r2 ) · · · (1 + rT )
I product here is called compounding
I for |rt | small (say, ≤ 0.01) and T not too big,
VT +1 ≈ V1 (1 + r1 + · · · + rT ) = V1 (1 + T avg(r))
Portfolio investment 15
Constant weight portfolio
Portfolio investment 16
Cumulative value plot
2.5
2
Value
1.5
0.5
0
0 500 1000 1500 2000 2500
Days
Portfolio investment 17
Cumulative value plot
I w = (−3, 4)
I portfolio goes bust (drops to 10% of starting value)
4
x 10
3
leveraged portfolio
individual assets
2.5
2
Value
1.5
0.5
0
0 500 1000 1500 2000 2500
Days
Portfolio investment 18
Outline
Portfolio investment
Portfolio optimization
Portfolio optimization 19
Portfolio optimization
Portfolio optimization 20
Portfolio optimization
I we are really asking what would have been the best constant
allocation, had we known future returns
Portfolio optimization 21
Portfolio optimization via least squares
Portfolio optimization 22
Examples
Portfolio optimization 23
Cumulative value plots for optimal portfolios
cumulative value plot for optimal portfolios and some individual assets
5
10
Value
4
10
Portfolio optimization 24
Optimal risk-return curve
25
20
Annualized Return
15
10
0
0 10 20 30 40 50 60
Annualized Risk
Portfolio optimization 25
Optimal portfolios
Portfolio optimization 26
The big assumption
I for example:
– choose w based on last 2 years of returns
– then use w for next 6 months
Portfolio optimization 27
Optimal risk-return curve
I trained on 900 days (red), tested on the next 200 days (blue)
I here BA held reasonably well
Train
25 Test
20
Annualized Return
15
10
0
0 2 4 6 8 10 12 14 16
Annualized Risk
Portfolio optimization 28
Optimal risk-return curve
4.5
4 Train Test
3.5
2.5
1.5
0.5
0
0 500 1000 1500 2000 2500
Portfolio optimization 29
Optimal risk-return curve
25 Train
Test
20
15
10
Annualized Return
−5
−10
−15
−20
0 2 4 6 8 10 12 14 16
Annualized Risk
Portfolio optimization 30
Optimal risk-return curve
4.5
4 Train Test
3.5
2.5
1.5
0.5
0
0 500 1000 1500 2000 2500
Portfolio optimization 31
Rolling portfolio optimization
rt−1 , . . . , rt−L
variations:
I update w every K periods (say, monthly or quarterly)
I add cost term κkwt − wt−1 k2 to objective to discourage turnover,
reduce transaction cost
I add logic to detect when the future is likely to not look like the past
I add ‘signals’ that predict future returns of assets
(. . . and pretty soon you have a quantitative hedge fund)
Portfolio optimization 32
Rolling portfolio optimization example
1.2
1.15
Value
1.1
1.05
0.95
1600 1700 1800 1900 2000 2100 2200 2300 2400 2500
Days
Portfolio optimization 33
Rolling portfolio optimization example
1.2
1.15
Value
1.1
1.05
0.95
1600 1700 1800 1900 2000 2100 2200 2300 2400 2500
Days
Portfolio optimization 34