Efficient frontier
The efficient frontier is the set of portfolios offering the highest expected return at each level of risk, or the lowest risk at each level of expected return.
Build a Robo-Advisor with Python (From Scratch)
The efficient frontier is the set of portfolios offering the highest expected return for each level of risk or the lowest risk for each expected return.
- How it is used
- Guides robo-advisor portfolio selection across varying risk levels and supports automated risk–return allocation.
- How deep it goes
- Derives the frontier equation and implements its plot, then extends it to constrained target-volatility optimization while deferring infeasible targets.
- Examples
- Uses three-stock random portfolios, risk–reward plots, frontier overlays, and constrained portfolios spanning target volatility levels.
- What you can do after
- Build it from scratch in Python by simulating weights, calculating portfolio statistics, plotting the frontier, and optimizing constrained target-risk portfolios.
Read how Build a Robo-Advisor with Python (From Scratch) explains efficient frontier →
Investing for Programmers
The efficient frontier is the set of portfolios that provide the highest expected return at each level of risk or the lowest risk at each expected return.
- How it is used
- Guides portfolio construction by comparing expected return, volatility, diversification, and risk-adjusted performance.
- How deep it goes
- Defines frontier efficiency and demonstrates randomized portfolio calculations, stopping short of guaranteeing future performance.
- Examples
- Uses three years of prices for seven named stocks, randomized portfolios, a frontier plot, and an optimal-weight table.
- What you can do after
- Build it from scratch with Python, NumPy, pandas, Matplotlib, and yfinance, then inspect candidate allocations and risk metrics.
Read how Investing for Programmers explains efficient frontier →
Related concepts
- Markowitz-efficient portfoliohas part · 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.
- meanuses · A mean is a measure of central tendency, calculated as the arithmetic average of values or, for a random variable, as the probability-weighted average of its possible values.
- minimum-variance frontierpart of · The minimum-variance frontier is the set of portfolios that achieve the lowest possible variance for specified expected returns when no risk-free asset is included.
- portfolioproduces · A portfolio is a collection of assets, work, tools, or initiatives assembled or managed together for purposes such as evaluation, presentation, investment, or prioritization.
- volatilityuses · Volatility is the degree or frequency with which a quantity, condition, or system varies or changes over time.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

