Markowitz’s Efficient Frontier in Python [Part 1/2]

Bernard Brenyah
DS Biz
Published in
3 min readOct 21, 2017

Image Credit: http://hmarkowitz.com

Harry Markowitz’s contribution to the world of finance and economics cannot be emphasized enough. He is widely regarded as the pioneer of Modern Portfolio Theory (MPT) with his groundbreaking paper “Portfolio Selection” in 1952. He eventually won a Nobel Memorial Prize in 1990 in Economic Sciences for his contribution to the field.

MPT is taught around the world in practically every business/finance class. This post (part of a 2 part series) looks at the underpinnings of the theory and the construction of an efficient frontier with Python using real-world stock data.

So what is MPT, why should you even bother understanding it and how does it even work with Python?

Like most theories, MPT was developed with some assumptions of the real world. The attempt to explain MTP commences with a presentation of its assumptions:

ASSUMPTIONS OF MPT

- Investors are rational and avoid risks whenever possible

- Investors aim for the maximum returns for their investment

- All investors share the aim maximizing their expected returns

- Commissions and taxes on the market are left out of consideration

- All investors have access to the same sources and level of all necessary information about investment decisions

- Investors have unlimited access to borrow and lend money at the risk free rate

Modern Portfolio Theory is a theory about how investors (who are risk averse) construct portfolios that maximise their expected returns for given levels of risk. The breakthrough insight from MPT was the fact that risks and returns characteristics of various investments need not be isolated and analysed but looked at how these investments affected the performance of a portfolio. The assumptions of MPT, thus, emphasise that investors only assume additional risk when there is a possibility of higher expected returns — “High risk, High Reward”

The fundamental tenet of this theory is the possibility for investors to construct an “efficient set of portfolios — Efficient Frontier” that offers the maximum expected returns for a given level of risk. An investor’s tolerance for risk determines the…

Bernard Brenyah
DS Biz
Editor for

I have a love/hate relationship with numbers