Optimal Portfolio under Five Constraints in the Markowitz Model and the Index Model

. Investing in stocks is an inseparable part of modern life. Besides, choosing a good investment portfolio with high return and respectively low risk is the demand and desire of most modern investors. This paper tries to obtain an optimal investment portfolio to provide accurate and professional investment suggestions to the potential investors through the Markowitz Model and the Index Model under five different constraints. It has been considered several aspects to analyse the results: minimum variance portfolio, maximal Sharpe Ratio, etc. Some findings are given, including that the options of investment portfolio available under no constraint are larger compared to portfolios without permission of short-selling and investing SPX. Besides, the influence of the former is more significant than that of the latter; and then, the corresponding impact of different constraints ---is discussed through efficient frontiers. Additionally, comparing the Sharpe Ratio under two different models, it can be found that the Markowitz Model is a better option.


Introduction
Most modern people may have heard of an investment theory: Don't Put Your Eggs in One Basket. How to distribute our assets reasonably is an important and highly concerned issue in daily life, accompanied by various financial assets, such as bank deposits, stocks, cash, bonds, and mutual funds. In many cases, it is optimal for the decision-makers to allocate all resources to the most promising alternative in each period [1]. However, risk tolerances vary across individuals. Individual investors have to select corresponding personalized investment portfolios to satisfy their own needs [2].
Investment portfolio theory is used commonly in many areas [3][4]. Muñoz et al. [5] presented a model for investing in renewable energies in the framework of the Spanish electricity market in a way that risk is minimized for the investor while returns are maximized. Fogarty [6] utilized the investment model and found that wine does not have a strong positive correlation with standard financial assets.
The popularity of portfolio theory is also evident in recent researches on the formation of portfolios based on risk and diversification [7]. Liow, K. H., & Alastair, A. indicated that diversification into Asian real estate stocks can provide positive portfolio implications for international investors [8]. Investing in the stock market effectively is possible only based on scientifically sound methods for analyzing investment instruments. [9] Markowitz proposed portfolio selection to maximize the expected value of a portfolio's return under certain variability constraints or to minimize the variability in a portfolio's return under certain expected value constraints. Investors use portfolio selection as a tool to predict investment returns accurately to manage future uncertainties, and most portfolio selection models are formulated based on the probability theory. [10] In this paper, the purpose of the research is to study the problem of restructuring investment portfolios to provide accurate and professional investment suggestions to our potential investors through Markowitz Model and Index Model under five different constraints. Several aspects are considered to analyze the results: minimum variance portfolio, maximal Sharpe Ratio, capital allocation line, minimal risk frontier, efficient frontier, and minimal return frontier. Some findings are given, including that the options of investment portfolio available under no constraint are larger compared to portfolios without permission of short-selling and investing SPX. Besides, the influence of the former is greater than that of the latter; and then, the corresponding impact of different constraints is discussed through efficient frontiers. Moreover, the paper compares the Markowitz Model and the Index Model in terms of the Sharpe ratio, and obtains that using the Markowitz Model will generate a higher return than the Index Model.
The reminder of the paper is organized as follows: section 2 describes the sample and data; section 3 is the establishment of the investment portfolio; section 4 introduces the final results, and the last section presents our conclusion.

Data description
For research, the daily closing price of these seven stocks are selected [S&P 500 Index (SPX), Amazon (AMZN), Apple (AAPL), Goldman Sachs Group Inc (GS), US Bancorp (USB), United Parcel Service-CL B (UPS) and FedEX (FDX)] from Yahoo Finance and Bloomberg; and range of data is approximately 20 years (from 2000 to 2020). Next, calculate their daily and transfer them to monthly; and then some characteristics of each stock such as excess return, standard deviations and beta and alpha. Excel can also derive the correlations between them. Table 1 shows the situation about the return of one index and six stocks. On average, Apple has the best performance because of its highest mean of return while SPX has the lowest one. However, the risk of investing in SPX is the lowest compared to others, especially for Amazon, which has the highest risk due to the most significant standard deviation of return. The price trend of SPX is presented in Fig.1. It can be seen that the index of SPX dropped gradually with fluctuation from November 2000 to September 2002, reaching the lowest point 837.12, and then increased slowly. However, this kind of index experienced a dramatic decline from May 2008 to February 2009, decreased to the second-lowest point (approximately 855.94). After that, it indicates a trend with overall upward continually until these days, but still accompanied by many small fluctuations. In general, the index of SPX shows an overall fabulous performance as it keeps on the rise today.

