Comparing against a benchmark

Introduction to Portfolio Analysis in Python

Charlotte Werger

Data Scientist

Active investing against a benchmark

Cumulative returns of a portfolio compared to benchmark cumulative returns

Introduction to Portfolio Analysis in Python

Active return for an actively managed portfolio

$$

  • Active return is the performance of an (active) investment, relative to the investment's benchmark.
  • Calculated as the difference between the benchmark and the actual return.
  • Active return is achieved by "active" investing, i.e. taking overweight and underweight positions from the benchmark.
Introduction to Portfolio Analysis in Python

Tracking error for an index tracker

$$

  • Passive investment funds, or index trackers, don't use active return as a measure for performance.
  • Tracking error is the name used for the difference in portfolio and benchmark for a passive investment fund.
Introduction to Portfolio Analysis in Python

Active weights

Bar chart of active weights per industry

1 Source: Schwab Center for Financial Research.
Introduction to Portfolio Analysis in Python

Active return in 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)
Introduction to Portfolio Analysis in Python

Active return in 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
Introduction to Portfolio Analysis in Python

Active weights in 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
Introduction to Portfolio Analysis in Python

Let's practice!

Introduction to Portfolio Analysis in Python

Preparing Video For Download...