Nonlinear Portfolio Optimization Methods
Nonlinear Portfolio Optimization Methods
053x Week 6
Optimization Methods
in Business Analytics
Nonlinear Programming
1
Nonlinear Optimization
Minimum
value
Thanks
to
Rob
Freund
and
Juan
Carlos
Ferrer
for
sharing
their
slides
2
Overview
• Por8olio
op:miza:on.
4
Por8olio
op:miza:on
• Important
topic
in
Finance
65%
expected
return:
“on
average,”
for
every
dollar
invested,
the
investor
will
have
$1.65
aVer
five
years.
15%
standard
devia:on:
can
be
roughly
interpreted
as
follows.
The
“return”
of
$1
invested
aVer
five
years
is
likely
(approximately
2/3
chance)
to
be
between
65%
-‐
.15%
and
65%
+
.15%,
(50%
and
80%)
7
Objec:ves
• Create
a
por8olio
• Maximize
expected
return
• Minimize
risk
(standard
dev.
of
por8olio)
10
The
three
random
variables
XI = 5-year return on investing in IBM
XP = 5-year return on investing in Prudential
XR = 5-year return on investing in Raytheon
12
Standard
devia:ons
and
variances
Suppose
that
X
is
a
random
variable.
• Let
VAR(X)
denote
Variance
of
X
• VAR(X)
=
SD(X)2
SD(X)
=
VAR(X)1/2
– The
math
of
variances
is
simpler
than
that
of
standard
devia:ons
14
Returns
and
expected
returns
W
=
return
of
the
en:re
por8olio
=
I
XI
+
P
XP
+
R
XR
E[W]
=
I * E(XI) + P * E(XP) + R * E(XR)
= 65 I + 80 P + 50 R
15
Standard
devia:on
and
variance
SD(
P
XP
)
=
SD(XP)
×
P
=
18
P
VAR(
P
XP
)
=
VAR(XP)
×
P2
=
182
P2
VAR(W)
=
Variance
of
the
en:re
por8olio
=
VAR(XI)
×
I2
+
VAR(XP)
×
P2
+
VAR(XR)
×
R2
SD(W)
=
VAR(W)1/2.
16
The
por8olio
op:miza:on
model
min
VAR(W)
=
225 I2
+
324
P2
+
100
R2
s.t.
E(W)
=
65
I
+
80
P
+
50
R
≥
65
I
+
P
+
R
=
1
I
≥
0,
P
≥
0,
R
≥
0
18
Risk
as
a
func:on
of
Expected
return
as
a
expected
return
func:on
of
risk
20
80
stand
dev.
of
por8olio
18
0.80
16
Ray
14
0.60
Prud
12
0.40
10
IBM
0.20
8
6
0.00
55
60
65
70
75
80
55
1
62
0
63
5
74
0
75
5
86
0
22
30
simula:ons
of
5
years
Uncorrelated
returns
130.00
Pruden:al
returns
120.00
110.00
100.00
90.00
80.00
70.00
60.00
50.00
40.00
30.00
50.00
70.00
90.00
110.00
IBM
returns
23
30
simula:ons
of
5
years
Correlated
returns
120.0
110.0
Pruden:al
returns
100.0
90.0
80.0
70.0
60.0
50.0
40.0
30.0
40.0
50.0
60.0
70.0
80.0
90.0
100.0
110.0
IBM
returns
24
What
happens
if
RVs
are
not
independent?
• The
updated
model
is
the
same
as
before
except
that
the
formula
for
the
VAR(W)
is
modified.
27
Risk
vs
Return
(correlated
returns)
stand
dev.
of
por8olio
18
16
14
12
10
8
6
55
60
65
70
75
80
18
16
To
achieve
the
14
same
return
12
The
tradeoff
curve
with
with
posi:vely
10
uncorrelated
correlated
8
returns.
variables,
the
6
55
60
65
70
75
80
risk
increases.
30
On
es:ma:ng
returns
We
don’t
know
the
expected
returns
or
the
covariance
matrix.
We
es:mate
them
from
data.
Five Year Expected Standard Dev. of Return
Company Return (%) (%) The
es:mate
of
expected
IBM 65 15 return
for
each
stock
is
Prudential 80 18
Raytheon 50 10 unbiased.
32
Simula:on
of
the
stock
market
Suppose
we
simulated
returns
from
the
stock
market
• We
can
toss
a
coin
12
:mes
to
simulate
1
year.
• Heads
(tails)
on
toss
j:
– our
stock
has
a
beder
(worse)
return
than
the
S&P
500
in
month
j.
• Keep
track
of
number
of
heads
and
tails.
For
any
given
simulated
stock,
the
expected
number
of
months
it
outperforms
the
stock
market
is
6.
33
We
simulated
500
stocks
for
one
year
120
The
op:mal
por8olio
will
Number
of
stocks
35
Final
comments
on
por8olio
op:miza:on
• Varia:ons
of
this
type
of
model
used
worldwide.
36
Convex
sets
and
convex
func:ons
37
Convex Sets
A set S is convex if for every p1, p2 ∈ S, the line
segment from p1 to p2 is also in the set;
y
3 If p1, p2 ∈ S, then so is (1 - λ)p1 + λp2 for λ ∈ [0,1].
1 2 3 4 x
38
Convex
sets
Non-‐convex
sets
39
Convex
func:ons
Suppose
f
is
defined
on
domain
D.
A
func:on
f
is
convex
if
for
all
x,
y
∈
D,
and
all
λ
∈
[0,1]
f ( λ x + (1 − λ )y ) ≤ λ f (x ) + (1 − λ )f (y )
A
func:on
f
is
strictly
convex
if
for
all
x,
y
∈
D,
and
all
λ
s.t.
0
<
λ
<
1
f ( λ x + (1 − λ )y ) < λ f (x ) + (1 − λ )f (y )
f(x) = x2 f(x) = x3 for x ≥ 0 f(x) = |x|
Strictly
convex
func:ons
Convex
43
f(x)
=
x2
g(x)
=
2x
1
2
1
0
0
-‐1
-‐1
0
1
-‐1
0
1
-‐2
45
Level
sets
of
convex
func:ons
are
convex
sets
Suppose
that
f(x)
is
convex.
Level
set
of
f(x)
at
α
is:
{x
:
f(x)
≤
α
}.
Theorem.
If
f(x)
is
convex,
then
each
level
set
is
a
convex
set.
y
Example:
f(x,
y)
=
x2
+
9y2
1
47
Global
minimum
for
a
minimiza:on
problem
48
ε
balls
in
a
feasible
region
Let
x’
be
a
point
in
S.
Let
B(S,
x’,
ε)
be
the
set
of
all
points
in
S
that
are
ε
within
a
distance
of
ε
from
x’.
B(S,
x’,
ε)
B(S,
x”,
ε)
B(S,
x’,
ε)
is
an
ε-‐ball
in
S
centered
at
x'.
Feasible
region
S
49
Local
minima
Min
f(x)
Problem
s.t.
x
∈
S
P
55
When
prices
depend
on
supplies
MIT
Corp
sells
up
to
1,000
red
widgets
for
a
profit
of
$3.50
per
widget.
It
can
sell
more.
For
every
δ
red
addi:onal
widgets
sold,
the
profit
(for
each
of
the
1,000
+
δ
red
widgets)
is
reduced
by
.002
×
δ.
How
many
should
be
sold,
assuming
no
other
constraints?
56
price
quan:ty
(
Profit(δ )! = 3.50 − .002 δ × 1,000 + δ
! ) ( )
!!!!!!!!!!!!!!!!!!
! = −.002 δ 2
+ 1.5 δ + 3,500
d(Profit)
= −.004 δ + 1.5
! dδ
58
Op:mal
Facility
Loca:on
Locate
a
new
warehouse
to
minimize
total
travel
costs
to
four
sales
centers.
Travel
cost
=
$1
per
mile.
Sales
Center
Code/Coordinates
Daily
Truck
Deliveries
Amherst
A
(8,2)
9
Boston
B
(3,10)
7
Colby
C
(8,15)
2
Dartmouth
D
(14,13)
5
2 4 6 8 10 12 14 16 x
Let P = (x , y) be the location of the warehouse.
( x − 8) + ( y − 2)
2 2
The distance from P to A = (8, 2) is
d(P, A) =
!
61
y
The
loca:on
of
the
four
sales
centers
16 C
14
D
12
10
B The optimal solution is :
Op:mal
loca:on
of
P
8
P=(x,y) P* = ( 6.95 , 7.47 )
6 P*
4 Cost = $142.97
2 A
2 4 6 8 10 12 14 16 x
y Suppose
that
zoning
The
loca:on
of
the
laws
required
it
to
be
within
four
stales
he
4c-‐sided
enters
region
below.
How
do
16 C the
model
and
op:mal
solu:on
change?
14
D
12 Min
[9
d(P,
A)]
+
[7
d(P,
B)]
B
+
[2
d(P,
C)]
+
[5
d(P,
D)]
10
8 P=(x,y) s.t.
P
=
(x,
y)
6 P*
x
≥
10
4
4
≤
y
≤
10
A
x
+
y
≤
24
2
2 4 6 8 10 12 14 16 18
20
x
y Suppose
that
zoning
laws
required
it
to
be
The
loca:on
Suppose
of
the
that
zoning
laws
required
it
to
be
within
four
tsthe
he
4c-‐sided
ales
enters
region
below.
How
do
within
4-‐sided
region
below.
How
do
16 C the
model
and
op:mal
solu:on
change?
the
model
and
op:mal
solu:on
change?
14
D
12
B Optimal is :
10
8
P* = (10.0, 7.4)
P=(x,y)
6 P*
Cost = $154.22
4 Cost has
2 A increased by
$11.25.
2 4 6 8 10 12 14 16 x
The$constrained$location$problem
Before
solving
Decision$variables
the
problem.
P"="(x,"y) x y
0.000 0.000
The$four$ Distance$ Weights$ Weighted$
points from$P (costs) distance
A 8 2 8.246 9 74.216
B 3 10 10.440 7 73.082
C 8 15 17.000 2 34.000
D 14 13 19.105 5 95.525
Total$weighted$distance 276.823
Constraints
x">="10 0.000 >= 10
y">="4 0.000 >= 4
y"<="10 0.000 <= 10
x+y"<="24 0.000 <= 24 65
The$constrained$location$problem
AVer
solving
Decision$variables
the
problem.
P"="(x,"y) x y
10.000 7.400
The$four$ Distance$ Weights$ Weighted$
points from$P (costs) distance
A 8 2 5.759 9 51.829
B 3 10 7.467 7 52.270
C 8 15 7.858 2 15.717
D 14 13 6.882 5 34.408
Total$weighted$distance 154.224
Constraints
x">="10 10.000 >= 10
y">="4 7.400 >= 4
y"<="10 7.400 <= 10
x+y"<="24 17.400 <= 24 66
67
2nd
Order
Cone
Programming:
An
easy
convex
minimiza:on
problem
68
Euclidean
norms
Nota:on:
Suppose
that
y
=
y1,
y2,
…,
yk
y
is
a
vector
of
k
decision
variables.
1/2
⎛ 2⎞
k
Then! y = ⎜ ∑ y i ⎟
2
⎝ i=1 ⎠
( ) .
!
e.g.,
y 2 + 3x1 − x5 ≤ 10
!
**
A
slightly
more
general
form
is
permided.
70
Second
order
cone
program
(SOCP)
• Lots
of
applica:ons
• Special
case
of
convex
minimiza:on
(or
concave
maximiza:on)
• Almost
as
easy
to
solve
as
linear
programs
• Lots
of
available
soVware
– CPLEX
– Gurobi
71
Example
1:
por8olio
op:miza:on
for
independent
random
variables
max E(W) = 65 I + 80 P + 50 R
s.t.
SD(W) ≤ 12
I + P + R = 1
I ≥ 0, P ≥ 0, R≥0
73
Example
2:
Simple
linear
regression
100.0
Es:mate
y
as
a
linear
func:on
of
x.
80.0
Choose
β0
and
β1
60.0
y
and
es:mate
y
as
(x1,
y1)
follows:
for
all
j:
40.0
20.0
ŷ j = β 0 + β 1 x j
!
0.0
N
0.0
50.0
100.0
150.0
200.0
min
∑
(y j − ŷ j )2
x:
independent
variable
! j =1 74
Ge†ng
it
into
the
right
form
N
min
∑
(y j − ŷ j )2
! j =1
76
Guidelines
for
solving
nonlinear
problems
78
Guidelines
in
Solving
Nonlinear
Problems
Guideline
1:
Unlike
linear
op:miza:on,
nonlinear
op:miza:on
may
be
difficult
to
solve
even
with
today’s
computers.