Lesson 5 of 15

Efficient Frontier

The Efficient Frontier

The efficient frontier is the set of portfolios that offer the highest expected return for a given level of risk (or equivalently, the lowest risk for a given return).

For two assets, we can trace out the entire frontier by sweeping the weight w₁ from 0 to 1 (with w₂ = 1 − w₁) and computing:

  • Portfolio standard deviation: σ_p(w₁)
  • Portfolio expected return: μ_p(w₁)

The resulting curve in (σ, μ) space is the mean-variance frontier.

Example

With σ₁ = 0.10, σ₂ = 0.20, ρ = 0.30, μ₁ = 0.08, μ₂ = 0.12:

  • At w₁ = 0 (all asset 2): (σ, μ) = (0.20, 0.12)
  • At w₁ = 1 (all asset 1): (σ, μ) = (0.10, 0.08)

Your Task

Implement efficient_frontier_2(s1, s2, corr, mu1, mu2, n=20) that returns a list of n+1 tuples (std, ret), evenly spaced from w₁ = 0 to w₁ = 1. Round each value to 6 decimal places.

Python runtime loading...
Loading...
Click "Run" to execute your code.