7 2
7 2
tests
Wei-Peng Chen
*
Department of Finance, Hsih-Shin University, Taiwan
[email protected]
Huimin Chung
Graduate Institute of Finance, National Chiao Tung University, Taiwan
Keng-Yu Ho
Department of Finance, National Central University, Taiwan
[email protected]
Tsui-Ling Hsu
Graduate Institute of Finance, National Chiao Tung University, Taiwan
[email protected]
Prepared for Handbook of Quantitative Finance and Risk Management
*
Wei-Peng Chen is at the Department of Finance at Shih-Hsin University; Huimin Chung and Tsui-Ling Hsu are at the
Graduate Institute of Finance at the National Chiao Tung University. Keng-Yu Ho is at Department of Finance, National Central
University. Address correspondence to Huimin Chung, Graduate Institute of Finance, National Chiao Tung University, 1001
Ta-Hsueh Road, Hsinchu 30050, Taiwan; Tel: +886-3-5712121 ext.57075; Fax: +886-3-5733260;. E-mail:
[email protected].
In this chapter we introduce the theory and the application of computer program of modern
portfolio theory. The notion of diversification is age-old don't put your eggs in one basket,
obviously predates economic theory. However a formal model showing how to make the most of
the power of diversification was not devised until 1952, a feat for which Harry Markowitz
eventually won Nobel Prize in economics.
Markowitz portfolio shows that as you add assets to an investment portfolio the total risk of that
portfolio - as measured by the variance (or standard deviation) of total return - declines
continuously, but the expected return of the portfolio is a weighted average of the expected returns
of the individual assets. In other words, by investing in portfolios rather than in individual assets,
investors could lower the total risk of investing without sacrificing return.
In the second part we introduce the mean-variance spanning test which follows directly from the
portfolio optimization problem.
INTRODUCTION OF MARKOWITZ PORTFOLIO-SELECTION MODEL
Harry Markowitz (1952, 1959) developed his portfolio-selection technique, which came to be
called modern portfolio theory (MPT). Prior to Markowitz's work, security-selection models
focused primarily on the returns generated by investment opportunities. Standard investment advice
was to identify those securities that offered the best opportunities for gain with the least risk and
then construct a portfolio from these. Following this advice, an investor might conclude that
railroad stocks all offered good risk-reward characteristics and compile a portfolio entirely from
these. The Markowitz theory retained the emphasis on return; but it elevated risk to a coequal level
of importance, and the concept of portfolio risk was born. Whereas risk has been considered an
important factor and variance an accepted way of measuring risk, Markowitz was the first to clearly
and rigorously show how the variance of a portfolio can be reduced through the impact of
diversification, he proposed that investors focus on selecting portfolios based on their overall risk-
reward characteristics instead of merely compiling portfolios from securities that each individually
have attractive risk-reward characteristics.
A Markowitz portfolio model is one where no added diversification can lower the portfolio's
risk for a given return expectation (alternately, no additional expected return can be gained without
increasing the risk of the portfolio). The Markowitz Efficient Frontier is the set of all portfolios of
2
which expected returns reach the maximum given a certain level of risk.
The Markowitz model is based on several assumptions concerning the behavior of investors
and financial markets:
1. A probability distribution of possible returns over some holding period can be estimated
by investors.
2. Investors have single-period utility functions in which they maximize utility within the
framework of diminishing marginal utility of wealth.
3. Variability about the possible values of return is used by investors to measure risk.
4. Investors care only about the means and variance of the returns of their portfolios over a
particular period.
5. Expected return and risk as used by investors are measured by the first two moments of
the probability distribution of returns-expected value and variance.
6. Return is desirable; risk is to be avoided
1
.
7. Financial markets are frictionless.
MEASURMENT OF RETURN AND RISK
Throughout this chapter, investors are assumed to measure the level of return by computing the
expected value of the distribution, using the probability distribution of expected returns for a
portfolio. Risk is assumed to be measurable by the variability around the expected value of the
probability distribution of returns. The most accepted measures of this variability are the variance
and standard deviation.
Return
Given any set of risky assets and a set of weights that describe how the portfolio investment is
1
Markowitz model assumes that investors are risk averse. This means that given two assets that offer the same expected
return, investors will prefer the less risky one. Thus, an investor will take on increased risk only if compensated by
higher expected returns. Conversely, an investor who wants higher returns must accept more risk. The exact trade-off
will differ by investor based on individual risk aversion characteristics. The implication is that a rational investor will
not invest in a portfolio if a second portfolio exists with a more favorable risk-return profile - i.e., if for that level of risk
an alternative portfolio exists which has better expected returns.
Using risk tolerance, we can simple classify investors into three types: risk-neutral, risk-averse, and risk-lover. Risk-
neutral investors do not require the risk premium for risk investments; they judge risky prospects solely by their
expected rates of return. Risk-averse investors are willing to consider only risk-free or speculative prospects with
positive premium; they make investment according the risk-return trade-off. A risk-lover is willing to engage in fair
games and gambles; this investor adjusts the expected return upward to take into account the fun of confronting the
prospects risk.
3
split, the general formulas of expected return for n assets is:
( )
1
( )
n
P i i
i
E r wE r
(X.1)
where:
1
n
i
i
w
= 1.0;
n = the number of securities;
i
w
= the proportion of the funds invested in security i;
,
i P
r r
= the return on ith security and portfolio p; and
( ) E
= the expectation of the variable in the parentheses.
The return computation is nothing more than finding the weighted average return of the
securities included in the portfolio.
Risk
The variance of a single security is the expected value of the sum of the squared deviations
from the mean, and the standard deviation is the square root of the variance. The variance of a
portfolio combination of securities is equal to the weighted average covariance
2
of the returns on
its individual securities:
( ) ( )
2
1 1
Var Cov ,
n n
p p i j i j
i j
r ww r r
(X.2)
Covariance can also be expressed in terms of the correlation coefficient as follows:
( )
Cov ,
i j ij i j ij
r r
(X.3)
where
ij
, and
j
(X.4)
Overall, the estimate of the mean return for each security is its average value in the sample
period; the estimate of variance is the average value of the squared deviations around the sample
2
High covariance indicates that an increase in one stock's return is likely to correspond to an increase in the other. A
low covariance means the return rates are relatively independent and a negative covariance means that an increase in
one stock's return is likely to correspond to a decrease in the other.
4
average; the estimate of the covariance is the average value of the cross-product of deviations.
EFFICIENT PORTFOLIO
Efficient portfolios may contain any number of asset combinations. We examine efficient
asset allocation by using two risky assets for example. After we understand the properties of
portfolios formed by mixing two risky assets, it will be easy to see how portfolio of many risky
assets might best be constructed.
Two-risky-assets portfolio
Because we now envision forming a -portfolio from two risky assets, we need to understand how
the uncertainties of asset returns interact. It turns out that the key determinant of portfolio risk id the
extent to which the returns on the two assets tend to vary rather in tandem or in opposition. The
degree to which a two-risky-assets portfolio reduces variance of returns depends on the degree of
correlation between the returns of the securities.
Suppose a proportion denoted by
A
w
is invested in asset A, and the remainder
1
A
w
, denoted by
B
w
, is invested in asset B. The expected rate of return on the portfolio is a weighted average of the
expected returns on the component assets, with the same portfolio proportions as weights.
( ) ( ) ( )
P A A B B
E r w E r w E r +
(X.5)
The variance of the rate of return on the two-asset portfolio is
2 2 2 2 2 2
( ) 2
P A A B B A A B B A B AB A B
w w w w w w + + + (X.6)
where
AB
is the correlation coefficient between the returns on asset A and asset B. If the
correlation between the component assets is small or negative, this will reduce portfolio risk.
First, assume that
1.0
AB
, which would mean that Asset A and B are perfectly positively
correlated, the right-hand side of equation X.6 is a perfect square and simplifies to
2 2 2 2 2
2
2
( )
p A A B B A B A B
A A B B
w w w w
w w
+ +
+
or
5
p A A B B
w w +
Therefore, the portfolio standard deviation is a weighted average of the component security
standard deviations only in the special case of perfect positive correlation. In this circumstance,
there are no gains to be had form diversification. Whatever the proportions of asset A and asset B,
both the portfolio mean and the standard deviation are simple weighted averages. Figure X.1 shows
the opportunity set with perfect positive correlation - a straight line through the component assets.
No portfolio can be discarded as inefficient in this case, and the choice among portfolios depends
only on risk preference. Diversification in the case of perfect positive correlation is not effective.
Figure X.1 Investment opportunity sets for asset A and asset B with various correlation coefficients
3
Perfect positive correlation is the only case in which there is no benefit from diversification.
With any correlation coefficient less than 1.0(
1 <
), there will be a diversification effect, the
portfolio standard deviation is less than the weighted average of the standard deviations of the
component securities. Therefore, there are benefits to diversification whenever asset returns are less
than perfectly correlated.
Our analysis has ranged from very attractive diversification benefits (
0
AB
<
) to no benefits at
all
1.0
AB
. For
AB
2
A B
B
A B
w
= -1
B
A
A B
w
+
A
B
A B
w
+
= 0
2
2 2
B
A B
A
w
+
2 2
2 2
2
A B
A B
B
w
+
Above, we simply use two-risky-assets portfolio to calculate the minimum variance portfolio
weights. If we generalization to portfolios containing N assets, the minimum portfolio weights can
then be obtained by minimizing the Lagrange function C for portfolio variance.
2
1 1
Min
n n
p i j ij i j
i j
ww
Subject to
1 2
... 1
N
w w w + + +
( )
1
1 1 1
Cov 1
n n n
i j i j i
i j i
C ww rr W
_
+
,
(X.8)
in which
1
Subject to
( )
*
1
n
i i
i
W E R E
, where
*
E
is the target expected return and
1
1.0
n
i
i
W
The first constraint simply says that the expected return on the portfolio should equal the target
return determined by the portfolio manager. The second constraint says that the weights of the
securities invested in the portfolio must sum to one.
The Lagrangian objective function can be written:
( ) ( )
*
1 2
1 1 1 1
Cov 1
n n n n
i j i j i i i
i j i i
C ww rr E wE r w
1 _
+ +
1
] ,
(X.9)
Taking the partial derivatives of this equation with respect to each of the variables,
1 2
, ,....,
N
w w w
1 2
, , and setting the resulting equations equal to zero yields the minimization of risk
subject to the Lagrangian constraints. Then, we can solve the weights and these weights are
represented optimal risky portfolio by using of matrix algebra.
If there no short selling constraint in the portfolio analysis, second constraint,
1
1.0
n
i
i
w
, should
12
substitute to
1
1.0
n
i
i
w
(X.12)
For the portfolio with two risky assets, the expected return and standard deviation of portfolio
S are
( ) ( ) ( )
P A A B B
E r w E r w E r +
(X.5)
0
B
A
Standard Deviation
E
x
p
e
c
t
e
d
R
e
t
u
r
n
Minimum
variance
portfolio Efficient
frontier of
risky assets
1
U
2
U
15
2 2 2 2 1/ 2
( 2 )
P A A B B A B AB A B
w w w w + + (X.13)
When we maximize the objection function,
S
CAL
, we have to satisfy the constraint that the
portfolio weights sum to 1. Therefore, we solve a mathematical problem formally written as
( )
i
p f
S
w
p
E r r
CAL
Max
Subject to
1
i
w
.In this case of two risky assets, the solution for the weights of the optimal
risky portfolio S, can be shown to be as follows
7
:
2
2 2
[ ( ) ] [ ( ) ]
[ ( ) ] [ ( ) ] [ ( ) ( ) ]
1
A f B B f AB A B
A
A f B B f A A f B f AB A B
B A
E r r E r r
w
E r r E r r E r r E r r
w w
+ +
Then, we form an optimal complete portfolio
8
given an optimal risky portfolio and the CAL
generated by a combination of portfolio S and risk-free asset. We have constructed the optimal
portfolio S, we can use the individual investors degree of risk aversion, A, to calculate the optimal
proportion of complete portfolio to invest in the risky component.
Assuming that a risk-free rate is
f
r
, and a risky portfolio with expected return
( )
p
E r
and
standard deviation
p
+
7
The solution procedure for two risky assets is as follows. Substitute for expected return from equationX.5 and for
standard deviation from equation X.13. Substitute 1
A
w for
B
w . Differentiate the resulting expression for Sp with
respect to
A
w , set the derivative equal to zero, and solve for
B
w .
8
The complete portfolio means that the entire portfolio including risky and risk-free assets.
16
Setting the derivative of this expression to zero, we can solve for
y
yield the optimal position
for risk-averse investors in the risky asset,
*
y , as follows:
*
2
( )
0.01
p f
p
E r r
y
A
(X.14)
The solution shows that the optimal position in the risky asset is, as one would expect,
inversely proportional to the level of risk aversion and the level of risk (measured by the variance)
and directly proportional to the risk premium offered by the risky asset.
Once we have reached this point, generalizing to the case of many risky assets is
straightforward. Before we move on, let us briefly summarize the steps we followed to arrive at the
complete portfolio.
1. Specify the return characteristics of all securities (expected returns, variances,
covariances).
2. Establish the risky portfolio:
a. Calculate the optimal risky portfolio S.
b. Calculate the properties of portfolio S using the weights determined in step and
equations X.5 and X.13.
3. Allocation funds between the risky portfolio and the risk-free asset:
a. Calculate the fraction of the complete portfolio allocated to Portfolio S (the risky
portfolio) and to risk-free asset (equation X.14).
b. Calculate the share of the complete portfolio invested in each asset and in risk-free
asset.
17
Figure X.7 Determination of the optimal portfolio
In practice, when we try to construct optimal risky portfolios from more than two risky assets
we need to rely on Microsoft EXCEL or another computer program. We present can be used to
construct efficient portfolios of many assets in the next section.
ALTERNATIVE COMPUTER PROGAME TO CALCULATE EFFICIENT FRONTIER
Several software packages can be used to generate the efficient frontier. In this section, we will
demonstrate the method using Microsoft Excel and MATLAB.
Application: Microsoft Excel
Excel is far from the best program for generating the efficient frontier and is limited in the
number of assets it can handle, but working through a simple portfolio optimizer in Excel can
illustrate concretely the nature of the calculations used in more sophisticated black-box programs.
You will find that Excel, the computation o the efficient frontier is fairly easy.
Assume an American investor who forms a six-stock-index portfolio. The portfolio consists of
six stock indexes: United State (S&P500), United Kingdom (FTSE100), Switzerlan (Swiss Market
Index, SMI) ,Singapore (Straits Times Index, STI), HongKong (Hang Seng Index, HSI) , and Korea
(Korea Composite Stock Price Index, KOSPI), with monthly price data from Jan. 1990 to Dec.
2006. He/she wants to know his/her optimal portfolio allocation.
Indifference Curve
Opportunity Set of Risky
Assets
Optimal
Complete
Portfolio
CAL
0
Optimal Risky Portfolio
Standard Deviation
E
x
p
e
c
t
e
d
R
e
t
u
r
n
f
r
18
The Markowitz portfolio selection problem can be divided into three parts. First, we need to
calculate the efficient frontier. Secondly, we need to choose the optimal risky portfolio given ones
capital allocation line (find the point at the tangent of a CAL and the efficient frontier). Finally,
using the optimal complete portfolio allocate funds between the risky portfolio and the risk-free
asset.
Step one: Finding efficient frontier
First, we need to calculate expected return, standard deviation, and covariance matrix. The
expected return and standard deviation can been calculated by applying the Excel STDEV and
AVERAGE functions to the historic monthly percentage returns data
9
. Table X.2A and B shows
average returns, standard deviations, and the correlation matrix
10
for the rates of return on the stock
index. After we input Table X.2A into our spreadsheet as shown, we create the covariance matrix in
Table X.2B using the relationship
( , )
i j ij i j
Cov r r
.
Table X.2 Performance of six stock indexes
9
The expected return and standard deviation of each index need to be annualized.
10
The correlation matrix is calculated in Excel using the data analysis function that is found under the Tool Menu. Note
if Data Analysis does not appear on the Tool Menu you will need to select Add-in and add to the Menu.
19
Table X.2 (Concluded)
20
Table X.2 (Concluded)
21
Before computing of the efficient frontier, we need to prepare the data to establish a
benchmark against which to evaluate our efficient portfolios, we can form a border-multiplied
covariance matrix. We use the target mean of 15% for example. To compute the target portfolios
mean and variance, these weights are entered in the border column B49-B54 and border row C48-
H48. We calculate the variance of this portfolio in cell C56 in Table X.2D. The entry in C56 equals
the sum of all elements in the border-multiplied covariance matrix where each element is first
multiplied by the portfolio weights given in both the row and column borders. We also include two
cells to compute the standard deviation and expected return of the target portfolio (formulas in cells
C57, C58)
11
.
To compute points along the efficient frontier we use the Excel Solver in Table X.2D (which you
can find in the Tools menu)
12
. Once you bring up Solver, you are asked to enter the cell of the target
(objective) function. In our application, the target is the variance of the portfolio, given in cell C56.
Solver will minimize this target. You next must input the cell range if the decision variables ( in this
case, the portfolio weights, contained in cells B49-B54). Finally, you enter all necessary constraints
into the Solver. For an unrestricted efficient frontier that allows short sales, there are two
constraints: first, that the sum of the weights1.0 (cell B55=1), and second, that the portfolio
expected return equals target return 15% (cell B58=15)
13
. Once you have entered the two
constraints you ask the Solver to find the optimal portfolio weights.
The Solver beeps when it has found a solution and automatically alters the portfolio weight
cells in row 48 and column C to show the makeup of the efficient portfolio. It adjusts the entries in
the border-multiplied covariance matrix to reflect the multiplication by these new weights, and it
shows the mean and variance of this optimal portfolio-the minimum variance portfolio with mean
return of 15%. These results are shown in Table X.2D, cells C56-C58. You can find that they yield
an expected return of 15% with a standard deviation of 17.11% (results in cells C58 and C57). To
generate the entire efficient frontier, keep changing the required mean in the constraint (cell C58),
11
Because the expected returns and the portfolio weights are represented by column vectors (denoted
e
and
w
respectively, with row vector transposes
T
e
and
T
w
), and the variance-covariance terms by matrix
V
, then the
expressions can be written as simple matrix formulas. So, the calculation of expected return and variance of portfolio
can use the Excel array functions.
Matrix notation Excel formula:
Portfolio return:
T
w e
=SUMPRODUCT(w,e)
Portfolio variance:
T
w Vw
=MMULT(TRANSPOSE( ),MMULT( , )) w V w
12
If Solver does not show up under the Tools menu, you should select Add-Ins and then select Analysis. This should ass
Solver to the list of options in the Tools menu.
13
If you do not set the second constraint: target mean equal to 20, then you can the minimum variance portfolio. The
minimum variance portfolio has 18.637% expected return and a standard deviation of 15.643%.
22
letting the Solver work for you. If you record a sufficient number of points, you will be able to
generate a graph of the quality of Figure X.8.
If short selling is not allowed, the Solver also allows you to all no short sales and other
constrains easily. We need to impose the additional constraints that each weight (the elements in
column B and row 49) must be nonnegative. Once they are entered, you repeat the variance-
minimization exercise until you generate the entire restricted frontier. The outer frontier in Figure
X.8 is drawn assuming that the investor may maintain negative portfolio weights, the inside frontier
obtained allowing short sales. Table X.2 E and F present a number of points on the two frontiers
with and without short sales. You can see that the weights in restricted portfolios are never negative.
The minimum variance portfolios in two frontiers are not the same.
Before we move on, let us summarize the steps of using Solver to calculate the variance-
minimization portfolio.
The steps with Solver are:
1. Invoke Solver by choosing Tools then Options then Solver.
2. Specify in the Solver parameter Dialog Box: the Target cell to be optimized specify max
or min
3. Choose Add to specify the constrains then OK
4. Solve and get the results in the spreadsheet.
Figure X.8 Efficient frontier of unrestricted and restricted portfolio
23
Portfolio Efficient Frontier
0
5
10
15
20
25
30
0 5 10 15 20 25 30 35
Portfolio Risk (%)
P
o
r
t
f
o
l
i
o
R
e
t
u
r
n
(
%
)
Restricted Unrestricted S&P 500 FTSE100 SMI STI HSI KOSPI
Step two: Finding optimal risky portfolio
Now that we have the efficient frontier, we proceed to step two. In order to get the optimal risky
portfolio, we should find the portfolio on the tangency point of capital allocation and efficient
frontier. To do so, we can use the Solver to help us. First, you enter the of the target function,
maximum the reward-to-variability ratio (
( )
p f
p
E r r
+ +
+ +
+
* *
1
B A
w w
Case one: Two assets are perfectly position correlated
If short sales are allowed, then even though
1
Selling short asset A and go extra long in asset B
12
If 1, +
2 2
2
*
( ) ( ) (1 ) ( )
[ (1 ) ]
[ (1 ) ]
: 0
( )
, ( ) ( )
( )
( )
( ) ( )
p A A A B
p A A A B
p A A A B
p
B
A
A A B
p p
A B A B
A A
p
p
A A B
p
p A B
A
E R w E r w E r
w w
w w
MVP w
w
E R
E r E r
w w
E R
E R
w E r E r
w
+
+
+
35
Case Two: Two assets are perfectly negative correlated
Just invest both asset A and b (both in long position)
12
If 1,
2 2
2
*
* 2
*
* *
( ) ( ) (1 ) ( )
[ (1 ) ]
[ (1 ) ]
: 0
a. 0
b.
2
2
2
( ) 0
[ (1 ) ] (
p A A A B
p A A A B
p A A A B
p
B
A
A A B
A A p
A A
B
A A A
A B
B
p A B B B
A B
p A A A B A
E R w E r w E r
w w
w w
MVP w
w
w w
w w
Let w w w
w w w
+
t
+
>
>
+
+ >
+
+
*
*
* *
)
[ (1 ) ]
( )
( )
( ) ( )
c.
0.5
0.5
0.5
( ) 0.5 0
[ (1
A B B
A A
p A A A B
p
p p
A A B
A B
p
A p B B
A
A A
B
A A A
A B
B
p A B B B
A B
p A A A
when w w
w w
E R
E R
w E r E r
w
w
w w
Let w w w
w w
+
>
+
+
+ +
+ +
<
<
+
+ <
+
*
) ] [ ( ) ]
[ ]
( )
( )
( ) ( )
( )
B A A B B
A A
p A A B A B
p
p p
A A B
A B
p
A p A B
A
w
when w w
w w
E R
E R
w E r E r
w
w
+
<
+
+
+
36
Appendix B
The weights of minimum variance portfolio
The weights should be chosen so that (for example) the risk is minimized, that is
2 2 2 2 2
Min 2
A
P A A B B A B AB A B
w
w w w w + +
for each chosen return and subject to
1, 0, 0
A B A B
w w w w +
. The last two constraints simply
imply that the assets cannot be in short positions.
Substitute
( , )
A B
AB
A B
Cov r r
2
2 2 2
2 2 2 2 4
P
A A B A B AB A B A AB A A
A
w w w
w
+ +
=
2 2 2
2 ( 2 ) 2 2 0
A A B AB A B B AB B A
w +
2
2 2
2
B AB A B
A
A B AB A B
w
+
1
B A
w w
When = 1
B
A
A B
w
2
A B
B
A B
w
When = -1
B
A
A B
w
+
A
B
A B
w
+
When = 0
2
2 2
B
A B
A
w
+
2 2
2 2
2
A B
A B
B
w
+
37