MA2668 - Portfolio Optimization: A QP Modeling Approach

Verified

Added on  2023/04/25

|6
|1377
|318
Homework Assignment
AI Summary
This assignment solution addresses a QP (Quadratic Programming) modeling problem related to portfolio optimization, specifically concerning the Department of Mathematics MA2668 course. The solution begins by calculating the expected rates of return and the covariance matrix for five different stocks using historical data. It then formulates a QP model to determine the mean-variance efficient portfolio, incorporating constraints such as a minimum expected rate of return of 1% and no short selling. The solution utilizes Excel Solver to find the optimal portfolio weights and variance. Further analysis includes determining the maximum expected rate of return, evaluating the portfolio's mean-variance efficiency, and modifying the QP model to meet additional requirements, such as restricting portfolio weights and limiting the number of stocks in the portfolio. The solution also explores the impact of incorporating a risk-free rate using the Sharpe Ratio and constructs a return efficient frontier, contrasting scenarios with and without a risk-free asset.
Document Page
Department of Mathematics
MA2668 - QP modelling assignment
Name of the Student
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Question [a] Expected Return and Covariance Matrix
Expected Return
Stock 1 Stock 2 Stock 3 Stock 4 Stock 5
8.30% 18.44% 2.92% 3.88% -1.61%
Covariance Matrix
Stock 1 Stock 2 Stock 3 Stock 4 Stock 5
Stock 1 0.266474 0.036271 0.026222 0.078812 0.020378
Stock 2 0.036271 0.061164 0.031783 0.014776 0.018112
Stock 3 0.026222 0.031783 0.050286 0.02687 0.014016
Stock 4 0.078812 0.014776 0.02687 0.068142 0.009125
Stock 5 0.020378 0.018112 0.014016 0.009125 0.043864
Question [b] QP Model
Let Xi denotes the weights for individual stocks for creating the desired portfolio.
Then the objective function will be:
Min 12*[0.022206*X1^2 + 2*0.003023*X1*X2 + 2*0.002185*X1*X3 + 2*0.006568*X1*X4 +
2*0.001698*X1*X5 + 0.005097*X2^2 + 2*0.002649*X2*X3 + 2*0.001231*X2*X4 + 2*0.001509 *
X2*X5 + 0.004191*X3^2 + 2*0.002239*X3*X4 + 2*0.001168*X3*X5 + 0.005679*X4^2 +
2*0.00076*X4*X5 + 0.003655*X5^2]
And the constraints will be:
0.0830*X1 + 0.1844*X2 + 0.0292*X3 + 0.0388*X4 – 0.0161*X5 >= R
X1 + X2 + X3 + X4 + X5 = 1
X1>=0, X2>=0, X3>=0, X4>=0, X5>=0;
Here, R is the given required rate of return, which is 0.01 in this case.
Question [c] Excel Solver
Optimal Variance 0.026514
Weights £ 40,000.00
Stock 1 0.00000 £ -
Stock 2 0.15161 £ 6,064.51
Stock 3 0.19144 £ 7,657.73
Stock 4 0.22256 £ 8,902.33
Stock 5 0.43439 £ 17,375.47
Question [d] maximum expected rate of return
Question [e] QP model
Let Xi denotes the weights for individual stocks for creating the desired portfolio.
Then the objective function will be:
Min 12*[0.022206*X1^2 + 2*0.003023*X1*X2 + 2*0.002185*X1*X3 + 2*0.006568*X1*X4 +
2*0.001698*X1*X5 + 0.005097*X2^2 + 2*0.002649*X2*X3 + 2*0.001231*X2*X4 + 2*0.001509 *
Document Page
X2*X5 + 0.004191*X3^2 + 2*0.002239*X3*X4 + 2*0.001168*X3*X5 + 0.005679*X4^2 +
2*0.00076*X4*X5 + 0.003655*X5^2]
And the constraints will be:
X1 + X2 + X3 + X4 + X5 = 1
X1>=0, X2>=0, X3>=0, X4>=0, X5>=0;
Here, R is the given required rate of return.
Now using excel solver we have the minimum variance portfolio:
X1 X2 X3 X4 X5
0 0.151613 0.191443 0.222558 0.434386
Objective Function 0.026514 Return 0.035197
Cons 2 1.00000 = 1
Cons 3 0.00000 >= 0
Cons 4 0.15161 >= 0
Cons 5 0.19144 >= 0
Cons 6 0.22256 >= 0
Cons 7 0.43439 >= 0
It indicates the optimal variance and weights as mentioned below:
Optimal Variance 0.026514
Weights
Stock 1 0.00000
Stock 2 0.15161
Stock 3 0.19144
Stock 4 0.22256
Stock 5 0.43439
Also the expected return will be 0.035197
This is portfolio mean-variance efficient as this is a portfolio which is the leftmost point of the mean–
variance efficient frontier. It is found by choosing portfolio weights that minimise overall variance
subject only to the constraint that the sum of the weights w is one.
Question [f] Portfolio
Optimal Variance Weights Return
Weights £ 40,000.00
Stock 1 £ 5,000.00 0.125 0.082951
Stock 2 £ 10,000.00 0.25 0.18438
Stock 3 £ 20,000.00 0.5 0.029199
Stock 4 £ 5,000.00 0.125 0.038808
Stock 5 £ - 0 -0.01608
Portfolio Return 0.075914806
Covariance Matrix
Stock 1 Stock 2 Stock 3 Stock 4 Stock 5
Document Page
Stock 1 0.26647393 0.036271 0.026222 0.078812 0.020378
Stock 2 0.03627065 0.061164 0.031783 0.014776 0.018112
Stock 3 0.026222108 0.031783 0.050286 0.02687 0.014016
Stock 4 0.078812286 0.014776 0.02687 0.068142 0.009125
Stock 5 0.020377937 0.018112 0.014016 0.009125 0.043864 Portfolio Variance
Variance 0.008167437 0.009391 0.019863 0.004437 0 0.041858283
Question [g]
To meet the additional requirement that any portfolio weight should be either >=20% or 0, let us
introduce another variable A, which will be binary in nature.
Therefore, the modified problem will look like:
Let Xi denotes the weights for individual stocks for creating the desired portfolio.
Then the objective function will be:
Min 12*[0.022206*X1^2 + 2*0.003023*X1*X2 + 2*0.002185*X1*X3 + 2*0.006568*X1*X4 +
2*0.001698*X1*X5 + 0.005097*X2^2 + 2*0.002649*X2*X3 + 2*0.001231*X2*X4 + 2*0.001509 *
X2*X5 + 0.004191*X3^2 + 2*0.002239*X3*X4 + 2*0.001168*X3*X5 + 0.005679*X4^2 +
2*0.00076*X4*X5 + 0.003655*X5^2]
And the constraints will be:
0.0830*X1 + 0.1844*X2 + 0.0292*X3 + 0.0388*X4 – 0.0161*X5 >= R
X1 + X2 + X3 + X4 + X5 = 1
X1>=20%*A, X2>=20%*A, X3>=20%*A, X4>=20%*A, X5>=20%*A;
Here, R is the given required rate of return, which is 0.01 in this case.
X1 X2 X3 X4 X5 Extra variable
0 0.151613 0.191443 0.222558 0.434387 0
Objective Function 0.026514
Cons 1 0.03520 >= 0.01
Cons 2 1.00000 = 1
Cons 3 0.00000 >= 0
Cons 4 0.15161 >= 0
Cons 5 0.19144 >= 0
Cons 6 0.22256 >= 0
Cons 7 0.43439 >= 0
Hence, optimal variance is 0.026514 with expected return 0.03520
Question [h]
In addition to the above mentioned criteria, the additional requirement that the portfolio is
composed of no more than 2 stocks has been considered here.
To incorporate this, below constraint is added:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Count of non-zero X1, X2, X3, X4, and X5 is less than 2.
X1 X2 X3 X4 X5 Extra variable
0 1 0 0 0 0
Objective Function 0.061164
Cons 1 0.18438 >= 0.01
Cons 2 1.00000 = 1
Cons 3 0.00000 >= 0
Cons 4 1.00000 >= 0
Cons 5 0.00000 >= 0
Cons 6 0.00000 >= 0
Cons 7 0.00000 >= 0
Cons 8 1 <= 2
From the above calculations it can be said that the investment will be on stock 2 only.
Question [i]
In this case to add risk free rate, the problem will be solved with the help of sharp ratio.
X1 X2 X3 X4 X5
0 0.151612877 0.191443 0.222558 0.434387
Objective Function 0.026514048
Cons 1 0.03820 >= 0.01
Cons 2 1.00000 = 1
Cons 3 0.00000 >= 0
Cons 4 0.15161 >= 0
Cons 5 0.19144 >= 0
Cons 6 0.22256 >= 0
Cons 7 0.43439 >= 0
Portfolio Return 0.03520
Risk free rate 0.30%
Desired Portfolio
Return 3.82%
Sharp Ratio 0.234581619
The above table is showing the optimal solution along with optimal variance.
Question [j]
Document Page
0.026 0.0265 0.027 0.0275 0.028 0.0285 0.029 0.0295
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
Efficient Frontier
Without riskfree asset With riskfree asset
Variance
Return
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]