Econ 424
Portfolio Theory with No Short Sales

Eric Zivot

November 25, 2014

Eﬃcient Portfolios without Short-Sales
Short Sale
• Borrow asset from broker and sell now• To close short position, buy back asset and return to broker• Profit if asset price drops after short sale
• If asset  is sold short then  0
where  = share of wealth in asset 

No Short Sale Restrictions• Exchanges (e.g. NYSE, NASDAQ) may prevent short sales in some assets• Some institutions (e.g. pension funds) are prevented from short-sellingassets• Certain accounts do not allow short sales (e.g. retirement accounts)• Short selling often requires substantial credit qualifications

Markowitz Algorithm with No Short Sales Restrictions
2 = x0Σx s.t.
min x = x0 = 0

x01 = 1 ≥ 0 ( = 1     )
Remark: With inequality constraints, the Lagrange multiplier method no longer
works because it imposes an equality in the constraint.

Remarks:• Problem must be solved numerically, e.g. using the Solver in Excel or thefunction solve.QP() in the R package quadprog.

• Portfolio Frontier can no longer be constructed from any two eﬃcient
portfolios (cannot guarantee positive weights). It has to be computed bybrute force for each portfolio with target expected return above the global
minimum variance expected return.

• There may not be a feasible solution; i.e., there may not exist a no-shortsale portfolio that reaches the target return 0• No short sale portfolio frontier must lie “inside” the portfolio frontier thatallows short sales

R functions for Minimum Variance Portfolios with No Short Sales Restrictions• My portfolio_noshorts.r functions can restrict short-sales for all assets(set optional argument shorts=FALSE)• R package quadprog function solve.QP()• R package tseries function portfolio.optim() (wrapper for solve.QP)• Guy Yollin’s R in Finance presentation on R tools for portfolio optimization
http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf

• Rmetrics (www.Rmetrics.org) package fPortfolio• PortfolioAnalytics package functions (from the authors of PerformanceAnalytics) available on R-forge (not ready yet for CRAN)

Solving the Markowitz Algorithm with No Short Sales using the R function solve.QP
Ruppert chapter 11 section 6 shows how the portfolio optimization problem
with inequality constraints can be set up as a quadratic programming problem
that can be solved with the R package quadprog function solve.QP().
Quadratic programming problems are of the form
1 0x
Dx
− d0x
 2A0 x ≥ b for  inequality constraints
A0 x = b for  equality constraints
minwhere D is an  ×  matrix, x and d are  × 1 vectors, A0 is an  × matrix, b is an  × 1 vector, A0 is an  ×  matrix, and b is an  × 1vector.

Consider the portfolio optimization problem
2 = x0Σx s.t.
min x = x0 = 0

x01 = 1 ≥ 0 ( = 1     )

1. For the objective function 12 x0Dx − d0x, set

D = 2 · Σ and d = (0     0)0
Then
1 0x Dx − d0x = x0Σx2

2. For the  = 2 equality constraints A0 x = b  we havex0= 0x = 0
x01= 10x = 1and so set

Ã

010!

0!

(2×1)

Ã!

Ã0x10x!

A0 =(2×)

b =
Then

A0 x =Ã010x=1



=

Ã

0
1!

3. For the  =  inequality constraints A0 x ≥ b we have ≥ 0  = 1     ⇒ x ≥ 0

so setA0 = I,(×)

Then

⎛

0

⎞

. ⎟b = ⎜⎝ . ⎠
(×1)
0A0 x = Ix = x ≥ 0Remark: The function solve.QP() assumes that the inequality constraints andequality constraints are combined into a single ( + ) ×  matrix A0 and asingle ( + ) × 1 vector b of the form

A0 ="A0A0# b=Ãbb

For the portfolio problem we have⎛

⎞⎛
⎞
00
⎜
⎟
⎜
A0 = ⎝ 10 ⎠  b = ⎝ 1 ⎟⎠where 0 = (0     0)0

I

0

!

Solving for the Global Minimum Variance Portfolio with No Short Sales
The optimization problem is2= m0Σm s.t.
min mm01 = 1  ≥ 0Here, the restriction matrices areA0 = 10 b = 1(1×1)(1×)A0 = I and b = (0     0)0(×1)(×)

So thatA0 =Ã10I!

 b=

Ã10!

Finding the Eﬃcient Frontier with No Short Sales• Compute the global minimum variance portfolio with no-short sales• Set an initial grid of target expected returns between the expected return on
the global minimum variance portfolio with no short sales and the highest
single asset expected return• Solve the Markowitz algorithm with no-short sales for each target expected
return in the grid
• Test to see if feasible solutions exist for target expected returns above thehighest single asset expected return