Technical note

Modern Portfolio Theory Using Matrix Algebra

A review of Markowitz's portfolio selection model, using matrix algebra to simplify the math behind risk, return, and optimization.

The following article reviews Markowitz's portfolio selection model, focusing on Modern Portfolio Theory to enhance methods of portfolio selection. It also introduces matrices and linear algebra to simplify the complex computation behind Modern Portfolio Theory, for faster and more accurate estimation of risk, return, and optimization of a given investment portfolio.

Introduction

Modern Portfolio Theory (MPT) is a theory on how risk-avoiding investors can construct portfolios to maximize expected return for a given level of market risk, emphasizing that risk is an inherent part of higher reward. Harry Markowitz formulated the first mathematical model for portfolio selection in 1952–59, evaluating investments in terms of their mean and variance — popularly known as Modern Portfolio Theory. The theory uses basic statistics and mathematical formulas to find risk, return, and optimization options in an investment portfolio comprising a number of different assets.

While working with larger portfolios, or portfolios with a large number of assets, using plain algebra to represent expected return, variance, and other aspects can become extremely cumbersome. In this journal, we review Markowitz's theory and introduce the use of matrix (linear) algebra, which can greatly simplify many of the computations behind MPT.

Portfolio optimization theory deals with the issues related to allocating total wealth among different assets. This theory was pioneered by Harry Markowitz in his paper "Portfolio Selection," published in 1952 by the Journal of Finance. He was later awarded a Nobel Prize for developing MPT. Based on statistical measures such as variance and correlation, MPT holds that an individual investment's return is less important than how the investment behaves in the context of the entire portfolio.

Matrix algebra formulation can be constructive when performing these computations. The linear algebra formulas easily convert to matrix programming languages like R and Octave. Popular spreadsheet programs like Google Sheets and Microsoft Excel, used widely in financial enterprises, can also handle basic matrix calculations to reach efficient portfolio optimization. All of this makes familiarity with matrix techniques for portfolio calculations a worthwhile investment.

Literature Review

Harry Markowitz is considered a pioneer for his theoretical contributions to financial economics and corporate finance. He shared a Nobel Prize in 1990 for his contributions to the field of finance, first laid out in his "Portfolio Selection" (1952) essay in The Journal of Finance, and more extensively in his book Portfolio Selection: Efficient Diversification (1959). His groundbreaking work formed the foundation of what is now popularly known as Modern Portfolio Theory. This foundation was later substantially expanded upon by Markowitz's fellow Nobel Prize co-winner, William Sharpe, widely known for his 1964 Capital Asset Pricing Model work on the theory of financial asset price formation.

Understanding Modern Portfolio Theory (MPT)

Modern Portfolio Theory argues that an investment's risk and return characteristics should not be viewed alone, but should always 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 maximizes 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 correlation, an individual investment's return is less important than how the investment behaves in the context of the entire portfolio.

Expected Return

To predict future returns (expected return) for a security or portfolio, the historical performance of returns is often examined. Expected return can be defined as "the average of a probability distribution of possible returns." Calculating the expected return is the first step in Markowitz's portfolio selection model — simply the historic average of a stock's return over a given period. Calculations for a portfolio of securities (two or more) involve calculating the weighted average of the expected individual returns.

The portfolio's risk is a complicated function of the variances of each asset and the correlations of each pair of assets. To calculate the risk of a four-asset portfolio, an investor needs each of the four assets' variances and six correlation values, since there are six possible two-asset combinations among four assets. Because of asset correlations, the total portfolio risk (standard deviation) is lower than what a weighted sum would suggest.

Portfolio Return Variance

There are various ways to determine the volatility (risk) of multiple investments — the two most common measures are variance and standard deviation. Variance is a "measure of the squared deviations of a stock's return from its expected return": the average squared difference between actual returns and the average return. In the context of a portfolio, variance measures the volatility of an asset or group of assets.

Larger variance values indicate greater risk. When many assets are held together in a portfolio, assets decreasing in value are often compensated by assets increasing in value, minimizing overall risk. Hence, the total variance of a portfolio of assets is always lower than a simple weighted average of the individual asset variances. Observations indicate that portfolio variance decreases as the number of portfolio assets increases. According to Frantz & Payne (2009), increasing the number of portfolio assets significantly improves its Efficient Frontier — an efficient allocation of diversified assets for variable risk. To a degree, returns on these assets tend to cancel each other out, meaning the portfolio's variance will be smaller than the corresponding weighted average of individual asset variances.

Maintaining portfolios with a greater number of assets allows investors to more effectively reduce risk. In fact, once the number of assets in a portfolio becomes large enough, total variance is derived more from covariance than from the variance of the individual assets (Schneeweis, Crowder, & Kazemi, 2010) — reinforcing the idea that how assets move within a portfolio matters more than how much each individual asset fluctuates in value.

Standard Deviation

Another common measure of volatility (risk) is the standard deviation of a security. Markowitz's portfolio selection model assumes investors make investment decisions based on returns and risk spread. For most investors, the risk of purchasing a security is that they'll receive returns lower than expected — a deviation from the expected (average) return. Each security has its own standard deviation from the average (McClure, 2010). A higher standard deviation translates to greater risk and a required higher potential return. The standard deviation of a return is the square root of the variance (Bradford & Miller, 2009).

