<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://optimization.cbe.cornell.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevinpan156</id>
	<title>Cornell University Computational Optimization Open Textbook - Optimization Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://optimization.cbe.cornell.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kevinpan156"/>
	<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Special:Contributions/Kevinpan156"/>
	<updated>2026-05-01T23:51:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6051</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6051"/>
		<updated>2021-12-17T23:55:18Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|382x382px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature|387x387px]]&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
Portfolio optimization could be solved and analyzed by Linear Programming and statistics. When figuring out the maximum return under the fixed risks investment projects it can be seen as follows: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Table 2: Fixed Risk Table&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
Table 3: Constraints&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 4: Annual Returns of Sample Portfolio]]&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 5:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;[[File:Frontier.jpg|thumb|434x434px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Linear programming is an applicable tool in the optimization of stock portfolios. With the sharpe ratio, the tools yield returns with less risks associated as the method selects stocks and allocates investments accordingly. The optimization method  will assist with new stock portfolios. It maximizes returns with the incorporation of the users risk tolerance.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6050</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6050"/>
		<updated>2021-12-17T23:53:59Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|382x382px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature|387x387px]]&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
Portfolio optimization could be solved and analyzed by Linear Programming and statistics. When figuring out the maximum return under the fixed risks investment projects it can be seen as follows: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Table 2: Fixed Risk Table&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
Table 3: Constraints&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 4: Annual Returns of Sample Portfolio]]&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 5:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;[[File:Frontier.jpg|thumb|434x434px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Linear programming is an applicable tool in the optimization of stock portfolios. With the sharpe ratio, the tools yield returns with less risks associated as the method selects stocks and allocates investments accordingly. The optimization method  will assist with new stock portfolios. It maximize returns with the incorporation of the users risk tolerance.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6048</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6048"/>
		<updated>2021-12-17T23:50:15Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|382x382px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature|387x387px]]&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
Portfolio optimization could be solved and analyzed by Linear Programming and statistics. When figuring out the maximum return under the fixed risks investment projects it can be seen as follows: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Table 2: Fixed Risk Table&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
Table 3: Constraints&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 4: Annual Returns of Sample Portfolio]]&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 5:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;[[File:Frontier.jpg|thumb|434x434px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Linear programming is an applicable tool in the optimization of stock portfolios. With the sharpe ratio, the tools yield returns with less risks associated as the method selects stocks and allocates investments accordingly. It will continue to be utilized in the future for new stock portfolios to maximize returns with the incorporation of the users risk tolerance.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6047</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=6047"/>
		<updated>2021-12-17T23:39:33Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|382x382px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature|387x387px]]&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Table 2: Fixed Risk Table&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
Table 3: Constraints&lt;br /&gt;
&lt;br /&gt;
Table 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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 4: Annual Returns of Sample Portfolio]]&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 5:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;[[File:Frontier.jpg|thumb|434x434px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5979</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5979"/>
		<updated>2021-12-16T04:25:28Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|382x382px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature|387x387px]]&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Table 2: Fixed Risk Table&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
