Portfolio optimization: Difference between revisions

From Cornell University Computational Optimization Open Textbook - Optimization Wiki
Jump to navigation Jump to search
Line 2: Line 2:


== Introduction ==
== Introduction ==
Portfolio optimization is a way to minimize risks to maximize net gains in a portfolio. Apply probability statistics, linear algebra, optimization and other methods to redistribute the investment portfolio under the established target returns and risk limits to achieve the goal of reducing risks or obtaining higher benefits under the same risk conditions.
Portfolio optimization is a way to minimize risks to maximize net gains in a portfolio. Apply probability statistics, linear algebra, optimization and other methods to redistribute the investment portfolio under the established target returns and risk limits to achieve the goal of reducing risks or obtaining higher benefits under the same risk conditions. [1]


Risk is a major factor in choosing stocks in a portfolio. In order to mitigate these risks, investors typically use an efficient frontier graph as shown in figure 1.
Risk is a major factor in choosing stocks in a portfolio. In order to mitigate these risks, investors typically use an efficient frontier graph as shown in figure 1.


The x- axis represents the standard deviation of the data, which is also known as the risk tolerance. On the y- axis is the expected percent return. The points near the solid line are optimal, which is also known as the frontier line. Any points that fall below the curve are considered to be nonoptimal. This is due to the fact that with the same risk tolerance there are better expected returns. This method has its limitations as it relies on past data.
The x- axis represents the standard deviation of the data, which is also known as the risk tolerance. On the y- axis is the expected percent return. The points near the solid line are optimal, which is also known as the frontier line. Any points that fall below the curve are considered to be nonoptimal. This is due to the fact that with the same risk tolerance there are better expected returns. This method has its limitations as it relies on past data. [2]




Line 20: Line 20:
The mitigation of risk can be characterized as follows. Let '''A''' be a matrix mxn of the daily returns, where m is the number of stocks and n is the number of days that are being analyzed.  
The mitigation of risk can be characterized as follows. Let '''A''' be a matrix mxn of the daily returns, where m is the number of stocks and n is the number of days that are being analyzed.  


'''Er''' represents the expected returns of the stock which is the average of the individual column of M. '''σ''' is the standard deviation of the individual the data set of an individual stock, where '''σ<math>^2</math>''' is the variance.     
'''Er''' represents the expected returns of the stock which is the average of the individual column of M. '''σ''' is the standard deviation of the individual the data set of an individual stock, where '''σ<math>^2</math>''' is the variance. [3]    


<math>X = A - Er</math>
<math>X = A - Er</math>
Line 30: Line 30:
This table will span the size of the number of stocks chosen mxm.
This table will span the size of the number of stocks chosen mxm.


<math>E(r_p) = w* Er </math>




<math>E(r_p) = w* Er </math>
'''E(rp)''' is the expected return of the portfolio. '''w''' is the percent of the initial capital being allocated into each stock. [4]
 
'''E(rp)''' is the expected return of the portfolio. '''w''' is the percent of the initial capital being allocated into each stock.




Line 40: Line 39:




σ<math>_p</math> represents the standard deviation of the portfolio.
σ<math>_p</math> represents the standard deviation of the portfolio. [5]




Line 244: Line 243:


== Conclusion ==
== Conclusion ==
Linear programming is an applicable tool in the optimization of stock portfolios. In parallel with the sharpe ratio the tools yield returns with less risks associated with choosing stocks as it optimizes the percent allocation. Linear programming has been around since the 1940’s and has such a wide base of applications. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks.
Linear programming is an applicable tool in the optimization of stock portfolios. In parallel with the sharpe ratio the tools yield returns with less risks associated with choosing stocks as it optimizes the percent allocation. Linear programming has been around since the 1940’s and has such a wide base of applications. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]


== Reference ==
== Reference ==
[1]  
[1] Vanderbei, R. J. (2000). ''Linear programming: Foundations and extensions''. Boston: Kluwer.
 
[2]
 
[3]


[4]
[2] Best, M. J. (2010). ''Champman & Hall/CRC Finance: Portfolio Optimization.'' Ontario: Canada.


[5]
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” ''Management Science'', vol. 30, no. 10, 1984, pp. 1143–1160., <nowiki>https://doi.org/10.1287/mnsc.30.10.1143</nowiki>.