Establish the Investment portfolio
This part compares the performance of stocks under Markowitz Model and Index Model with five different constraints. The five constraints are as follows.
(1). broker-dealers to allow their customers to have positions, 50% or more of which are funded by the customer's account equity; (2). the absolute value of each asset weight to be less than or equal to 1, which contain short and long positions; (3). no constrain, invest into any asset as much as you like; (4). weight of any asset must be more or equal to 1; (5). weight of the broad index equal to 0, which we wonder whether the inclusion of the broad index into our portfolio has a positive or negative effect.
This section utilised the Markowitz portfolio and Index Model to establish the different investment portfolio, including minimum variance portfolio, maximal Sharpe Ratio, capital allocation line, minimal risk frontier, efficient frontier, and minimal return frontier.
Markowitz portfolio regards the price change of the portfolio as a random variable. It uses its mean value to measure the return and variance to measure the risk (so Markowitz theory is also called Mean-Variance Analysis). Markowitz model is one of the well-known models in the portfolio selection problem. [11]. Taking the proportion of various securities in the portfolio as a variable, the portfolio problem of minimum risk with a certain return would become a quadratic programming problem under linear constraints. Then according to the preference of investors, investment decision can be made.
After summarizing the Markowitz portfolio model, then the Index Model is introduced. The singleindex model (SIM) is a simple asset pricing model to measure both the risk and the stock return. The model was developed by William Sharpe in 1963.
To simplify the analysis, the single-index model assumes that only one macroeconomic factor causes the systematic risk affecting all stock returns. This factor can be represented by the rate of return on a market index, such as the S&P 500. According to this model, the return of any stock can be decomposed into the expected excess return of the individual stock due to firm-specific factors, commonly denoted by its alpha coefficient (α), the return due to macroeconomic events that affect the market, and the unexpected micro-economic events that affect only the firm. Then, the model is described. The sum of the absolute weights of the seven stocks is less than or equal to two, allowing broker-dealers to allow their customers to have positions, 50% or more of which are funded by the customer's account equity.
It is mainly considered two models, the Markowitz model (MM) and Index Model (IM), to investigate the optimal portfolio in this part. Then some basic information is introduced conveniently.
(i) Minimal risk： (for the second part, i is not equal to j; N is the number of stocks) The minimum variance portfolio is going to derive the minimal variance by changing the weights, setting the standard deviation cell as the minimum value in the solver, not limiting the value of returns as we want to find the minimal one no matter what return is, and varying the asset weight cell. And for constrain 1, I also need to add the constrain: the sum of the absolute weights of the seven stocks is less than or equal to two.
(ii) Excess return Excess return=every monthly return -risk-free return Average excess return= w1 × r1 + w2 × r2 + w3 × r3 + w4 × r4 + w5 × r5 + w6 × r6 + w7 × r7 (w: weight of each stock; r: the return of each stock) The process of finding the maximum Sharpe is almost the same compared to the minimum variance. The Sharpe ratio is defined as the standard deviation divided by excess returns. Set the Sharpe ratio cell as the maximum value, and the variable cell is the weight of each asset. The weight of each asset is calculated. Then we can get the maximal Sharpe ratio.
According to the formula, the standard deviation and yield of a portfolio of risk assets + one-month treasury bonds can be obtained. Then the group of yield and standard deviation are expressed in the scatter diagram.
(iii) Capital Allocation Line Capital Allocation Line is also known as the capital market link (CML), is a line created on a graph of all possible combinations of risk-free and risky assets. The risk-free assets have zero standard deviation as the risk is zero, so one of the CAL points is the origin. The other point is that selecting a random coefficient and multiplying it by the Maximal Sharpe. The coefficient only determines the line and does not have the actual meanings.
(v) Minimal Risk Frontier Setting the standard deviation cell in the solver as the minimum value is the method to find the minimal variance boundary, control the excess returns as the fixed value at random (maybe from -0.2 ~ 0.7), and then add different constraints and keep the sum of the weight of all assets equals to 1, which need to be always noticed. The variable cells are each asset weight, then calculate the standard deviation of the asset portfolio and each asset weight, and repeat the steps by just changing the excess return. We can get other data, and then they will be represented through a scatter diagram.
(vi) Efficient Frontier The effective boundary (maximum yield boundary) is to set the returns cell as the maximum value in the solver, control the standard deviation at a fixed value from 0-1 (variable cell is each asset weight), and then repeat those steps and multiple groups of yield and standard deviation data can be obtained, which is represented by scatter diagram, which is also the upper part of the Minimal Variance Frontier.
(vii) Minimal Return Frontier The way to derive the minimum yield boundary is similar to the way to get the effective frontier. The only difference is setting the returns cell as the minimum value in the solver, and the resulting curve is the lower part of the minimum variance boundary.

