Playing with the Rubik cube: Principal Component Analysis Solving the Close E...
Case 2
1. Introduction
In this case, 16 stocks were selected to find out the minimum variance portfolio. Hang
Seng Industry Classification System would be a good tool to select stocks according to their
different industries, it is a system designed for the Hong Kong Stock market, covering 11
industries and 28 sectors.
4 stocks from materials industry, 3 stocks from industrial Goods industry, 3 stocks from
the Consumer Services industry and 4 stocks from the Properties and Construction industry were
selected to form a portfolio in order to determine the minimum variance of the portfolio.
For a minimum variance portfolio, it is a portfolio where the investor invest their money
to buy the stocks according to the portfolio weights of different selected stocks, at which the
investor is in the lowest risk situation when compare to other portfolio weights of the same group
of stocks.
Methodology
` First, to compute the minimum variance portfolio, some basic information are needed,
using Bloomberg, the end-of-month closing price from February 2012 to February 2104 of the
selected stocks could obtained.
After finding out the end-of-month closing price of the selected stocks, rate of return of
the stocks could be obtained by using the formula below,
where is the rate of return at time t.
Using the following formula, annualized mean, annualized variance and annualized
covariance of the selected stock could be determined,
1
2. where is the rate of return at time t, M is the total number of period , n is the number of
period per year.
After finding the annualized mean, variance and covariance, the annualized mean vector
and the covariance matrix of the rate of return could be obtained, where the annualized mean
vector of rate of return is in the form as below,
where is the annualized mean of rate of return of the stock.
The form of the covariance matrix of the rate of return of the selected stocks is shown below,
2
3. where is the covariance of the stock rate of return and the rate of return, if
i = j, then represents the variance of the stock rate of return.
By the Markowitz portfolio theory, which developed by Harry Markowitz, who derived
the expected rate of return for a portfolio of assets and an expected risk measure. This model
shower that the variance of the rate of return was a meaningful measure of portfolio risk under a
reasonable set of assumptions. This model derived the formulas for computing the variance of a
portfolio not only indicated the importance of diversifying the investments to reduce the total
risk of a portfolio, but also showed how to effectively diversify. The Markowitz solution can be
found by using the method of Lagrange Multiplier, then the minimum variance set of the
portfolio could be determined, where the minimum variance set would be shown as below,
where represents the portfolio weight of the stock.
The mean ) and standard deviation ( ) of the annual rate of return of this minimum
variance portfolio then could be calculated
.
3
4. Then the mean-standard deviation diagram could be computed when setting two different
level of expected rate of return, which contained the minimum variance set, finally the efficient
portfolio with minimum variance could be determined.
In the above case, only one constraint exist, which is the sum of the 16 portfolio weights
(wi) need to equal to one. Now adding one more constraint to the Lagrange Multiplier, setting the
expected rate of return of the portfolio equal to the second highest annual rate of return among
16 selected stocks, which means adding the following constraints,
Using the two fund theorem, the weights of different selected stocks then could be calculated
where w1i represents the weightings of the ith
stock in the portfolio 1, w2i is the weightings of the
ith
stock in the portfolio 2
4
5. Select 16 stocks in 4 given industries
Using the Hang Seng Industry Classification system, the 16 stocks were selected as
follow,
Materials Stock Code
1 297 Sinofert
2 347 Angang Steel
3 1208 MMG
Inductrial Goods
1 148 Kingboard Chem
2 316 OOIL
3 566 Hanergy Solar
4 658 C Transmission
Consumer Services
1 66 MTR Corporation
2 293 Cathay Pac. Air
3 308 China Travel HK
4 753 Air China
5 69 Shangri-La Asia
Properties & Construction
1 1 Cheung Kong
2 12 Henderson Road
3 17 New World Dev
4 119 Poly Property
5
6. Find the end-of-month closing price
The end-of-price of the 16 selected stocks from February 2012 to February 2014 were
attached in the Appendix A.
Annualized mean vector and covariance matrix
By using the formula stated in the methodology part, the annualized mean vector of the
annual rate of return can be calculated and the result is shown below,
The covariance matrix can also be computed according to the formula below,
where M represents the total number of period, n represents the number of period per year.
6
7. The covariance matrix of the annual rate of return of these 16 selected stocks was attached in the
Appendix B.
Find the minimum variance set and the mean-standard deviation
diagram
To find out the minimum variance set, two set of solution that have the minimum
variance with different level of expected return need to be considered as to apply the two fund
theorem.
Setting the two expected return as 0.002 and 0.1, two different set of solutions including
the weightings of each of the 16 selected stocks, the portfolio mean and standard deviation of the
rate of return could be obtained by using the Langrage Multiplier and the formula stated above.
In this case, rather than one constraint, two constraints were subjected to minimize the
variance of the portfolio,
where in this case would equal to 0.002 and 0.1 respectively in order to find out two set of
solutions according to the different expected rate of return.
7
8. Find out and then put them equal to zero, there would have 18 equations and 18
unknowns, after that, transformed the 18 equations into the form ,
V is the var-cov(r) matrix
8
9. R is the annualized mean vector,
Result could be computed and the solutions of the two portfolios with different expected rate of
return could be found in the Appendix C.
Two sets of solution could be computed, using the result of the weightings of the 26
selected stocks in two different expected rate of return, the mean and standard deviation of the
portfolio could be obtained, letting the portfolio with expected rate of return 0.002 be portfolio A
and the one with expected rate of return 0.1 be portfolio B, the table below could be constructed,
portfolio A portfolio B
variance 0.007930757 0.008376584
S.D 0.089054796 0.091523679
expected rate of
return
0.002 0.1
covariance 0.00786807
where the covariance is computed using the equation below,
XA is the matrix of weightings of the 16 selected stocks in portfolio A, XB represented that of
portfolio B. V is the variance covariance matrix of the rate of return of the 16 selected stocks.
9
10. Consider portfolio A as asset A and portfolio B as asset B, then using the two assets case,
the minimum variance set can be calculated and the diagram could be computed. Let
and be the rate of return of the asset A and B respectively, has the mean of and the
variance of ; has the mean and variance of and respectively. The covariance of
and is .
Let x and 1-x be the portfolio weight of asset A and asset B respectively. The rate of
return of the portfolio and the mean of the rate of return are,
and the variance is,
Different portfolio weights involving the two portfolios mentioned above are used with the mean
and standard deviation of the rate of return of portfolios that are listed in the following table,
weight of portfolio A portfolio standard deviation portfolio mean
-0.5 0.095015251 0.149
-0.4 0.094206088 0.1392
-0.3 0.093451058 0.1294
-0.2 0.092751482 0.1196
-0.1 0.092108624 0.1098
0 0.091523679 0.1
0.1 0.090997764 0.0902
0.2 0.090531908 0.0804
0.3 0.090127041 0.0706
0.4 0.08978399 0.0608
0.5 0.089503464 0.051
0.6 0.089286054 0.0412
10
11. 0.7 0.089132221 0.0314
0.8 0.089042294 0.0216
0.9 0.089016467 0.0118
1 0.089054796 0.002
1.1 0.089157199 -0.0078
1.2 0.089323455 -0.0176
1.3 0.089553207 -0.0274
1.4 0.08984597 -0.0372
1.5 0.09020113 -0.047
After finding the portfolio standard deviation and mean with different weighting of portfolio A
and B, the mean-standard deviation diagram could be obtained by the minimum variance sets in
the table above,
From the diagram above, the minimum-variance set has bullet shape, there is a special
point having the minimum variance which called minimum-variance point, which is shown by
the cross in the above diagram. Using this minimum-variance point, the efficient portfolio could
be obtained by using the two fund theorem.
11
12. The curve in the above mean-standard deviation diagram defined by nonnegative
mixtures of two assets A and B lies within the triangular region shown below which defined by
the two original assets A and B and point on the vertical axis of height is
Point on the vertical axis of height:
By substituting the value of , the vertical axis of height is 0.05033
Using the two fund theorem,
By solving the equation, x = 0.50684 and using the equation stated before, the efficient portfolio
could be calculated easily, the mean, variance and standard deviation of the portfolio could also
be found out, the mean of this portfolio is equal to 0.05033 and the variance is 0.008008.
12
13. Stock Allocation
Sinofert -0.00612
Angang Steel -0.137344
MMG 0.1544809
Kingboard Chem -0.199923
OOIL -0.088097
Hanergy Solar 0.0077333
C Transmission 0.0806506
MTR Corporation 0.6629117
Cathay Pac. Air 0.1650581
China Travel HK 0.3799111
Air China 0.0911574
Shangri-La Asia -0.150657
Cheung Kong 0.289253
Henderson Road 0.1659749
New World Dev -0.378129
Poly Property -0.036862
expected rate of return 0.05033
Variance 0.0080078
Determine the efficient portfolio
To find the solution of the Markowitz model, Lagrange Multiplier is a good method to
solve this problem, by setting the condition and the constraints,
where wi is the portfolio weight of the ith
stock of the 16 selected stocks.
13
14. Then using the method of Lagrange Multiplier, the equation below could be obtained,
After setting the equation above, by finding and , then put these 17 equations equal to
zero,
where i=1,2,3,….,16
Using as an example, it can be used to prove the 17 equations can be expressed in a matrix
form.
which is the same as
14
15. For i=1,2,3,…16, same expression could be obtained. When combining these 16 equation to
matrix form like the one above, the below result would be obtained,
Also, for the , could also be transformed to matrix form
By combing all the matrix above, the matrix form of these 17 equations were shown as below,
V is the var-cov(r) matrix
15
16. is in the form of , where
By using the property of matrix, value of matrix x could be found out easily,
By using the var-cov(r) matrix obtained above, the weightings of the 16 selected stocks with the
minimum variance could be found out eventually, the result was shown below,
16
17. The mean and the standard deviation of the portfolio can be calculated using the formula stated
in the methodology part,
.
The mean and variance of the annual rates of return of this minimum variance set is 0.01276 and
0.0079739 respectively.
17
18. Stock Allocation
Sinofert 0.0182314
Angang Steel -0.166412
MMG 0.1938072
Kingboard Chem -0.185961
OOIL -0.091607
Hanergy Solar -0.00247
C Transmission 0.0702031
MTR Corporation 0.5955472
Cathay Pac. Air 0.1582968
China Travel HK 0.4394392
Air China 0.0542938
Shangri-La Asia -0.152109
Cheung Kong 0.2865231
Henderson Road 0.1878331
New World Dev -0.387335
Poly Property -0.018281
expected rate of return 0.0127551
Variance 0.0079239
The efficient portfolio can also be estimated by the mean-standard deviation diagram
shown above. For the diagram above, the minimum-variance point is (0.089016467, 0.0118),
which means the expected rate of return and standard deviation of the efficient portfolio is
0.0118 and 0.089016467 respectively. At this level of mean, by checking the table in the
previous page, the weight of portfolio A is 0.9, which means x=0.9, by the two-fund theorem,
two efficient funds can be established so that any efficient portfolio can be duplicated, in terms
of mean and variance, as a combination of these two. On other words, all investor seeking
efficient portfolios need only in combinations of these two funds.
is the weighting of the ith
stock of the 16 selected stocks in the efficient portfolio,
and are weightings of the ith
stock of the selected stocks in the portfolio A and portfolio
B which have found already in the previous part.
18
19. The efficient portfolio would be,
with the mean equal to 0.118 and variance equal to 0.0079239 which used the annualized mean
vector and the variance-covariance matrix of the rate of return to compute.
Find the efficient portfolio when given the target expected rate of
return
This time setting the target expected rate of return as the 2nd
highest annualized mean of
rate of return of the 16 selected stocks, by using the same method as before, the efficient
portfolio could be calculated easily,
By checking the annualized mean vector of the rate of return of the selected stocks, the
target expected rate of return is 0.03491, using two fund theorem,
19
20. Then the weightings of the stocks in this efficient portfolio are,
Stock Allocation
Sinofert 0.0038748
Angang Steel -0.149275
MMG 0.170622
Kingboard Chem -0.194192
OOIL -0.089537
Hanergy Solar 0.0035456
C Transmission 0.0763625
MTR Corporation 0.6352626
Cathay Pac. Air 0.162283
China Travel HK 0.4043438
Air China 0.0760271
Shangri-La Asia -0.151253
Cheung Kong 0.2881326
Henderson Road 0.1749464
New World Dev -0.381908
Poly Property -0.029235
expected rate of return 0.0349078
Variance 0.0159061
the portfolio mean and variance are 0.0349078 and 0.0159061 respectively.
Conclusion
From the result calculated above, a portfolio which consists of a basket of stocks has the
lowest variance compare to any single stock in the basket. In the case above, the portfolio
consists of the 16 selected stocks can construct a efficient minimum variance portfolio has a
relatively lower variance when compare to the 16 stocks, which means the portfolio would have
a lower risk for investor to invest comparing to the singe stocks. Moreover, when more and more
stocks are added into the portfolio, the variance of the minimum efficient portfolio would be
lower and lower, the more the stocks in the portfolio, the lower the variance, which implied a
lower risk could be obtained. This phenomenon called diversification. Investor always pretend to
invest in an assets which has a lower risks, which mean a relatively lower variance portfolio, by
20
26. Appendix C.
Portfolio A Portfolio B
Stock Allocation
Sinofert 0.0252015
Angang Steel -0.174732
MMG 0.2050635
Kingboard Chem -0.181965
OOIL -0.092612
Hanergy Solar -0.00539
C Transmission 0.0672127
MTR Corporation 0.5762655
Cathay Pac. Air 0.1563616
China Travel HK 0.4564779
Air China 0.0437423
Shangri-La Asia -0.152524
Cheung Kong 0.2857417
Henderson Road 0.1940896
New World Dev -0.389971
Poly Property -0.012962
expected rate of return 0.002
Variance 0.0079308
Stock Allocation
Sinofert -0.03831
Angang Steel -0.09892
MMG 0.1024961
Kingboard Chem -0.218379
OOIL -0.083456
Hanergy Solar 0.0212204
C Transmission 0.0944612
MTR Corporation 0.7519599
Cathay Pac. Air 0.1739958
China Travel HK 0.3012217
Air China 0.139887
Shangri-La Asia -0.148738
Cheung Kong 0.2928617
Henderson Road 0.1370807
New World Dev -0.365958
Poly Property -0.061424
expected rate of return 0.1
Variance 0.0083766
26
27. Stock Allocation
Sinofert -0.03831
Angang Steel -0.09892
MMG 0.1024961
Kingboard Chem -0.218379
OOIL -0.083456
Hanergy Solar 0.0212204
C Transmission 0.0944612
MTR Corporation 0.7519599
Cathay Pac. Air 0.1739958
China Travel HK 0.3012217
Air China 0.139887
Shangri-La Asia -0.148738
Cheung Kong 0.2928617
Henderson Road 0.1370807
New World Dev -0.365958
Poly Property -0.061424
expected rate of return 0.1
Variance 0.0083766
27