[6]
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” ''Portfolio Probe | Investment Technology for the 21st Century'', 19 Apr. 2012, <nowiki>https://www.portfolioprobe.com/features/constraints/</nowiki>.


[7]
[5] Disatnik, David, and Saggi Katz. ''“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance & Accounting, 2012,'' <nowiki>https://doi.org/10.1111/j.1468-5957.2012.02279.x</nowiki>.


[8]
[6] Ahmed, Shabbir. ''Isye 6669: Deterministic Optimization ... - Isye Home | Isye''. 2002, <nowiki>https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio</nowiki>.


[9]
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” ''Management Science'', vol. 55, no. 5, 2009, pp. 798–812., <nowiki>https://doi.org/10.1287/mnsc.1080.0986</nowiki>.


[10]
[8] Overton, M. L. (1997). ''Linear Programming''

Revision as of 23:56, 28 November 2021

Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429), SYSEN 5800 Fall 2021

Introduction

Portfolio optimization is a way to minimize risks to maximize net gains in a portfolio. Apply probability statistics, linear algebra, optimization and other methods to redistribute the investment portfolio under the established target returns and risk limits to achieve the goal of reducing risks or obtaining higher benefits under the same risk conditions. [1]

Risk is a major factor in choosing stocks in a portfolio. In order to mitigate these risks, investors typically use an efficient frontier graph as shown in figure 1.

The x- axis represents the standard deviation of the data, which is also known as the risk tolerance. On the y- axis is the expected percent return. The points near the solid line are optimal, which is also known as the frontier line. Any points that fall below the curve are considered to be nonoptimal. This is due to the fact that with the same risk tolerance there are better expected returns. This method has its limitations as it relies on past data. [2]


Figure 1: Efficient Frontier Graph



Theory

The portfolio optimization mainly assumes two directions. The first is to assume that an investor has a fixed amount of investment in his hand, and requires to find one that has the smallest investment risk under certain relevant constraints of known investment projects. The other direction is to find a portfolio with the greatest return on investment under the same assumptions.

Nomenclature

The mitigation of risk can be characterized as follows. Let A be a matrix mxn of the daily returns, where m is the number of stocks and n is the number of days that are being analyzed.

Er represents the expected returns of the stock which is the average of the individual column of M. σ is the standard deviation of the individual the data set of an individual stock, where σ is the variance. [3]

X represents the daily return subtracted by the expected returns of each respective stock. The variance and covariance table is a vital tool as it allows the user to estimate volatility of the overall portfolio.

This table will span the size of the number of stocks chosen mxm.


E(rp) is the expected return of the portfolio. w is the percent of the initial capital being allocated into each stock. [4]



σ represents the standard deviation of the portfolio. [5]



SR is the sharpe ratio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk.

Methodology

Portfolio optimization could be solved and analyzed by Linear Programming and statistics. Cut the relevant information and conditions in the portfolio optimization, as well as the final requirements into the relevant variables, constraints and linear functions of the linear programming problem.

When figuring out the maximum return under the fixed risks investment projects:

Function Max ri*Xi
Factor: Xi The amount of investment project i should invest
Coefficient: ri The risk of investment project i
Constants The limit requirements

Constraints:

The constraints of portfolio optimization are various, include[4]:

Monetary value constraints Turnover constraint
Long- only constraint Maximum weight constraints
Asset trade constraints Risk fraction constraints
Number of Assets Held Constraint Number of Assets trade Constraint
Trade Universe Constraint Threshold Constraints
Forced Trade Constraints Linear Constraints
Count Constraints Tracking Error Constraints
Volatility constraints Expected return constraints
Distance constraints Sum of largest weights constraints
Cost constraint Number of closing positions constraint
Quadratic constraints Round Lot constraints

In one portfolio optimization analysis, several types of constraints will be selected to formulate the final return. The difference of constraints depends on the differences in investment projects, and related policy requirements, etc.

Numerical Example

Example 1:

Now the investor is looking for investment opportunities for $200000, and the financial analyst identified seven investment opportunities and projected their annual rates of return. The investor is required to figure out a portfolio that could receive maximum returns.