An Example of Illustration
In this part, constraint 4 is considered as an example to establish an investment portfolio. This additional optimization constraint is designed to simulate the typical limitations existing in the U.S. mutual fund industry: a U.S. open-ended mutual fund is not allowed to have any short positions.
The two results obtained are as follows.  However, for the Markowitz Model, we can observe the Minimal Return Frontier suddenly stopped. The possible reason for this difference is that the different standard deviation calculations, which make further Minimal Return Frontier not available.

Portfolio Analysis
In this part, we make a comparison from these aspects: the impact of short-selling, the impact of whether it includes SPX in the investment portfolio and the analysis to the efficient frontier, respectively.  And then, it can be seen clearly that the area enclosed by the blue line suggests the available investment option or portfolio investors can invest in, and the green line represents the portfolio situation when the market forbade short-selling. Immediately after the comparison, it can be noticed that the area enclosed with permission of short-selling is much larger compared to this kind of area under the portfolio without short-selling. Meanwhile, for the Minimal Risk Portfolio, there is a lower risk if we allow short-selling. In terms of the Maximum Sharp Ratio for the portfolio with shortselling (no constraint) is in the relatively high and right position in the graph, which means it has higher return but also higher risk. However, this does not necessarily mean a good phenomenon because risk and return happen simultaneously. If the market forbade the short-selling, the Maximum Sharp Ratio portfolio that can be invested in has a lower return, but also has a lower risk. . It can be directly and clearly observed that the area enclosed by the blue line is much smaller than the area under the orange line, which means that there is a decrease in the investment portfolio we can invest in without investing in the SPX. For those points (Minimal Risk Portfolio and Maximum Sharp Ratio), they are similar to the previous condition; no constraint portfolio has a higher return but also a higher risk compared to constraint 5 without investing SPX.

Impact of S&P 500 index
It seems for us to find a conclusion through comparing these two kinds of conditions, the impact of short-selling is larger than the impact of do not invest SPX. As we can see, the blue line in the left graph and orange line in the right graph represent constraint 3 (no constraint), and the area enclosed by the green line in the left graph is much smaller than the area under the blue line in the right one. As a consequence, if the market forbade short-selling, the options of the investment portfolios that our potential investors could invest in will suffer a dramatic decline. This is also the power of shortselling.   Fig.8 are combined charts for the efficient frontier. The left part shows the Markowitz Model and the right one for the Index Model. Firstly, the orange line represents constraint 3 (freeproblem), which lies at the outermost case----means it encloses the largest area. This also satisfies the previous conclusion we got, which is that the potential investors will have the most options and investment portfolios to invest in if there is no constraint for the market. Next, the red line (constraint 4) without permission of short-selling is also an interesting one. From the graphs, it seems a little bit strange for the whole shape of the red line because it goes up at first and then verges to horizontal. Actually, it is not that horizontal; it is even creeping down slightly. As a result, if the market forbidden short-selling and investors intend to invest in a higher risk portfolio, the corresponding return will not rise proportionately like the other conditions; it even will decrease. In addition, the black line (constraint 1) is too short for both charts compared to others and worth our discussion. One of the reasonable reasons for this kind of situation is that since the summation of the absolute value is less or equal to two, each rate will be extremely close to zero, no matter it is positively or negatively. We can also interpret it in another way: the maximum short-selling amount investors can invest in is 50%; hence this limitation may prevent the line from further going on.