Table 3: Constraints&lt;br /&gt;
&lt;br /&gt;
Table 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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 4: Annual Returns of Sample Portfolio]]&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 5:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;[[File:Frontier.jpg|thumb|434x434px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5975</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5975"/>
		<updated>2021-12-16T04:22:47Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Table 2: Fixed Risk Table&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
Table 3: Constraints&lt;br /&gt;
&lt;br /&gt;
Table 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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 4: Annual Returns of Sample Portfolio]]&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 5:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5972</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5972"/>
		<updated>2021-12-16T04:16:19Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph |alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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.&amp;lt;ref&amp;gt;Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&amp;lt;/ref&amp;gt;&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results.&amp;lt;ref&amp;gt;“Harry Markowitz&#039;s Modern Portfolio Theory [the Efficient Frontier].” &#039;&#039;Guided Choice&#039;&#039;, 14 Feb. 2020, &amp;lt;nowiki&amp;gt;https://www.guidedchoice.com/video/dr-harry-markowitz-father-of-modern-portfolio-theory/&amp;lt;/nowiki&amp;gt;. “Constraints: Portfolio Probe: Generate &amp;lt;/ref&amp;gt; &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.&amp;lt;ref&amp;gt;Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&amp;lt;ref&amp;gt;Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
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.&amp;lt;ref&amp;gt;Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &amp;lt;ref&amp;gt;DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Retirement fund investment portfolio is one of the specific applications of investment portfolio optimization in modern times. Retirement planning needs to determine the source of income, estimate expenses, implement savings plans, and manage assets and risks. In the field of asset management and risk, modern financial theory advocates focusing on the total return of retirement-oriented investment portfolios rather than income. When the investment portfolio needs to be allocated, investors can choose between different asset classes and adjust their investment shares. &amp;lt;ref&amp;gt;Armstrong, Frank. “How to Create a Retirement Portfolio Strategy.” &#039;&#039;Investopedia&#039;&#039;, Investopedia, 22 Aug. 2021, &amp;lt;nowiki&amp;gt;https://www.investopedia.com/articles/retirement/11/implement-effective-retirement-income-strategy.asp#toc-a-balanced-portfolio&amp;lt;/nowiki&amp;gt;.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks.&amp;lt;ref&amp;gt;Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5945</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5945"/>
		<updated>2021-12-16T03:07:46Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:Step 1.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:Step2.jpg|820x820px]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Step 3.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p4.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ste p5.jpg]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Ste_p5.jpg&amp;diff=5944</id>
		<title>File:Ste p5.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Ste_p5.jpg&amp;diff=5944"/>
		<updated>2021-12-16T03:06:28Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Step 5&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Ste_p4.jpg&amp;diff=5942</id>
		<title>File:Ste p4.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Ste_p4.jpg&amp;diff=5942"/>
		<updated>2021-12-16T03:05:54Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Step 4&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Step_3.jpg&amp;diff=5940</id>
		<title>File:Step 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Step_3.jpg&amp;diff=5940"/>
		<updated>2021-12-16T03:05:08Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Step 3&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Step2.jpg&amp;diff=5937</id>
		<title>File:Step2.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Step2.jpg&amp;diff=5937"/>
		<updated>2021-12-16T03:04:04Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Step 2&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Step_1.jpg&amp;diff=5936</id>
		<title>File:Step 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Step_1.jpg&amp;diff=5936"/>
		<updated>2021-12-16T03:03:20Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Step 1&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5931</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5931"/>
		<updated>2021-12-16T02:57:10Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Constraints&lt;br /&gt;
!Explanation&lt;br /&gt;
|-&lt;br /&gt;
|Monetary Value Constraints&lt;br /&gt;
|Control the amount of money in the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Maximum Weight Constraints&lt;br /&gt;
|Limit the proportion of assets in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Risk Fraction Constraints&lt;br /&gt;
|Control the number of variances that each asset may have.&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held/ Traded Constraints&lt;br /&gt;
|Limit the number of assets held/traded in the portfolio.&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Limit the number of assets that show in each category of a category variable&lt;br /&gt;
|-&lt;br /&gt;
|Cost Constraints&lt;br /&gt;
|Limit the transaction cost&lt;br /&gt;
|-&lt;br /&gt;
|Expected Return Constraints&lt;br /&gt;
|Control the predicted expected return of the portfolio&lt;br /&gt;
|-&lt;br /&gt;
|Volatility Constraints&lt;br /&gt;
|Constrain the predicted volatility of the portfolio(Calculate by predicted variance matrix)&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Trade with assets of at lease a certain size&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P1.jpg|alt=|821x821px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:P2.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P3.jpg|alt=]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P4.jpg|alt=]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P5.jpg|alt=]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5922</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5922"/>
		<updated>2021-12-16T02:52:30Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Fanghan Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P1.jpg|alt=|821x821px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:P2.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P3.jpg|alt=]]&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P4.jpg|alt=]]&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[index.php%3Ftitle=File:P5.jpg|alt=]]&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Portfolio optimization is often used for investment screening and investment amount allocation. 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 constraints, the model will give reasonable investment allocation suggestions and related optimal returns. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5909</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5909"/>
		<updated>2021-12-16T02:45:42Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simplex table can be derived as the following:&lt;br /&gt;
