Section 8. Economic theory
https://doi.org/10.29013/EJEMS-21-2-68-75
Siqi Zhao, Bellevue High School E-mail: [email protected]; [email protected]
MEAN VARIANCE PORTFOLIO OPTIMIZATION -INSIGHTS DURING THE COVID-19 PERIOD
Abstract
Modern portfolio theory argues that an investment's risk and return characteristics should not be viewed alone, rather, they should be evaluated by how the investment affects the overall portfolio's risk and return. MPT shows that an investor can construct a portfolio of multiple assets that will maximize returns for a given level of risk. Likewise, given a desired level of expected return, an investor can construct a portfolio with the lowest possible risk. Based on statistical measures such as variance and correlations, an individual investment's performance is less important than how it impacts the entire portfolio.
Thus, in this project, we will perform the mean variance portfolio of the targeted portfolio with diagonal adjusted covariance matrix methodology which can give us robust estimation. Then we will use the optimal portfolio to visualize the efficient frontier and compare the optimal portfolio with index or other randomly chosen portfolio.
Keywords: Modern portfolio theory, Mean Variance Portfolio Optimization, investment, diagonal adjusted covariance matrix methodology.
Introduction Here are some basic explanations of the impor-
The mean-variance analysis is the process of tant variables: finding optimal asset allocation that provides the Portfolio Expected Return: weighted average of best trade-off between the expected return and the returns of each asset in the portfolio. risk (measured as the variance of returns). A key Volatility: measurement of the risk of an asset concept connected to the mean-variance analysis (Each asset volatility will be calculated by the stan-is the Efficient Frontier - a set of optimal portfolios dard deviation of the asset log return). providing the highest expected portfolio return for Risk Aversion: investor's personalized tolerance a given level of risk - or framing it differently - pro- to risk. The larger the risk aversion, the more conser-viding the minimum level of risk for the expected vative the investors will be. Generally, the risk averportfolio return. sion ranges from 0 to infinity.
Methodology Overview
1. Objective Function
In general, portfolios have two objectives: to maximize returns and minimize risk. The goal of optimization is therefore to find a balance that tends to maximize returns or minimize risk, depending on the investor's risk aversion. Assuming that there are n assets in the portfolio, R is the rate of return for the entire portfolio.
Objective function:
maximize E (R) - awT Sw
^ maximize rTw - awTSw
Where w is the asset weights in the portfolio ( w e[0,l]), a is the risk aversion, £ is the return covariance matrix.
2. Constraints
The most critical constraint is that the weight of the asset adds up to 1.
n
& = 1
i=1
You can specify a weight limit for each asset.
3. Define Risk Aversion Value
There are some common utility functions:
• Exponential utility function U (w ) = -e ~flw ;a > 0;
• Logarithm utility function U(w) = ln(w);w > 0;
• Power utility function
w l-b
U(w) =-;b > 0;w > 0,b
v ' 1 - b
* 1.
Utility functions can be used to determine an investor's level of risk aversion - the larger the recess of the utility function (i.e., the more negative U'' (w)) represents the greater the amount of wealth that needs to be added in order to increase a unit of utility. This demonstrates that the investor is more risk averse. 4. Optimization Calculation With above objective function and the introduction of risk aversion, we can transform the objective function into following form:
• • 1 Tv 1 T
minimize—w Zw—r w 2 a
subject toeTw = 1
where e is a vector contains all elements as 1. Let's denote A = 1/a, A > 0.
Now the KKT condition is:
0 = Zw -Xw -ye
eTw = 1
With above two equations, we can have:
1-AwT Z-1e
r=-
eT Z-1e
Denote w1 =
£-1e eT Z-1e
and w 2 =
£'1w eT £_1w
Then the optimal solution of the whole system should be:
wopt = ( - k )w1 + kw2
Where k - AwT Z^e
Model Construction Work Flow
We first provide a procedure overview of the model construction: (Figure 1).
1. Data Source
The monthly return data for five stocks was extracted from Google Finance with the stock tickers: MCD, SBUX, ZM, COST, HSTRF
The necessary data is the daily adjusted closing price of the asset, if the unadjusted closing price is used, the yield needs to be adjusted according to the stock dividend, stock split and other events, so as to avoid causing abnormal return
2. Stock Data Overview
• Log Return Distribution (Figure 2).
Ideally, although the algorithm does not require the data to follow the normal pattern, the log return of each stock is approximately normally distributed which makes it can suit wider situations of optimization.
Data Preparation
Missing Value Impute
Outlier Detection
Covariance Estimation
Objectives Definition
Model Construction
Constraints Clarification
Optimal Portfolio Allocation
Efficient Frontier Visualization
Comparison to Random Portfolios
Model Improvements
Robust Covariance Estimation
Risk Free Asset
Allocation Constraints
Figure 1.
Figure 2.
Ideally, although the algorithm does not require which makes it can suit wider situations of optimiza-the data to follow the normal pattern, the log return tion.
of each stock is approximately normally distributed • Stock Price Time Series.
Figure 4.
With these time series plot, some information has already been revealed. During the Covid 19 period, Zoom company got a sharp increase due to the lifestyle changes. Among the businesses and schools, people are mostly switching from offline to online communication methods, thus, technology developed by Zoom gets more exposure to the market.
Meanwhile the Hollister Biosciences Inc also shows an increase during later period since the vaccine becomes the one of most promising solution which can help humans get rid of the virus attack.
What can be foreseen is that if investors are seeking high return during this Covid time, the above two stocks should be a great choice.
3. Data Preprocessing
• The log return is calculated from the current price and the previous month's adjusted closing price.
• The missing value of return can be replaced by the historical average rate of return (Note: it is not recommended to replace the missing price data directly with the average price)
• Return values which are outside than 3 standard deviations are removed directly as outlier values (This can be adjustable for known return distributions)
• The return co-variance matrix estimation:
Highly related assets can have a significant impact on optimization results. Here we give two ways to adjust the yield co-variance matrix calculated using historical data.
(1) Diagonal adjustment - A very small number (e.g. 0.001, 0.005) is added uniformly to the main diagonal of the yield co-variance matrix, thus ensuring that the result error is not magnified when we inverse the matrix.
(2) Ledoit-Wolf shrinkage - Using Ledoit-Wolf shrinkage method to acquire robust covariance matrix estimation.
4. Optimizer Construction We are using python and package scipy which provides a convenient API to build all kinds of minimization problem structure. Then the constraints are introduced by adding inequality or equality.
Here we restricted every asset has upper bound allocation percentage of 30% and has lower bound allocation percentage of 0%, which means no short sells are allowed. Model Results 1. Optimal Portfolio
Here is the information about the optimizer results: Optimization terminated successfully. (Exit mode 0) Current function value: -0.00299274725150995 Iterations: 10 Function evaluations: 70 Gradient evaluations: 10
And the optimal portfolio allocation is:
Stock Ticker Optimal Weights Risk Aversion=2 Optimal Weights Risk Aversion=5 Optimal Weights Risk Aversion=10
MCD 5.81% 16.71% 20.11%
ZM 66.88% 30.00% 28.75%
COST 12.59% 20.51% 23.15%
SBUX 3.85% 14.86% 18.13%
HSTRF 10.87% 9.96% 9.86%
Optimal Portfolio Information:
2. Efficient Frontier
The efficient frontier is the set of optimal portfolios that offer the highest expected return for a defined level of risk or the lowest risk for a given level of expected return. Portfolios that lie below the efficient frontier are sub-optimal because they do not provide enough return for the level of risk. Portfolios that cluster to the right of the efficient frontier are sub-optimal because they have a higher level of risk for the defined rate of return.
The efficient frontier will possess following attributes:
(1) Any point on the effective frontier represents an optimal portfolio with a given asset weight, and of course there are some portfolios within the effective frontier, but given a portfolio P within the effective frontier, a portfolio P within the effective frontier can always find a combination with the same volatility as P but a higher expected return. Therefore, in order to maximize the benefits, investors will always choose a combination of effective frontier. Ultimately, the best portfolio points move along the effective frontier based on different risk aversion values.
(2) When limiting the maximum weight of an asset or applying other weight constraints, the efficient frontier shape may change accordingly.
The efficient frontier of current portfolio: (Figure 5).
From the plots we see that with our current risk aversion = 2, risk aversion=5, and risk aversion=10, the optimal portfolio is shown as the red point on each of the plots. And the global optimal can reach about 5.30%, 3.60%, and 3.31% of portfolio volatil-
ity and about 0.58%, 0.36%, and 0.296% of expected return, respectively. Conclusively, as the risk aversion factor increases, the expected return decreases, while the portfolio volatility increases, indicating that the more risk an investor can bear, the more return he/ she will typically receive.
Our optimal portfolio is always exactly lying on the efficient frontier. This means that with the same risk, our optimal portfolio will always have higher return than the other portfolios. The higher the risk aversion, the lower the return and risk will be. We can deduct that when risk aversion=infinity, the optimal portfolio will become the global minimum risk portfolio
Further Improvement
1.Covariance Estimation Improvements
The covariance matrix estimation is extremely sensitive to data quality and usually results in an unstable estimation which cause problem when shaping the efficient frontier. Thus, one method is to use Ledoit-Wolf shrinkage method to estimate robust covariance matrix.
2. Add Free Risk Asset
The Markowitz model is used for the allocation of risk assets in this case, and in practice risk-free assets can be added to find the optimal allocation point more precisely. This will become the classical CAPM model.
3. Precise Asset Allocation Specification
Add asset specific allocation upper bound, lower bound and group allocation can further help investors to decide precise weights they want to achieve.
Figure 5.
Conclusion
Based on the actual financial market, this project has coded the traditional Markowitz asset allocation model. This is an asset optimization method based on risk aversion factors, yields and volatility. This asset allocation model can be used for a variety of
asset types, such as stocks, bonds, or indices. The allocation of asset weights for the next period is optimized based on the previous return and volatility of the asset. Markowitz asset allocation model is a financial gain/risk trade-off, which lays a solid theoretical foundation for CAPM model.
Generally, when the risk aversion factor increases, the portfolio return would decrease while the risk would decrease. For instance, based on the portfolio optimization results, when the risk aversion is set to 2, the portfolio return is 0.58%, and the risk is 5.30%, whereas when the risk aversion is set to 10, the portfolio return decreased to 0.296%, and the risk lowered to 3.31%.
Stock allocation is easily affected by the risk aversion factor. Using stock MCD as an example, when the risk aversion factor is set to be 2, the stock allocation is 5.81%, while when the risk aversion factor is set to be 10, its stock allocation increases to 20.11%, indicating that MCD is a relatively low-risk stock investment. This can also be indicated by the stock price time series plot, in which the MCD stock price curve is comparatively flat. Accordingly, when the risk aversion factor increases, the percent allocation of low-risk stock increases, similarly, when the risk aversion factor decreases, the percent allocation of low-risk stock decreases.
When deciding to invest in different stocks, people should calculate and decide their personalized risk aversion factor based on their current financial situation. Since the expected return and risk can vary as the risk aversion factor varies, establishing their most fit risk aversion factor would find the best balance between expected return and risk for their own situation. To better avoid high risks, people should not put their eggs in the same basket, specifically, they should choose different investments with varying levels of risks. Financial investment can also be related with political and societal changes. For example, the corona virus has significantly impacted the stock market, causing most of the stock prices to fall dramatically. Moreover, the government subsidy can cause inflation, thus also shifting, mostly raising, the overall stock price.
Summary
When allocating assets, it is essential to find a balance between profits maximization and risk minimization. Understanding that the investors are risk-averse, we recommended them to distribute their portfolio into various asset classes with different levels of risk. Supposedly, losses in one investment will be covered by the profits earned in other investments.
The ideal assets allocation strategy can help people maintain and increment their wealth, with the preliminary understanding that no investment is risk-free, however, there are some investments with lower risk and some others with higher risk. To avoid spending all the assets in one investment, we will set an upper and a lower allocation bound.
References:
1. Ledoit Olivier and Michael Wolf. "Improved estimation of the covariance matrix of stock returns with an application to portfolio selection." Journal of empirical finance - 10.5. 2003. - P. 603-621.
2. Roll Richard. "A mean/variance analysis of tracking error." The Journal of Portfolio Management - 18.4. 1992. - P. 13-22.
3. Mangram Myles E. "A simplified perspective of the Markowitz portfolio theory." Global journal of business research - 7.1. 2013. - P. 59-70.
4. Virtanen Pauli et al. "SciPy 1.0: fundamental algorithms for scientific computing in Python." Nature methods - 17.3. 2020. - P. 261-272.
5. Google Finance: Stock market quotes, news, currency conversions & more. (n.d.). Google. Retrieved October 11, 2020. From: URL: http://www.google.com/finance
6. Erlich István, Ganesh K. Venayagamoorthy, and Nakawiro Worawat. "A mean-variance optimization algorithm." IEEE Congress on Evolutionary Computation. IEEE, 2010.