The following are the investment guidelines:

  1. The investment in growth stocks cannot be more than 50 percent of the total investment.
  2. The investment in value stocks cannot be more than 50 percent of the total investment.
  3. 20 percent of value stocks should be invested into bonds.
  4. To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.


Solution[5]:


Define the dolling decision variables:

x1: dollars invested in AAPL

x2: dollars invested in MSFT

x3: dollars invested in GOOGL

x4: dollars invested in BRK.A

x5: dollars invested in KR

x6: dollars invested in MSCI

x7: dollars invested in VBMFX


Objective: Maximizing return


Define the constraints:

x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)

x1 + x2 + x3 <= 100000 (half into growth stocks)

x4 + x5 + x6 <= 100000 (half into value stocks)

0.2*(x4 + x5 + x6) <= x7 (20% of the value stocks are invested into bonds)

0.6*(x1+x2+x3) >= x3 (diversify value stock)

x1,x2,x3,x4,x5,x6,x7 >=0


GAMS solution:

x1, x4,x5 = 0

x2 = 40,000

x3 = 60,000

x6 = 100,000

x7 = 20,000


Z = 23,330 (optimal solution)

Conclusion: Therefore, if the portfolio is $40000 in MSFT, $60,000 in GOOGL, $ 100,000 in MSCI, $ 20,000 in VBMFX, $0 in AAPL, BRK.A, and KR, the investor could receive the maximum return $23,330(optimal solution).


Example 2:

Using the same 7 stocks as the first example, matrix A represents the daily closing value of each stock collected. It is a matrix the size of 7x251 where 251 is the number of available trading days in the year 2018.


Variance - Covariance Table

Where X is a matrix that contains the daily percent return. Er is the estimated return. With that being said the variance and covariance can then be calculated as shown.


Define the dolling decision variables:

x1: Percent invested in AAPL

x2: Percent invested in MSFT

x3: Percent invested in GOOGL

x4: Percent invested in BRK.A

x5: Percent invested in KR

x6: Percent invested in MSCI

x7: Percent invested in VBMFX


Objective: Maximizing the SR value for optimal risk to returns ratio


With the following constraints:

x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)

x1,x2,x3,x4,x5,x6 <= 0.05 (at least 5% weight on each stock)


Using excel as the solver the solution is as follows

Solution:

x1,x2,x3 = 5%

Efficient frontier graph of the 7 stocks from January 2018 to January 2019

X4,x5 = 40%

X6 = 1.48%

X7 = 17%

Optimal solution: sharpe ratio = 0.05087 [unitless]


The scatter plot represents the first 10,000 random weight stocks. The optimal regions are on and near the line. It shows that larger gains come with larger risks. The graph allows the characterization of the performance of different weighted stocks in a portfolio.

Applications

Portfolio optimization can be used to screen investment projects that meet investors, rationally allocate investment amounts, etc. The operation of this model gives investors the opportunity to avoid risks as much as possible while obtaining the maximum relevant benefits. At the same time, after entering the relevant conditions, the model will give reasonable investment allocation suggestions and related optimal returns.

Conclusion

Linear programming is an applicable tool in the optimization of stock portfolios. In parallel with the sharpe ratio the tools yield returns with less risks associated with choosing stocks as it optimizes the percent allocation. Linear programming has been around since the 1940’s and has such a wide base of applications. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]

Reference

[1] Vanderbei, R. J. (2000). Linear programming: Foundations and extensions. Boston: Kluwer.

[2] Best, M. J. (2010). Champman & Hall/CRC Finance: Portfolio Optimization. Ontario: Canada.

[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” Management Science, vol. 30, no. 10, 1984, pp. 1143–1160., https://doi.org/10.1287/mnsc.30.10.1143.

[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” Portfolio Probe | Investment Technology for the 21st Century, 19 Apr. 2012, https://www.portfolioprobe.com/features/constraints/.

[5] Disatnik, David, and Saggi Katz. “Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance & Accounting, 2012, https://doi.org/10.1111/j.1468-5957.2012.02279.x.

[6] Ahmed, Shabbir. Isye 6669: Deterministic Optimization ... - Isye Home | Isye. 2002, https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio.

[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” Management Science, vol. 55, no. 5, 2009, pp. 798–812., https://doi.org/10.1287/mnsc.1080.0986.

[8] Overton, M. L. (1997). Linear Programming