In this project I outline the beginning foundation of modern portfolio theory and its underlying basics. I calculate and graph key portfolio performance indicators - the Efficient Frontier, the CAPM, and the Sharpe Ratio - using Python. Hopefully this highlights how powerful, efficient, and informative using programming is for financial analysis.
Harry Markowitz was an American economist that created the Efficient Frontier model in 1952. This model finds optimal asset portfolios that give the highest returns with minimal risk. To achieve this optimal portfolio, different weights for assets in the portfolio are used to produce desired returns. This concept is central to the risk-return trade-off at the cornerstone of modern portfolio management philosophies.
To find the Efficient Frontier, also known as Markowitz's Bullet, we plot the Expected Return on the y-axis and the Portfolio Risk (as Standard Deviation) on the x-axis.
To calculate the Expected Return we use the formula below:
- Expected Return (
$R$ ) - Portfolio Weight of Asset (
$w_{x}$ ) - Rate of Return of Asset (
$r_{x}$ )
By using this formula with various assets' weights we can calculate different Expected Returns for a portfolio.
To calculate the Portfolio Risk we use the formula below:
- Portfolio Risk (
$\sigma P$ ) - Portfolio Weight of Asset (
$w_{x}$ ) - Standard Deviation of Asset (
$\sigma_{x}$ ) - Correlation Coefficient (
$Corr$ )
Lucky for us, all these calculations can be handled using Python.
The Capital Assest Pricing Model (CAPM) formula:
The CAPM is a measure of the the risk and return of a security investment. There are three essential components to the CAPM:
- Risk-Free Return (
$r_{f}$ ) - Market Risk Premium (
$r_{m}-r_{f}$ ) - Beta of the investment (
$\beta_{im}$ )
The Risk-Free Return (
The Market Risk Premium
The Beta (
We get the Beta (
The Beta value indicates the relationship the investment has in relation to the market. In other words, this metric will show if an investment will or will not behave similarly to the rest of the market.
If
If
If
If
The Sharpe ratio formula:
- Risk-Free Return (
$r_{f}$ ) - Return of the investment (
$r_{i}$ ) - Standard Deviation of the investment (
$\sigma_{i}$ )
The Sharpe ratio is a metric used to calculate an investment or portfolio's risk-adjusted return. It also highlights any additional return that is gained after taking on the risk.
Considered simply, a higher Sharpe ratio or index indicates a better return relative to the risk of the investment or the relationship of the investments in the portfolio.