Modern portfolio theory proposes how rational investors use diversification to optimize their portfolio(s) of risky assets. The basic concepts of the theory go back to Markowitz (1952)’s idea of diversification and the efficient portfolio frontier. His model considers asset returns as a random variable, and models a portfolio as a weighted combination of assets. Being a random variable, a portfolio’s returns have an expected mean and variance. In this model, return and risk are estimated by the sample mean and the sample standard deviation of the asset returns for Shariah compliant/ Islamic Fund.
The following examples show how to compute the properties of a minimum risk mean-variance portfolio. These portfolios have a quadratic objective function defined by the covariance matrix of the financial assets and a fixed target return. Included are efficient, tang ency and global minimum risk portfolios.
The data employed in the study consists of daily closing prices of kSE-30. The data set encompassed the trading days from 4th August, 2008 to 2nd February 2015, 2009. The data is collected from the historical data available on the website of Pakistan stock Exchange.
The table for listed companies along with their groups are provided below
| Symbol | Company.Name | Sector | Group |
|---|---|---|---|
| DGKC | D.G. Khan Cement Company Limited | Cement | Nishat |
| KEL | K-Electric Limited | power generation | Abraaj / Shanghai Electric |
| POL | Pakistan Oilfields Limited | oil and gas exploration | Attock |
| ENGRO | Engro Corporation Limited | fertilizer | Dawood |
| LUCK | Lucky Cement Limited | Cement | YBG |
| PPL | Pakistan Petroleum Limited | oil and gas exploration | Government |
| FCCL | Fauji Cement Company Limited | Cement | Fauji |
| MARI | Mari Petroleum Company Limited | oil and gas exploration | Fauji |
| PSO | Pakistan State Oil Company Limited | oil and gas marketing | Government |
| FFBL | Fauji Fertilizer Bin Qasim Limited | fertilizer | Fauji |
| MCB | MCB Bank Limited | bank | Nishat |
| PTC | Pakistan Telecommunication Company Limited | communication | Etisalat |
| FFC | Fauji Fertilizer Company Limited | fertilizer | Fauji |
| MLCF | Maple Leaf Cement Factory Limited | cement | KMLG |
| SEARL | The Searle Company Limited | pharmaceutical | |
| HBL | Habib Bank Limited | bank | Agha Khan |
| HCAR | Honda Atlas Cars (Pakistan) Limited | auto | Shirazi |
| HUBC | Hub Power Company Limited | power generation | Dawood |
| JSCL | Jahangir Siddiqui Company Limited | investment bank | JS Group |
| KAPCO | Kot Addu Power Company Limited | power generation | Government |
| NBP | National Bank Of Pakistan | bank | Government |
| NML | Nishat Mills Limited | textile composite | Nishat |
| OGDC | Oil and Gas Development Company Limited | oil and gas exploration | Government |
| PAEL | Pak Elektron Limited | cable | Saigol |
| PIOC | Pioneer Cement Limited | cement | |
| TRG | TRG Pakistan Limited | communication | |
| UBL | United Bank Limited | bank | Bestway |
A minimum risk efficient portfolio is a portfolio with the lowest risk for a given target return. We define our target return to be the mean of the assets in our portfolio.
##
## Title:
## MV Efficient Portfolio
## Estimator: covEstimator
## Solver: solveRquadprog
## Optimize: minRisk
## Constraints:
##
## Portfolio Weights:
## HCAR MCB HBL NBP UBL PAEL DGKC LUCK FCCL MLCF
## 0.0095 0.0000 0.0000 0.0000 0.0000 0.0325 0.0000 0.0000 0.0000 0.0000
## PIOC PTC TRG ENGRO FFBL FFC JSCL POL PPL MARI
## 0.0052 0.0293 0.0000 0.0000 0.0798 0.1285 0.0000 0.0483 0.0992 0.0249
## OGDC PSO SEARL KEL HUBC KAPCO NML
## 0.1279 0.0129 0.1020 0.0000 0.1500 0.1500 0.0000
##
## Covariance Risk Budgets:
## HCAR MCB HBL NBP UBL PAEL DGKC LUCK FCCL MLCF
## 0.0088 0.0000 0.0000 0.0000 0.0000 0.0346 0.0000 0.0000 0.0000 0.0000
## PIOC PTC TRG ENGRO FFBL FFC JSCL POL PPL MARI
## 0.0052 0.0326 0.0000 0.0000 0.0826 0.1386 0.0000 0.0513 0.1086 0.0252
## OGDC PSO SEARL KEL HUBC KAPCO NML
## 0.1328 0.0138 0.1020 0.0000 0.1473 0.1165 0.0000
##
## Target Returns and Risks:
## mean Cov CVaR VaR
## 0.0319 1.0777 2.8128 1.6272
##
## Description:
## Mon Jan 23 09:41:30 2017 by user: azam.yahya
The output first reports the settings, then the portfolio weights, then the covariance risk budgets, and finally the target returns and risks. This includes the portfolio mean, and several portfolio risk measures, including the variance computed from the covariance matrix, the conditional value-at-risk, and the value-at-risk.
As shown in the portfolio weights, the portfolio is dominated by the FFC,OGDC, HUBC and KAPCO, which contribute 50% to the weights of the optimized portfolio.
Now let us display the results from the minimum risk portfolio, the assignment of weights, and the attribution of returns and risk.
In the above graph,we created a view of the pies with a legend listing the asset names and the percentual part of the pies
The global minimum variance portfolio is the efficient portfolio with the lowest possible risk. The global minimum variance point is thus the point which separates the efficient frontier from the minimum variance locus. Internally, the global minimum mean-variance portfolio is calculated by minimizing the efficient portfolio with respect to the target risk. This is a quadratic optimization problem with linear constraints.
##
## Title:
## MV Minimum Variance Portfolio
## Estimator: covEstimator
## Solver: solveRquadprog
## Optimize: minRisk
## Constraints:
##
## Portfolio Weights:
## HCAR MCB HBL NBP UBL PAEL DGKC LUCK FCCL MLCF
## 0.0324 0.0000 0.0000 0.0000 0.0000 0.0268 0.0000 0.0000 0.0000 0.0000
## PIOC PTC TRG ENGRO FFBL FFC JSCL POL PPL MARI
## 0.0125 0.0020 0.0000 0.0000 0.0904 0.1193 0.0000 0.0438 0.0756 0.0296
## OGDC PSO SEARL KEL HUBC KAPCO NML
## 0.1500 0.0060 0.1117 0.0000 0.1500 0.1500 0.0000
##
## Covariance Risk Budgets:
## HCAR MCB HBL NBP UBL PAEL DGKC LUCK FCCL MLCF
## 0.0341 0.0000 0.0000 0.0000 0.0000 0.0282 0.0000 0.0000 0.0000 0.0000
## PIOC PTC TRG ENGRO FFBL FFC JSCL POL PPL MARI
## 0.0131 0.0021 0.0000 0.0000 0.0951 0.1255 0.0000 0.0461 0.0795 0.0312
## OGDC PSO SEARL KEL HUBC KAPCO NML
## 0.1577 0.0063 0.1175 0.0000 0.1469 0.1166 0.0000
##
## Target Returns and Risks:
## mean Cov CVaR VaR
## 0.0373 1.0736 2.7968 1.6868
##
## Description:
## Mon Jan 23 09:41:30 2017 by user: azam.yahya
The portfolio is now dominated by the OGDC,SEARL,FFC, HUBC and KAPCO, which contribute 68% to the weights of the optimized portfolio.
Weights, weighted returns, and covariance risk budgets plots for an equal weighted and a minimum variance portfolio in Shariah fund are shown above. The equally weighted portfolio is shown to the left and the efficient portfolio with the same target return to the right. We have reduced the radius of the pies to 70% since we have a legend to the right and left. The legend to the left lists the assets and the legend to the right the percentual parts of the pie. The text to the right margin denotes the portfolio type, MV, and the solver, solveRquadprog, used for optimizing the portfolio.
The pie plots for the global minimum mean-variance portfolio are shown in the left-hand column of below graph.
The above graph shows the eights, weighted returns, and covariance risk budget plots for the global minimum risk and the tang ency portfolios: The global minimum risk portfolio is shown to the left and the tang ency portfolio to the right.
The tang ency portfolio is calculated by minimizing the Sharpe Ratio for a given risk-free rate. The Sharpe ratio is the ratio of the target return lowered by the risk-free rate and the covariance risk. The default risk-free rate is zero and can be reset to another value by modifying the portfolio’s specification.
##
## Title:
## MV Tangency Portfolio
## Estimator: covEstimator
## Solver: solveRquadprog
## Optimize: minRisk
## Constraints:
##
## Portfolio Weights:
## HCAR MCB HBL NBP UBL PAEL DGKC LUCK FCCL MLCF
## 0.1500 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1500 0.0408 0.0420
## PIOC PTC TRG ENGRO FFBL FFC JSCL POL PPL MARI
## 0.0271 0.0000 0.0000 0.0000 0.0471 0.0000 0.0000 0.0000 0.0000 0.0486
## OGDC PSO SEARL KEL HUBC KAPCO NML
## 0.0445 0.0000 0.1500 0.0000 0.1500 0.1500 0.0000
##
## Covariance Risk Budgets:
## HCAR MCB HBL NBP UBL PAEL DGKC LUCK FCCL MLCF
## 0.2057 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1681 0.0531 0.0665
## PIOC PTC TRG ENGRO FFBL FFC JSCL POL PPL MARI
## 0.0312 0.0000 0.0000 0.0000 0.0353 0.0000 0.0000 0.0000 0.0000 0.0492
## OGDC PSO SEARL KEL HUBC KAPCO NML
## 0.0323 0.0000 0.1517 0.0000 0.1141 0.0927 0.0000
##
## Target Returns and Risks:
## mean Cov CVaR VaR
## 0.0708 1.2388 3.1007 1.8794
##
## Description:
## Mon Jan 23 09:41:31 2017 by user: azam.yahya
The portfolio is now dominated by the HCAR, LUCK, HUBC, KAPCO and SEARL which contribute 75% to the weights of the optimized portfolio.
Weights, weighted returns, and covariance risk budget bar plots for the shariah constraints tang ency portfolio with zero risk-free rate are shown above.
Mean-variance portfolios constructed using the sample mean and covariance matrix of asset returns often perform poorly out-of-sample due to estimation errors in the mean vector and covariance matrix. To achieve better stability properties compared to traditional minimum variance portfolios, we try to reduce the estimation error using robust methods to compute the mean and/or covariance matrix of the set of Shariah fund in the next post.