風險調整後報酬

Python 投資組合分析入門

Charlotte Werger

Data Scientist

選擇投資組合

$ $

投資組合 1

  • 年化報酬 14%
  • 波動度(標準差)8%

$ $

投資組合 2

  • 年化報酬 6%
  • 波動度 3%
Python 投資組合分析入門

風險調整後報酬

$$

  • 以產生該報酬所承擔的風險來界定投資的報酬
  • 通常是一個比率
  • 讓你能客觀比較不同投資選項
  • 告訴你報酬是否足以彌補其風險
Python 投資組合分析入門

Sharpe ratio

  • Sharpe ratio 是最常用的風險調整後報酬比率
  • 計算方式如下:
  • $ Sharpe \; ratio = \frac{R_p - R_f} {\sigma_p} $

  • 其中:$ R_p$ 為投資組合報酬,$R_f$ 為無風險利率,${\sigma_p} $ 為投資組合的標準差

  • 還記得投資組合 ${\sigma_p} $ 的公式嗎?

  • $ \sigma_p = \sqrt(Weights \; transposed (Covariance \; matrix \; * \; Weights)$)
Python 投資組合分析入門

年化波動度

$$

  • 年化標準差計算:$ \sigma_a=\sigma_m * \sqrt{T} $
  • $ \sigma_m $ 為量得之標準差
  • $ \sigma_a $ 為年化標準差
  • T 為每年資料點數
  • 或者,若用變異數取代標準差:$ \sigma_a^2=\sigma_m^2 * {T} $
Python 投資組合分析入門

計算 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
Python 投資組合分析入門

你選了哪個投資組合?

$ $

投資組合 1

  • 年化報酬 14%
  • 波動度(標準差)8%
  • Sharpe ratio 為 1.75

$ $

投資組合 2

  • 年化報酬 6%
  • 波動度 3%
  • Sharpe ratio 為 2
Python 投資組合分析入門

一起來練習吧!

Python 投資組合分析入門

Preparing Video For Download...