©

- Finding the Global Minimum Variance Portfolio assuming no riskless lending and borrowing
- Techniques for calculating the efficient frontier
- Step-by-step calculation of the efficient frontier
- Other Links for Portfolio Construction

Optimization by taking two assets at a time, while
conceptually feasible, is not practically possible, and in any
case cannot be done with the formulae in the book. This problem
will have to be solved mathematically first, using matrix
notation. (If you don't follow matrix notation, look up a book on
Portfolio Theory, such as Levy and Sarnat, or Elton & Gruber,
Modern Portfolio Theory and Investment Analysis. If you do want
to understand the material below better, in addition to the
textbooks, you can always come see me.):

If X is the vector of portfolio weights, and Q is the
Variance-Covariance matrix, then the problem of finding the
portfolio with the smallest variance of returns can be stated as:

Min X'QX such that X'* i* = 1, where

Solving this by using calculus, we can write the problem as: Min X'QX -g(X'

The first order condition is: 2QX - g

Normalizing the components of Q

The following description tells us how to compute the entire efficient frontier for different assumptions regarding riskless borrowing and lending.

The efficient set is given by the line R_{f}B. This
can be obtained by maximizing the slope of the set of lines
passing through the point R_{f}.

Max s.t. .

The solution is obtained by solving the set of first order conditions:

, for all i = 1,...,N, where g is the Lagrange multiplier.

Substituting Z_{k} for gX_{k}, we get

**R**-R_{f}* i* = Q'

where Q is the variance-covariance matrix of returns,

The solution is given by **Z** =Q^{-1}(**R**-R_{f}* i*),
and

This follows, because Z_{k} = gX_{k}, and
hence, Z_{k} = X_{k} = g.

Solve for the tangency portfolio as before with different
values for the riskfree rate of return. With R_{f} = R_{f1},
we get portfolio B1; with R_{f} = R_{f2}, we get
portfolio B2. Similarly, we can trace out all other portfolios.

Alternatively, instead of solving the equation **Z** =Q^{-1}(**R**-R_{f}* i*)
for the particular value of R

**Z** = Q^{-1}**R** - (Q^{-1})* i*R

If we wish to find an efficient portfolio with a given
expected return R_{0}, we just need to find the right
value of R_{f} that will produce an expected return of R_{0}.
This can be done by setting **Z**'**R/Z**'* i*
= R

This produces a value R_{f} = **R**'Q^{-1}**R**-R_{0}[* i*'Q

To confirm, compute the portfolio weights, and check to see if the expected return on the resultant portfolio equals R

First use the return data you have to compute the vector **R**
of expected returns, and Q, the variance-covariance matrix. Q is
a matrix containing the variances of the asset returns along the
diagonals, and the covariances along the off-diagonals. Thus, if
we designate by Q(i,j) the cell representing the intersection of
the i-th row and the j-th column, Q(i,j) equals Cov(R_{i},R(_{j})
if i is not equal to j, and equals Var(R_{i}) if i=j.
Obviously, the upper right hand side of the matrix Q is just a
reflection of the lower left hand side of Q. Let us take a
concrete example, using Excel.

Suppose we have the following data:

Date | alco standard corp | american brands inc | brown group inc |

8701 | 0.12836 | 0.17694 | 0.07246 |

8702 | 0.07556 | 0.0202 | 0.06419 |

8703 | -0.0198 | -0.03713 | -0.0127 |

8704 | 0.0101 | -0.0874 | 0.01948 |

8705 | -0.0261 | -0.00518 | -0.03822 |

8706 | 0.07494 | 0.07163 | 0.14238 |

8707 | 0.07692 | 0.07262 | 0 |

8708 | -0.05679 | 0.16877 | 0.01462 |

8709 | 0.00476 | -0.03879 | -0.0317 |

8710 | -0.27014 | -0.22556 | -0.33634 |

8711 | -0.10805 | -0.1261 | 0.08145 |

The expected return vector, **R**, is given by

Expected Return | -0.01002 | -0.00090909 | -0.00222 |

(Note: A vector is a row or column of numbers.)

The variance-covariance matrix, Q, is given by

@var(R1) | @covar(R1,R2)*11/10 | @covar(R1,R3)*11/10 |

@covar(R1,R2)*11/10 | @var(R2) | @covar(R2,R3)*11/10 |

@covar(R1,R3)*11/10 | @covar(R2,R3)*11/10 | @var(R3) |

The numbers, when calculated are:

0.012169 | 0.009986842 | 0.01071 |

0.009987 | 0.014792196 | 0.009255 |

0.01071 | 0.009255227 | 0.015257 |

The next step is to compute the inverse Q^{-1}. The
inverse is also a 3x3 matrix. (For 5 assets, you'd have a 5x5
matrix.)

This is accomplished by using the Excel function MINVERSE.
However, in order for the entire inverse to show up, you must
highlight a 3x3 area, entire the formula (which in our case is
@MINVERSE(Cell Address of Q)), and then press Control, Shift and
Enter simultaneously. This will produce Q^{-1}, the 3x3
inverse of Q. This works out to:

300.8895 | -114.414348 | -141.811 |

-114.414 | 152.4663567 | -12.1741 |

-141.811 | -12.1741212 | 172.4787 |

Now, choose any value for the riskfree rate, say 0.05, or 5%.
Subtract 0.05 from the expected return vector, **R**,
to create a new vector **R**-R_{f}* i*.
In our example, this works out to

R-R_{f}i |
-0.06002 | -0.05090909 | -0.05222 |

Now postmultiply Q^{-1} by the vector **R**-R_{f}* i*.
Postmultiplication is accomplished as follows:

Multiply the first row of Q^{-1} by the vector **R**-R_{f}* i*;

the second row of Q

the third row of Q

(Note: Multiplying two vectors is accomplished by multiplying the first element of the first vector by the first element of the second vector; the second element of the first vector by the second element of the second vector; the third element of the first vector by the third element of the second vector; and adding the three resulting products. In Excel, this can be accomplished by the function @SUMPRODUCT or @MMULT. For @SUMPRODUCT to work, both vectors must be row vectors or both vectors must be column vectors; for @MMULT to work, the first vector must be a row vector and the second vector must be a column vector.)

Alternatively, use @MMULT making sure that you depress
Control, Shift and Enter simultaneously, as for MMINVERSE, and
that you highlight an area of the appropriate size. In this case,
the result of the postmultiplication of Q^{-1} by the
column vector **R**-R_{f}* i*
would be a column vector of length 3.

This gives us three numbers; call these Z1, Z2, and Z3. For our example, the numbers are:

Z |

-4.83033 |

-0.25888 |

0.125338 |

Define three new numbers, X1, X2, and X3, such that X1 = Z1/@sum(Z1,Z2,Z3), Z2 = Z2/@sum(Z1,Z2,Z3), and X3 = Z3/@sum(Z1,Z2,Z3).

For our example, this works out to:

X |

0.973098 |

0.052152 |

-0.02525 |

This represents one efficient portfolio. By varying our choice
of R_{f}, we can compute other efficient portfolios. We
then compute the expected return and standard deviation of these
different portfolios, and then plot them in (E(R), sigma) space
as before.

Note that the variance of a portfolio represented by the vector, X, can be computed very simply as (the row vector X) times (Q) times (the column vector X).

Download Excel file with details of the computations presented here. (Click here for information on how to download Excel files.)

The Optimization Technology Center has a lot of information on optimization algortihms, among them algorithms for the Portfolio Optimization problem. You can find a demo program with a limited number of stocks here.

Also, check out William Sharpe's website and Prof. Michael Kishinevsky's site.