年化報酬率

Python 投資組合分析入門

Charlotte Werger

Data Scientist

比較報酬

  1. Annual Return:一個曆年內的總報酬

  2. Annualized return:由任意期間推算的年度報酬率

  3. Average Return:較長期間的總報酬,平均分攤到較短期間

  4. Cumulative (compounding) return:包含利息、股利與資本利得再投資的複利報酬

Python 投資組合分析入門

為什麼要年化報酬?

$$ 投資組合報酬表

$$

  • 平均報酬 = (100 - 50) / 2 = 25%
  • 實際報酬 = 0%,所以平均報酬不適合評估績效!
  • 如何比較不同期間長度的投資組合?
  • 如何納入時間複利效應?
Python 投資組合分析入門

計算年化報酬

$$

  • N 為年數:$rate= (1 +Return)^{1/N} -1$

  • N 為月數:$rate= (1+Return)^{12/N} -1$

  • 將任何期間轉換為年報酬率:

  • Return 為你要年化的總報酬。
  • N 為迄今的期數。
Python 投資組合分析入門

Python 中的年化報酬

# Check the start and end of timeseries
apple_price.head(1)
date
2015-01-06    105.05
Name: AAPL, dtype: float64
apple_price.tail(1)
date
2018-03-29    99.75
Name: AAPL, dtype: float64
# Assign the number of months
months = 38
Python 投資組合分析入門

Python 中的年化報酬

# Calculate the total return
total_return = (apple_price[-1] - apple_price[0]) / 
                apple_price[0]

print (total_return)
0.5397420653068692
Python 投資組合分析入門

Python 中的年化報酬

# Calculate the annualized returns over months
annualized_return=((1 + total_return)**(12/months))-1
print (annualized_return)
0.14602501482708763
# Select three year period
apple_price = apple_price.loc['2015-01-01':'2017-12-31']
apple_price.tail(3)
date
2017-12-27    170.60
2017-12-28    171.08
2017-12-29    169.23
Name: AAPL, dtype: float64
Python 投資組合分析入門

Python 中的年化報酬

# Calculate annualized return over 3 years
annualized_return = ((1 + total_return)**(1/3))-1

print (annualized_return)
0.1567672968419047
Python 投資組合分析入門

一起來練習吧!

Python 投資組合分析入門

Preparing Video For Download...