Risk adjusted returns

Introduction to Portfolio Analysis in Python

Charlotte Werger

Data Scientist

Choose a portfolio

$ $

Portfolio 1

  • Annual return of 14%
  • Volatility (standard deviation) is 8%

$ $

Portfolio 2

  • Annual return of 6%
  • Volatility is 3%
Introduction to Portfolio Analysis in Python

Risk adjusted return

$$

  • It defines an investment's return by measuring how much risk is involved in producing that return
  • It's usually a ratio
  • Allows you to objectively compare across different investment options
  • Tells you whether the return justifies the underlying risk
Introduction to Portfolio Analysis in Python

Sharpe ratio

  • Sharpe ratio is the most commonly used risk adjusted return ratio
  • It's calculated as follows:
  • $ Sharpe \; ratio = \frac{R_p - R_f} {\sigma_p} $

  • Where: $ R_p$ is the portfolio return, $R_f$ is the risk free rate and ${\sigma_p} $ is the portfolio standard deviation

  • Remember the formula for the portfolio ${\sigma_p} $?

  • $ \sigma_p = \sqrt(Weights \; transposed (Covariance \; matrix \; * \; Weights)$)
Introduction to Portfolio Analysis in Python

Annualizing volatility

$$

  • Annualized standard deviation is calculated as follows: $ \sigma_a=\sigma_m * \sqrt{T} $
  • $ \sigma_m $ is the measured standard deviation
  • $ \sigma_a $ is the annualized standard deviation
  • T is the number of data points per year
  • Alternatively, when using variance instead of standard deviation; $ \sigma_a^2=\sigma_m^2 * {T} $
Introduction to Portfolio Analysis in Python

Calculating the Sharpe Ratio

# Calculate the annualized standard deviation
annualized_vol = apple_returns.std()*np.sqrt(250)
print (annualized_vol)

0.2286248397870068
# Define the risk free rate
risk_free = 0.01
# Calcuate the sharpe ratio
sharpe_ratio = (annualized_return - risk_free) / annualized_vol
print (sharpe_ratio)

0.6419569149994251
Introduction to Portfolio Analysis in Python

Which portfolio did you choose?

$ $

Portfolio 1

  • Annual return of 14%
  • Volatility (standard deviation) is 8%
  • Sharpe ratio of 1.75

$ $

Portfolio 2

  • Annual return of 6%
  • Volatility is 3%
  • Sharpe ratio of 2
Introduction to Portfolio Analysis in Python

Let's practice!

Introduction to Portfolio Analysis in Python

Preparing Video For Download...