The standard deviation of expected returns requires the statistical calculation of several factors that help measure a return's volatility, or risk.

Covariance of Return

Variance and standard deviation measure stock variability. However, to measure the relationship between the returns of one stock and another, we need covariance or correlation. Covariance and correlation measure how two random variables relate to each other (Ross, Westerfield & Jaffe, 2002). Covariance is a statistical measure addressing the interrelationship between the returns of two securities.

If returns are positively related, their covariance will be positive; if negatively related, the covariance will be negative; and if unrelated, the covariance should be zero (Ross, Westerfield & Jaffe, 2002). Markowitz argues that "it is necessary to avoid investing in securities with high covariance among themselves" (Markowitz, 1952, p. 89).

Correlation Coefficient of Returns

The correlation coefficient is the final measure of risk/volatility examined here. It determines the degree to which two variables are related, and addresses some of the difficulties of analyzing the squared-deviation units presented by covariance (Ross, Westerfield & Jaffe, 2002). The correlation coefficient simply divides the covariance by the standard deviations of a pair of securities.

If the correlation between two securities is positive, the variables are positively correlated; if negative, they're negatively correlated; and if zero, they're uncorrelated (Ross, Westerfield & Jaffe, 2002). The degree of risk reduction depends on the variance of the different assets, particularly the correlation between an investment asset and its weight in the portfolio — the greater the proportion of uncorrelated assets, the greater the risk reduction. "Imperfect" correlations (between +1.00 and −1.00) generally indicate a reduction in portfolio risk; pairs with smaller correlation coefficient values suggest less risk than pairs with larger values. These risk factors should be carefully selected, since correlation between assets and risk factors is not always obvious, and may exist even when the factor and asset are not in the same business or industry.

Efficient Frontier

The Efficient Frontier is a key concept of MPT, representing the best combination of securities or assets within an investment portfolio. It describes the relationship between expected portfolio returns and portfolio volatility, usually depicted as a curve comparing risk against expected return. The optimal portfolios plotted along this curve represent the highest possible expected return for their level of risk (McClure, 2010).

One of the major implications of Markowitz's Efficient Frontier theory is what it tells us about the benefits of diversification. Diversification can increase expected portfolio returns without increasing risk. Markowitz's theory implies that rational investors seek portfolios that generate the largest possible returns with the least amount of risk.

Shortcomings

The Markowitz model involves complex calculations for risk and return that can become cumbersome with a large number of assets in the portfolio. Computation can also become difficult and monotonous with a large portfolio. Another shortcoming: the Markowitz model assumes the investor knows the true expected return. In practice, investors can only estimate expected return, since investment returns change over time, and historical data about security returns is often limited. The classical portfolio formulation ignores estimation error and performs poorly under uncertain conditions. A portfolio optimization methodology that accounts for data uncertainty — integrating statistical methods with expert experience — is needed to better estimate future returns.

Methods & Finding the Solution

Consider a three-asset portfolio problem with assets denoted A, B, and C. Let Ri (i = A, B, C) denote the return on asset i, and assume the Constant Expected Return (CER) model holds.

Let 1 represent the total wealth available for investment, and xi denote the portion of wealth invested in asset i (i = A, B, C, where xA + xB + xC = 1). The portfolio return Rp,x is a random variable.

Calculating this return becomes tedious as the number of assets grows. If we convert the linear calculation into matrix form, computation becomes much easier.

Portfolio Characteristics Using Matrix Notation

Define n×1 column vectors containing the asset returns and portfolio weights. To find the portfolio return, we multiply the first matrix by the transpose of the other.

If we define E[R] as the mean of the historic returns data, we can define another 3×1 column matrix accordingly — giving us the expected return on the portfolio.

To simplify further, we define a 3×3 covariance matrix of returns, which lets us compute the variance of the portfolio.

Recall that xi sums to 1 (the total wealth available for investment); this condition can be expressed using a 3×1 vector with each element equal to 1. We can also compute the covariance between the return on portfolio x and the return on portfolio y.

Conclusion

When working with large portfolios, the algebra of representing portfolio expected returns and variances becomes cumbersome. Matrix (linear) algebra can greatly simplify many of these computations, and is especially useful when it comes time to do the actual computation on a computer. Matrix algebra formulas translate easily into programming languages like R, and popular spreadsheet programs like Microsoft Excel — the workhorse of many financial houses — can also handle basic matrix calculations. All of this makes it worthwhile to become familiar with matrix techniques for portfolio calculations.

Bibliography

  1. Expected Return — Investopedia
  2. Market Risk — Investopedia
  3. Harry Markowitz — Investopedia
  4. Markowitz, H. (1952). "Portfolio Selection." The Journal of Finance. doi.org/10.1111/j.1540-6261.1952.tb01525.x
  5. SSRN working paper (link corrupted in the original export)
  6. Modern Portfolio Theory (MPT) — Investopedia
  7. SSRN — Efficient Frontier paper
  8. SpringerLink — Financial Innovation, 2018
  9. Portfolio Theory Matrix — faculty.washington.edu
  10. youtu.be/YtrMGKLRtwA
  11. en.samt.ag — Modern Portfolio Theory
  12. youtu.be/V-I64oviqs8
  13. cfa-course.com
← All writing