Python으로 배우는 포트폴리오 분석 입문
Charlotte Werger
Data Scientist
연간 수익률(Annual Return): 한 달력연 동안의 총수익
연환산 수익률(Annualized return): 임의 기간에서 환산한 연간 수익률
평균 수익률(Average Return): 긴 기간의 총수익을 더 짧은 기간으로 고르게 나눈 값
누적(복리) 수익률(Cumulative return): 이자·배당·자본이익의 재투자 효과를 포함한 수익률
$$

$$
$$
N(연 단위): $rate= (1 +Return)^{1/N} -1$
N(월 단위): $rate= (1+Return)^{12/N} -1$
어떤 기간이든 연간 수익률로 환산:
# 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
# Calculate the total return
total_return = (apple_price[-1] - apple_price[0]) /
apple_price[0]
print (total_return)
0.5397420653068692
# 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
# Calculate annualized return over 3 years
annualized_return = ((1 + total_return)**(1/3))-1
print (annualized_return)
0.1567672968419047
Python으로 배우는 포트폴리오 분석 입문