liveBook · Manning

Markowitz-efficient portfolio

As explained in Investing for Programmers

A Markowitz-efficient portfolio is a portfolio on the efficient frontier that offers the highest expected return for a given risk or the lowest risk for a given return.

A Markowitz-efficient portfolio lies on the efficient frontier: no alternative offers higher expected return at the same risk or lower risk at the same return. Diversification balances expected return against variance, making the model a practical way to compare portfolio choices rather than a guarantee of future performance. section 7.6.1

A Python portfolio calculation

Using three years of data for AAPL, WMT, GOOGL, KO, PFE, BRK-B, and NVDA, the calculation uses a 0.0422 risk-free rate and 10,000 candidate portfolios. One resulting allocation assigns 63.6% to NVDA, 29.3% to PFE, and smaller weights to the remaining stocks. Such concentration is a useful prompt to inspect assumptions and risk, not an investment recommendation.

How Investing for Programmers covers it

How deep it goes
Works from historical returns through annualization, covariance, random portfolios, Sharpe scoring, and frontier visualization.
Examples
Uses seven named stocks, 10,000 simulated portfolios, a frontier plot, and a table of calculated optimal weights.
What it assumes
Assumes access to stock-price data while explaining returns, volatility, risk-free rate, and Sharpe ratio along the way.
What you can do after
Build it from scratch with Python, NumPy, pandas, Matplotlib, and yfinance using historical price data.
How it connects
Connects efficient frontier, modern portfolio theory, diversification, variance, volatility, covariance, risk-free rate, and Sharpe ratio.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Investing for Programmers. The section links point to the parts of the book it draws on.