Introduction

Why Portfolio Theory?

Modern portfolio theory, developed by Harry Markowitz in 1952, revolutionized finance by showing that diversification reduces risk without sacrificing return. The key insight: what matters for a portfolio is not each asset's individual risk, but how assets move together. This course implements the complete framework from scratch in pure Python.

You will implement:

  • Return & Risk — Portfolio expected return, 2-asset variance, and N-asset covariance matrices
  • Optimization — Minimum variance portfolio, efficient frontier, and tangency portfolio
  • Capital Market Theory — Capital market line, CAPM beta, security market line, Jensen's alpha
  • Factor Models — Risk decomposition, single-factor models, Black-Litterman, and risk parity
Next →