與基準比較

Python 投資組合分析入門

Charlotte Werger

Data Scientist

對照基準的主動型投資

投資組合與基準的累積報酬比較

Python 投資組合分析入門

主動管理投資組合的主動報酬

$$

  • 主動報酬是(主動)投資「相對於」其基準的表現。
  • 計算為「基準與實際報酬之差」。
  • 主動報酬源自「主動型」投資,也就是相對基準採取「超配與低配」部位。
Python 投資組合分析入門

指數型基金的追蹤誤差

$$

  • 被動型基金或「指數型基金」不以主動報酬評估表現。
  • 「追蹤誤差」是用來描述被動型基金之投組與基準差異的名稱。
Python 投資組合分析入門

主動權重

各產業的主動權重長條圖

1 來源:Schwab Center for Financial Research。
Python 投資組合分析入門

在 Python 計算主動報酬

# Inspect the data 
portfolio_data.head()
      mean_ret    var     pf_w     bm_w     GICS Sector    
Ticker                            
A       0.146    0.035    0.002    0.005    Health Care    
AAL     0.444    0.094    0.214    0.189    Industrials    
AAP     0.242    0.029    0.000    0.000    Consumer Discretionary    
AAPL    0.225    0.027    0.324    0.459    Information Technology        
ABBV    0.182    0.029    0.026    0.010    Health Care
1 Global Industry Classification System (GICS)
Python 投資組合分析入門

在 Python 計算主動報酬

# Calculate mean portfolio return
total_return_pf = (pf_w*mean_ret).sum()
# Calculate mean benchmark return
total_return_bm = (bm_w*mean_ret).sum()
# Calculate active return
active_return = total_return_pf - total_return_bm 
print ("Simple active return: ", active_return)
Simple active return: 6.5764
Python 投資組合分析入門

在 Python 計算主動權重

# Group dataframe by GICS sectors 
grouped_df=portfolio_data.groupby('GICS Sector').sum()
# Calculate active weights of portfolio
grouped_df['active_weight']=grouped_df['pf_weights']-
                            grouped_df['bm_weights']

print (grouped_df['active_weight'])
GICS Sector
Consumer Discretionary         20.257
Financials                     -2.116
...etc
Python 投資組合分析入門

一起來練習吧!

Python 投資組合分析入門

Preparing Video For Download...