Analysis to Efficient Frontier
The third section mainly analyses the impact of short-selling, the impact of the existence of SPX in the investment portfolio, and the efficient frontier. The findings are that investment portfolio options available under no constraint are larger than portfolios without permission of short-selling and investing SPX. Besides, the influence of the former is greater than that of the latter; and then, the corresponding impact of different constraints is analysed through efficient frontiers.

Final results
This chapter primarily analyzes the minimum risk portfolio and maximum Sharpe Ratio portfolio of the Markowitz Model and Index Model, and including some of their results, as shown in Tables 2,  3, 4, and 5.  Table 2 is the output of the Minimal Risk Portfolio in the Markowitz Model, which demonstrates the weights of each stock when the standard deviation/ risk is minimized under every different constraint. It is noteworthy that the data of constraint 1 and constraint 3 are identical; it seems reasonable because no constraint (constraint 3) does cover the situation under the sum of the absolute weights of the seven stocks is less than or equal to two (constraint 1). In addition, both of them have the smallest standard deviations compared to other constraints but have the lowest returns at the same time. However, the largest risk and the highest return appear in the investment portfolio without investing in SPX, and also the highest Sharpe Ratio. In terms of the Index Model, it is extremely similar to the Markowitz Model. In Table 3, it can be observed clearly that constraint 1 and constraint 3 still have the lowest risk, return, and Sharpe Ratio, while the last constraint has the highest characteristics. Therefore, a theory could be confirmed---the higher the risk, the higher the return is. Not only the investors are interested in an expected excess return to be over the risk-free rate, but also in risk premium being commensurate with the risk they take; hence, Sharpe Raito is a measurement. Table 4 presents the situation under the Markowitz Model----the weights of each stock when the Sharpe Ratio is maximized under every different constraint. Constraint 3 has the best performance (1.172) and the lowest risk and return, whereas constraint 4 has the smallest Sharpe Ratio (1.035). A similar situation also appears to the Index Model, which also has the smallest Sharpe Ratio (1.056) under constraint 4 and the largest one (1.164) under constraint 3. It means that our potential investors should choose constraint 3 as a higher Sharpe Ratio represents that it could generate a higher return on a risk-adjusted basis. Besides, the previous analysis can also be reflected; investment portfolio under no constraints are better compared to any other constraint.
For the whole portfolio return, under the Markowitz Model, the highest Sharpe Ratio is higher than that in the Index Model (1.172 > 1.164). In comparison, the lowest Sharpe Ratio is lower than the other model (1.035 < 1.056). For the difference, we think it probably due to the limited sample size (the number of stocks). It will have more accurate data and reduce the deviation if we use more stocks to generate the results. Therefore, we recommend using the Markowitz Model to establish the investment portfolio as it provides a higher Sharpe Ratio.

Conclusion
In this paper, the performance of investment portfolio is researched through Markowitz Model and Index Model under five different constraints, because the distribution of wealth is not only a problem for the rich but also a decision for ordinary people these days. Different situations under different restrictions are analysed through these aspects (minimum variance portfolio, maximal Sharpe Ratio, capital allocation line, minimal risk frontier, efficient frontier, and minimal return frontier).
Some findings are given, including that the options of investment portfolio available under no constraint are larger compared to portfolios without permission of short-selling and investing SPX. Besides, the influence of the former is greater than that of the latter; and then, the corresponding impact of different constraints is discussed through efficient frontiers. In terms of the suggestion, the Markowitz Model is more suitable for constructing the investment portfolios as it has a higher Sharpe Ratio than the Index Model.
The biases of this paper mainly include three aspects. First of all, the solver table in Excel is not extremely accurate. For instance, when changing variables (target return or standard deviation), the incremental increases sometimes are relatively large, such as 1% or 0.5% each time. Even though these numbers are very small, they are not approaching zero. The smaller the numbers used, the more accurate the outputs are. Therefore, the accuracy of data lacks to some extent. The second bias is that during the calculation, monthly data is used to replace daily data. Monthly data may only contain 10% of the whole data; thus, if daily data is used, it will be more accurate and persuasive.
The last bias is the less accuracy of the estimation of future data from historical data in the Markowitz Model and simplification of the estimation of the covariance matrix problem. In the future, other constraints that the paper does not include would be researched, such as the impact of investing in mutual funds or Bitcoin, which is closer to today's social development because of the prevalence of Internet finance.