Module 12Mean-VarianceLesson 6 of 722 min
Two-Asset Portfolio Vol
σ_p(w) formula and sweep.
Variance
σ_p² = w²σ1² + (1-w)²σ2² + 2w(1-w)ρ σ1 σ2
Sweep w
Find minimum-vol mix on a grid.
Challenge
Track μ_p = w μ1 + (1-w) μ2 and print return/vol.
Tips
- Closed-form min-var exists
- Constraints dominate live books
- N-asset needs matrix algebra
Try it live
Two-Asset Portfolio VolRust 2021
Loading editor…
Output
Press Run to compile and execute.