Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound:...

35
Portfolios and Optimization Andrew Mullhaupt
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    225
  • download

    4

Transcript of Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound:...

Page 1: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Portfolios and Optimization

Andrew Mullhaupt

Page 2: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Portfolio Selection

2 1maxT

T

u C ur u

Maximize profit with risk bound:

1

1maxT

T

Cu CuC r Cu

In ‘unit risk’ coordinates:

2

* 1/ 22T

C ru

r C r

Mean-variance portfolio

THE END

Page 3: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Transaction Costs

Commissions and Fees

Taxes

Slippage -

Page 4: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Slippage

0Initial portfolio: u

1Final portfolio: u

0Fair market price at time of decision: p

1 :price d transacteActual p

1 0 1 0Slippage: T

u u p p

Page 5: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Trade size

Exp

ect

ed

C

ost

s

Proportional Costs

Induced Costs

‘Eating the Book’

Page 6: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Portfolio

Loss

Initial Portfolio

Mean-variance portfolio

Cost relative to Initial Portfolio

Total Loss

Risk relative to optimal mean-variance portfolio

Optimal Portfolio

Portfolio Selection With Deterministic Costs

Page 7: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Portfolio

Loss

*0 uu

*0 and risk, cost,by determined is Trade uu

Page 8: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Original Portfolio

Mean-variance Portfolio

:enough small is When *0 uu

Page 9: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Original Portfolio

Trading cannot reduce the loss

Mean-variance Portfolio

tradeno of tradeThe

Page 10: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

No Trade Regions

* 0Set of portfolio differences where the slope

of the risk is less than slopes of cost at zero trade

u u

Proportional Costs:

Always trades to the no-trade region

Independent of induced costs

Page 11: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

No Trade Region = Optimality for Proportional Costs

Optimality for Superproportional Costs Contains The No Trade Region

Page 12: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Take the gradient with respect to wOPTSolve for the optimal trade wUse duality to exchange the order of optimization 1

Trick substitution: maxT T

zT w e T w z

OPT

2OPT * 0

T

w ww u u C T w z

2

* 0 0T

C w u u T w z

TT w e TT w z1

maxz

minw

The no trade region is a Parallelopiped

2* 0 * 0

1

2

Tw u u C w u u

linear image of the cube 1z

OPTNo Trade Region: 0 :w

2* 0 0

T

wu u C T w z

Page 13: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Proportional Costs are Incredible!

as

T ww

w

Proportional costs are too

optimistic for large trades,

so reasonable costs are :superlinear

Page 14: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Who Says Say’s Law?

• Say’s Law: Supply Creates Demand• In the large? (Supply Side Economics).• In the small? Look for sublinear transaction

costs (‘volume attracts volume’).• Not frequent enough to explain the

expectation but it could be a variance component.

Page 15: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Special case quadratic costs Tw diagwc diagw2d

convexity requires d 0

being on the buy side requires c 0

wzTTw z c 2 diagz dw

w u u0 C 2 wzTTw

I 2C 2 diagz d 1u u0 C 2z c

d 0 w u u0 C 2z caka "proportional costs"

Page 16: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

"proportional costs" w u u0 C 2z c

max z 112z cTC 2z c z cTu u0 C 2z c

max z 1 12z cTC 2z c z cTu u0

min z 112z cTC 2z c z cTu u0

min |qk | ck12qTC 2q qTu u0

w u u0 C 2q

Bound constrained quadratic program:

Page 17: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Quadratic loss with bounded trades:

min |w | 12w u u0 TC2w u u0

equivalent to

min |w | 12wTC2w wTC2u u0

also a bound constrained quadratic program.

Page 18: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

minAx b 12xTGx dTx

KKT Conditions

Gx AT d 0

Ax y b 0

y 0

yT 0

#

#

#

#

Page 19: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

G AT 0

A 0 I

0 Y

x

y

Gx AT d

Ax y b

y

Central path 1n y

T

G AT 0

A 0 I