&lt;br /&gt;
[[File:P1.jpg|left|821x821px]]&lt;br /&gt;
&lt;br /&gt;
The least coefficient is found to be row 2, where the constant is divided by &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;. Once the pivot is found then the row reduction can begin. &lt;br /&gt;
&lt;br /&gt;
[[File:P2.jpg]]&lt;br /&gt;
&lt;br /&gt;
There are 3 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x1&amp;lt;/math&amp;gt;.&lt;br /&gt;
[[File:P3.jpg|left|Part 3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are 2 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x3&amp;lt;/math&amp;gt;.&lt;br /&gt;
[[File:P4.jpg|left|part 4]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is now 1 negative terms in the last row, row reduction will occur for column &amp;lt;math&amp;gt;x2&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:P5.jpg|left|part 5]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is no need to conduct further calculations as all values in the last row are now positive. Therefore, the optimal solution is achieved:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Conclusion: Therefore, if the portfolio is $100,000in MSFT, $100,000 in GOOGL, $0 in AAPL, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:P5.jpg&amp;diff=5904</id>
		<title>File:P5.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:P5.jpg&amp;diff=5904"/>
		<updated>2021-12-16T02:30:10Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;part5&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:P4.jpg&amp;diff=5902</id>
		<title>File:P4.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:P4.jpg&amp;diff=5902"/>
		<updated>2021-12-16T02:29:27Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Part4&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5901</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5901"/>
		<updated>2021-12-16T02:27:28Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:P1.jpg|left|821x821px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:P2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1&amp;lt;/math&amp;gt; (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05&amp;lt;/math&amp;gt; (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 = 5%&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
&amp;lt;math&amp;gt;x4,x5 = 40%&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 1.48%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 17%&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: Sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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. It will continue to be utilized in the future for new stock portfolios to maximize returns with tolerable risks. [8]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5898</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5898"/>
		<updated>2021-12-16T02:23:44Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:P1.jpg|left|821x821px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:P2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:P3.jpg&amp;diff=5896</id>
		<title>File:P3.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:P3.jpg&amp;diff=5896"/>
		<updated>2021-12-16T02:11:56Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;part 3&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:P2.jpg&amp;diff=5895</id>
		<title>File:P2.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:P2.jpg&amp;diff=5895"/>
		<updated>2021-12-16T02:09:57Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;part2&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:P1.jpg&amp;diff=5894</id>
		<title>File:P1.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:P1.jpg&amp;diff=5894"/>
		<updated>2021-12-16T02:08:57Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Step1&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5859</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5859"/>
		<updated>2021-12-15T23:56:23Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;&amp;lt;math&amp;gt;\sigma_p^2&lt;br /&gt;
 &amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p &amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.06*x1 + 0.14*x2 +0.15*x3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 &amp;lt;= 100000&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 &amp;lt;= 100000&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3 &amp;gt;= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Z = 29,000 &amp;lt;/math&amp;gt; &#039;&#039;&#039;(optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5832</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5832"/>
		<updated>2021-12-15T22:56:03Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 + x4 +x5 +x6 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 &amp;lt;= 100000&amp;lt;/math&amp;gt; (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4 + x5 + x6 &amp;lt;= 100000 &amp;lt;/math&amp;gt; (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.2*(x4 + x5 + x6) &amp;lt;= x7 &amp;lt;/math&amp;gt; (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.6*(x1+x2+x3) &amp;gt;= x3&amp;lt;/math&amp;gt;  (diversify value stock)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1, x4,x5 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 40,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 60,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 20,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5831</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5831"/>
		<updated>2021-12-15T22:54:04Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Methodology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Types of Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|-&lt;br /&gt;
|Monetary value constraints&lt;br /&gt;
|Turnover constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 + x4 +x5 +x6 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 &amp;lt;= 100000&amp;lt;/math&amp;gt; (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4 + x5 + x6 &amp;lt;= 100000 &amp;lt;/math&amp;gt; (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.2*(x4 + x5 + x6) &amp;lt;= x7 &amp;lt;/math&amp;gt; (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.6*(x1+x2+x3) &amp;gt;= x3&amp;lt;/math&amp;gt;  (diversify value stock)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1, x4,x5 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 40,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 60,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 20,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5824</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5824"/>
		<updated>2021-12-15T22:35:10Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Modern Portfolio Theory (MPT) or mean variance analysis is a mathematical framework introduced by the economist Harry Markowitz. MPT is used to combine a portfolio of assets in order to maximize the expected return under a given level of risk. Its main point is that investors can choose the best combination of asset risk and return based on the assessment of individual risk tolerance, so as to obtain the most ideal results. &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 + x4 +x5 +x6 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 &amp;lt;= 100000&amp;lt;/math&amp;gt; (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4 + x5 + x6 &amp;lt;= 100000 &amp;lt;/math&amp;gt; (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.2*(x4 + x5 + x6) &amp;lt;= x7 &amp;lt;/math&amp;gt; (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.6*(x1+x2+x3) &amp;gt;= x3&amp;lt;/math&amp;gt;  (diversify value stock)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1, x4,x5 = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2 = 40,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3 = 60,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6 = 100,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 = 20,000 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5808</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5808"/>
		<updated>2021-12-15T22:09:51Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Markowitz&#039;s model &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Table 1:Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px|Table 2: Annual Returns of Sample Portfolio]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Defining the following decision variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 &amp;lt;/math&amp;gt;: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x2&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x3&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x5&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x6&lt;br /&gt;
 &amp;lt;/math&amp;gt;: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x7 &amp;lt;/math&amp;gt;: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 + x4 +x5 +x6 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 &amp;lt;= 100000&amp;lt;/math&amp;gt; (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4 + x5 + x6 &amp;lt;= 100000 &amp;lt;/math&amp;gt; (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.2*(x4 + x5 + x6) &amp;lt;= x7 &amp;lt;/math&amp;gt; (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.6*(x1+x2+x3) &amp;gt;= x3&amp;lt;/math&amp;gt;  (diversify value stock)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Table 3:Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Figure 2: Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5802</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5802"/>
		<updated>2021-12-15T21:57:35Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Markowitz&#039;s model &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 +x2 + x3 + x4 +x5 +x6 = 200000 &amp;lt;/math&amp;gt; (amount invested)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1 + x2 + x3 &amp;lt;= 100000&amp;lt;/math&amp;gt; (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x4 + x5 + x6 &amp;lt;= 100000 &amp;lt;/math&amp;gt; (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.2*(x4 + x5 + x6) &amp;lt;= x7 &amp;lt;/math&amp;gt; (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.6*(x1+x2+x3) &amp;gt;= x3&amp;lt;/math&amp;gt;  (diversify value stock)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5800</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5800"/>
		<updated>2021-12-15T21:47:12Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
Markowitz&#039;s model &lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio. &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb|394x394px]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5742</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5742"/>
		<updated>2021-12-15T17:50:24Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. A portfolio is a set of selected stocks chosen by the investor. Risk is defined by the potential associated lost of some or all the original investment. Returns are the associated gains when the price of the stocks increases beyond the original investment.  By applying 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio. &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5625</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5625"/>
		<updated>2021-12-15T07:50:44Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
A&amp;lt;/math&amp;gt;&#039;&#039;&#039; be a matrix &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m x n&amp;lt;/math&amp;gt;&#039;&#039;&#039; of the daily returns, where &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of stocks and &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the number of days that are being analyzed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
Er&amp;lt;/math&amp;gt;&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
m&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039;. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
mxm&amp;lt;/math&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) &amp;lt;/math&amp;gt; is the expected return of the portfolio. &#039;&#039;&#039;&amp;lt;math&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p &amp;lt;/math&amp;gt; is the sharpe ratio of the portfolio. The sharpe ratio is a risk to return ratio that allows the investor to identify if the investment is worth the risk. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5624</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5624"/>
		<updated>2021-12-15T07:41:18Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table|489x489px]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5313</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5313"/>
		<updated>2021-12-14T06:21:06Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=]]&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5312</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5312"/>
		<updated>2021-12-14T06:20:11Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph|alt=|none]]&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5311</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=5311"/>
		<updated>2021-12-14T06:17:36Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Portfolio optimization is a way to maximize net gains in a portfolio while minimizing risk. 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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4793</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4793"/>
		<updated>2021-12-06T00:15:48Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li, Kevin Pan, Qizeng Sun, Hanshen Li, Eric Luo, SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4537</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4537"/>
		<updated>2021-11-29T03:56:26Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429), SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. [3]    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock. [4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio. [5]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] Vanderbei, R. J. (2000). &#039;&#039;Linear programming: Foundations and extensions&#039;&#039;. Boston: Kluwer. &lt;br /&gt;
&lt;br /&gt;
[2] Best, M. J. (2010). &#039;&#039;Champman &amp;amp; Hall/CRC Finance: Portfolio Optimization.&#039;&#039; Ontario: Canada.&lt;br /&gt;
&lt;br /&gt;
[3] Perold, Andre F. “Large-Scale Portfolio Optimization.” &#039;&#039;Management Science&#039;&#039;, vol. 30, no. 10, 1984, pp. 1143–1160., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.30.10.1143&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[4] “Constraints: Portfolio Probe: Generate Random Portfolios. Fund Management Software by Burns Statistics.” &#039;&#039;Portfolio Probe | Investment Technology for the 21st Century&#039;&#039;, 19 Apr. 2012, &amp;lt;nowiki&amp;gt;https://www.portfolioprobe.com/features/constraints/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[5] Disatnik, David, and Saggi Katz. &#039;&#039;“Portfolio Optimization Using a Block Structure for the Covariance Matrix.” Journal of Business Finance &amp;amp; Accounting, 2012,&#039;&#039; &amp;lt;nowiki&amp;gt;https://doi.org/10.1111/j.1468-5957.2012.02279.x&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[6] Ahmed, Shabbir. &#039;&#039;Isye 6669: Deterministic Optimization ... - Isye Home | Isye&#039;&#039;. 2002, &amp;lt;nowiki&amp;gt;https://www2.isye.gatech.edu/~sahmed/isye6669/notes/portfolio&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[7] DeMiguel, Victor, et al. “A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms.” &#039;&#039;Management Science&#039;&#039;, vol. 55, no. 5, 2009, pp. 798–812., &amp;lt;nowiki&amp;gt;https://doi.org/10.1287/mnsc.1080.0986&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[8] Overton, M. L. (1997). &#039;&#039;Linear Programming&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4523</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4523"/>
		<updated>2021-11-29T03:27:58Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429), SYSEN 5800 Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] &lt;br /&gt;
&lt;br /&gt;
[2]&lt;br /&gt;
&lt;br /&gt;
[3]&lt;br /&gt;
&lt;br /&gt;
[4]&lt;br /&gt;
&lt;br /&gt;
[5]&lt;br /&gt;
&lt;br /&gt;
[6]&lt;br /&gt;
&lt;br /&gt;
[7]&lt;br /&gt;
&lt;br /&gt;
[8]&lt;br /&gt;
&lt;br /&gt;
[9]&lt;br /&gt;
&lt;br /&gt;
[10]&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4520</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4520"/>
		<updated>2021-11-29T03:25:26Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]] &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4519</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4519"/>
		<updated>2021-11-29T03:23:41Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Numerical Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.    &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
[[File:Table1 .jpg|thumb]]&lt;br /&gt;
The example above is converted into the following table: &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following are the investment guidelines:&lt;br /&gt;
&lt;br /&gt;
# The investment in growth stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# The investment in value stocks cannot be more than 50 percent of the total investment.&lt;br /&gt;
# 20 percent of value stocks should be invested into bonds.&lt;br /&gt;
# To diversify the portfolio, 60 percent of the $100,000  should be invested into one of the higher annual return investments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution[5]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: dollars invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: dollars invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: dollars invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: dollars invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: dollars invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: dollars invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: dollars invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing return&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: 0.055*x1 + 0.1374*x2 +0.1489*x3 + 0.0168*x4 + 0.0077*x5 +0.093*x6 - 0.02*x7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the constraints:&lt;br /&gt;
&lt;br /&gt;
x1 +x2 + x3 + x4 +x5 +x6 = 200000 (amount invested)&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 &amp;lt;= 100000 (half into growth stocks)&lt;br /&gt;
&lt;br /&gt;
x4 + x5 + x6 &amp;lt;= 100000 (half into value stocks)&lt;br /&gt;
&lt;br /&gt;
0.2*(x4 + x5 + x6) &amp;lt;= x7 (20% of the value stocks are invested into bonds)&lt;br /&gt;
&lt;br /&gt;
0.6*(x1+x2+x3) &amp;gt;= x3 (diversify value stock) &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6,x7 &amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GAMS solution:&lt;br /&gt;
&lt;br /&gt;
x1, x4,x5 = 0&lt;br /&gt;
&lt;br /&gt;
x2 = 40,000&lt;br /&gt;
&lt;br /&gt;
x3 = 60,000&lt;br /&gt;
&lt;br /&gt;
x6 = 100,000&lt;br /&gt;
&lt;br /&gt;
x7 = 20,000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Z = 23,330 (optimal solution)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:Varcovar.jpg|thumb|Variance - Covariance Table]]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define the dolling decision variables:&lt;br /&gt;
&lt;br /&gt;
x1: Percent invested in AAPL&lt;br /&gt;
&lt;br /&gt;
x2: Percent invested in MSFT&lt;br /&gt;
&lt;br /&gt;
x3: Percent invested in GOOGL&lt;br /&gt;
&lt;br /&gt;
x4: Percent invested in BRK.A&lt;br /&gt;
&lt;br /&gt;
x5: Percent invested in KR&lt;br /&gt;
&lt;br /&gt;
x6: Percent invested in MSCI&lt;br /&gt;
&lt;br /&gt;
x7: Percent invested in VBMFX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Objective: Maximizing the SR value for optimal risk to returns ratio&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Max: &lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the following constraints: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(r_p) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
x1 + x2 + x3 + x4 + x5 + x6 +x7 = 1 (percentage needs to add up to 100)&lt;br /&gt;
&lt;br /&gt;
x1,x2,x3,x4,x5,x6 &amp;lt;= 0.05 (at least 5% weight on each stock)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using excel as the solver the solution is as follows&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
&lt;br /&gt;
x1,x2,x3 = 5%&lt;br /&gt;
[[File:Frontier.jpg|thumb|381x381px|Efficient frontier graph of the 7 stocks from January 2018 to January 2019]]&lt;br /&gt;
X4,x5 = 40% &lt;br /&gt;
&lt;br /&gt;
X6 = 1.48%&lt;br /&gt;
&lt;br /&gt;
X7 = 17%&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Optimal solution: sharpe ratio = 0.05087 [unitless]&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Frontier.jpg&amp;diff=4514</id>
		<title>File:Frontier.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Frontier.jpg&amp;diff=4514"/>
		<updated>2021-11-29T03:21:24Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;asdf&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Varcovar.jpg&amp;diff=4504</id>
		<title>File:Varcovar.jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Varcovar.jpg&amp;diff=4504"/>
		<updated>2021-11-29T03:15:22Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;car&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=File:Table1_.jpg&amp;diff=4498</id>
		<title>File:Table1 .jpg</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=File:Table1_.jpg&amp;diff=4498"/>
		<updated>2021-11-29T03:06:21Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;table1&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4494</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4494"/>
		<updated>2021-11-29T03:03:22Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(rp) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma_p = \surd(w*\Sigma*w^T)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
σ&amp;lt;math&amp;gt;_p&amp;lt;/math&amp;gt; represents the standard deviation of the portfolio.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;SR_p = E(r_p)/\sigma_p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== Methodology ==&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
When figuring out the maximum return under the fixed risks investment projects:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Function&lt;br /&gt;
!Max &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;ri*Xi&lt;br /&gt;
|-&lt;br /&gt;
|Factor: Xi&lt;br /&gt;
|The amount of investment project i should invest&lt;br /&gt;
|-&lt;br /&gt;
|Coefficient: ri&lt;br /&gt;
|The risk of investment project i &lt;br /&gt;
|-&lt;br /&gt;
|Constants&lt;br /&gt;
|The limit requirements&lt;br /&gt;
|}&lt;br /&gt;
Constraints:&lt;br /&gt;
&lt;br /&gt;
The constraints of portfolio optimization are various, include[4]:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Monetary value constraints&lt;br /&gt;
!Turnover constraint&lt;br /&gt;
|-&lt;br /&gt;
|Long- only constraint&lt;br /&gt;
|Maximum weight constraints&lt;br /&gt;
|-&lt;br /&gt;
|Asset trade constraints&lt;br /&gt;
|Risk fraction constraints&lt;br /&gt;
|-&lt;br /&gt;
|Number of Assets Held Constraint&lt;br /&gt;
|Number of Assets trade Constraint&lt;br /&gt;
|-&lt;br /&gt;
|Trade Universe Constraint&lt;br /&gt;
|Threshold Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Forced Trade Constraints&lt;br /&gt;
|Linear Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Count Constraints&lt;br /&gt;
|Tracking Error Constraints&lt;br /&gt;
|-&lt;br /&gt;
|Volatility constraints&lt;br /&gt;
|Expected return constraints&lt;br /&gt;
|-&lt;br /&gt;
|Distance constraints &lt;br /&gt;
|Sum of largest weights constraints&lt;br /&gt;
|-&lt;br /&gt;
|Cost constraint&lt;br /&gt;
|Number of closing positions constraint&lt;br /&gt;
|-&lt;br /&gt;
|Quadratic constraints&lt;br /&gt;
|Round Lot constraints&lt;br /&gt;
|}&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Numerical Example ==&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The example above is converted into the following table:&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4483</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4483"/>
		<updated>2021-11-29T02:47:22Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(rp) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4481</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4481"/>
		<updated>2021-11-29T02:47:13Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;X = A - Er&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Sigma = (X^T*X)/(n-1) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This table will span the size of the number of stocks chosen mxm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E(rp) = w* Er &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;E(rp)&#039;&#039;&#039; is the expected return of the portfolio. &#039;&#039;&#039;w&#039;&#039;&#039; is the percent of the initial capital being allocated into each stock.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma = w*w^T &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4475</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4475"/>
		<updated>2021-11-29T02:37:44Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. &lt;br /&gt;
&lt;br /&gt;
X = A - Er &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Σ = X^T &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4474</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4474"/>
		<updated>2021-11-29T02:31:46Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. &lt;br /&gt;
&lt;br /&gt;
X = A - Er &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Σ= XX(n-1)&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
	<entry>
		<id>https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4473</id>
		<title>Portfolio optimization</title>
		<link rel="alternate" type="text/html" href="https://optimization.cbe.cornell.edu/index.php?title=Portfolio_optimization&amp;diff=4473"/>
		<updated>2021-11-29T02:30:49Z</updated>

		<summary type="html">&lt;p&gt;Kevinpan156: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Authors: Ainsely Li (fl366), Kevin Pan (kp428), Qizeng Sun (qs95), Hanshen Li (hl2436), Eric Luo (yl2429) Fall 2021&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
[[File:Figure 1- Efficient Frontier Graph.jpg|thumb|333x333px|Figure 1: Efficient Frontier Graph]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
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.&lt;br /&gt;
[[File:Nomenclature.jpg|thumb|Nomenclature]]&lt;br /&gt;
The mitigation of risk can be characterized as follows. Let &#039;&#039;&#039;A&#039;&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Er&#039;&#039;&#039; represents the expected returns of the stock which is the average of the individual column of M. &#039;&#039;&#039;σ&#039;&#039;&#039; is the standard deviation of the individual the data set of an individual stock, where &#039;&#039;&#039;σ&amp;lt;math&amp;gt;^2&amp;lt;/math&amp;gt;&#039;&#039;&#039; is the variance. &lt;br /&gt;
&lt;br /&gt;
X = A - Er &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Σ= XX(n-1)&lt;/div&gt;</summary>
		<author><name>Kevinpan156</name></author>
	</entry>
</feed>