Modern Portfolio Theory

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

Consider a portfolio consisting of a risk-free asset, such as a three-month US Treasury note, and the common stocks Apple (AAPL), Boeing (BA), Disney (DIS), General Electric (GE), Coca-Cola (KO) and Microsoft (MSFT). The plot locates each asset according to its volatility and mean return based on real stock market data from a specified year. The relative size of each bubble indicates the relative amount of money that should be invested in each asset according to modern portfolio theory (MPT). Purchased assets are indicated in green and those that are short-sold are orange. The red curve indicates the efficient frontier and the red dot indicates the portfolio with minimal volatility that achieves the specified minimum mean return.

Contributed by: Cassandra DeBacco  (July 2020)
Open content licensed under CC BY-NC-SA



Consider a set of assets with variable returns , and suppose that the mean return of asset is and the covariance of assets and is . The volatility of asset is its standard deviation . A risk-free asset has a positive mean return but zero volatility and it has zero covariance with every other asset. A portfolio consisting of the assets with random value , where , has mean return and variance . An investor may choose the weights according to various criteria, but modern portfolio theory (MPT), introduced by Markowitz in 1952, which earned him the 1990 Nobel Memorial Prize in Economic Sciences, chooses the weights to minimize the variance (or volatility) of the portfolio. That is, MPT solves the quadratic program:

Minimize subject to .

The investor may optionally add a constraint that the mean return must meet or exceed some level so that , and the investor may exclude the possibility of short sales by requiring for all . The set of MPT portfolios for different values of constitute the efficient frontier, which is shown in red in the plot. A characteristic of the efficient frontier is that the mean return and volatility increase in tandem.

Snapshot 1: short sales have been excluded, so all of the assets appear in green, and . That is, the portfolio is expected to have a 20% return on average.

Snapshot 2: AAPL and MSFT have been removed from the portfolio, and that causes a strong curve in the efficient frontier as the curve bends around DIS to end at GE.

Snapshot 3: the risk-free asset has been removed from the portfolio and . Short sales are also permitted, and BA is short sold.


[1] H. M. Markowitz, "Portfolio Selection," The Journal of Finance, 7(1), 1952 pp. 77–91. doi:10.1111/j.1540-6261.1952.tb01525.x.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.