0 Y

x

y

Gx AT d

Ax y b

y

0

0

e

Newton direction

Page 20: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Choose step size t 0 such that

Ax t x b

t 0

#

#

update

Interior point iteration

x, x t x, t

y Ax b

#

#

...what about ?

Page 21: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

G AT 0

A 0 I

0 Y

x

y

Gx AT d

Ax y b

y

0

0

e

eliminate y A x

G AT

A Y

x

Gx AT d

Y

0

e

add ATY 1 times bottom part to the top part:

I ATY 1

0 I

G AT

A Y

G ATY 1 A 0

A Y

The top part is the ‘reduced system’

G ATY 1 A x Gx d ATY 1e

Page 22: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

G ATY 1 A x Gx d ATY 1e

Y Y e A x y A x

Structure of A and G can provide great computational advantage.

Bound Constraints:

I

Ix

l

u

A I

I ATY 1 A is diagonal

Any structure for G that accomodates addition of a diagonal matrix

(banded, sparse, low grade, factor, etc.)

Page 23: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

I XXT I XI XTX 1XT I XXT XI XTX 1XT XXTXI XTX 1XT

I XXT XI XTXI XTX 1XT

I XXT XXT

I

I XXT 1 I XI XTX 1XT

Solve D VVT x y

D D1/2XD1/2XT x y

D1/2I XXT D1/2x y

x D 1/2 I XI XTX 1XT D 1/2y

Page 24: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Iterated Diagonal Box QP

x zD V

V I

x

zz V x

x D VV x

D V

V I

I 0

VD 1 I

D 0

0 I VD 1V

I D 1V

0 I

min l x uz V x

f 12Vz

x 1

2xTDx

Page 25: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Iterated Diagonal Box QP

xk 1 arg minl x u

f 12Vzk

x 1

2xDx

zk 1 V xk 1

#

#

stationarity: 0 f 12Vz

j

Djjx j

x j min uj ,max l j , Djj 1 f 12Vz

j

min l x uz V x

f 12Vz

x 1

2xTDx

Page 26: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Modified Steepest Descent

Alternate between:

Move as far as feasible

1) toward the vertex

2) Toward the minimum along the gradient direction

Page 27: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Postprocessing

Gx d l u 0

x l y l 0

u x yu 0

y l l 0

yu u 0

Once we have u and d we can solve for x via x G 1 l u d

Page 28: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Accuracy Comparison

Page 29: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Time Comparison – 5 instances3000x150

Unstructured (ip) 90.8 sec

Matlab Factor (qp) 0.690

Homegrown factor (bq) 0.995

Diagonal Iterate (di) 0.059

Mod. Steepest Descent (ms) 0.128

The unstructured method is too slow to compare for enough instances

Page 30: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Time and Accuracy 150 instances3000x15

Method Time Max Inaccuracy

QP 17.16 0.3525

BQ 8.5 0.1075

MS 0.91 0.0360

DI 0.37 0.1075

Page 31: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Time and Accuracy 150 instances3000x50

Method Time Max Inaccuracy

QP 19.43 0.2356

BQ 18.55 0.0744

MS 2.04 0.0057

DI 0.722 0.0745

Page 32: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Time and Accuracy 150 instances3000x150

Method Time Max Inaccuracy

QP 17.6 0.1347

BQ 33.2 0.0401

MS 3.8 0.0355

DI 1.72 0.0399

Page 33: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Equity Curve

Page 34: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Covariance Distortion Hedgeminw 1

2u1 u C2u1 u eT|Tu1 u0 |

2u1ThhTu1

u minhTu 0

uTC2u 1

rTu

u minuT C2 hhT u 1 rTu

minw 12u1 u C2 hhT u1 u eT|Tu1 u0 |

Page 35: Portfolios and Optimization Andrew Mullhaupt. Portfolio Selection Maximize profit with risk bound: In ‘unit risk’ coordinates: Mean-variance portfolio.

Question TimeYes, you have questions.