Introduction¶

This is the code for our Master Thesis "A Comparative Study of Active Management in Norway and the US: Analysing Mutual Fund Performance and Fees" by by Lars Christian Wiig & Hjalmar Kristoffer Bjørgan. In this notebook we have divided our code into sections with a little introduction to each section. The code uses a excel file that is included.

In [ ]:
# Imports
import pandas as pd
import seaborn as sns
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import statsmodels.api as sm
from statsmodels.stats.diagnostic import het_white
from statsmodels.stats.diagnostic import acorr_breusch_godfrey
import datetime as dt
import warnings
warnings.filterwarnings('ignore')

pd.options.display.float_format = '{:.3f}'.format # To not get scientific notation
In [ ]:
Norway = True # Use Norwegian Data else using US Data
level = 100 # Sign level -> set to 100 for using all results

# Change benchmark
change_benchmark = False
bench = 'MSCI_ETF' #If benchmark is changed

# Period
min_months = 12 # Need atleast this amount of months to be in the dataset
start_year = 2012 # Starting from this year
end_year = 2022 # Whole year

Preparing data¶

In this section, we prepared the dataset. Firstly, we imported the data from Excel, which was already imported from Eikon. Then, we structured the necessary dataframes required for conducting our analysis. Further, we removed funds and standardize the gross returns, net returns, expense ratio, and factors.

Preparing data¶

In [ ]:
# Selecting country
if Norway:
    sheet = 'NAV_NOR'
    factor = 'FF+MOM-GLOBAL'
    sheet_for_EXP_ratios = 'EXP_NOR'
    currency = 'NOK'
else:
    sheet = 'NAV_US'
    factor = 'FF+MOM-GLOBAL'
    sheet_for_EXP_ratios = 'EXP_US'
    currency = 'USD'

if Norway:
    var = 'Norway'
else:
    var = 'USA'
In [ ]:
# Importing excel files
NAV = pd.read_excel('fund_data.xlsx', sheet_name=sheet)
FF = pd.read_excel('fund_data.xlsx', sheet_name=factor)
exp = pd.read_excel('fund_data.xlsx', sheet_name=sheet_for_EXP_ratios)
FF['date'] = pd.to_datetime(FF['date'], format='%Y%m%d') #standarizing dates

# Setting dates as index
FF.set_index(FF['date'], inplace=True)
NAV.set_index(NAV['date'], inplace=True)
exp.set_index(exp['date'], inplace=True)

NAV.columns = list(map(lambda x: x.replace(' - TOT RETURN IND',''),NAV.columns))
exp.columns = list(map(lambda x: x.replace(' - TOT EXPENSE RATIO',''),exp.columns))


# Limit the columns to those that is being used
F = FF[['Mkt-RF','SMB','HML','MOM','RMW','CMA','RF']]



# Making a matrix for all results of Regressions
results = pd.DataFrame()
#results[['Name','Alpha','Mkt-RF','SMB','HML','MOM','EXP','ADJ_R_SQ']] = 0
results[['Name','Alpha','Mkt-RF','SMB','HML','MOM','RMW','CMA','EXP','ADJ_R_SQ']] = 0
results['Name'] = NAV.columns[1:]
results.set_index(NAV.columns[1:],inplace=True)
                  
# The result matrices
res_CAPM_ = results[['Alpha','Mkt-RF','ADJ_R_SQ']]
res_FFC_ = results[['Alpha','Mkt-RF','SMB','HML','MOM','ADJ_R_SQ']]
res_FF3_ = results[['Alpha','Mkt-RF','SMB','HML','ADJ_R_SQ']]
res_FFC_EXP = results[['Alpha','Mkt-RF','SMB','HML','MOM','EXP','ADJ_R_SQ']]
res_FF5_ = results[['Alpha','Mkt-RF','SMB','HML','RMW','CMA','ADJ_R_SQ']]

# Used for EXP ratio storage 
temp = res_FFC_EXP.copy(deep=True)

# Removing the date column since it is set as index
exp = exp.drop(['date'],axis=1)
NAV = NAV.drop(['date'],axis=1)

# Setting the start and end year of the data set as inputed above
NAV = NAV[str(start_year):str(end_year)]
exp = exp[str(start_year):str(end_year)]
F = F[str(start_year):str(end_year)]

# List of factors
CAPM = ['Mkt-RF']
FAMA3 = ['Mkt-RF','SMB','HML']
FAMAC = ['Mkt-RF','SMB','HML','MOM']
FAMA5 = ['Mkt-RF','SMB','HML','RMW','CMA',] #NOTE

# USD / NOK - > FX rate 
FX_RATE = FF['USD/NOK']

# Mkt return (not excess, used for plotting) & IR
Mkt = FF['Mkt-RF']+FF['RF']

# Checking if Using nok, if we do we need to convert to USD
# since we wont make currency appreciation / depreciation impact our results
if currency == 'NOK':
    NAV = NAV.mul(FX_RATE[str(start_year):str(end_year)],axis=0)
In [ ]:
F
Out[ ]:
Mkt-RF SMB HML MOM RMW CMA RF
date
2012-01-31 0.056 0.021 -0.008 -0.068 -0.020 -0.010 0.000
2012-02-29 0.049 -0.008 -0.003 -0.026 -0.004 -0.002 0.000
2012-03-30 0.012 -0.004 0.000 0.036 0.005 0.012 0.000
2012-04-30 -0.011 0.002 -0.017 0.049 0.022 -0.001 0.000
2012-05-31 -0.089 -0.005 0.001 0.062 0.021 0.018 0.000
... ... ... ... ... ... ... ...
2022-08-31 -0.042 0.004 0.025 0.033 -0.026 0.013 0.002
2022-09-30 -0.095 -0.017 0.019 0.034 -0.012 0.012 0.002
2022-10-31 0.068 -0.020 0.044 0.026 0.004 0.033 0.002
2022-11-30 0.072 -0.002 -0.003 -0.019 0.022 0.010 0.003
2022-12-30 -0.043 0.021 0.025 0.038 -0.005 0.033 0.003

132 rows × 7 columns

In [ ]:
# Change Benchmark from MSCI World Dev
if change_benchmark == True:
    BENCH = FF[bench].dropna().pct_change(1).loc[str(start_year):str(end_year)].dropna()
    F['Mkt-RF'] = BENCH
    #F['bench'] = BENCH
    F = F.dropna()
In [ ]:
# This is a sorting function, it stores the fund that is feasible and remove those who is not

def sort():
    EW_list = [] # Funds that has the right attributes get added to this list
    EW_clean = [] # Check if fund also have Expense ratio
    EW_final = [] # Checking if there is enough returns when we are looking at gross ret
    for i in NAV.columns:
        FF_FUND = F[['Mkt-RF','RF']].copy(deep=True)
        ret = NAV[i].pct_change()
        ret = ret.replace(0,np.NaN)
        FF_FUND[i] = ret # returns
        FF_FUND = FF_FUND.dropna() # Removing all zero returns
        FF_FUND = FF_FUND.loc[str(start_year):str(end_year)]
        if len(FF_FUND) <= min_months: # Remove fund with less than 'min_months' months
            continue
        if 'IND' in i: # Remove index funds
            continue
        EW_list.append(i) # Adding those funds that made it throght to this list
    for i in exp.columns:
        if '#ERROR' in i or i not in EW_list:
            continue
        else:
            EW_clean.append(i)
            
    for i in EW_clean:
        ret = NAV[i].pct_change()
        ret = ret.replace(0,np.NaN)
        ret = ret*exp[i]/exp[i]
        exp[i] = ret * exp[i]/ret
        GROSS = ret+((exp[i]/100/12))
        GROSS = GROSS.dropna()
        if len(GROSS) <= min_months: # Remove fund with less than 'min_months' months
            continue
            
        EW_final.append(i)
        
        
    EW_list = EW_final
    return EW_list
In [ ]:
EW_list = sort() # Funds that has the right attributes get added to this list
In [ ]:
print(f'''There are {len(EW_list)} of {len(NAV.columns)} funds that has atleast {min_months} gross returns from {start_year} to {end_year}''')
There are 52 of 56 funds that has atleast 12 gross returns from 2012 to 2022
In [ ]:
# Only using feaseble data
exp = exp[EW_list]
NAV = NAV[EW_list]
In [ ]:
ret = NAV.pct_change() # Making return from NAV
ret = ret.replace(0,np.NaN) # Setting 0 as NAN since 0 in return means that the fund is dead
ret = (exp * ret) / exp # Stadarizing for matching with Expense ratio
ret
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
date
2012-01-31 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-02-29 0.024 0.056 NaN 0.079 NaN 0.048 0.049 0.047 0.048 0.053 ... 0.088 NaN NaN 0.046 0.055 NaN 0.046 0.088 NaN 0.053
2012-03-30 0.008 0.002 NaN -0.008 NaN 0.029 0.030 0.029 0.029 0.029 ... -0.007 NaN NaN 0.014 0.006 NaN 0.009 -0.008 NaN 0.014
2012-04-30 -0.010 -0.001 NaN -0.010 NaN -0.016 -0.015 -0.016 -0.016 -0.018 ... -0.020 NaN NaN -0.015 -0.024 NaN -0.018 -0.018 NaN -0.005
2012-05-31 -0.092 -0.092 NaN -0.134 NaN -0.101 -0.100 -0.101 -0.101 -0.101 ... -0.124 NaN NaN -0.088 -0.097 NaN -0.091 -0.124 NaN -0.086
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2022-08-31 -0.026 -0.044 -0.048 -0.019 NaN NaN NaN NaN -0.048 NaN ... NaN -0.027 -0.043 -0.027 NaN -0.047 -0.040 NaN -0.052 NaN
2022-09-30 -0.086 -0.111 -0.114 -0.074 NaN NaN NaN NaN -0.084 NaN ... NaN -0.116 -0.094 -0.091 NaN -0.112 -0.096 NaN -0.097 NaN
2022-10-31 0.086 0.033 0.036 0.042 NaN NaN NaN NaN 0.069 NaN ... NaN 0.051 0.070 0.086 NaN 0.058 0.102 NaN 0.061 NaN
2022-11-30 0.044 0.090 0.085 0.062 NaN NaN NaN NaN 0.106 NaN ... NaN 0.042 0.082 0.083 NaN 0.092 0.090 NaN 0.100 NaN
2022-12-30 -0.042 -0.017 -0.015 -0.008 NaN NaN NaN NaN -0.038 NaN ... NaN -0.053 -0.052 -0.043 NaN -0.050 -0.039 NaN -0.046 NaN

132 rows × 52 columns

In [ ]:
exp = (exp * ret) / ret # Stadarizing for matching
exp
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
date
2012-01-31 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-02-29 1.600 1.400 NaN 1.600 NaN 1.520 0.510 1.820 1.820 0.620 ... 1.500 NaN NaN 0.500 0.600 NaN 1.500 1.500 NaN 1.500
2012-03-30 1.600 1.400 NaN 1.600 NaN 1.520 0.510 1.820 1.820 0.620 ... 1.500 NaN NaN 0.500 0.600 NaN 1.500 1.500 NaN 1.500
2012-04-30 1.600 1.400 NaN 1.600 NaN 1.520 0.510 1.820 1.820 0.620 ... 1.500 NaN NaN 0.500 0.600 NaN 1.500 1.500 NaN 1.500
2012-05-31 1.600 1.400 NaN 1.600 NaN 1.520 0.510 1.820 1.820 0.620 ... 1.500 NaN NaN 0.500 0.600 NaN 1.500 1.500 NaN 1.500
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2022-08-31 1.078 1.400 1.600 1.600 NaN NaN NaN NaN 1.200 NaN ... NaN 1.050 0.400 0.750 NaN 0.750 0.751 NaN 1.050 NaN
2022-09-30 1.078 1.400 1.600 1.600 NaN NaN NaN NaN 1.200 NaN ... NaN 1.050 0.400 0.750 NaN 0.750 0.751 NaN 1.050 NaN
2022-10-31 1.078 1.400 1.600 1.600 NaN NaN NaN NaN 1.200 NaN ... NaN 1.050 0.400 0.750 NaN 0.750 0.751 NaN 1.050 NaN
2022-11-30 1.078 1.400 1.600 1.600 NaN NaN NaN NaN 1.200 NaN ... NaN 1.050 0.400 0.750 NaN 0.750 0.751 NaN 1.050 NaN
2022-12-30 1.078 1.400 1.600 1.600 NaN NaN NaN NaN 1.200 NaN ... NaN 1.050 0.400 0.750 NaN 0.750 0.751 NaN 1.050 NaN

132 rows × 52 columns

In [ ]:
GROSS = ret+((exp/100/12)) # Gross
GROSS = (GROSS * exp) / exp # Stadarizing for matching
GROSS
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
date
2012-01-31 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-02-29 0.026 0.057 NaN 0.080 NaN 0.049 0.049 0.049 0.049 0.053 ... 0.089 NaN NaN 0.046 0.055 NaN 0.047 0.089 NaN 0.054
2012-03-30 0.009 0.003 NaN -0.006 NaN 0.031 0.031 0.031 0.031 0.029 ... -0.005 NaN NaN 0.014 0.007 NaN 0.010 -0.007 NaN 0.016
2012-04-30 -0.008 0.000 NaN -0.008 NaN -0.014 -0.014 -0.014 -0.014 -0.018 ... -0.018 NaN NaN -0.014 -0.024 NaN -0.016 -0.017 NaN -0.004
2012-05-31 -0.090 -0.090 NaN -0.133 NaN -0.100 -0.100 -0.100 -0.099 -0.100 ... -0.123 NaN NaN -0.087 -0.097 NaN -0.090 -0.123 NaN -0.085
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2022-08-31 -0.025 -0.043 -0.046 -0.017 NaN NaN NaN NaN -0.047 NaN ... NaN -0.026 -0.043 -0.027 NaN -0.047 -0.039 NaN -0.051 NaN
2022-09-30 -0.085 -0.110 -0.112 -0.072 NaN NaN NaN NaN -0.083 NaN ... NaN -0.116 -0.094 -0.090 NaN -0.112 -0.095 NaN -0.096 NaN
2022-10-31 0.087 0.034 0.038 0.044 NaN NaN NaN NaN 0.070 NaN ... NaN 0.052 0.070 0.087 NaN 0.059 0.103 NaN 0.062 NaN
2022-11-30 0.045 0.091 0.086 0.063 NaN NaN NaN NaN 0.107 NaN ... NaN 0.043 0.083 0.084 NaN 0.092 0.091 NaN 0.101 NaN
2022-12-30 -0.041 -0.016 -0.014 -0.006 NaN NaN NaN NaN -0.037 NaN ... NaN -0.052 -0.052 -0.042 NaN -0.050 -0.039 NaN -0.045 NaN

132 rows × 52 columns

In [ ]:
NAV = (NAV * exp) / exp # Stadarizing for matching with Expense ratio
NAV
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
date
2012-01-31 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-02-29 36.548 952.204 NaN 180.970 NaN 60.304 21.270 8.825 6.152 17.455 ... 28.585 NaN NaN 139.551 118.207 NaN 237.056 30.861 NaN 119.547
2012-03-30 36.837 954.275 NaN 179.577 NaN 62.072 21.914 9.083 6.331 17.958 ... 28.396 NaN NaN 141.478 118.974 NaN 239.077 30.599 NaN 121.267
2012-04-30 36.481 953.400 NaN 177.862 NaN 61.101 21.589 8.939 6.231 17.628 ... 27.838 NaN NaN 139.395 116.093 NaN 234.851 30.044 NaN 120.617
2012-05-31 33.132 866.139 NaN 153.943 NaN 54.944 19.428 8.035 5.602 15.849 ... 24.389 NaN NaN 127.180 104.831 NaN 213.377 26.307 NaN 110.231
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2022-08-31 67.280 2202.330 395.812 307.424 NaN NaN NaN NaN 13.594 NaN ... NaN 79.431 184.528 335.580 NaN 424.026 468.871 NaN 84.520 NaN
2022-09-30 61.493 1958.262 350.832 284.778 NaN NaN NaN NaN 12.449 NaN ... NaN 70.179 167.192 305.017 NaN 376.324 423.868 NaN 76.308 NaN
2022-10-31 66.781 2022.728 363.580 296.811 NaN NaN NaN NaN 13.309 NaN ... NaN 73.779 178.866 331.285 NaN 398.161 467.255 NaN 80.990 NaN
2022-11-30 69.743 2204.468 394.491 315.251 NaN NaN NaN NaN 14.722 NaN ... NaN 76.892 193.611 358.774 NaN 434.727 509.496 NaN 89.102 NaN
2022-12-30 66.820 2167.504 388.532 312.866 NaN NaN NaN NaN 14.169 NaN ... NaN 72.832 183.545 343.371 NaN 412.794 489.379 NaN 84.971 NaN

132 rows × 52 columns

Summary statistics¶

In this section, we conducted some summary statistics. We looked at the exchange rate, the factors, and different statistics from the dataset over the period.

In [ ]:
(1/FF['USD/NOK'].loc[str(start_year):str(end_year)]).plot()
plt.title(label='USDNOK')
Out[ ]:
Text(0.5, 1.0, 'USDNOK')
In [ ]:
# plotting Fama french factors
(1+F).cumprod().plot()
plt.title('Fama-French Factors')
plt.show()
In [ ]:
F.corr()
Out[ ]:
Mkt-RF SMB HML MOM RMW CMA RF
Mkt-RF 1.000 0.132 -0.029 -0.392 -0.014 -0.277 -0.123
SMB 0.132 1.000 -0.099 -0.035 -0.289 -0.227 -0.125
HML -0.029 -0.099 1.000 -0.462 -0.540 0.792 -0.075
MOM -0.392 -0.035 -0.462 1.000 0.294 -0.096 0.057
RMW -0.014 -0.289 -0.540 0.294 1.000 -0.276 0.018
CMA -0.277 -0.227 0.792 -0.096 -0.276 1.000 -0.009
RF -0.123 -0.125 -0.075 0.057 0.018 -0.009 1.000
In [ ]:
F.describe()
Out[ ]:
Mkt-RF SMB HML MOM RMW CMA RF
count 132.000 132.000 132.000 132.000 132.000 132.000 132.000
mean 0.008 -0.002 -0.000 0.005 0.003 0.001 0.001
std 0.042 0.015 0.027 0.028 0.013 0.017 0.001
min -0.138 -0.042 -0.092 -0.109 -0.029 -0.054 0.000
25% -0.015 -0.011 -0.017 -0.013 -0.006 -0.009 0.000
50% 0.013 -0.002 -0.003 0.006 0.004 -0.002 0.000
75% 0.029 0.009 0.012 0.024 0.011 0.008 0.001
max 0.133 0.033 0.120 0.067 0.046 0.081 0.003
In [ ]:
F.skew()
Out[ ]:
Mkt-RF   -0.518
SMB      -0.058
HML       0.631
MOM      -0.551
RMW       0.100
CMA       1.138
RF        1.416
dtype: float64
In [ ]:
F.kurtosis()
Out[ ]:
Mkt-RF    1.301
SMB      -0.280
HML       3.090
MOM       1.416
RMW       0.582
CMA       4.746
RF        1.113
dtype: float64
In [ ]:
NAV
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
date
2012-01-31 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
2012-02-29 36.548 952.204 NaN 180.970 NaN 60.304 21.270 8.825 6.152 17.455 ... 28.585 NaN NaN 139.551 118.207 NaN 237.056 30.861 NaN 119.547
2012-03-30 36.837 954.275 NaN 179.577 NaN 62.072 21.914 9.083 6.331 17.958 ... 28.396 NaN NaN 141.478 118.974 NaN 239.077 30.599 NaN 121.267
2012-04-30 36.481 953.400 NaN 177.862 NaN 61.101 21.589 8.939 6.231 17.628 ... 27.838 NaN NaN 139.395 116.093 NaN 234.851 30.044 NaN 120.617
2012-05-31 33.132 866.139 NaN 153.943 NaN 54.944 19.428 8.035 5.602 15.849 ... 24.389 NaN NaN 127.180 104.831 NaN 213.377 26.307 NaN 110.231
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2022-08-31 67.280 2202.330 395.812 307.424 NaN NaN NaN NaN 13.594 NaN ... NaN 79.431 184.528 335.580 NaN 424.026 468.871 NaN 84.520 NaN
2022-09-30 61.493 1958.262 350.832 284.778 NaN NaN NaN NaN 12.449 NaN ... NaN 70.179 167.192 305.017 NaN 376.324 423.868 NaN 76.308 NaN
2022-10-31 66.781 2022.728 363.580 296.811 NaN NaN NaN NaN 13.309 NaN ... NaN 73.779 178.866 331.285 NaN 398.161 467.255 NaN 80.990 NaN
2022-11-30 69.743 2204.468 394.491 315.251 NaN NaN NaN NaN 14.722 NaN ... NaN 76.892 193.611 358.774 NaN 434.727 509.496 NaN 89.102 NaN
2022-12-30 66.820 2167.504 388.532 312.866 NaN NaN NaN NaN 14.169 NaN ... NaN 72.832 183.545 343.371 NaN 412.794 489.379 NaN 84.971 NaN

132 rows × 52 columns

In [ ]:
ret.mean(axis=1).describe()
Out[ ]:
count   131.000
mean      0.006
std       0.044
min      -0.151
25%      -0.019
50%       0.010
75%       0.029
max       0.137
dtype: float64
In [ ]:
ret.mean(axis=1).skew()
Out[ ]:
-0.5320489092775641
In [ ]:
ret.mean(axis=1).kurtosis()
Out[ ]:
1.3573231668939743
In [ ]:
ret.shape[0] * ret.shape[1]
Out[ ]:
6864
In [ ]:
ret.corr()
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
ALFRED BERG GLOBAL 1.000 0.887 0.884 0.836 0.694 0.903 0.913 0.925 0.889 0.917 ... 0.842 0.918 0.938 0.889 0.825 0.876 0.819 0.844 0.907 0.896
C WORLD WIDE GLOBALE AKSJER 0.887 1.000 0.993 0.851 0.914 0.843 0.897 0.906 0.867 0.904 ... 0.823 0.931 0.933 0.836 0.821 0.870 0.772 0.820 0.973 0.917
C WORLD WIDE GLOBALE AKSJER ETISK 0.884 0.993 1.000 0.843 0.938 0.810 0.928 0.943 0.859 0.896 ... 0.765 0.927 0.927 0.823 0.796 0.860 0.762 0.760 0.974 0.894
C WORLD WIDE STABILE AKSJER 0.836 0.851 0.843 1.000 0.742 0.881 0.911 0.914 0.847 0.917 ... 0.882 0.961 0.904 0.833 0.835 0.825 0.775 0.878 0.961 0.941
CARNEGIE WORLD WIDE ETISK II 0.694 0.914 0.938 0.742 1.000 0.753 0.932 0.946 0.755 0.900 ... 0.779 NaN NaN 0.745 0.807 0.547 0.767 0.787 NaN 0.897
DNB NOR KAPFORV.GLOBAL II 0.903 0.843 0.810 0.881 0.753 1.000 1.000 0.999 0.999 0.997 ... 0.933 NaN NaN 0.966 0.906 0.944 0.957 0.932 NaN 0.950
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.913 0.897 0.928 0.911 0.932 1.000 1.000 0.999 0.999 0.998 ... 0.941 NaN NaN 0.973 0.915 NaN 0.972 0.938 NaN 0.962
DNB NOR KAPFORV. POSTBANKEN GLOBAL 0.925 0.906 0.943 0.914 0.946 0.999 0.999 1.000 1.000 0.997 ... 0.938 NaN NaN 0.977 0.907 NaN 0.973 0.935 NaN 0.954
DNB GLOBAL A 0.889 0.867 0.859 0.847 0.755 0.999 0.999 1.000 1.000 0.997 ... 0.919 0.886 0.969 0.946 0.907 0.897 0.938 0.918 0.931 0.951
DNB NOR KAPFORV.GLOBAL ETISK IV 0.917 0.904 0.896 0.917 0.900 0.997 0.998 0.997 0.997 1.000 ... 0.939 NaN NaN 0.972 0.905 0.980 0.966 0.937 NaN 0.950
DNB NOR KAPFORV.GLOBAL ETISK V 0.892 0.830 0.804 0.808 0.741 0.996 0.998 0.997 0.993 0.999 ... 0.921 NaN 0.928 0.953 0.905 0.917 0.929 0.921 NaN 0.950
DNB GLOBAL LAVKARBON A 0.935 0.911 0.910 0.893 NaN NaN NaN NaN 0.942 NaN ... NaN 0.870 0.965 0.928 NaN 0.916 0.884 NaN 0.927 NaN
DNB NOR KAPFORV.GLOBAL SELEKTIV I 0.924 0.906 0.940 0.914 0.944 0.999 0.999 1.000 0.999 0.997 ... 0.937 NaN NaN 0.976 0.903 NaN 0.972 0.934 NaN 0.954
DNB NOR KAPFORV. GLOBALSPAR 0.915 0.905 0.915 0.921 0.920 0.995 0.994 0.995 0.995 0.993 ... 0.949 NaN NaN 0.980 0.923 NaN 0.977 0.947 NaN 0.951
DNB NAVIGATOR A DEAD - Liquidated 0.654 0.607 0.556 0.647 0.499 0.735 0.743 0.741 0.779 0.763 ... 0.828 NaN 0.835 0.766 0.761 0.670 0.755 0.833 NaN 0.776
DELPHI GLOBAL A 0.870 0.869 0.854 0.789 0.818 0.924 0.932 0.936 0.873 0.926 ... 0.910 0.920 0.898 0.859 0.885 0.898 0.798 0.909 0.888 0.930
DELPHI GREEN TRENDS A 0.728 0.827 0.808 0.713 NaN NaN NaN NaN 0.677 NaN ... NaN 0.862 0.797 0.708 NaN 0.920 0.505 NaN 0.867 NaN
EIKA GLOBAL 0.879 0.860 0.846 0.852 0.759 0.954 0.958 0.953 0.949 0.954 ... 0.900 0.895 0.953 0.960 0.842 0.902 0.942 0.899 0.935 0.998
EIKA SPAR 0.837 0.827 0.808 0.842 0.781 0.915 0.919 0.916 0.921 0.915 ... 0.975 0.884 0.939 0.917 0.864 0.874 0.900 0.975 0.904 0.919
FIRST GLOBAL FOCUS 0.673 0.676 0.655 0.693 NaN NaN NaN NaN 0.853 NaN ... NaN 0.746 0.802 0.848 NaN 0.744 0.882 NaN 0.804 NaN
FRAM GLOBAL 0.689 0.742 0.716 0.709 0.677 0.772 0.759 0.775 0.798 0.807 ... 0.846 0.617 0.788 0.796 0.749 0.799 0.794 0.851 0.706 0.834
HOLBERG GLOBAL A 0.878 0.907 0.893 0.853 0.731 0.884 0.893 0.895 0.901 0.903 ... 0.904 0.902 0.964 0.888 0.902 0.923 0.832 0.910 0.938 0.870
KLP AKSJE GLOBAL FLERFAK P 0.914 0.857 0.852 0.900 NaN 0.942 NaN NaN 0.929 NaN ... 0.915 0.894 0.960 0.927 NaN 0.904 0.885 0.915 0.923 NaN
NORDEA GLOBAL II DEAD - Merged:88750W 0.874 0.890 0.884 0.910 NaN NaN NaN NaN 0.950 NaN ... NaN NaN 0.953 0.909 NaN 0.840 0.908 NaN NaN NaN
NORDEA GLOBAL NOK 0.903 0.917 0.911 0.862 0.826 0.945 0.952 0.953 0.928 0.954 ... 0.922 0.945 0.959 0.911 0.914 0.899 0.879 0.920 0.915 0.926
NORDEA INTERNASJONALE AKSJER 0.878 0.897 0.863 0.832 0.809 0.937 0.939 0.941 0.942 0.945 ... 0.917 NaN 0.943 0.925 0.904 0.914 0.910 0.914 NaN 0.923
NORDEA INTERNASJONALE AKSJER II 0.878 0.898 0.862 0.830 0.810 0.936 0.940 0.941 0.944 0.945 ... 0.918 NaN 0.896 0.927 0.905 0.916 0.909 0.916 NaN 0.922
NORDEA INTERNASJONALE AKSJER III 0.877 0.899 0.862 0.828 0.807 0.936 0.939 0.941 0.943 0.945 ... 0.915 NaN 0.894 0.925 0.904 0.911 0.908 0.912 NaN 0.922
NORDEA STABILE AKSJER GLOBAL 0.812 0.788 0.774 0.848 0.835 0.915 0.929 0.934 0.887 0.923 ... 0.926 0.867 0.901 0.885 0.900 0.823 0.866 0.930 0.831 0.907
NORDEA STABILE AKSJER GLOBAL ETISK 0.848 0.835 0.829 0.869 0.851 0.905 0.934 0.937 0.902 0.925 ... 0.862 0.836 0.902 0.899 0.879 0.807 0.888 0.861 0.836 0.864
ODIN GLOBAL C 0.886 0.903 0.885 0.850 0.684 0.914 0.901 0.906 0.889 0.907 ... 0.918 0.913 0.948 0.874 0.843 0.895 0.806 0.917 0.956 0.925
ODIN GLOBAL II DEAD - Merged:74930E 0.757 0.687 0.659 0.716 0.617 0.862 NaN NaN 0.852 0.979 ... 0.924 NaN NaN 0.819 NaN 0.836 0.780 0.915 NaN NaN
ODIN FORVALTNING AS MARITIM NOK 0.612 0.551 0.421 0.660 0.520 0.753 0.778 0.781 0.715 0.763 ... 0.771 NaN NaN 0.722 0.740 0.484 0.737 0.779 NaN 0.816
PLUSS UTLAND AKSJE 0.898 0.912 0.902 0.858 0.750 0.933 0.953 0.953 0.959 0.939 ... 0.881 0.933 0.981 0.923 0.868 0.906 0.895 0.877 0.947 0.936
PLUSS UTLAND ETISK DEAD - Merged:88728F 0.894 0.916 0.906 0.855 0.747 0.936 0.952 0.954 0.949 0.941 ... 0.883 0.924 0.971 0.907 0.871 0.902 0.875 0.878 0.942 0.934
PARETO GLOBAL A 0.875 0.837 0.825 0.858 0.637 0.936 0.953 0.950 0.955 0.941 ... 0.910 0.901 0.955 0.920 0.907 0.881 0.898 0.909 0.971 0.940
SKAGEN GLOBAL A NOK 0.891 0.901 0.895 0.838 0.680 0.943 0.933 0.930 0.911 0.941 ... 0.929 0.947 0.949 0.851 0.917 0.879 0.800 0.927 0.986 0.895
SKAGEN GLOBAL II NOK 0.907 0.910 0.912 0.838 NaN 0.991 NaN NaN 0.904 NaN ... 0.914 0.946 0.944 0.839 NaN 0.875 0.783 0.908 0.986 NaN
SKAGEN INSIGHT DEAD - Liquidated 0.753 0.809 0.767 0.724 NaN NaN NaN NaN 0.894 NaN ... NaN NaN 0.909 0.927 NaN 0.857 0.889 NaN NaN NaN
SKAGEN VEKST A NOK 0.807 0.824 0.805 0.822 0.678 0.864 0.890 0.892 0.915 0.874 ... 0.923 0.776 0.910 0.894 0.882 0.868 0.890 0.927 0.874 0.891
SR-UTBYTTE A 0.807 0.763 0.756 0.802 0.569 0.890 NaN NaN 0.886 0.982 ... 0.951 0.839 0.889 0.881 NaN 0.838 0.878 0.958 0.855 NaN
SPARE BANK 1 VERDEN VERDI C 0.835 0.793 0.799 0.854 NaN NaN NaN NaN 0.929 NaN ... NaN 0.795 0.885 0.890 NaN 0.822 0.925 NaN 0.831 NaN
STOREBRAND INT INV.FUND BARNESPAR 0.842 0.823 0.765 0.882 0.779 0.933 0.941 0.938 0.919 0.939 ... 1.000 NaN NaN 0.920 0.935 0.894 0.915 0.999 NaN 0.912
STOREBRAND EQUAL OPPORTUNITIES A 0.918 0.931 0.927 0.961 NaN NaN NaN NaN 0.886 NaN ... NaN 1.000 0.953 0.890 NaN 0.938 0.803 NaN 0.914 NaN
STOREBRAND GLOBAL ESG 0.938 0.933 0.927 0.904 NaN NaN NaN NaN 0.969 NaN ... NaN 0.953 1.000 0.944 NaN 0.942 0.906 NaN 0.964 NaN
STOREBRAND GLOBAL MULTIFACTOR A 0.889 0.836 0.823 0.833 0.745 0.966 0.973 0.977 0.946 0.972 ... 0.920 0.890 0.944 1.000 0.928 0.903 0.961 0.921 0.941 0.932
STOREBRAND INTL.INV.FD. GLOBAL SRI 0.825 0.821 0.796 0.835 0.807 0.906 0.915 0.907 0.907 0.905 ... 0.935 NaN NaN 0.928 1.000 NaN 0.926 0.935 NaN 0.836
STOREBRAND GLOBAL SOLUTIONS A 0.876 0.870 0.860 0.825 0.547 0.944 NaN NaN 0.897 0.980 ... 0.894 0.938 0.942 0.903 NaN 1.000 0.838 0.895 0.964 NaN
STOREBRAND GLOBAL VALUE A 0.819 0.772 0.762 0.775 0.767 0.957 0.972 0.973 0.938 0.966 ... 0.915 0.803 0.906 0.961 0.926 0.838 1.000 0.919 0.874 0.924
STOREBRAND INTL.INV.FD. PENSJONSPAR 0.844 0.820 0.760 0.878 0.787 0.932 0.938 0.935 0.918 0.937 ... 0.999 NaN NaN 0.921 0.935 0.895 0.919 1.000 NaN 0.911
STOREBRAND SMART CITIES A 0.907 0.973 0.974 0.961 NaN NaN NaN NaN 0.931 NaN ... NaN 0.914 0.964 0.941 NaN 0.964 0.874 NaN 1.000 NaN
TERRA GLOBAL DEAD - Merged:88738D 0.896 0.917 0.894 0.941 0.897 0.950 0.962 0.954 0.951 0.950 ... 0.912 NaN NaN 0.932 0.836 NaN 0.924 0.911 NaN 1.000

52 rows × 52 columns

In [ ]:
ret.describe()
Out[ ]:
ALFRED BERG GLOBAL C WORLD WIDE GLOBALE AKSJER C WORLD WIDE GLOBALE AKSJER ETISK C WORLD WIDE STABILE AKSJER CARNEGIE WORLD WIDE ETISK II DNB NOR KAPFORV.GLOBAL II DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J DNB NOR KAPFORV. POSTBANKEN GLOBAL DNB GLOBAL A DNB NOR KAPFORV.GLOBAL ETISK IV ... STOREBRAND INT INV.FUND BARNESPAR STOREBRAND EQUAL OPPORTUNITIES A STOREBRAND GLOBAL ESG STOREBRAND GLOBAL MULTIFACTOR A STOREBRAND INTL.INV.FD. GLOBAL SRI STOREBRAND GLOBAL SOLUTIONS A STOREBRAND GLOBAL VALUE A STOREBRAND INTL.INV.FD. PENSJONSPAR STOREBRAND SMART CITIES A TERRA GLOBAL DEAD - Merged:88738D
count 131.000 131.000 121.000 131.000 24.000 44.000 19.000 21.000 131.000 26.000 ... 50.000 13.000 63.000 131.000 20.000 109.000 131.000 50.000 13.000 23.000
mean 0.005 0.008 0.008 0.006 0.010 0.007 0.014 0.016 0.008 0.016 ... 0.005 -0.028 0.007 0.008 0.011 0.007 0.007 0.005 -0.017 0.015
std 0.037 0.040 0.040 0.040 0.029 0.034 0.037 0.037 0.045 0.036 ... 0.041 0.066 0.050 0.043 0.038 0.046 0.048 0.042 0.071 0.033
min -0.108 -0.111 -0.114 -0.149 -0.041 -0.101 -0.100 -0.101 -0.153 -0.101 ... -0.124 -0.133 -0.131 -0.194 -0.097 -0.166 -0.199 -0.124 -0.101 -0.086
25% -0.010 -0.009 -0.010 -0.014 -0.004 -0.015 -0.008 -0.009 -0.017 -0.002 ... -0.023 -0.077 -0.027 -0.011 -0.008 -0.019 -0.018 -0.025 -0.081 0.002
50% 0.011 0.011 0.009 0.012 0.011 0.012 0.023 0.025 0.015 0.023 ... 0.004 -0.033 0.015 0.014 0.023 0.008 0.017 0.003 -0.046 0.015
75% 0.028 0.034 0.033 0.025 0.030 0.030 0.033 0.038 0.035 0.040 ... 0.031 0.025 0.037 0.032 0.037 0.032 0.032 0.031 0.024 0.030
max 0.086 0.097 0.100 0.119 0.064 0.065 0.066 0.065 0.139 0.067 ... 0.088 0.075 0.115 0.133 0.064 0.128 0.169 0.088 0.101 0.069

8 rows × 52 columns

Regressions¶

In this section, we performed different individual regressions for the funds. Before and after fees. We performed:

  • CAPM
  • Fama-French Three-factor regression
  • Carhart four-factor regression
In [ ]:
def signif(x):
    if x < 0.01:
        return '***'
    elif (x > 0.01) and (x < 0.05):
        return '**'
    elif (x > 0.05) and (x < 0.10):
        return '*'
    else:
        return ''
In [ ]:
# This function takes a pre-set dataframe, factors, dataframe with returns and
# Perform a Regression with the factors on every fund in the return dataframe
# The results get stored in the pre-set dataframe
# We also Added the option to print and to use robust std

def factor(dataframe1, factors, returns, prints=False, h=False, test_kit=False, show_sign=False,level=level):
    dataframe = dataframe1.copy(deep=True)
    
    
    if test_kit:
        fund_test = pd.DataFrame()
        fund_test.index = returns.columns
        fund_test['White'] = np.NaN
        fund_test['BG'] = np.NaN
        fund_test['JB'] = np.NaN

    
    
    for i in returns.columns:
        FF_FUND = F[factors].copy(deep=True)
        FF_FUND['RF'] = F['RF'].copy(deep=True)
        FF_FUND[i] = returns[i] # returns
        FF_FUND = FF_FUND.dropna() # Removing all
        X = FF_FUND[factors]
        Y = FF_FUND[i]-FF_FUND['RF']
        if len(X) < 3: # Build in to have at least 3 returns in set (used for yearly reg, since else we cannot use OLS)
            continue
        X_sm = sm.add_constant(X)
        model = sm.OLS(Y,X_sm)
        if h:
            results_reg = model.fit(cov_type='HAC', cov_kwds={'maxlags': 1})
        else:
            results_reg = model.fit()
        if prints:
            print(results_reg.summary())
            
        if test_kit:
            fund_test.loc[i] = tester(results_reg,save=True,reg_mode=True)

        # Checking if Alpha is significant
        if show_sign == True:
            dataframe.at[i,'Alpha'] = str(round(results_reg.params[0],4)) + signif(results_reg.pvalues[0])
            for ind,facto in enumerate(factors):
                dataframe.at[i,facto] = str(round(results_reg.params[ind+1],4)) + signif(results_reg.pvalues[ind+1])
            dataframe.at[i,'ADJ_R_SQ'] = results_reg.rsquared_adj
            continue


        if results_reg.pvalues[0] > level:
            dataframe.loc[i]['Alpha'] = 0
        else:
            dataframe.loc[i]['Alpha'] = results_reg.params[0]
        for ind,facto in enumerate(factors):
            dataframe.loc[i][facto] = results_reg.params[ind+1]
        dataframe.loc[i]['ADJ_R_SQ'] = results_reg.rsquared_adj
    if test_kit:
        return fund_test
    return dataframe.dropna()

CAPM Regression¶

In [ ]:
res_CAPM = factor(res_CAPM_,CAPM,ret,h=True)
res_CAPM_GROSS = factor(res_CAPM_,CAPM,GROSS,h=True)
In [ ]:
res_CAPM_level = factor(res_CAPM_,CAPM,ret,h=True,level=0.1)
res_CAPM_GROSS_level = factor(res_CAPM_,CAPM,GROSS,h=True,level=0.1)
In [ ]:
print(f'''There are {len(res_CAPM)} individual funds, from these {len(res_CAPM[res_CAPM['Alpha'] > 0])} generated positive alpha if we looking
at after fee numbers
Before fee there are {len(res_CAPM_GROSS[res_CAPM_GROSS['Alpha'] > 0])} funds


There are {len(res_CAPM)} individual funds, from these {len(res_CAPM[res_CAPM['Alpha'] < 0])} generated negative alpha if we looking
at after fee numbers
Before fee there are {len(res_CAPM_GROSS[res_CAPM_GROSS['Alpha'] < 0])} funds


''')

print(f'''
10% Significance

There are {len(res_CAPM_level)} individual funds, from these {len(res_CAPM_level[res_CAPM_level['Alpha'] > 0])} generated positive alpha if we looking
at after fee numbers
Before fee there are {len(res_CAPM_GROSS_level[res_CAPM_GROSS_level['Alpha'] > 0])} funds


There are {len(res_CAPM_level)} individual funds, from these {len(res_CAPM_level[res_CAPM_level['Alpha'] < 0])} generated negative alpha if we looking
at after fee numbers
Before fee there are {len(res_CAPM_GROSS_level[res_CAPM_GROSS_level['Alpha'] < 0])} funds


''')
There are 52 individual funds, from these 10 generated positive alpha if we looking
at after fee numbers
Before fee there are 21 funds


There are 52 individual funds, from these 42 generated negative alpha if we looking
at after fee numbers
Before fee there are 31 funds




10% Significance

There are 52 individual funds, from these 0 generated positive alpha if we looking
at after fee numbers
Before fee there are 1 funds


There are 52 individual funds, from these 13 generated negative alpha if we looking
at after fee numbers
Before fee there are 4 funds



In [ ]:
res_CAPM_GROSS_level[res_CAPM_GROSS_level['Alpha'] > 0]
Out[ ]:
Alpha Mkt-RF ADJ_R_SQ
NORDEA STABILE AKSJER GLOBAL ETISK 0.002 0.767 0.817
In [ ]:
res_CAPM_GROSS.sort_values('Alpha', ascending=False)
Out[ ]:
Alpha Mkt-RF ADJ_R_SQ
FIRST GLOBAL FOCUS 0.003 1.490 0.685
NORDEA STABILE AKSJER GLOBAL ETISK 0.002 0.767 0.817
C WORLD WIDE GLOBALE AKSJER ETISK 0.002 0.848 0.807
SPARE BANK 1 VERDEN VERDI C 0.002 0.935 0.807
C WORLD WIDE GLOBALE AKSJER 0.001 0.878 0.822
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.001 1.064 0.963
STOREBRAND GLOBAL ESG 0.001 0.979 0.983
DNB GLOBAL LAVKARBON A 0.001 0.911 0.915
STOREBRAND GLOBAL SOLUTIONS A 0.001 1.004 0.864
DNB NOR KAPFORV.GLOBAL SELEKTIV I 0.001 1.056 0.966
STOREBRAND GLOBAL MULTIFACTOR A 0.001 0.988 0.914
ODIN GLOBAL C 0.001 1.051 0.858
DNB NOR KAPFORV. POSTBANKEN GLOBAL 0.001 1.059 0.966
DNB GLOBAL A 0.000 1.045 0.941
CARNEGIE WORLD WIDE ETISK II 0.000 0.845 0.596
HOLBERG GLOBAL A 0.000 1.019 0.884
TERRA GLOBAL DEAD - Merged:88738D 0.000 0.965 0.905
SKAGEN GLOBAL II NOK 0.000 0.995 0.855
DELPHI GLOBAL A 0.000 1.022 0.819
DNB NOR KAPFORV.GLOBAL ETISK IV 0.000 1.086 0.960
PARETO GLOBAL A 0.000 1.077 0.895
DNB NOR KAPFORV.GLOBAL II -0.000 1.041 0.953
C WORLD WIDE STABILE AKSJER -0.000 0.833 0.760
SR-UTBYTTE A -0.000 1.136 0.783
ALFRED BERG GLOBAL -0.000 0.824 0.860
KLP AKSJE GLOBAL FLERFAK P -0.000 0.774 0.886
DNB NOR KAPFORV. GLOBALSPAR -0.000 1.041 0.972
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.001 1.042 0.918
PLUSS UTLAND AKSJE -0.001 1.054 0.935
DNB NOR KAPFORV.GLOBAL ETISK V -0.001 1.090 0.930
SKAGEN GLOBAL A NOK -0.001 1.024 0.855
STOREBRAND GLOBAL VALUE A -0.001 1.075 0.852
NORDEA INTERNASJONALE AKSJER -0.001 1.037 0.881
NORDEA GLOBAL NOK -0.001 1.053 0.915
NORDEA INTERNASJONALE AKSJER III -0.001 1.057 0.882
ODIN GLOBAL II DEAD - Merged:74930E -0.001 1.222 0.699
NORDEA INTERNASJONALE AKSJER II -0.001 1.055 0.884
EIKA GLOBAL -0.002 1.020 0.926
FRAM GLOBAL -0.002 0.950 0.635
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.003 1.006 0.810
EIKA SPAR -0.003 1.189 0.869
SKAGEN VEKST A NOK -0.003 1.085 0.819
STOREBRAND INT INV.FUND BARNESPAR -0.003 1.108 0.848
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.004 1.138 0.851
NORDEA STABILE AKSJER GLOBAL -0.004 1.242 0.814
NORDEA GLOBAL II DEAD - Merged:88750W -0.004 1.459 0.920
STOREBRAND SMART CITIES A -0.004 1.099 0.921
DELPHI GREEN TRENDS A -0.009 1.162 0.586
ODIN FORVALTNING AS MARITIM NOK -0.011 1.197 0.519
SKAGEN INSIGHT DEAD - Liquidated -0.014 1.303 0.823
STOREBRAND EQUAL OPPORTUNITIES A -0.017 1.006 0.906
DNB NAVIGATOR A DEAD - Liquidated -0.020 1.601 0.575
In [ ]:
pd.concat([res_CAPM.describe(), res_CAPM_GROSS.describe()], axis=1)
Out[ ]:
Alpha Mkt-RF ADJ_R_SQ Alpha Mkt-RF ADJ_R_SQ
count 52.000 52.000 52.000 52.000 52.000 52.000
mean -0.003 1.058 0.846 -0.002 1.058 0.846
std 0.005 0.160 0.109 0.005 0.160 0.109
min -0.021 0.767 0.519 -0.020 0.767 0.519
25% -0.003 0.993 0.816 -0.002 0.993 0.816
50% -0.001 1.048 0.866 -0.000 1.048 0.866
75% -0.001 1.092 0.918 0.000 1.092 0.918
max 0.002 1.601 0.983 0.003 1.601 0.983
In [ ]:
res_CAPM.sort_values('Alpha', ascending=False)
Out[ ]:
Alpha Mkt-RF ADJ_R_SQ
FIRST GLOBAL FOCUS 0.002 1.490 0.685
NORDEA STABILE AKSJER GLOBAL ETISK 0.001 0.767 0.817
C WORLD WIDE GLOBALE AKSJER ETISK 0.001 0.849 0.807
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.001 1.064 0.963
STOREBRAND GLOBAL ESG 0.001 0.979 0.983
SPARE BANK 1 VERDEN VERDI C 0.000 0.935 0.807
C WORLD WIDE GLOBALE AKSJER 0.000 0.878 0.822
DNB GLOBAL LAVKARBON A 0.000 0.911 0.915
STOREBRAND GLOBAL SOLUTIONS A 0.000 1.004 0.864
STOREBRAND GLOBAL MULTIFACTOR A 0.000 0.988 0.914
SKAGEN GLOBAL II NOK -0.000 0.995 0.855
DNB NOR KAPFORV.GLOBAL ETISK IV -0.000 1.086 0.960
KLP AKSJE GLOBAL FLERFAK P -0.001 0.774 0.886
TERRA GLOBAL DEAD - Merged:88738D -0.001 0.966 0.906
HOLBERG GLOBAL A -0.001 1.020 0.884
DNB GLOBAL A -0.001 1.045 0.940
DNB NOR KAPFORV.GLOBAL SELEKTIV I -0.001 1.056 0.966
ODIN GLOBAL C -0.001 1.051 0.858
DNB NOR KAPFORV. POSTBANKEN GLOBAL -0.001 1.059 0.966
PARETO GLOBAL A -0.001 1.076 0.893
DNB NOR KAPFORV.GLOBAL ETISK V -0.001 1.090 0.930
CARNEGIE WORLD WIDE ETISK II -0.001 0.845 0.596
DNB NOR KAPFORV.GLOBAL II -0.001 1.041 0.953
NORDEA GLOBAL NOK -0.001 1.053 0.915
C WORLD WIDE STABILE AKSJER -0.001 0.833 0.760
ALFRED BERG GLOBAL -0.001 0.824 0.860
DELPHI GLOBAL A -0.001 1.021 0.819
SR-UTBYTTE A -0.001 1.136 0.783
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.002 1.042 0.918
PLUSS UTLAND AKSJE -0.002 1.054 0.935
STOREBRAND GLOBAL VALUE A -0.002 1.075 0.852
NORDEA INTERNASJONALE AKSJER III -0.002 1.056 0.882
DNB NOR KAPFORV. GLOBALSPAR -0.002 1.041 0.972
SKAGEN GLOBAL A NOK -0.002 1.026 0.855
ODIN GLOBAL II DEAD - Merged:74930E -0.002 1.222 0.699
NORDEA INTERNASJONALE AKSJER -0.002 1.037 0.881
NORDEA INTERNASJONALE AKSJER II -0.002 1.055 0.884
EIKA GLOBAL -0.003 1.021 0.926
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.003 1.006 0.810
SKAGEN VEKST A NOK -0.004 1.085 0.819
FRAM GLOBAL -0.004 0.950 0.635
NORDEA STABILE AKSJER GLOBAL -0.004 1.242 0.814
EIKA SPAR -0.004 1.189 0.869
STOREBRAND INT INV.FUND BARNESPAR -0.004 1.108 0.848
NORDEA GLOBAL II DEAD - Merged:88750W -0.005 1.459 0.920
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.005 1.138 0.851
STOREBRAND SMART CITIES A -0.005 1.099 0.921
DELPHI GREEN TRENDS A -0.010 1.162 0.586
ODIN FORVALTNING AS MARITIM NOK -0.013 1.197 0.519
SKAGEN INSIGHT DEAD - Liquidated -0.015 1.303 0.823
STOREBRAND EQUAL OPPORTUNITIES A -0.018 1.006 0.906
DNB NAVIGATOR A DEAD - Liquidated -0.021 1.601 0.575

Fama-French 3 Regression¶

In [ ]:
res_FF3 = factor(res_FF3_,FAMA3,ret,h=True)
res_FF3_GROSS = factor(res_FF3_,FAMA3,GROSS,h=True)
res_FF3_level = factor(res_FF3_,FAMA3,ret,h=True,level=0.1)
res_FF3_GROSS_level = factor(res_FF3_,FAMA3,GROSS,h=True,level=0.1)
In [ ]:
print(f'''There are {len(res_FF3)} individual funds, from these {len(res_FF3[res_FF3['Alpha'] > 0])} generated alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF3_GROSS[res_FF3_GROSS['Alpha'] > 0])} funds''')


print(f'''There are {len(res_FF3)} individual funds, from these {len(res_FF3[res_FF3['Alpha'] < 0])} negative alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF3_GROSS[res_FF3_GROSS['Alpha'] < 0])} funds''')


print(f'''

10% significance

There are {len(res_FF3_level)} individual funds, from these {len(res_FF3_level[res_FF3_level['Alpha'] > 0])} generated alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF3_GROSS_level[res_FF3_GROSS_level['Alpha'] > 0])} funds''')


print(f'''There are {len(res_FF3_level)} individual funds, from these {len(res_FF3_level[res_FF3_level['Alpha'] < 0])} negative alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF3_GROSS_level[res_FF3_GROSS_level['Alpha'] < 0])} funds''')
There are 52 individual funds, from these 9 generated alpha if we looking 
at after fee numbers
Before fee there are 24 funds
There are 52 individual funds, from these 43 negative alpha if we looking 
at after fee numbers
Before fee there are 28 funds


10% significance

There are 52 individual funds, from these 0 generated alpha if we looking 
at after fee numbers
Before fee there are 0 funds
There are 52 individual funds, from these 14 negative alpha if we looking 
at after fee numbers
Before fee there are 7 funds
In [ ]:
res_FF3_GROSS_level[res_FF3_GROSS_level['Alpha'] > 0]
Out[ ]:
Alpha Mkt-RF SMB HML ADJ_R_SQ
In [ ]:
res_FF3_GROSS.sort_values('Alpha',ascending=False) # Overview over Regression output
Out[ ]:
Alpha Mkt-RF SMB HML ADJ_R_SQ
DELPHI GREEN TRENDS A 0.008 1.024 0.635 -0.725 0.764
FIRST GLOBAL FOCUS 0.007 1.464 0.998 0.762 0.781
NORDEA STABILE AKSJER GLOBAL ETISK 0.002 0.780 -0.239 0.167 0.843
STOREBRAND SMART CITIES A 0.002 1.061 0.262 -0.186 0.932
C WORLD WIDE GLOBALE AKSJER ETISK 0.001 0.850 -0.189 -0.329 0.862
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.001 1.066 0.013 -0.019 0.958
STOREBRAND GLOBAL MULTIFACTOR A 0.001 0.982 0.237 0.235 0.940
ODIN GLOBAL II DEAD - Merged:74930E 0.001 1.187 -0.203 0.638 0.722
C WORLD WIDE GLOBALE AKSJER 0.001 0.882 -0.216 -0.329 0.873
STOREBRAND GLOBAL SOLUTIONS A 0.001 0.994 0.118 -0.130 0.870
SR-UTBYTTE A 0.001 1.144 0.175 0.451 0.838
SPARE BANK 1 VERDEN VERDI C 0.001 0.950 0.042 0.347 0.859
ODIN GLOBAL C 0.001 1.045 0.030 -0.261 0.879
DNB NOR KAPFORV.GLOBAL SELEKTIV I 0.001 1.056 -0.094 0.015 0.963
DNB NOR KAPFORV. POSTBANKEN GLOBAL 0.000 1.059 -0.090 0.009 0.963
DELPHI GLOBAL A 0.000 1.014 0.087 -0.210 0.832
DNB GLOBAL LAVKARBON A 0.000 0.917 -0.124 -0.046 0.915
HOLBERG GLOBAL A 0.000 1.017 -0.015 -0.174 0.894
DNB GLOBAL A 0.000 1.054 -0.134 0.180 0.955
TERRA GLOBAL DEAD - Merged:88738D 0.000 0.964 -0.074 0.019 0.896
DNB NOR KAPFORV.GLOBAL II 0.000 1.020 -0.073 0.202 0.959
STOREBRAND GLOBAL ESG 0.000 0.988 -0.208 -0.071 0.988
CARNEGIE WORLD WIDE ETISK II 0.000 0.839 -0.212 0.095 0.573
DNB NOR KAPFORV.GLOBAL ETISK IV 0.000 1.072 -0.188 0.048 0.960
C WORLD WIDE STABILE AKSJER -0.000 0.839 -0.163 -0.028 0.760
STOREBRAND GLOBAL VALUE A -0.000 1.075 0.221 0.514 0.937
DNB NOR KAPFORV. GLOBALSPAR -0.000 1.037 0.005 0.036 0.969
ALFRED BERG GLOBAL -0.000 0.826 -0.118 -0.171 0.875
SKAGEN GLOBAL II NOK -0.001 1.008 -0.442 -0.247 0.893
DNB NOR KAPFORV.GLOBAL ETISK V -0.001 1.077 0.037 0.230 0.941
KLP AKSJE GLOBAL FLERFAK P -0.001 0.790 -0.278 0.056 0.900
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.001 1.048 -0.178 -0.095 0.923
NORDEA INTERNASJONALE AKSJER -0.001 1.029 -0.071 0.104 0.880
FRAM GLOBAL -0.001 0.932 0.552 0.323 0.684
PLUSS UTLAND AKSJE -0.001 1.062 -0.214 -0.042 0.940
PARETO GLOBAL A -0.001 1.104 0.054 0.217 0.909
NORDEA INTERNASJONALE AKSJER III -0.001 1.049 -0.086 0.120 0.883
NORDEA GLOBAL NOK -0.001 1.057 -0.119 -0.057 0.916
NORDEA INTERNASJONALE AKSJER II -0.001 1.047 -0.076 0.124 0.885
EIKA GLOBAL -0.002 1.025 -0.020 0.205 0.941
SKAGEN GLOBAL A NOK -0.002 1.038 -0.392 -0.176 0.877
SKAGEN VEKST A NOK -0.002 1.083 0.206 0.353 0.856
EIKA SPAR -0.002 1.189 0.142 0.324 0.895
STOREBRAND INT INV.FUND BARNESPAR -0.003 1.065 -0.070 0.547 0.879
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.003 1.094 -0.049 0.578 0.883
NORDEA GLOBAL II DEAD - Merged:88750W -0.003 1.442 0.026 0.090 0.913
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.004 0.980 -0.279 0.410 0.819
NORDEA STABILE AKSJER GLOBAL -0.004 1.257 -0.204 0.359 0.846
SKAGEN INSIGHT DEAD - Liquidated -0.006 1.309 0.378 0.682 0.880
ODIN FORVALTNING AS MARITIM NOK -0.010 1.240 1.199 0.682 0.641
STOREBRAND EQUAL OPPORTUNITIES A -0.011 0.933 -0.166 -0.316 0.925
DNB NAVIGATOR A DEAD - Liquidated -0.013 1.493 0.744 1.078 0.664
In [ ]:
res_FF3_GROSS.sort_values('Alpha', ascending=False)
Out[ ]:
Alpha Mkt-RF SMB HML ADJ_R_SQ
DELPHI GREEN TRENDS A 0.008 1.024 0.635 -0.725 0.764
FIRST GLOBAL FOCUS 0.007 1.464 0.998 0.762 0.781
NORDEA STABILE AKSJER GLOBAL ETISK 0.002 0.780 -0.239 0.167 0.843
STOREBRAND SMART CITIES A 0.002 1.061 0.262 -0.186 0.932
C WORLD WIDE GLOBALE AKSJER ETISK 0.001 0.850 -0.189 -0.329 0.862
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.001 1.066 0.013 -0.019 0.958
STOREBRAND GLOBAL MULTIFACTOR A 0.001 0.982 0.237 0.235 0.940
ODIN GLOBAL II DEAD - Merged:74930E 0.001 1.187 -0.203 0.638 0.722
C WORLD WIDE GLOBALE AKSJER 0.001 0.882 -0.216 -0.329 0.873
STOREBRAND GLOBAL SOLUTIONS A 0.001 0.994 0.118 -0.130 0.870
SR-UTBYTTE A 0.001 1.144 0.175 0.451 0.838
SPARE BANK 1 VERDEN VERDI C 0.001 0.950 0.042 0.347 0.859
ODIN GLOBAL C 0.001 1.045 0.030 -0.261 0.879
DNB NOR KAPFORV.GLOBAL SELEKTIV I 0.001 1.056 -0.094 0.015 0.963
DNB NOR KAPFORV. POSTBANKEN GLOBAL 0.000 1.059 -0.090 0.009 0.963
DELPHI GLOBAL A 0.000 1.014 0.087 -0.210 0.832
DNB GLOBAL LAVKARBON A 0.000 0.917 -0.124 -0.046 0.915
HOLBERG GLOBAL A 0.000 1.017 -0.015 -0.174 0.894
DNB GLOBAL A 0.000 1.054 -0.134 0.180 0.955
TERRA GLOBAL DEAD - Merged:88738D 0.000 0.964 -0.074 0.019 0.896
DNB NOR KAPFORV.GLOBAL II 0.000 1.020 -0.073 0.202 0.959
STOREBRAND GLOBAL ESG 0.000 0.988 -0.208 -0.071 0.988
CARNEGIE WORLD WIDE ETISK II 0.000 0.839 -0.212 0.095 0.573
DNB NOR KAPFORV.GLOBAL ETISK IV 0.000 1.072 -0.188 0.048 0.960
C WORLD WIDE STABILE AKSJER -0.000 0.839 -0.163 -0.028 0.760
STOREBRAND GLOBAL VALUE A -0.000 1.075 0.221 0.514 0.937
DNB NOR KAPFORV. GLOBALSPAR -0.000 1.037 0.005 0.036 0.969
ALFRED BERG GLOBAL -0.000 0.826 -0.118 -0.171 0.875
SKAGEN GLOBAL II NOK -0.001 1.008 -0.442 -0.247 0.893
DNB NOR KAPFORV.GLOBAL ETISK V -0.001 1.077 0.037 0.230 0.941
KLP AKSJE GLOBAL FLERFAK P -0.001 0.790 -0.278 0.056 0.900
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.001 1.048 -0.178 -0.095 0.923
NORDEA INTERNASJONALE AKSJER -0.001 1.029 -0.071 0.104 0.880
FRAM GLOBAL -0.001 0.932 0.552 0.323 0.684
PLUSS UTLAND AKSJE -0.001 1.062 -0.214 -0.042 0.940
PARETO GLOBAL A -0.001 1.104 0.054 0.217 0.909
NORDEA INTERNASJONALE AKSJER III -0.001 1.049 -0.086 0.120 0.883
NORDEA GLOBAL NOK -0.001 1.057 -0.119 -0.057 0.916
NORDEA INTERNASJONALE AKSJER II -0.001 1.047 -0.076 0.124 0.885
EIKA GLOBAL -0.002 1.025 -0.020 0.205 0.941
SKAGEN GLOBAL A NOK -0.002 1.038 -0.392 -0.176 0.877
SKAGEN VEKST A NOK -0.002 1.083 0.206 0.353 0.856
EIKA SPAR -0.002 1.189 0.142 0.324 0.895
STOREBRAND INT INV.FUND BARNESPAR -0.003 1.065 -0.070 0.547 0.879
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.003 1.094 -0.049 0.578 0.883
NORDEA GLOBAL II DEAD - Merged:88750W -0.003 1.442 0.026 0.090 0.913
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.004 0.980 -0.279 0.410 0.819
NORDEA STABILE AKSJER GLOBAL -0.004 1.257 -0.204 0.359 0.846
SKAGEN INSIGHT DEAD - Liquidated -0.006 1.309 0.378 0.682 0.880
ODIN FORVALTNING AS MARITIM NOK -0.010 1.240 1.199 0.682 0.641
STOREBRAND EQUAL OPPORTUNITIES A -0.011 0.933 -0.166 -0.316 0.925
DNB NAVIGATOR A DEAD - Liquidated -0.013 1.493 0.744 1.078 0.664
In [ ]:
pd.concat([res_FF3.describe(), res_FF3_GROSS.describe()], axis=1)
Out[ ]:
Alpha Mkt-RF SMB HML ADJ_R_SQ Alpha Mkt-RF SMB HML ADJ_R_SQ
count 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000
mean -0.002 1.049 0.023 0.127 0.872 -0.001 1.049 0.023 0.127 0.872
std 0.003 0.151 0.319 0.333 0.088 0.003 0.151 0.319 0.333 0.088
min -0.015 0.780 -0.441 -0.725 0.573 -0.013 0.780 -0.442 -0.725 0.573
25% -0.003 0.982 -0.180 -0.077 0.853 -0.001 0.982 -0.180 -0.077 0.854
50% -0.001 1.046 -0.071 0.092 0.884 -0.000 1.046 -0.072 0.092 0.884
75% -0.001 1.075 0.093 0.330 0.933 0.001 1.076 0.094 0.330 0.933
max 0.006 1.493 1.199 1.077 0.988 0.008 1.493 1.199 1.078 0.988

Fama-French Carhart Regression¶

In [ ]:
res_FFC = factor(res_FFC_,FAMAC,ret,h=True)
res_FFC_GROSS = factor(res_FFC_,FAMAC,GROSS,h=True)
res_FFC_level = factor(res_FFC_,FAMAC,ret,h=True,level=0.1)
res_FFC_GROSS_level = factor(res_FFC_,FAMAC,GROSS,h=True,level=0.1)
In [ ]:
print(f'''There are {len(res_FFC)} individual funds, from these {len(res_FFC[res_FFC['Alpha'] > 0])} generated alpha if we looking
at after fee numbers
Before fee there are {len(res_FFC_GROSS[res_FFC_GROSS['Alpha'] > 0])} funds''')

print(f'''There are {len(res_FFC)} individual funds, from these {len(res_FFC[res_FFC['Alpha'] < 0])} negative alpha if we looking 
at after fee numbers
Before fee there are {len(res_FFC_GROSS[res_FFC_GROSS['Alpha'] < 0])} funds''')
      

print(f'''

10% significance

There are {len(res_FFC_level)} individual funds, from these {len(res_FFC_level[res_FFC_level['Alpha'] > 0])} generated alpha if we looking 
at after fee numbers
Before fee there are {len(res_FFC_GROSS_level[res_FFC_GROSS_level['Alpha'] > 0])} funds''')


print(f'''There are {len(res_FFC_level)} individual funds, from these {len(res_FFC_level[res_FFC_level['Alpha'] < 0])} negative alpha if we looking 
at after fee numbers
Before fee there are {len(res_FFC_GROSS_level[res_FFC_GROSS_level['Alpha'] < 0])} funds''')
There are 52 individual funds, from these 6 generated alpha if we looking
at after fee numbers
Before fee there are 20 funds
There are 52 individual funds, from these 46 negative alpha if we looking 
at after fee numbers
Before fee there are 32 funds


10% significance

There are 52 individual funds, from these 1 generated alpha if we looking 
at after fee numbers
Before fee there are 1 funds
There are 52 individual funds, from these 12 negative alpha if we looking 
at after fee numbers
Before fee there are 6 funds
In [ ]:
res_FFC_GROSS_level[res_FFC_GROSS_level['Alpha'] > 0]
Out[ ]:
Alpha Mkt-RF SMB HML MOM ADJ_R_SQ
FIRST GLOBAL FOCUS 0.010 1.358 0.989 0.589 -0.402 0.789
In [ ]:
pd.concat([res_FFC.describe(), res_FFC_GROSS.describe()], axis=1)
Out[ ]:
Alpha Mkt-RF SMB HML MOM ADJ_R_SQ Alpha Mkt-RF SMB HML MOM ADJ_R_SQ
count 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000 52.000
mean -0.002 1.053 0.020 0.136 0.025 0.873 -0.001 1.053 0.020 0.136 0.025 0.873
std 0.004 0.151 0.324 0.327 0.146 0.088 0.004 0.151 0.324 0.327 0.146 0.088
min -0.015 0.755 -0.444 -0.663 -0.402 0.582 -0.013 0.755 -0.445 -0.663 -0.402 0.582
25% -0.003 0.987 -0.192 -0.047 -0.069 0.853 -0.001 0.987 -0.192 -0.047 -0.069 0.853
50% -0.001 1.033 -0.066 0.066 0.005 0.890 -0.000 1.033 -0.071 0.066 0.005 0.889
75% -0.000 1.064 0.094 0.351 0.116 0.932 0.001 1.064 0.095 0.351 0.115 0.932
max 0.009 1.549 1.227 1.135 0.435 0.988 0.010 1.549 1.227 1.137 0.435 0.988
In [ ]:
res_FFC.sort_values('Alpha', ascending=False)
Out[ ]:
Alpha Mkt-RF SMB HML MOM ADJ_R_SQ
FIRST GLOBAL FOCUS 0.009 1.358 0.989 0.589 -0.402 0.789
DELPHI GREEN TRENDS A 0.004 1.077 0.624 -0.663 0.223 0.758
STOREBRAND SMART CITIES A 0.003 1.025 0.325 -0.199 -0.199 0.930
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.001 1.059 0.000 -0.040 -0.026 0.956
STOREBRAND GLOBAL SOLUTIONS A 0.000 0.984 0.118 -0.149 -0.040 0.869
DNB NOR KAPFORV.GLOBAL ETISK IV 0.000 1.063 -0.201 -0.004 -0.051 0.959
STOREBRAND GLOBAL MULTIFACTOR A -0.000 1.005 0.238 0.278 0.086 0.942
NORDEA STABILE AKSJER GLOBAL ETISK -0.000 0.807 -0.239 0.218 0.104 0.846
ODIN GLOBAL II DEAD - Merged:74930E -0.000 1.218 -0.219 0.766 0.114 0.713
ODIN GLOBAL C -0.000 1.021 0.028 -0.306 -0.091 0.880
DNB NOR KAPFORV.GLOBAL ETISK V -0.000 1.061 0.034 0.163 -0.084 0.942
C WORLD WIDE GLOBALE AKSJER ETISK -0.000 0.880 -0.189 -0.270 0.123 0.866
DNB NOR KAPFORV. GLOBALSPAR -0.000 1.019 -0.007 -0.038 -0.081 0.970
STOREBRAND GLOBAL ESG -0.001 0.996 -0.207 -0.057 0.031 0.988
STOREBRAND GLOBAL VALUE A -0.001 1.053 0.220 0.472 -0.082 0.937
HOLBERG GLOBAL A -0.001 1.013 -0.013 -0.182 -0.015 0.893
DNB GLOBAL A -0.001 1.043 -0.134 0.160 -0.042 0.955
DNB NOR KAPFORV.GLOBAL SELEKTIV I -0.001 1.053 -0.095 0.004 -0.013 0.961
SKAGEN GLOBAL II NOK -0.001 0.993 -0.444 -0.273 -0.055 0.892
DNB NOR KAPFORV. POSTBANKEN GLOBAL -0.001 1.056 -0.091 -0.003 -0.013 0.961
DNB NOR KAPFORV.GLOBAL II -0.001 1.017 -0.071 0.185 -0.020 0.958
C WORLD WIDE GLOBALE AKSJER -0.001 0.909 -0.215 -0.277 0.105 0.875
NORDEA INTERNASJONALE AKSJER III -0.001 1.034 -0.087 0.064 -0.068 0.883
TERRA GLOBAL DEAD - Merged:88738D -0.001 0.971 -0.060 0.047 0.029 0.892
KLP AKSJE GLOBAL FLERFAK P -0.001 0.810 -0.275 0.091 0.070 0.901
PARETO GLOBAL A -0.001 1.082 0.058 0.185 -0.084 0.907
NORDEA INTERNASJONALE AKSJER -0.002 1.013 -0.074 0.045 -0.074 0.881
SR-UTBYTTE A -0.002 1.192 0.175 0.540 0.178 0.841
NORDEA INTERNASJONALE AKSJER II -0.002 1.032 -0.077 0.065 -0.071 0.885
DNB GLOBAL LAVKARBON A -0.002 0.984 -0.116 0.067 0.260 0.931
NORDEA GLOBAL NOK -0.002 1.067 -0.119 -0.037 0.039 0.915
SPARE BANK 1 VERDEN VERDI C -0.002 0.987 0.054 0.403 0.148 0.859
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.002 1.052 -0.178 -0.088 0.014 0.922
PLUSS UTLAND AKSJE -0.002 1.061 -0.214 -0.044 -0.003 0.939
SKAGEN GLOBAL A NOK -0.002 1.017 -0.390 -0.224 -0.086 0.878
DELPHI GLOBAL A -0.002 1.045 0.086 -0.149 0.119 0.834
STOREBRAND INT INV.FUND BARNESPAR -0.002 1.032 -0.055 0.404 -0.170 0.882
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.002 1.058 -0.033 0.422 -0.186 0.888
C WORLD WIDE STABILE AKSJER -0.003 0.882 -0.161 0.054 0.166 0.767
FRAM GLOBAL -0.003 0.941 0.552 0.340 0.034 0.681
SKAGEN VEKST A NOK -0.003 1.081 0.204 0.350 -0.007 0.855
CARNEGIE WORLD WIDE ETISK II -0.003 0.755 -0.298 0.321 0.335 0.582
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.003 0.965 -0.284 0.352 -0.062 0.808
EIKA GLOBAL -0.003 1.034 -0.014 0.224 0.036 0.942
ALFRED BERG GLOBAL -0.004 0.900 -0.117 -0.031 0.283 0.902
NORDEA GLOBAL II DEAD - Merged:88750W -0.004 1.549 -0.053 0.351 0.435 0.925
EIKA SPAR -0.004 1.206 0.142 0.357 0.067 0.895
NORDEA STABILE AKSJER GLOBAL -0.006 1.297 -0.203 0.436 0.153 0.848
SKAGEN INSIGHT DEAD - Liquidated -0.007 1.346 0.384 0.802 0.129 0.875
ODIN FORVALTNING AS MARITIM NOK -0.009 1.203 1.227 0.519 -0.198 0.638
STOREBRAND EQUAL OPPORTUNITIES A -0.014 0.962 -0.217 -0.305 0.163 0.920
DNB NAVIGATOR A DEAD - Liquidated -0.015 1.509 0.740 1.135 0.085 0.661

Equally-weighted Regressions¶

In this section, we performed the equally weighted regressions with the different regression models using net and gross of fees.

In [ ]:
# A function that uses the returns for each months then take the average of these and save in a dataframe
# Then uses the factors and perfrom a Regression on the average excess returns
# Also added the option to only chose one year at time, printing the results, and the use of robust std

def EW(factors,YEAR=False,Show=True, returns=ret, h=False):
    
    ret_1 = returns.replace(0,np.NaN)
    FF_EW = F.copy(deep=True)
    FF_EW['EW'] = ret_1.mean(axis=1)
    CLEAN = FF_EW[factors].copy(deep=True)
    CLEAN['EW-RF'] = FF_EW['EW']-FF_EW['RF']
    CLEAN = CLEAN.dropna()
    if YEAR == False:
        X = CLEAN[factors]
        Y = CLEAN['EW-RF']
    else:    
        X = CLEAN[factors].loc[YEAR]
        Y = CLEAN['EW-RF'].loc[YEAR]
    X_sm = sm.add_constant(X)
    model = sm.OLS(Y,X_sm)
    if h:
        results_reg = model.fit(cov_type='HAC', cov_kwds={'maxlags': 1})
    else:
        results_reg = model.fit()
    if Show:
        print('Equaly weighted')
        print(results_reg.summary())
    return results_reg

Net returns¶

In [ ]:
EW(CAPM,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.971
Model:                            OLS   Adj. R-squared:                  0.971
Method:                 Least Squares   F-statistic:                     5649.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          2.24e-108
Time:                        15:39:56   Log-Likelihood:                 456.34
No. Observations:                 131   AIC:                            -908.7
Df Residuals:                     129   BIC:                            -902.9
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0022      0.001     -3.598      0.000      -0.003      -0.001
Mkt-RF         1.0351      0.014     75.158      0.000       1.008       1.062
==============================================================================
Omnibus:                        0.425   Durbin-Watson:                   2.279
Prob(Omnibus):                  0.809   Jarque-Bera (JB):                0.561
Skew:                           0.115   Prob(JB):                        0.755
Kurtosis:                       2.778   Cond. No.                         24.1
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc818924430>
In [ ]:
EW(FAMA3,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.973
Model:                            OLS   Adj. R-squared:                  0.973
Method:                 Least Squares   F-statistic:                     2417.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          8.46e-112
Time:                        15:39:56   Log-Likelihood:                 461.94
No. Observations:                 131   AIC:                            -915.9
Df Residuals:                     127   BIC:                            -904.4
Df Model:                           3                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0021      0.001     -3.625      0.000      -0.003      -0.001
Mkt-RF         1.0357      0.013     80.250      0.000       1.010       1.061
SMB            0.0169      0.045      0.374      0.708      -0.072       0.106
HML            0.0785      0.022      3.509      0.000       0.035       0.122
==============================================================================
Omnibus:                        0.429   Durbin-Watson:                   2.300
Prob(Omnibus):                  0.807   Jarque-Bera (JB):                0.403
Skew:                           0.132   Prob(JB):                        0.818
Kurtosis:                       2.934   Cond. No.                         69.2
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a4e37c0>
In [ ]:
EW(FAMAC,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.973
Model:                            OLS   Adj. R-squared:                  0.973
Method:                 Least Squares   F-statistic:                     1846.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          9.14e-111
Time:                        15:39:56   Log-Likelihood:                 462.35
No. Observations:                 131   AIC:                            -914.7
Df Residuals:                     126   BIC:                            -900.3
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0023      0.001     -4.019      0.000      -0.003      -0.001
Mkt-RF         1.0426      0.015     70.887      0.000       1.014       1.071
SMB            0.0172      0.045      0.381      0.703      -0.071       0.105
HML            0.0915      0.022      4.105      0.000       0.048       0.135
MOM            0.0263      0.032      0.833      0.405      -0.036       0.088
==============================================================================
Omnibus:                        0.238   Durbin-Watson:                   2.290
Prob(Omnibus):                  0.888   Jarque-Bera (JB):                0.291
Skew:                           0.099   Prob(JB):                        0.864
Kurtosis:                       2.882   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc7c8f33d00>

Gross returns¶

In [ ]:
EW(CAPM, returns=GROSS,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.971
Model:                            OLS   Adj. R-squared:                  0.971
Method:                 Least Squares   F-statistic:                     5646.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          2.32e-108
Time:                        15:39:56   Log-Likelihood:                 456.53
No. Observations:                 131   AIC:                            -909.1
Df Residuals:                     129   BIC:                            -903.3
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0012      0.001     -1.907      0.057      -0.002    3.19e-05
Mkt-RF         1.0351      0.014     75.137      0.000       1.008       1.062
==============================================================================
Omnibus:                        0.450   Durbin-Watson:                   2.284
Prob(Omnibus):                  0.799   Jarque-Bera (JB):                0.587
Skew:                           0.117   Prob(JB):                        0.746
Kurtosis:                       2.771   Cond. No.                         24.1
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc7c8f3b880>
In [ ]:
EW(FAMA3, returns=GROSS,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.973
Model:                            OLS   Adj. R-squared:                  0.973
Method:                 Least Squares   F-statistic:                     2422.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          7.46e-112
Time:                        15:39:56   Log-Likelihood:                 462.15
No. Observations:                 131   AIC:                            -916.3
Df Residuals:                     127   BIC:                            -904.8
Df Model:                           3                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0011      0.001     -1.882      0.060      -0.002    4.56e-05
Mkt-RF         1.0357      0.013     80.366      0.000       1.010       1.061
SMB            0.0166      0.045      0.369      0.712      -0.072       0.105
HML            0.0786      0.022      3.504      0.000       0.035       0.123
==============================================================================
Omnibus:                        0.433   Durbin-Watson:                   2.306
Prob(Omnibus):                  0.805   Jarque-Bera (JB):                0.405
Skew:                           0.132   Prob(JB):                        0.817
Kurtosis:                       2.935   Cond. No.                         69.2
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc7e8ed2310>
In [ ]:
EW(FAMAC, returns=GROSS,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.974
Model:                            OLS   Adj. R-squared:                  0.973
Method:                 Least Squares   F-statistic:                     1857.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          6.32e-111
Time:                        15:39:56   Log-Likelihood:                 462.58
No. Observations:                 131   AIC:                            -915.2
Df Residuals:                     126   BIC:                            -900.8
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0013      0.001     -2.249      0.025      -0.002      -0.000
Mkt-RF         1.0426      0.015     71.137      0.000       1.014       1.071
SMB            0.0168      0.045      0.375      0.707      -0.071       0.105
HML            0.0918      0.022      4.115      0.000       0.048       0.135
MOM            0.0266      0.032      0.843      0.399      -0.035       0.088
==============================================================================
Omnibus:                        0.243   Durbin-Watson:                   2.296
Prob(Omnibus):                  0.886   Jarque-Bera (JB):                0.294
Skew:                           0.101   Prob(JB):                        0.863
Kurtosis:                       2.884   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a4d30a0>

Time-series segmentation¶

We split our equally-weighted portfolio into 3 sub-samples over the time-horizon and conducted the Carhart four-factor regression on each sub-sample.

Equally-weighted¶

In [ ]:
EW(FAMAC, returns=ret.loc[str(start_year):str(start_year+3)])
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.961
Model:                            OLS   Adj. R-squared:                  0.957
Method:                 Least Squares   F-statistic:                     257.2
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           6.15e-29
Time:                        15:39:57   Log-Likelihood:                 167.23
No. Observations:                  47   AIC:                            -324.5
Df Residuals:                      42   BIC:                            -315.2
Df Model:                           4                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0025      0.001     -1.982      0.054      -0.005    4.67e-05
Mkt-RF         1.0234      0.036     28.162      0.000       0.950       1.097
SMB           -0.0187      0.079     -0.237      0.814      -0.177       0.140
HML            0.2011      0.091      2.221      0.032       0.018       0.384
MOM           -0.0463      0.060     -0.776      0.442      -0.167       0.074
==============================================================================
Omnibus:                        2.455   Durbin-Watson:                   2.399
Prob(Omnibus):                  0.293   Jarque-Bera (JB):                2.177
Skew:                           0.519   Prob(JB):                        0.337
Kurtosis:                       2.813   Cond. No.                         93.4
==============================================================================

Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a4ed340>
In [ ]:
# number of funds in the sample
sum(ret.loc[str(start_year):str(start_year+3)].sum() != 0)
Out[ ]:
43
In [ ]:
EW(FAMAC, returns=ret.loc[str(start_year+4):str(start_year+7)])
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.967
Model:                            OLS   Adj. R-squared:                  0.964
Method:                 Least Squares   F-statistic:                     318.8
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           2.39e-31
Time:                        15:39:57   Log-Likelihood:                 176.95
No. Observations:                  48   AIC:                            -343.9
Df Residuals:                      43   BIC:                            -334.5
Df Model:                           4                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0019      0.001     -1.944      0.058      -0.004    7.15e-05
Mkt-RF         1.0397      0.033     31.777      0.000       0.974       1.106
SMB            0.0056      0.083      0.068      0.946      -0.161       0.173
HML            0.1204      0.061      1.980      0.054      -0.002       0.243
MOM            0.0593      0.050      1.177      0.246      -0.042       0.161
==============================================================================
Omnibus:                        1.007   Durbin-Watson:                   2.371
Prob(Omnibus):                  0.604   Jarque-Bera (JB):                0.396
Skew:                           0.172   Prob(JB):                        0.820
Kurtosis:                       3.282   Cond. No.                         89.9
==============================================================================

Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc7e8d92d60>
In [ ]:
# number of funds in the sample
sum(ret.loc[str(start_year+4):str(start_year+7)].sum() != 0)
Out[ ]:
38
In [ ]:
EW(FAMAC, returns=ret.loc[str(start_year+8):str(start_year+10)])
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.986
Model:                            OLS   Adj. R-squared:                  0.984
Method:                 Least Squares   F-statistic:                     546.7
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           2.93e-28
Time:                        15:39:57   Log-Likelihood:                 126.01
No. Observations:                  36   AIC:                            -242.0
Df Residuals:                      31   BIC:                            -234.1
Df Model:                           4                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0017      0.001     -1.224      0.230      -0.005       0.001
Mkt-RF         1.0564      0.026     40.217      0.000       1.003       1.110
SMB            0.0629      0.073      0.862      0.395      -0.086       0.212
HML            0.0928      0.036      2.552      0.016       0.019       0.167
MOM            0.0943      0.051      1.846      0.075      -0.010       0.199
==============================================================================
Omnibus:                        0.410   Durbin-Watson:                   2.244
Prob(Omnibus):                  0.815   Jarque-Bera (JB):                0.552
Skew:                          -0.038   Prob(JB):                        0.759
Kurtosis:                       2.398   Cond. No.                         56.0
==============================================================================

Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a4c3d90>
In [ ]:
# number of funds in the sample
sum(ret.loc[str(start_year+8):str(start_year+10)].sum() != 0)
Out[ ]:
35

Expense Ratio statistics and Expense ratio Regression¶

In this section, we first looked at the expense ratio trend over the sample period and some basic statistics. Then we conducted a regression based on the results from the Carhart four-factor regression for each of the individual funds on their expense ratio to see how they relate to our sample. We then plotted the results and took a closer look at the distribution of the alphas and fees.

Expense ratio statistics¶

In [ ]:
# Making a overview of exp mean
exp_mean = pd.DataFrame(exp[EW_list].mean())
# Exp ratio matrix for exp ratio Regression
alphas_header = ['Alpha_CAPM','Alpha_FF3','Alpha_FFC','Avg_EXP']
exp_ratios = pd.DataFrame()
exp_ratios[['Name','Alpha_CAPM','Alpha_FF3','Alpha_FFC','Avg_EXP']] = 0
exp_ratios['Name'] = NAV[EW_list].columns
exp_ratios.set_index(NAV[EW_list].columns,inplace=True)
exp_ratios_GR = exp_ratios.copy(deep=True)

# Inputting all values that are generated
exp_ratios_GR['Alpha_CAPM'] = res_CAPM_GROSS['Alpha']
exp_ratios_GR['Alpha_FF3'] = res_FF3_GROSS['Alpha']
exp_ratios_GR['Alpha_FFC'] = res_FFC_GROSS['Alpha']

exp_ratios['Alpha_CAPM'] = res_CAPM['Alpha']
exp_ratios['Alpha_FF3'] = res_FF3['Alpha']
exp_ratios['Alpha_FFC'] = res_FFC['Alpha']

# Using the mean exp_ratio over the periode for all the funds
exp_ratios_GR['Avg_EXP'] = exp_mean[0]
exp_ratios['Avg_EXP'] = exp_mean[0]
exp_ratios_GR.dropna(inplace=True)
exp_ratios.dropna(inplace=True)
exp_ratios.drop(['Name'], axis=1)
Out[ ]:
Alpha_CAPM Alpha_FF3 Alpha_FFC Avg_EXP
ALFRED BERG GLOBAL -0.001 -0.002 -0.004 1.393
C WORLD WIDE GLOBALE AKSJER 0.000 -0.000 -0.001 1.400
C WORLD WIDE GLOBALE AKSJER ETISK 0.001 0.000 -0.000 1.243
C WORLD WIDE STABILE AKSJER -0.001 -0.002 -0.003 1.600
CARNEGIE WORLD WIDE ETISK II -0.001 -0.002 -0.003 2.000
DNB NOR KAPFORV.GLOBAL II -0.001 -0.001 -0.001 1.510
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.001 0.001 0.001 0.505
DNB NOR KAPFORV. POSTBANKEN GLOBAL -0.001 -0.001 -0.001 1.815
DNB GLOBAL A -0.001 -0.001 -0.001 1.516
DNB NOR KAPFORV.GLOBAL ETISK IV -0.000 -0.001 0.000 0.614
DNB NOR KAPFORV.GLOBAL ETISK V -0.001 -0.001 -0.000 0.505
DNB GLOBAL LAVKARBON A 0.000 -0.000 -0.002 0.671
DNB NOR KAPFORV.GLOBAL SELEKTIV I -0.001 -0.001 -0.001 1.805
DNB NOR KAPFORV. GLOBALSPAR -0.002 -0.002 -0.000 1.805
DNB NAVIGATOR A DEAD - Liquidated -0.021 -0.015 -0.015 1.856
DELPHI GLOBAL A -0.001 -0.001 -0.002 1.938
DELPHI GREEN TRENDS A -0.010 0.006 0.004 1.501
EIKA GLOBAL -0.003 -0.003 -0.003 1.758
EIKA SPAR -0.004 -0.004 -0.004 1.840
FIRST GLOBAL FOCUS 0.002 0.006 0.009 1.250
FRAM GLOBAL -0.004 -0.003 -0.003 2.000
HOLBERG GLOBAL A -0.001 -0.001 -0.001 1.236
KLP AKSJE GLOBAL FLERFAK P -0.001 -0.001 -0.001 0.270
NORDEA GLOBAL II DEAD - Merged:88750W -0.005 -0.004 -0.004 0.255
NORDEA GLOBAL NOK -0.001 -0.002 -0.002 0.250
NORDEA INTERNASJONALE AKSJER -0.002 -0.002 -0.002 1.449
NORDEA INTERNASJONALE AKSJER II -0.002 -0.002 -0.002 1.019
NORDEA INTERNASJONALE AKSJER III -0.002 -0.002 -0.001 0.517
NORDEA STABILE AKSJER GLOBAL -0.004 -0.004 -0.006 0.558
NORDEA STABILE AKSJER GLOBAL ETISK 0.001 0.001 -0.000 1.500
ODIN GLOBAL C -0.001 -0.001 -0.000 1.798
ODIN GLOBAL II DEAD - Merged:74930E -0.002 0.000 -0.000 0.927
ODIN FORVALTNING AS MARITIM NOK -0.013 -0.011 -0.009 2.003
PLUSS UTLAND AKSJE -0.002 -0.002 -0.002 1.200
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.002 -0.002 -0.002 1.200
PARETO GLOBAL A -0.001 -0.002 -0.001 1.458
SKAGEN GLOBAL A NOK -0.002 -0.003 -0.002 1.178
SKAGEN GLOBAL II NOK -0.000 -0.001 -0.001 0.724
SKAGEN INSIGHT DEAD - Liquidated -0.015 -0.007 -0.007 1.500
SKAGEN VEKST A NOK -0.004 -0.003 -0.003 1.093
SR-UTBYTTE A -0.001 -0.001 -0.002 1.638
SPARE BANK 1 VERDEN VERDI C 0.000 -0.001 -0.002 1.500
STOREBRAND INT INV.FUND BARNESPAR -0.004 -0.004 -0.002 1.500
STOREBRAND EQUAL OPPORTUNITIES A -0.018 -0.012 -0.014 1.050
STOREBRAND GLOBAL ESG 0.001 -0.000 -0.001 0.402
STOREBRAND GLOBAL MULTIFACTOR A 0.000 0.001 -0.000 0.686
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.003 -0.004 -0.003 0.600
STOREBRAND GLOBAL SOLUTIONS A 0.000 0.000 0.000 0.750
STOREBRAND GLOBAL VALUE A -0.002 -0.001 -0.001 0.876
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.005 -0.004 -0.002 1.500
STOREBRAND SMART CITIES A -0.005 0.001 0.003 1.050
TERRA GLOBAL DEAD - Merged:88738D -0.001 -0.001 -0.001 1.166
In [ ]:
# average exp for each year, plotted

exp.mean(axis=1).plot(label=f'{var}', color='blue')
plt.title('Average Total Expense Ratio')
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc818aa7c70>
In [ ]:
print(f' Exp ratio at start: {exp.mean(axis=1).dropna()[0]}')
print(f' Exp ratio at end {exp.mean(axis=1).dropna()[-1]}')
 Exp ratio at start: 1.2644444444444445
 Exp ratio at end 1.20009375
In [ ]:
sns.histplot(exp_ratios[['Alpha_CAPM','Alpha_FFC','Alpha_FF3']])
plt.xlabel('Alpha')
plt.axvline(exp_ratios['Alpha_CAPM'].median(), c='blue', ls='--', lw=2.5)
plt.axvline(exp_ratios['Alpha_FF3'].median(), c='orange', ls='--', lw=2.5)
plt.axvline(exp_ratios['Alpha_FFC'].median(), c='green', ls='--', lw=2.5)
plt.title(f'Alphas from Regressions for {var}')
plt.show()
In [ ]:
sns.histplot(exp_ratios[['Avg_EXP']], bins=30)
plt.xlabel('Average Expense ratios')
plt.axvline(exp_ratios['Avg_EXP'].median(), c='blue', ls='--', lw=2.5)
plt.title(f'Total Expense Ratio in {var}')
plt.show()
In [ ]:
# Comparing the below and above median funds (based on FFC alpha) and their expense ratio
median_alpha = res_FFC['Alpha'].median()

low_alpha_funds = res_FFC[res_FFC['Alpha'] <= median_alpha].index
high_alpha_funds = res_FFC[res_FFC['Alpha'] > median_alpha].index

plt.plot(exp[low_alpha_funds].mean(axis=1), label='low performance', color='r')
plt.plot(exp[high_alpha_funds].mean(axis=1),label='high performance', color='g')
plt.ylabel('expense ratio')
plt.ylim((0.90,1.7))
plt.xlabel('time')
plt.title(f'High performance vs Low performance by Expense ratio in {var}')
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc7c8fbd2b0>

Expense ratio regression¶

In [ ]:
# Making a easy Regresion function
def reg(X,Y,returns=False, h=False):
    X_sm = sm.add_constant(X)
    model = sm.OLS(Y,X_sm)
    if h:
        results_reg = model.fit(cov_type='HAC', cov_kwds={'maxlags': 1})
    else:
        results_reg = model.fit()
    if returns:
        return results_reg
    else:
        print(results_reg.summary())

Gross return Alphas on Average Expense ratios¶

In [ ]:
# Running 3 Regressions, EXP ratios on the different Alphas
reg(exp_ratios_GR['Avg_EXP']/100, (exp_ratios_GR['Alpha_CAPM']+1)**12-1,h=True)
reg(exp_ratios_GR['Avg_EXP']/100, (exp_ratios_GR['Alpha_FF3']+1)**12-1, h=True)
reg(exp_ratios_GR['Avg_EXP']/100, (exp_ratios_GR['Alpha_FFC']+1)**12-1, h=True)
                            OLS Regression Results                            
==============================================================================
Dep. Variable:             Alpha_CAPM   R-squared:                       0.022
Model:                            OLS   Adj. R-squared:                  0.003
Method:                 Least Squares   F-statistic:                     1.537
Date:                Sun, 25 Jun 2023   Prob (F-statistic):              0.221
Time:                        15:39:58   Log-Likelihood:                 82.416
No. Observations:                  52   AIC:                            -160.8
Df Residuals:                      50   BIC:                            -156.9
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0025      0.012     -0.204      0.838      -0.026       0.021
Avg_EXP       -1.4685      1.185     -1.240      0.215      -3.790       0.853
==============================================================================
Omnibus:                       38.066   Durbin-Watson:                   2.073
Prob(Omnibus):                  0.000   Jarque-Bera (JB):               92.777
Skew:                          -2.206   Prob(JB):                     7.14e-21
Kurtosis:                       7.832   Cond. No.                         197.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
                            OLS Regression Results                            
==============================================================================
Dep. Variable:              Alpha_FF3   R-squared:                       0.004
Model:                            OLS   Adj. R-squared:                 -0.016
Method:                 Least Squares   F-statistic:                    0.2488
Date:                Sun, 25 Jun 2023   Prob (F-statistic):              0.620
Time:                        15:39:58   Log-Likelihood:                 94.557
No. Observations:                  52   AIC:                            -185.1
Df Residuals:                      50   BIC:                            -181.2
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0040      0.011     -0.374      0.708      -0.025       0.017
Avg_EXP       -0.4982      0.999     -0.499      0.618      -2.456       1.460
==============================================================================
Omnibus:                       16.907   Durbin-Watson:                   2.034
Prob(Omnibus):                  0.000   Jarque-Bera (JB):               37.693
Skew:                          -0.827   Prob(JB):                     6.53e-09
Kurtosis:                       6.829   Cond. No.                         197.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
                            OLS Regression Results                            
==============================================================================
Dep. Variable:              Alpha_FFC   R-squared:                       0.004
Model:                            OLS   Adj. R-squared:                 -0.016
Method:                 Least Squares   F-statistic:                    0.2980
Date:                Sun, 25 Jun 2023   Prob (F-statistic):              0.588
Time:                        15:39:58   Log-Likelihood:                 93.041
No. Observations:                  52   AIC:                            -182.1
Df Residuals:                      50   BIC:                            -178.2
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0037      0.012     -0.314      0.754      -0.027       0.019
Avg_EXP       -0.5281      0.967     -0.546      0.585      -2.424       1.368
==============================================================================
Omnibus:                       18.464   Durbin-Watson:                   2.143
Prob(Omnibus):                  0.000   Jarque-Bera (JB):               54.251
Skew:                          -0.780   Prob(JB):                     1.66e-12
Kurtosis:                       7.755   Cond. No.                         197.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction

Plotting Regression¶

In [ ]:
from scipy.interpolate import UnivariateSpline
# Plotting and uses a basic Regression line based on the output from the Regression above
coef = reg(exp_ratios_GR['Avg_EXP']/100, (exp_ratios_GR['Alpha_FFC']+1)**12-1,True)
plt.xlabel('Expense ratio')
plt.ylabel('Annualized 4-Factor Alpha')
line = lambda x: coef.params[0]+x*coef.params[1]

# Plotting Non-parametric line
spl = UnivariateSpline(exp_ratios_GR.sort_values('Avg_EXP')['Avg_EXP']/100,(exp_ratios_GR.sort_values('Avg_EXP')['Alpha_FFC']+1)**12-1)

v = np.linspace(0.2,2,100)/100

ys = spl(v)
plt.scatter(exp_ratios_GR['Avg_EXP']/100, (exp_ratios_GR['Alpha_FFC']+1)**12-1, label='Fund', color='grey')
plt.plot(v,ys, label='Non-parametric line')
plt.plot(v,line(v), color='black', label='Linear Regression line')
plt.ylim(-0.30,0.2)
plt.xlim(0.1/100, 2/100)

#plt.axvline(x=cheap/100, c='g', ls='--',label='Low/Medium cost')
#plt.axvline(x=medium/100, c='y', ls='--',label='Medium/High cost')
plt.title(f'Carhart 4 Alpha on Expense Ratio')
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc7d85d97c0>

Net return Alphas on Average Expense ratios¶

In [ ]:
reg(exp_ratios['Avg_EXP']/100, (exp_ratios['Alpha_FFC']+1)**12-1, h=True)
                            OLS Regression Results                            
==============================================================================
Dep. Variable:              Alpha_FFC   R-squared:                       0.035
Model:                            OLS   Adj. R-squared:                  0.016
Method:                 Least Squares   F-statistic:                     2.458
Date:                Sun, 25 Jun 2023   Prob (F-statistic):              0.123
Time:                        15:39:58   Log-Likelihood:                 93.700
No. Observations:                  52   AIC:                            -183.4
Df Residuals:                      50   BIC:                            -179.5
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0039      0.012     -0.334      0.738      -0.026       0.019
Avg_EXP       -1.4959      0.954     -1.568      0.117      -3.366       0.374
==============================================================================
Omnibus:                       18.373   Durbin-Watson:                   2.143
Prob(Omnibus):                  0.000   Jarque-Bera (JB):               53.990
Skew:                          -0.774   Prob(JB):                     1.89e-12
Kurtosis:                       7.746   Cond. No.                         197.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction

Cost categories¶

In this section, we split our dataset into 3 cost categories. We then compared the different cost categories equally-weighted portfolios Carhart four-factor results. We then plotted the cumulative returns for each of the portfolios.

In [ ]:
fund = exp.columns
cheap = exp.mean().quantile(1/3)
medium = exp.mean().quantile(2/3)


cheap_funds = fund[exp.mean()<=cheap]
medium_funds = fund[(exp.mean()>cheap) & (exp.mean() < medium)]
expensive_funds = fund[medium<=exp.mean()]
In [ ]:
# Total funds
len(cheap_funds) + len(medium_funds) + len(expensive_funds)
Out[ ]:
52
In [ ]:
# cheap and medium exp ratio
cheap,medium
Out[ ]:
(1.05, 1.5)
In [ ]:
# Based on the avg exp over the periode the funds get sorted into groups.
# then perfomring the FFC Regression on the results


cheap_reg = factor(res_FFC_,FAMAC,ret[cheap_funds])
medium_reg = factor(res_FFC_,FAMAC,ret[medium_funds])
expens_reg = factor(res_FFC_,FAMAC,ret[expensive_funds])
In [ ]:
pd.concat([cheap_reg.describe(),medium_reg.describe(),expens_reg.describe()],axis=1)
Out[ ]:
Alpha Mkt-RF SMB HML MOM ADJ_R_SQ Alpha Mkt-RF SMB HML MOM ADJ_R_SQ Alpha Mkt-RF SMB HML MOM ADJ_R_SQ
count 17.000 17.000 17.000 17.000 17.000 17.000 14.000 14.000 14.000 14.000 14.000 14.000 21.000 21.000 21.000 21.000 21.000 21.000
mean -0.001 1.069 -0.098 0.150 0.038 0.900 -0.002 1.023 -0.007 -0.029 -0.011 0.889 -0.003 1.061 0.134 0.235 0.039 0.840
std 0.002 0.161 0.181 0.262 0.141 0.065 0.005 0.117 0.341 0.259 0.165 0.038 0.004 0.167 0.374 0.381 0.139 0.116
min -0.006 0.810 -0.444 -0.273 -0.084 0.713 -0.014 0.880 -0.390 -0.305 -0.402 0.789 -0.015 0.755 -0.298 -0.663 -0.198 0.582
25% -0.002 0.993 -0.207 -0.037 -0.062 0.883 -0.002 0.964 -0.208 -0.218 -0.081 0.876 -0.003 1.017 -0.091 0.004 -0.042 0.767
50% -0.001 1.034 -0.116 0.067 -0.026 0.915 -0.001 1.015 -0.096 -0.066 -0.005 0.892 -0.002 1.043 -0.007 0.224 0.036 0.875
75% -0.000 1.063 0.000 0.351 0.086 0.942 -0.001 1.059 0.040 0.047 0.086 0.917 -0.001 1.077 0.175 0.404 0.129 0.942
max 0.001 1.549 0.238 0.766 0.435 0.988 0.009 1.358 0.989 0.589 0.283 0.939 0.004 1.509 1.227 1.135 0.335 0.970
In [ ]:
plt.scatter(exp_mean.T[cheap_funds].T,cheap_reg['Alpha'], label='Cheap')
plt.scatter(exp_mean.T[expensive_funds].T,expens_reg['Alpha'], label='Expensive')
plt.scatter(exp_mean.T[medium_funds.T],medium_reg['Alpha'], label='Medium')
plt.xlabel('Expense ratio');
plt.ylabel('Alpha');
plt.title('Total Expense Ratios & Alphas')
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc7e8db59a0>

Comparing different cost-categories¶

In [ ]:
EW(FAMAC,returns = ret[cheap_funds], h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.976
Model:                            OLS   Adj. R-squared:                  0.975
Method:                 Least Squares   F-statistic:                     1253.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          2.18e-100
Time:                        15:39:58   Log-Likelihood:                 469.57
No. Observations:                 131   AIC:                            -929.1
Df Residuals:                     126   BIC:                            -914.8
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0013      0.001     -2.225      0.026      -0.002      -0.000
Mkt-RF         1.0469      0.017     62.956      0.000       1.014       1.079
SMB           -0.0648      0.045     -1.432      0.152      -0.154       0.024
HML            0.1117      0.021      5.393      0.000       0.071       0.152
MOM            0.0300      0.030      1.003      0.316      -0.029       0.089
==============================================================================
Omnibus:                        3.272   Durbin-Watson:                   2.430
Prob(Omnibus):                  0.195   Jarque-Bera (JB):                3.544
Skew:                           0.065   Prob(JB):                        0.170
Kurtosis:                       3.795   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a4da550>
In [ ]:
EW(FAMAC,returns = ret[medium_funds], h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.965
Model:                            OLS   Adj. R-squared:                  0.964
Method:                 Least Squares   F-statistic:                     946.7
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           6.15e-93
Time:                        15:39:58   Log-Likelihood:                 445.68
No. Observations:                 131   AIC:                            -881.4
Df Residuals:                     126   BIC:                            -867.0
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0016      0.001     -2.429      0.015      -0.003      -0.000
Mkt-RF         1.0266      0.019     54.043      0.000       0.989       1.064
SMB           -0.0582      0.050     -1.172      0.241      -0.156       0.039
HML           -0.0423      0.029     -1.443      0.149      -0.100       0.015
MOM            0.0111      0.035      0.314      0.753      -0.058       0.080
==============================================================================
Omnibus:                        0.942   Durbin-Watson:                   2.241
Prob(Omnibus):                  0.624   Jarque-Bera (JB):                0.940
Skew:                           0.035   Prob(JB):                        0.625
Kurtosis:                       2.591   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a6f1be0>
In [ ]:
EW(FAMAC,returns = ret[expensive_funds], h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.951
Model:                            OLS   Adj. R-squared:                  0.950
Method:                 Least Squares   F-statistic:                     1187.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           5.90e-99
Time:                        15:39:58   Log-Likelihood:                 419.55
No. Observations:                 131   AIC:                            -829.1
Df Residuals:                     126   BIC:                            -814.7
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0036      0.001     -4.342      0.000      -0.005      -0.002
Mkt-RF         1.0531      0.019     55.093      0.000       1.016       1.091
SMB            0.1381      0.059      2.357      0.018       0.023       0.253
HML            0.1949      0.032      6.169      0.000       0.133       0.257
MOM            0.0477      0.045      1.070      0.284      -0.040       0.135
==============================================================================
Omnibus:                        1.213   Durbin-Watson:                   2.216
Prob(Omnibus):                  0.545   Jarque-Bera (JB):                0.921
Skew:                           0.200   Prob(JB):                        0.631
Kurtosis:                       3.096   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc7d85cb490>
In [ ]:
# Cummulative return EW

(ret[cheap_funds].mean(axis=1) + 1).cumprod().plot(color='g', label='Low-cost - net return')
(GROSS[cheap_funds].mean(axis=1) + 1).cumprod().plot(color='c', label='Low-cost - gross return')
(ret[medium_funds].mean(axis=1) + 1).cumprod().plot(color='orange', label='Medium-cost - net return')
(GROSS[medium_funds].mean(axis=1) + 1).cumprod().plot(color='y', label='Medium-cost - gross return')
(ret[expensive_funds].mean(axis=1) + 1).cumprod().plot(color='r', label='High-cost - net return')
(GROSS[expensive_funds].mean(axis=1) + 1).cumprod().plot(color='m', label='High-cost - gross return')
plt.axhline(y = 1, color = 'r', linestyle = '--')
plt.title(f'Low-cost vs. Medium-cost vs. High-cost in {var}')
plt.ylim((0.5,3.2))
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc7d85cb1f0>

Plotting & returns in funds¶

In this section, we plotted the returns for each fund and the equally weighted portfolio. We also took a closer look at some of the top performers, and the bottom performers. We also took a closer look at when the different funds were alive.

Best performer on return basis¶

In [ ]:
import warnings
warnings.filterwarnings("ignore", message="DataFrame is highly fragmented.")


# Mkt where new funds start from mkts return - adjusted
adjusted = pd.DataFrame()
adjusted['Mkt'] = (Mkt.loc[str(start_year):str(end_year)]+1).cumprod()

# To adjust the start of each fund to where the market is when they arrive
for i in ret:
    Mkt_c = (Mkt.loc[str(start_year):str(end_year)]+1).cumprod()
    x = pd.concat([ret[i],Mkt_c],axis=1)
    x = x.dropna()
    x[i][0] = x[i][0]+x[0][0]
    x[i][1:] = x[i][1:] + 1
    x[i] = x[i].cumprod()
    adjusted[i] = x[i].copy(deep=True)
    
adjusted.interpolate(limit_area='inside', inplace=True)

adjusted[1:].plot()
Mkt_c.plot(lw=2, color='blue')
plt.legend('');
In [ ]:
Fund_with_highest_end_return = adjusted.iloc[-1].idxmax()
print(Fund_with_highest_end_return)
adjusted[Fund_with_highest_end_return][-1]
FIRST GLOBAL FOCUS
Out[ ]:
2.956993904834917
In [ ]:
highest_retrun_point = ((ret + 1).cumprod()).max().idxmax()
print(highest_retrun_point)
adjusted[highest_retrun_point].max()
HOLBERG GLOBAL A
Out[ ]:
3.5793393068991333
In [ ]:
Fund_with_lowest_end_return = adjusted.iloc[-1].idxmin()
print(Fund_with_lowest_end_return)
adjusted[Fund_with_lowest_end_return][-1]
FRAM GLOBAL
Out[ ]:
1.554640648908042
In [ ]:
lowest_return_point = ((ret + 1).cumprod()).min().idxmin()
print(lowest_return_point)
adjusted[lowest_return_point].min()
DNB NAVIGATOR A DEAD - Liquidated
Out[ ]:
0.2829693834763005
In [ ]:
exp_ratios.loc[Fund_with_highest_end_return]
Out[ ]:
Name          FIRST GLOBAL FOCUS
Alpha_CAPM                 0.002
Alpha_FF3                  0.006
Alpha_FFC                  0.009
Avg_EXP                    1.250
Name: FIRST GLOBAL FOCUS, dtype: object
In [ ]:
res_FFC.loc[Fund_with_highest_end_return]
Out[ ]:
Alpha       0.009
Mkt-RF      1.358
SMB         0.989
HML         0.589
MOM        -0.402
ADJ_R_SQ    0.789
Name: FIRST GLOBAL FOCUS, dtype: float64

Equal Weighted port Cummulative return¶

In [ ]:
# Cummulative return EW
(Mkt.loc[str(start_year):str(end_year)]+1).cumprod().plot(lw=4, color='b', label='Mkt')
(ret.mean(axis=1) + 1).cumprod().plot(color='r', label='EW port')
plt.axhline(y = 1, color = 'r', linestyle = '--')
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc7c9179160>

Funds alive timeline¶

In [ ]:
# Time line over funds
all_df = ret[EW_list].copy(deep=True)
all_df = all_df.interpolate(method='linear',limit_area='inside')
all_df['ALIVE'] = np.nan
for i in range(1,len(all_df)):
    all_df['ALIVE'].iloc[i] = len((all_df.iloc[i]).dropna())
all_df['ALIVE'].dropna().plot()
plt.title(f'Number of funds in {var}')
plt.ylabel('alive');

Testing for Autocorrelation, Heteroscedasity, Non-normality¶

In this section, we tested funds for autocorrelation, heteroscedasticity, and non-normality. We further plotted some of our results.

In [ ]:
from statsmodels.graphics.tsaplots import plot_acf


def tester(reg, show=False, save=False, reg_mode=False):
    white_test = het_white(reg.resid, reg.model.exog)
    bg = acorr_breusch_godfrey(reg, nlags=1)
    jb = sp.stats.jarque_bera(reg.resid)
    if reg_mode == False:
        print(f'P-Value = {white_test[3]} - If this is lower than 0.05 We have a problem with hetero')
        print(f'P-Value = {bg[1]} - Autocorrelation if lower than 0.05')
        print(f'P-Values = {jb[1]} - If not high, this is not normality')
    if show:
        plt.hist(reg.resid)
        plt.show()
        plt.plot(reg.resid)
        plt.show()
        print(reg.resid.sort_values(ascending=True).head(15))
        plot_acf(reg.resid, lags=10)
    if save:
        return (white_test[3] > 0.05, bg[1] > 0.05, jb[1] > 0.05)
In [ ]:
print('Equally Weighted Net')
tester(EW(CAPM, Show=False))
print('-'*75)
tester(EW(FAMA3, Show=False))
print('-'*75)
tester(EW(FAMAC, Show=False))
print('-'*75)
print('-'*75)

tester(EW(CAPM,returns=GROSS, Show=False))
print('-'*75)
tester(EW(FAMA3,returns=GROSS, Show=False))
print('-'*75)
tester(EW(FAMAC,returns=GROSS, Show=False))
print('-'*75)

print()

print('Induvidual CAPM, FF3, FFC')
print('-'*75)
print('CAPM')
print(factor(res_CAPM_,CAPM,ret,h=True, test_kit=True).apply(lambda x: sum(x)/len(x)))
print('-'*75)
print('FF3')
print(factor(res_FF3_,FAMA3,ret,h=True, test_kit=True).apply(lambda x: sum(x)/len(x)))
print('-'*75)
print('FFC')
print(factor(res_FFC_,FAMAC,ret,h=True, test_kit=True).apply(lambda x: sum(x)/len(x)))
print('-'*75)
Equally Weighted Net
P-Value = 0.9268591685058103 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.056399032247377454 - Autocorrelation if lower than 0.05
P-Values = 0.7554883076108444 - If not high, this is not normality
---------------------------------------------------------------------------
P-Value = 0.3118740312592521 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.042400356026063256 - Autocorrelation if lower than 0.05
P-Values = 0.8175734058773277 - If not high, this is not normality
---------------------------------------------------------------------------
P-Value = 0.34089790510747836 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.04860034250267984 - Autocorrelation if lower than 0.05
P-Values = 0.8644029773928977 - If not high, this is not normality
---------------------------------------------------------------------------
---------------------------------------------------------------------------
P-Value = 0.9327114374761978 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.052045287137861156 - Autocorrelation if lower than 0.05
P-Values = 0.7455729705100629 - If not high, this is not normality
---------------------------------------------------------------------------
P-Value = 0.3052125279544053 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.0384640773013481 - Autocorrelation if lower than 0.05
P-Values = 0.8168506517901979 - If not high, this is not normality
---------------------------------------------------------------------------
P-Value = 0.3352270989253424 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.044059321045860876 - Autocorrelation if lower than 0.05
P-Values = 0.8631622720105587 - If not high, this is not normality
---------------------------------------------------------------------------

Induvidual CAPM, FF3, FFC
---------------------------------------------------------------------------
CAPM
White   0.712
BG      0.904
JB      0.846
dtype: float64
---------------------------------------------------------------------------
FF3
White   0.654
BG      0.885
JB      0.827
dtype: float64
---------------------------------------------------------------------------
FFC
White   0.596
BG      0.885
JB      0.827
dtype: float64
---------------------------------------------------------------------------
In [ ]:
pd.merge(pd.DataFrame(EW(FAMAC,Show=False).resid).reset_index(),F.reset_index()).set_index('date').corr()
Out[ ]:
0 Mkt-RF SMB HML MOM RMW CMA RF
0 1.000 0.000 0.000 -0.000 -0.000 0.075 0.034 0.090
Mkt-RF 0.000 1.000 0.120 -0.026 -0.381 0.001 -0.273 -0.117
SMB 0.000 0.120 1.000 -0.097 -0.004 -0.274 -0.221 -0.118
HML -0.000 -0.026 -0.097 1.000 -0.480 -0.550 0.792 -0.076
MOM -0.000 -0.381 -0.004 -0.480 1.000 0.270 -0.112 0.045
RMW 0.075 0.001 -0.274 -0.550 0.270 1.000 -0.289 0.009
CMA 0.034 -0.273 -0.221 0.792 -0.112 -0.289 1.000 -0.013
RF 0.090 -0.117 -0.118 -0.076 0.045 0.009 -0.013 1.000
In [ ]:
tester(EW(CAPM),show=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.971
Model:                            OLS   Adj. R-squared:                  0.971
Method:                 Least Squares   F-statistic:                     4308.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          5.62e-101
Time:                        15:40:01   Log-Likelihood:                 456.34
No. Observations:                 131   AIC:                            -908.7
Df Residuals:                     129   BIC:                            -902.9
Df Model:                           1                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0022      0.001     -3.272      0.001      -0.003      -0.001
Mkt-RF         1.0351      0.016     65.633      0.000       1.004       1.066
==============================================================================
Omnibus:                        0.425   Durbin-Watson:                   2.279
Prob(Omnibus):                  0.809   Jarque-Bera (JB):                0.561
Skew:                           0.115   Prob(JB):                        0.755
Kurtosis:                       2.778   Cond. No.                         24.1
==============================================================================

Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
P-Value = 0.9268591685058103 - If this is lower than 0.05 We have a problem with hetero
P-Value = 0.056399032247377454 - Autocorrelation if lower than 0.05
P-Values = 0.7554883076108444 - If not high, this is not normality
date
2015-07-31   -0.016
2014-11-28   -0.016
2013-02-28   -0.014
2013-03-29   -0.014
2017-11-30   -0.014
2020-10-30   -0.013
2012-05-31   -0.013
2014-10-31   -0.012
2018-03-30   -0.012
2020-01-31   -0.011
2022-09-30   -0.011
2018-08-31   -0.011
2014-06-30   -0.010
2020-04-30   -0.010
2022-07-29   -0.010
dtype: float64

Information Ratio & Sharpe Ratio¶

In this section, we used the information ratio and the Sharpe ratio for all the funds in our sample. We also plotted some of the results and conducted some analysis on the different cost categories.

In [ ]:
# Calulcating the Information ratio for each fund
def ir(start=str(start_year), end=str(end_year), returns=ret, l=25, printing=False):
    start = str(start)
    end = str(end)
    SR = pd.DataFrame()
    SR.index = returns.columns
    SR['ir'] = np.NaN


    for i in returns:
        fund_rf = pd.concat([returns[i].loc[start:end],Mkt.loc[start:end]], axis=1).dropna()
        SR['ir'].loc[i] = ((fund_rf[i]-fund_rf[0]).mean()/((fund_rf[i]-fund_rf[0]).std()))*np.sqrt(12)

    if printing == False:
        print('-'*50)
        print(f'from {start} to {end}')
        print(SR.sort_values('ir', ascending=False).head(l))
        plt.hist(SR['ir'])
        plt.show()
        print(f'Mean IR of {SR.mean()}')
        print(f'Median IR of {SR.median()}')
        
    else:
        return SR.sort_values('ir', ascending=False)
In [ ]:
# Sharpe ratio
def SR(fund_ret,start=start_year, end=end_year):
    rf = FF['RF'].loc[str(start):str(end)].mean()*12
    fund_return = fund_ret.loc[str(start):str(end)].mean() * 12
    sigma = fund_ret.std() * np.sqrt(12)
    return (fund_return-rf)/sigma
In [ ]:
all_ir = ir(printing=True)
In [ ]:
all_ir
Out[ ]:
ir
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J 0.773
DNB NOR KAPFORV.GLOBAL ETISK IV 0.409
FIRST GLOBAL FOCUS 0.260
NORDEA GLOBAL II DEAD - Merged:88750W 0.253
STOREBRAND GLOBAL ESG 0.236
DNB NOR KAPFORV.GLOBAL SELEKTIV I 0.034
STOREBRAND GLOBAL SOLUTIONS A 0.030
SPARE BANK 1 VERDEN VERDI C -0.001
STOREBRAND GLOBAL MULTIFACTOR A -0.005
DNB NOR KAPFORV. POSTBANKEN GLOBAL -0.016
C WORLD WIDE GLOBALE AKSJER ETISK -0.049
DNB GLOBAL LAVKARBON A -0.063
SKAGEN GLOBAL II NOK -0.065
SR-UTBYTTE A -0.074
ODIN GLOBAL C -0.105
HOLBERG GLOBAL A -0.116
DNB NOR KAPFORV.GLOBAL ETISK V -0.118
C WORLD WIDE GLOBALE AKSJER -0.130
NORDEA STABILE AKSJER GLOBAL ETISK -0.134
DNB GLOBAL A -0.139
PARETO GLOBAL A -0.153
STOREBRAND GLOBAL VALUE A -0.206
DELPHI GLOBAL A -0.209
ODIN GLOBAL II DEAD - Merged:74930E -0.214
NORDEA GLOBAL NOK -0.232
NORDEA STABILE AKSJER GLOBAL -0.289
PLUSS UTLAND ETISK DEAD - Merged:88728F -0.316
SKAGEN GLOBAL A NOK -0.339
NORDEA INTERNASJONALE AKSJER III -0.345
PLUSS UTLAND AKSJE -0.374
TERRA GLOBAL DEAD - Merged:88738D -0.415
KLP AKSJE GLOBAL FLERFAK P -0.422
DNB NOR KAPFORV.GLOBAL II -0.440
C WORLD WIDE STABILE AKSJER -0.442
EIKA SPAR -0.468
SKAGEN VEKST A NOK -0.483
FRAM GLOBAL -0.503
NORDEA INTERNASJONALE AKSJER II -0.531
NORDEA INTERNASJONALE AKSJER -0.560
ALFRED BERG GLOBAL -0.599
CARNEGIE WORLD WIDE ETISK II -0.639
STOREBRAND INTL.INV.FD. GLOBAL SRI -0.660
DNB NOR KAPFORV. GLOBALSPAR -0.722
DELPHI GREEN TRENDS A -0.732
STOREBRAND INT INV.FUND BARNESPAR -0.744
STOREBRAND INTL.INV.FD. PENSJONSPAR -0.758
EIKA GLOBAL -0.831
DNB NAVIGATOR A DEAD - Liquidated -1.014
ODIN FORVALTNING AS MARITIM NOK -1.044
STOREBRAND SMART CITIES A -1.109
SKAGEN INSIGHT DEAD - Liquidated -1.887
STOREBRAND EQUAL OPPORTUNITIES A -3.268
In [ ]:
# EW Infromation ratio
ew_ret = pd.DataFrame(ret.mean(axis=1).dropna())
ew_ret = ew_ret.rename(columns={0:'ew'})
IR_total = ir(2012, 2022,ew_ret, printing=True)
print(IR_total)
       ir
ew -0.870
In [ ]:
# Cheap funds
cheap_ret = pd.DataFrame(ret[cheap_funds].mean(axis=1)).dropna()
cheap_ret = cheap_ret.rename(columns={0:'cheap'})

cheap_IR = ir(2012, 2022, cheap_ret, printing=True)
print(cheap_IR)
          ir
cheap -0.337
In [ ]:
# Medium funds
medium_ret = pd.DataFrame(ret[medium_funds].mean(axis=1)).dropna()
medium_ret = medium_ret.rename(columns={0:'medium'})

medium_IR = ir(2012, 2022, medium_ret, printing=True)
print(medium_IR)
           ir
medium -0.528
In [ ]:
# Expensive funds
expensive_ret = pd.DataFrame(ret[expensive_funds].mean(axis=1)).dropna()
expensive_ret = expensive_ret.rename(columns={0:'expensive'})

expensive_IR = ir(2012, 2022, expensive_ret, printing=True)
print(expensive_IR)
              ir
expensive -0.989
In [ ]:
alive = ret.iloc[-1].dropna().index
In [ ]:
high_IR_funds = ir(returns=ret[alive],printing=True).head(3)
In [ ]:
high_IR_funds
Out[ ]:
ir
FIRST GLOBAL FOCUS 0.260
STOREBRAND GLOBAL ESG 0.236
STOREBRAND GLOBAL SOLUTIONS A 0.030
In [ ]:
adjusted[high_IR_funds.index].plot()
(1+Mkt.loc[str(start_year):str(end_year)]).cumprod().plot();

Based on Bogle's - "An index fund fundamentalist"¶

In this section, we tried to replicate Bogle's (2002) method -- soruce from thesis (https://doi.org/10.3905/jpm.2002.319840). We used morningstar style-boxes obtained from Morningstar direct. Further, we sorted the funds into portfolios based on their style and cost. We then compared their Sharpe ratio.

In [ ]:
def cost(x):
    if x in cheap_funds:
        return 'Low-Cost'
    elif x in medium_funds:
        return  'Medium-Cost'
    elif x in expensive_funds:
        return 'High-Cost'
In [ ]:
fund_df = pd.DataFrame({'fund':fund})
fund_df.set_index('fund', inplace=True)
morningstar_data = pd.read_excel('fund_data.xlsx', sheet_name=f'{var}_INFO')
morningstar_data = morningstar_data[[0,'Equity Style Box (Long)']].set_index(0)
ret_df = pd.DataFrame({'ret':ret.mean(axis=0)*12})
exp_df = pd.DataFrame({'exp':exp.mean(axis=0)})
b_df2 = ret_df.merge(res_FFC,left_index=True, right_index=True,how='right')
b_df = exp_df.merge(b_df2,left_index=True, right_index=True, how='inner')
b_df = pd.concat([b_df,morningstar_data],axis=1)
b_df = b_df.rename(columns={'Equity Style Box (Long)':'style'})
b_df = b_df.reset_index()
b_df['cost'] = b_df['index'].apply(lambda x: cost(x))
b_df.set_index('index', inplace=True)
h_df = b_df
b_df = b_df.dropna()
b_df['cap'] = b_df['style'].apply(lambda x:x.split()[0])
b_df['type'] = b_df['style'].apply(lambda x:x.split()[1])
b_df
Out[ ]:
exp ret Alpha Mkt-RF SMB HML MOM ADJ_R_SQ style cost cap type
index
ALFRED BERG GLOBAL 1.393 0.066 -0.004 0.900 -0.117 -0.031 0.283 0.902 Large Blend Medium-Cost Large Blend
C WORLD WIDE GLOBALE AKSJER 1.400 0.090 -0.001 0.909 -0.215 -0.277 0.105 0.875 Large Growth Medium-Cost Large Growth
C WORLD WIDE GLOBALE AKSJER ETISK 1.243 0.095 -0.000 0.880 -0.189 -0.270 0.123 0.866 Large Growth Medium-Cost Large Growth
C WORLD WIDE STABILE AKSJER 1.600 0.067 -0.003 0.882 -0.161 0.054 0.166 0.767 Large Blend High-Cost Large Blend
DNB GLOBAL A 1.516 0.093 -0.001 1.043 -0.134 0.160 -0.042 0.955 Large Blend High-Cost Large Blend
DNB GLOBAL LAVKARBON A 0.671 0.079 -0.002 0.984 -0.116 0.067 0.260 0.931 Large Value Low-Cost Large Value
DELPHI GLOBAL A 1.938 0.084 -0.002 1.045 0.086 -0.149 0.119 0.834 Large Growth High-Cost Large Growth
DELPHI GREEN TRENDS A 1.501 -0.115 0.004 1.077 0.624 -0.663 0.223 0.758 Mid Growth High-Cost Mid Growth
EIKA GLOBAL 1.758 0.064 -0.003 1.034 -0.014 0.224 0.036 0.942 Mid Value High-Cost Mid Value
EIKA SPAR 1.840 0.065 -0.004 1.206 0.142 0.357 0.067 0.895 Mid Blend High-Cost Mid Blend
FIRST GLOBAL FOCUS 1.250 0.126 0.009 1.358 0.989 0.589 -0.402 0.789 Large Value Medium-Cost Large Value
FRAM GLOBAL 2.000 0.046 -0.003 0.941 0.552 0.340 0.034 0.681 Large Blend High-Cost Large Blend
HOLBERG GLOBAL A 1.236 0.092 -0.001 1.013 -0.013 -0.182 -0.015 0.893 Large Growth Medium-Cost Large Growth
KLP AKSJE GLOBAL FLERFAK P 0.270 0.058 -0.001 0.810 -0.275 0.091 0.070 0.901 Large Blend Low-Cost Large Blend
NORDEA GLOBAL NOK 0.250 0.087 -0.002 1.067 -0.119 -0.037 0.039 0.915 Large Blend Low-Cost Large Blend
NORDEA INTERNASJONALE AKSJER 1.449 0.097 -0.002 1.013 -0.074 0.045 -0.074 0.881 Large Blend Medium-Cost Large Blend
NORDEA STABILE AKSJER GLOBAL 0.558 0.072 -0.006 1.297 -0.203 0.436 0.153 0.848 Large Value Low-Cost Large Value
NORDEA STABILE AKSJER GLOBAL ETISK 1.500 0.090 -0.000 0.807 -0.239 0.218 0.104 0.846 Large Value High-Cost Large Value
ODIN GLOBAL C 1.798 0.092 -0.000 1.021 0.028 -0.306 -0.091 0.880 Large Growth High-Cost Large Growth
ODIN GLOBAL II DEAD - Merged:74930E 0.927 0.008 -0.000 1.218 -0.219 0.766 0.114 0.713 Large Growth Low-Cost Large Growth
PLUSS UTLAND AKSJE 1.200 0.083 -0.002 1.061 -0.214 -0.044 -0.003 0.939 Large Blend Medium-Cost Large Blend
PLUSS UTLAND ETISK DEAD - Merged:88728F 1.200 0.084 -0.002 1.052 -0.178 -0.088 0.014 0.922 Large Blend Medium-Cost Large Blend
PARETO GLOBAL A 1.458 0.074 -0.001 1.082 0.058 0.185 -0.084 0.907 Large Blend Medium-Cost Large Blend
SKAGEN GLOBAL A NOK 1.178 0.078 -0.002 1.017 -0.390 -0.224 -0.086 0.878 Large Growth Medium-Cost Large Growth
SKAGEN GLOBAL II NOK 0.724 0.077 -0.001 0.993 -0.444 -0.273 -0.055 0.892 Large Growth Low-Cost Large Growth
SKAGEN VEKST A NOK 1.093 0.062 -0.003 1.081 0.204 0.350 -0.007 0.855 Large Value Medium-Cost Large Value
SPARE BANK 1 VERDEN VERDI C 1.500 0.077 -0.002 0.987 0.054 0.403 0.148 0.859 Large Value High-Cost Large Value
STOREBRAND EQUAL OPPORTUNITIES A 1.050 -0.341 -0.014 0.962 -0.217 -0.305 0.163 0.920 Large Growth Medium-Cost Large Growth
STOREBRAND GLOBAL ESG 0.402 0.084 -0.001 0.996 -0.207 -0.057 0.031 0.988 Large Blend Low-Cost Large Blend
STOREBRAND GLOBAL MULTIFACTOR A 0.686 0.098 -0.000 1.005 0.238 0.278 0.086 0.942 Mid Value Low-Cost Mid Value
STOREBRAND GLOBAL SOLUTIONS A 0.750 0.082 0.000 0.984 0.118 -0.149 -0.040 0.869 Large Growth Low-Cost Large Growth
STOREBRAND GLOBAL VALUE A 0.876 0.085 -0.001 1.053 0.220 0.472 -0.082 0.937 Large Value Low-Cost Large Value
STOREBRAND SMART CITIES A 1.050 -0.201 0.003 1.025 0.325 -0.199 -0.199 0.930 Mid Growth Medium-Cost Mid Growth
In [ ]:
b_df[['exp', 'ret', 'style']].groupby('style').mean()
Out[ ]:
exp ret
style
Large Blend 1.158 0.076
Large Growth 1.224 0.036
Large Value 1.064 0.084
Mid Blend 1.840 0.065
Mid Growth 1.276 -0.158
Mid Value 1.222 0.081
In [ ]:
b_df = b_df.reset_index()
h_df = h_df.reset_index()
b_df['SR'] = b_df['index'].apply(lambda x: SR(ret[x]))
h_df['SR'] = h_df['index'].apply(lambda x: SR(ret[x]))
b_df = b_df.set_index('index')
h_df = h_df.set_index('index')

high_cost_df = b_df[b_df['cost'] == 'High-Cost']
med_cost_df = b_df[b_df['cost'] == 'Medium-Cost']
low_cost_df = b_df[b_df['cost'] == 'Low-Cost']
high = high_cost_df[['style','SR']].groupby('style').mean()
med = med_cost_df[['style','SR']].groupby('style').mean()
low = low_cost_df[['style','SR']].groupby('style').mean()
low = low.rename(columns={'SR':'Indv Low cost'})
med = med.rename(columns={'SR':'Indv Medium cost'})
high = high.rename(columns={'SR':'Indv High cost'})

overview = pd.concat([high,low,med],axis=1)
overview
Out[ ]:
Indv High cost Indv Low cost Indv Medium cost
style
Large Blend 0.411 0.454 0.535
Large Growth 0.502 0.300 0.144
Large Value 0.510 0.412 0.349
Mid Blend 0.319 NaN NaN
Mid Growth -0.467 NaN -0.838
Mid Value 0.377 0.618 NaN
In [ ]:
# Make the table for EW portfolios
for i in np.unique(b_df['style']):
    for z in np.unique(b_df['cost']):
        if len(ret[b_df[(b_df['cost'] == z) & (b_df['style'] == i)].index]) > 0:
            overview.at[i, z+' EW'] = SR(ret[b_df[(b_df['cost'] == z) & (b_df['style'] == i)].index].mean(axis=1))
        else:
            overview.at[i, z+' EW'] = np.NaN
In [ ]:
overview.sort_index()
Out[ ]:
Indv High cost Indv Low cost Indv Medium cost High-Cost EW Low-Cost EW Medium-Cost EW
style
Large Blend 0.411 0.454 0.535 0.437 0.567 0.511
Large Growth 0.502 0.300 0.144 0.522 0.453 0.559
Large Value 0.510 0.412 0.349 0.665 0.466 0.350
Mid Blend 0.319 NaN NaN 0.319 NaN NaN
Mid Growth -0.467 NaN -0.838 -0.467 NaN -0.838
Mid Value 0.377 0.618 NaN 0.377 0.618 NaN
In [ ]:
# Medium cost funds - SR
SR(ret[b_df[b_df['cost'] == 'Medium-Cost'].index].mean(axis=1))
Out[ ]:
0.508985553486398
In [ ]:
# Low cost funds - SR
SR(ret[b_df[b_df['cost'] == 'Low-Cost'].index].mean(axis=1))
Out[ ]:
0.5521841212281601
In [ ]:
# High cost funds - SR
SR(ret[b_df[b_df['cost'] == 'High-Cost'].index].mean(axis=1))
Out[ ]:
0.4584935614822083
In [ ]:
# All Equally Weighted - SR
SR(ret[b_df.dropna().index].mean(axis=1))
Out[ ]:
0.5020358660349766
In [ ]:
# total fund in the sample
len(b_df.dropna().index)
Out[ ]:
33
In [ ]:
# All cost categories by style
for i in np.unique(b_df['style']):
    print(i, SR(ret[b_df[(b_df['style'] == i)].index].mean(axis=1)))
Large Blend 0.5022681081655604
Large Growth 0.5530772801509415
Large Value 0.47552268187995933
Mid Blend 0.31908973059091944
Mid Growth -0.4517398496429241
Mid Value 0.5012274531032237

Report to Excel & Latex¶

In this section, we converted some of our results into Excel files. We also created some latex tables from the results to make it easier to input into our thesis.

In [ ]:
over_ = pd.concat([h_df,all_ir],axis=1)
over_[['exp','ret','style','cost','SR','ir']].to_excel(f'fund_in_{var}_overview.xlsx') # Sharpe, IR, and Style

factor(res_FFC_,FAMAC,ret,h=True, test_kit=True).to_excel(f'fund_testing_ind_in_{var}.xlsx') # Testing all funds on Carhart Regressions

factor(res_FFC_,FAMAC,ret,h=True, show_sign=True).to_excel(f'fund_famac_ind_net_in_{var}.xlsx') # Carhart Regressions Net
factor(res_FFC_,FAMAC,GROSS,h=True, show_sign=True).to_excel(f'fund_famac_ind_gross_in_{var}.xlsx') # Carhart Regressions Gross
In [ ]:
print(over_[['exp','ret','style','cost','SR','ir']].to_latex())
\begin{tabular}{lrrllrr}
\toprule
{} &   exp &    ret &         style &         cost &     SR &     ir \\
\midrule
ALFRED BERG GLOBAL                            & 1.393 &  0.066 &   Large Blend &  Medium-Cost &  0.467 & -0.599 \\
C WORLD WIDE GLOBALE AKSJER                   & 1.400 &  0.090 &  Large Growth &  Medium-Cost &  0.603 & -0.130 \\
C WORLD WIDE GLOBALE AKSJER ETISK             & 1.243 &  0.095 &  Large Growth &  Medium-Cost &  0.646 & -0.049 \\
C WORLD WIDE STABILE AKSJER                   & 1.600 &  0.067 &   Large Blend &    High-Cost &  0.440 & -0.442 \\
CARNEGIE WORLD WIDE ETISK II                  & 2.000 &  0.126 &           NaN &    High-Cost &  1.209 & -0.639 \\
DNB NOR KAPFORV.GLOBAL II                     & 1.510 &  0.086 &           NaN &    High-Cost &  0.678 & -0.440 \\
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J & 0.505 &  0.169 &           NaN &     Low-Cost &  1.266 &  0.773 \\
DNB NOR KAPFORV. POSTBANKEN GLOBAL            & 1.815 &  0.187 &           NaN &    High-Cost &  1.426 & -0.016 \\
DNB GLOBAL A                                  & 1.516 &  0.093 &   Large Blend &    High-Cost &  0.559 & -0.139 \\
DNB NOR KAPFORV.GLOBAL ETISK IV               & 0.614 &  0.190 &           NaN &     Low-Cost &  1.455 &  0.409 \\
DNB NOR KAPFORV.GLOBAL ETISK V                & 0.505 &  0.111 &           NaN &     Low-Cost &  0.886 & -0.118 \\
DNB GLOBAL LAVKARBON A                        & 0.671 &  0.079 &   Large Value &     Low-Cost &  0.435 & -0.063 \\
DNB NOR KAPFORV.GLOBAL SELEKTIV I             & 1.805 &  0.189 &           NaN &    High-Cost &  1.438 &  0.034 \\
DNB NOR KAPFORV. GLOBALSPAR                   & 1.805 &  0.173 &           NaN &    High-Cost &  1.337 & -0.722 \\
DNB NAVIGATOR A DEAD - Liquidated             & 1.856 & -0.094 &           NaN &    High-Cost & -0.363 & -1.014 \\
DELPHI GLOBAL A                               & 1.938 &  0.084 &  Large Growth &    High-Cost &  0.479 & -0.209 \\
DELPHI GREEN TRENDS A                         & 1.501 & -0.115 &    Mid Growth &    High-Cost & -0.467 & -0.732 \\
EIKA GLOBAL                                   & 1.758 &  0.064 &     Mid Value &    High-Cost &  0.377 & -0.831 \\
EIKA SPAR                                     & 1.840 &  0.065 &     Mid Blend &    High-Cost &  0.319 & -0.468 \\
FIRST GLOBAL FOCUS                            & 1.250 &  0.126 &   Large Value &  Medium-Cost &  0.371 &  0.260 \\
FRAM GLOBAL                                   & 2.000 &  0.046 &   Large Blend &    High-Cost &  0.234 & -0.503 \\
HOLBERG GLOBAL A                              & 1.236 &  0.092 &  Large Growth &  Medium-Cost &  0.551 & -0.116 \\
KLP AKSJE GLOBAL FLERFAK P                    & 0.270 &  0.058 &   Large Blend &     Low-Cost &  0.402 & -0.422 \\
NORDEA GLOBAL II DEAD - Merged:88750W         & 0.255 &  0.222 &           NaN &     Low-Cost &  0.705 &  0.253 \\
NORDEA GLOBAL NOK                             & 0.250 &  0.087 &   Large Blend &     Low-Cost &  0.512 & -0.232 \\
NORDEA INTERNASJONALE AKSJER                  & 1.449 &  0.097 &   Large Blend &  Medium-Cost &  0.781 & -0.560 \\
NORDEA INTERNASJONALE AKSJER II               & 1.019 &  0.106 &           NaN &     Low-Cost &  0.860 & -0.531 \\
NORDEA INTERNASJONALE AKSJER III              & 0.517 &  0.114 &           NaN &     Low-Cost &  0.919 & -0.345 \\
NORDEA STABILE AKSJER GLOBAL                  & 0.558 &  0.072 &   Large Value &     Low-Cost &  0.331 & -0.289 \\
NORDEA STABILE AKSJER GLOBAL ETISK            & 1.500 &  0.090 &   Large Value &    High-Cost &  0.687 & -0.134 \\
ODIN GLOBAL C                                 & 1.798 &  0.092 &  Large Growth &    High-Cost &  0.524 & -0.105 \\
ODIN GLOBAL II DEAD - Merged:74930E           & 0.927 &  0.008 &  Large Growth &     Low-Cost &  0.008 & -0.214 \\
ODIN FORVALTNING AS MARITIM NOK               & 2.003 & -0.024 &           NaN &    High-Cost & -0.163 & -1.044 \\
PLUSS UTLAND AKSJE                            & 1.200 &  0.083 &   Large Blend &  Medium-Cost &  0.491 & -0.374 \\
PLUSS UTLAND ETISK DEAD - Merged:88728F       & 1.200 &  0.084 &   Large Blend &  Medium-Cost &  0.497 & -0.316 \\
PARETO GLOBAL A                               & 1.458 &  0.074 &   Large Blend &  Medium-Cost &  0.439 & -0.153 \\
SKAGEN GLOBAL A NOK                           & 1.178 &  0.078 &  Large Growth &  Medium-Cost &  0.448 & -0.339 \\
SKAGEN GLOBAL II NOK                          & 0.724 &  0.077 &  Large Growth &     Low-Cost &  0.423 & -0.065 \\
SKAGEN INSIGHT DEAD - Liquidated              & 1.500 & -0.100 &           NaN &    High-Cost & -0.550 & -1.887 \\
SKAGEN VEKST A NOK                            & 1.093 &  0.062 &   Large Value &  Medium-Cost &  0.326 & -0.483 \\
SR-UTBYTTE A                                  & 1.638 &  0.073 &           NaN &    High-Cost &  0.351 & -0.074 \\
SPARE BANK 1 VERDEN VERDI C                   & 1.500 &  0.077 &   Large Value &    High-Cost &  0.333 & -0.001 \\
STOREBRAND INT INV.FUND BARNESPAR             & 1.500 &  0.057 &           NaN &    High-Cost &  0.353 & -0.744 \\
STOREBRAND EQUAL OPPORTUNITIES A              & 1.050 & -0.341 &  Large Growth &  Medium-Cost & -1.526 & -3.268 \\
STOREBRAND GLOBAL ESG                         & 0.402 &  0.084 &   Large Blend &     Low-Cost &  0.447 &  0.236 \\
STOREBRAND GLOBAL MULTIFACTOR A               & 0.686 &  0.098 &     Mid Value &     Low-Cost &  0.618 & -0.005 \\
STOREBRAND INTL.INV.FD. GLOBAL SRI            & 0.600 &  0.138 &           NaN &     Low-Cost &  0.986 & -0.660 \\
STOREBRAND GLOBAL SOLUTIONS A                 & 0.750 &  0.082 &  Large Growth &     Low-Cost &  0.470 &  0.030 \\
STOREBRAND GLOBAL VALUE A                     & 0.876 &  0.085 &   Large Value &     Low-Cost &  0.470 & -0.206 \\
STOREBRAND INTL.INV.FD. PENSJONSPAR           & 1.500 &  0.054 &           NaN &    High-Cost &  0.329 & -0.758 \\
STOREBRAND SMART CITIES A                     & 1.050 & -0.201 &    Mid Growth &  Medium-Cost & -0.838 & -1.109 \\
TERRA GLOBAL DEAD - Merged:88738D             & 1.166 &  0.178 &           NaN &  Medium-Cost &  1.506 & -0.415 \\
\bottomrule
\end{tabular}

In [ ]:
print(factor(res_FFC_,FAMAC,ret,h=True, test_kit=True).to_latex())
\begin{tabular}{llll}
\toprule
{} &  White &     BG &     JB \\
\midrule
ALFRED BERG GLOBAL                            &  False &   True &   True \\
C WORLD WIDE GLOBALE AKSJER                   &   True &  False &   True \\
C WORLD WIDE GLOBALE AKSJER ETISK             &   True &   True &   True \\
C WORLD WIDE STABILE AKSJER                   &  False &  False &  False \\
CARNEGIE WORLD WIDE ETISK II                  &  False &   True &  False \\
DNB NOR KAPFORV.GLOBAL II                     &   True &   True &   True \\
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J &   True &   True &   True \\
DNB NOR KAPFORV. POSTBANKEN GLOBAL            &   True &   True &   True \\
DNB GLOBAL A                                  &   True &   True &  False \\
DNB NOR KAPFORV.GLOBAL ETISK IV               &   True &   True &   True \\
DNB NOR KAPFORV.GLOBAL ETISK V                &   True &   True &   True \\
DNB GLOBAL LAVKARBON A                        &   True &   True &   True \\
DNB NOR KAPFORV.GLOBAL SELEKTIV I             &   True &   True &   True \\
DNB NOR KAPFORV. GLOBALSPAR                   &   True &   True &   True \\
DNB NAVIGATOR A DEAD - Liquidated             &   True &   True &   True \\
DELPHI GLOBAL A                               &  False &   True &  False \\
DELPHI GREEN TRENDS A                         &   True &   True &   True \\
EIKA GLOBAL                                   &   True &   True &   True \\
EIKA SPAR                                     &   True &   True &   True \\
FIRST GLOBAL FOCUS                            &  False &   True &   True \\
FRAM GLOBAL                                   &   True &   True &   True \\
HOLBERG GLOBAL A                              &  False &   True &   True \\
KLP AKSJE GLOBAL FLERFAK P                    &  False &   True &   True \\
NORDEA GLOBAL II DEAD - Merged:88750W         &   True &   True &   True \\
NORDEA GLOBAL NOK                             &  False &  False &  False \\
NORDEA INTERNASJONALE AKSJER                  &  False &  False &   True \\
NORDEA INTERNASJONALE AKSJER II               &  False &  False &   True \\
NORDEA INTERNASJONALE AKSJER III              &  False &  False &   True \\
NORDEA STABILE AKSJER GLOBAL                  &   True &   True &   True \\
NORDEA STABILE AKSJER GLOBAL ETISK            &   True &   True &   True \\
ODIN GLOBAL C                                 &   True &   True &   True \\
ODIN GLOBAL II DEAD - Merged:74930E           &   True &   True &   True \\
ODIN FORVALTNING AS MARITIM NOK               &   True &   True &   True \\
PLUSS UTLAND AKSJE                            &   True &   True &  False \\
PLUSS UTLAND ETISK DEAD - Merged:88728F       &  False &   True &  False \\
PARETO GLOBAL A                               &   True &   True &   True \\
SKAGEN GLOBAL A NOK                           &  False &   True &   True \\
SKAGEN GLOBAL II NOK                          &  False &   True &   True \\
SKAGEN INSIGHT DEAD - Liquidated              &   True &   True &   True \\
SKAGEN VEKST A NOK                            &   True &   True &   True \\
SR-UTBYTTE A                                  &   True &   True &   True \\
SPARE BANK 1 VERDEN VERDI C                   &   True &   True &   True \\
STOREBRAND INT INV.FUND BARNESPAR             &  False &   True &   True \\
STOREBRAND EQUAL OPPORTUNITIES A              &  False &   True &   True \\
STOREBRAND GLOBAL ESG                         &   True &   True &   True \\
STOREBRAND GLOBAL MULTIFACTOR A               &  False &   True &  False \\
STOREBRAND INTL.INV.FD. GLOBAL SRI            &   True &   True &   True \\
STOREBRAND GLOBAL SOLUTIONS A                 &  False &   True &  False \\
STOREBRAND GLOBAL VALUE A                     &  False &   True &   True \\
STOREBRAND INTL.INV.FD. PENSJONSPAR           &  False &   True &   True \\
STOREBRAND SMART CITIES A                     &  False &   True &   True \\
TERRA GLOBAL DEAD - Merged:88738D             &   True &   True &   True \\
\bottomrule
\end{tabular}

In [ ]:
print(factor(res_FFC_,FAMAC,ret,h=True, show_sign=True).to_latex())
\begin{tabular}{llllllr}
\toprule
{} &       Alpha &     Mkt-RF &         SMB &         HML &        MOM &  ADJ\_R\_SQ \\
\midrule
ALFRED BERG GLOBAL                            &  -0.0037*** &  0.8996*** &    -0.1172* &     -0.0312 &  0.2828*** &     0.902 \\
C WORLD WIDE GLOBALE AKSJER                   &      -0.001 &  0.9089*** &   -0.2155** &  -0.2767*** &     0.105* &     0.875 \\
C WORLD WIDE GLOBALE AKSJER ETISK             &     -0.0004 &  0.8796*** &   -0.1887** &    -0.27*** &    0.1231* &     0.866 \\
C WORLD WIDE STABILE AKSJER                   &    -0.0029* &  0.8823*** &     -0.1615 &      0.0538 &    0.1657* &     0.767 \\
CARNEGIE WORLD WIDE ETISK II                  &     -0.0031 &  0.7555*** &      -0.298 &      0.3213 &     0.3354 &     0.582 \\
DNB NOR KAPFORV.GLOBAL II                     &     -0.0009 &  1.0171*** &     -0.0708 &    0.1847** &      -0.02 &     0.958 \\
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J &      0.0013 &  1.0588*** &      0.0003 &       -0.04 &    -0.0255 &     0.956 \\
DNB NOR KAPFORV. POSTBANKEN GLOBAL            &     -0.0009 &  1.0557*** &     -0.0913 &      -0.003 &    -0.0134 &     0.961 \\
DNB GLOBAL A                                  &     -0.0007 &  1.0429*** &  -0.1342*** &   0.1596*** &    -0.0417 &     0.955 \\
DNB NOR KAPFORV.GLOBAL ETISK IV               &      0.0004 &  1.0627*** &   -0.2009** &     -0.0043 &    -0.0507 &     0.959 \\
DNB NOR KAPFORV.GLOBAL ETISK V                &     -0.0003 &  1.0606*** &      0.0341 &   0.1625*** &   -0.0836* &     0.942 \\
DNB GLOBAL LAVKARBON A                        &     -0.0018 &  0.9844*** &     -0.1161 &      0.0669 &  0.2604*** &     0.931 \\
DNB NOR KAPFORV.GLOBAL SELEKTIV I             &     -0.0008 &  1.0528*** &     -0.0953 &      0.0035 &     -0.013 &     0.961 \\
DNB NOR KAPFORV. GLOBALSPAR                   &     -0.0005 &   1.019*** &     -0.0066 &     -0.0376 &     -0.081 &     0.970 \\
DNB NAVIGATOR A DEAD - Liquidated             &   -0.015*** &  1.5086*** &    0.7404** &    1.135*** &     0.0853 &     0.661 \\
DELPHI GLOBAL A                               &     -0.0021 &  1.0451*** &      0.0861 &     -0.1491 &     0.1194 &     0.834 \\
DELPHI GREEN TRENDS A                         &      0.0043 &  1.0772*** &      0.6239 &  -0.6633*** &     0.2225 &     0.758 \\
EIKA GLOBAL                                   &  -0.0033*** &  1.0345*** &     -0.0142 &   0.2244*** &     0.0362 &     0.942 \\
EIKA SPAR                                     &  -0.0044*** &  1.2058*** &      0.1415 &    0.357*** &     0.0666 &     0.895 \\
FIRST GLOBAL FOCUS                            &     0.0086* &   1.358*** &   0.9886*** &   0.5892*** &    -0.4019 &     0.789 \\
FRAM GLOBAL                                   &      -0.003 &  0.9412*** &   0.5524*** &   0.3402*** &      0.034 &     0.681 \\
HOLBERG GLOBAL A                              &     -0.0006 &  1.0132*** &     -0.0134 &  -0.1816*** &    -0.0151 &     0.893 \\
KLP AKSJE GLOBAL FLERFAK P                    &     -0.0014 &  0.8098*** &  -0.2752*** &      0.0908 &     0.0704 &     0.901 \\
NORDEA GLOBAL II DEAD - Merged:88750W         &     -0.0042 &  1.5486*** &     -0.0533 &    0.3509** &   0.4349** &     0.925 \\
NORDEA GLOBAL NOK                             &     -0.0019 &  1.0671*** &     -0.1185 &     -0.0373 &     0.0389 &     0.915 \\
NORDEA INTERNASJONALE AKSJER                  &     -0.0015 &  1.0131*** &     -0.0739 &      0.0448 &    -0.0739 &     0.881 \\
NORDEA INTERNASJONALE AKSJER II               &     -0.0017 &  1.0316*** &      -0.077 &      0.0655 &    -0.0708 &     0.885 \\
NORDEA INTERNASJONALE AKSJER III              &     -0.0011 &   1.034*** &     -0.0867 &      0.0644 &    -0.0678 &     0.883 \\
NORDEA STABILE AKSJER GLOBAL                  &   -0.0055** &  1.2971*** &     -0.2026 &   0.4356*** &     0.1535 &     0.848 \\
NORDEA STABILE AKSJER GLOBAL ETISK            &     -0.0001 &  0.8073*** &  -0.2386*** &   0.2183*** &    0.1037* &     0.846 \\
ODIN GLOBAL C                                 &     -0.0003 &  1.0214*** &      0.0276 &  -0.3059*** &    -0.0913 &     0.880 \\
ODIN GLOBAL II DEAD - Merged:74930E           &     -0.0001 &  1.2175*** &     -0.2189 &      0.7665 &     0.1144 &     0.713 \\
ODIN FORVALTNING AS MARITIM NOK               &    -0.0093* &  1.2034*** &   1.2266*** &      0.5186 &    -0.1983 &     0.638 \\
PLUSS UTLAND AKSJE                            &   -0.0021** &  1.0614*** &  -0.2144*** &     -0.0438 &    -0.0033 &     0.939 \\
PLUSS UTLAND ETISK DEAD - Merged:88728F       &     -0.002* &  1.0515*** &   -0.1775** &    -0.0878* &     0.0139 &     0.922 \\
PARETO GLOBAL A                               &     -0.0014 &  1.0821*** &      0.0579 &   0.1854*** &    -0.0837 &     0.907 \\
SKAGEN GLOBAL A NOK                           &     -0.0021 &  1.0169*** &  -0.3904*** &  -0.2241*** &    -0.0864 &     0.878 \\
SKAGEN GLOBAL II NOK                          &     -0.0009 &  0.9925*** &  -0.4437*** &  -0.2734*** &     -0.055 &     0.892 \\
SKAGEN INSIGHT DEAD - Liquidated              &   -0.0066** &  1.3464*** &      0.3842 &   0.8019*** &     0.1294 &     0.875 \\
SKAGEN VEKST A NOK                            &   -0.0031** &   1.081*** &    0.2042** &   0.3504*** &    -0.0067 &     0.855 \\
SR-UTBYTTE A                                  &     -0.0015 &  1.1924*** &      0.1752 &   0.5396*** &    0.1783* &     0.841 \\
SPARE BANK 1 VERDEN VERDI C                   &     -0.0019 &  0.9874*** &      0.0539 &   0.4033*** &     0.1477 &     0.859 \\
STOREBRAND INT INV.FUND BARNESPAR             &     -0.0022 &  1.0323*** &     -0.0554 &    0.4044** &    -0.1704 &     0.882 \\
STOREBRAND EQUAL OPPORTUNITIES A              &  -0.0137*** &  0.9621*** &     -0.2173 &  -0.3054*** &     0.1627 &     0.920 \\
STOREBRAND GLOBAL ESG                         &     -0.0005 &  0.9964*** &  -0.2065*** &   -0.0574** &     0.0308 &     0.988 \\
STOREBRAND GLOBAL MULTIFACTOR A               &        -0.0 &  1.0049*** &    0.2378** &   0.2777*** &    0.0862* &     0.942 \\
STOREBRAND INTL.INV.FD. GLOBAL SRI            &     -0.0032 &  0.9655*** &      -0.284 &       0.352 &    -0.0617 &     0.808 \\
STOREBRAND GLOBAL SOLUTIONS A                 &      0.0004 &  0.9835*** &      0.1176 &    -0.1494* &      -0.04 &     0.869 \\
STOREBRAND GLOBAL VALUE A                     &     -0.0005 &  1.0531*** &   0.2204*** &   0.4722*** &    -0.0819 &     0.937 \\
STOREBRAND INTL.INV.FD. PENSJONSPAR           &     -0.0024 &   1.058*** &     -0.0335 &    0.4218** &    -0.1857 &     0.888 \\
STOREBRAND SMART CITIES A                     &      0.0028 &  1.0247*** &       0.325 &    -0.1986* &    -0.1992 &     0.930 \\
TERRA GLOBAL DEAD - Merged:88738D             &     -0.0013 &  0.9715*** &     -0.0605 &      0.0473 &     0.0293 &     0.892 \\
\bottomrule
\end{tabular}

In [ ]:
print(factor(res_FFC_,FAMAC,GROSS,h=True, show_sign=True).to_latex())
\begin{tabular}{llllllr}
\toprule
{} &       Alpha &     Mkt-RF &         SMB &         HML &        MOM &  ADJ\_R\_SQ \\
\midrule
ALFRED BERG GLOBAL                            &   -0.0026** &  0.8997*** &    -0.1161* &     -0.0308 &  0.2831*** &     0.902 \\
C WORLD WIDE GLOBALE AKSJER                   &      0.0001 &  0.9089*** &   -0.2155** &  -0.2767*** &     0.105* &     0.875 \\
C WORLD WIDE GLOBALE AKSJER ETISK             &      0.0006 &  0.8795*** &   -0.1892** &  -0.2684*** &    0.124** &     0.866 \\
C WORLD WIDE STABILE AKSJER                   &     -0.0016 &  0.8823*** &     -0.1615 &      0.0538 &    0.1657* &     0.767 \\
CARNEGIE WORLD WIDE ETISK II                  &     -0.0014 &  0.7555*** &      -0.298 &      0.3213 &     0.3354 &     0.582 \\
DNB NOR KAPFORV.GLOBAL II                     &      0.0003 &  1.0171*** &     -0.0709 &    0.1848** &      -0.02 &     0.958 \\
DNB NOR KAPFORV.GLOBAL V DEAD - Merged:72937J &      0.0017 &  1.0588*** &         0.0 &       -0.04 &    -0.0255 &     0.956 \\
DNB NOR KAPFORV. POSTBANKEN GLOBAL            &      0.0007 &  1.0557*** &     -0.0914 &      -0.003 &    -0.0134 &     0.961 \\
DNB GLOBAL A                                  &      0.0006 &  1.0433*** &  -0.1341*** &   0.1594*** &    -0.0409 &     0.955 \\
DNB NOR KAPFORV.GLOBAL ETISK IV               &      0.0009 &  1.0626*** &   -0.2011** &     -0.0043 &    -0.0507 &     0.959 \\
DNB NOR KAPFORV.GLOBAL ETISK V                &      0.0001 &  1.0606*** &       0.034 &   0.1625*** &   -0.0837* &     0.942 \\
DNB GLOBAL LAVKARBON A                        &     -0.0012 &  0.9843*** &     -0.1163 &      0.0665 &  0.2599*** &     0.931 \\
DNB NOR KAPFORV.GLOBAL SELEKTIV I             &      0.0008 &  1.0528*** &     -0.0955 &      0.0035 &    -0.0131 &     0.961 \\
DNB NOR KAPFORV. GLOBALSPAR                   &       0.001 &  1.0189*** &     -0.0068 &     -0.0377 &     -0.081 &     0.970 \\
DNB NAVIGATOR A DEAD - Liquidated             &  -0.0134*** &  1.5089*** &    0.7401** &   1.1371*** &     0.0865 &     0.661 \\
DELPHI GLOBAL A                               &     -0.0005 &  1.0451*** &      0.0876 &    -0.1515* &     0.1176 &     0.834 \\
DELPHI GREEN TRENDS A                         &      0.0055 &  1.0772*** &      0.6239 &  -0.6633*** &     0.2225 &     0.758 \\
EIKA GLOBAL                                   &    -0.0018* &  1.0332*** &     -0.0202 &   0.2213*** &     0.0325 &     0.941 \\
EIKA SPAR                                     &    -0.0028* &   1.206*** &      0.1426 &   0.3572*** &     0.0669 &     0.895 \\
FIRST GLOBAL FOCUS                            &     0.0096* &   1.358*** &   0.9886*** &   0.5892*** &    -0.4019 &     0.789 \\
FRAM GLOBAL                                   &     -0.0013 &  0.9412*** &   0.5524*** &   0.3402*** &      0.034 &     0.681 \\
HOLBERG GLOBAL A                              &      0.0004 &  1.0127*** &     -0.0149 &  -0.1824*** &    -0.0159 &     0.893 \\
KLP AKSJE GLOBAL FLERFAK P                    &     -0.0011 &  0.8098*** &  -0.2752*** &      0.0908 &     0.0704 &     0.901 \\
NORDEA GLOBAL II DEAD - Merged:88750W         &      -0.004 &  1.5486*** &     -0.0533 &    0.3508** &   0.4348** &     0.925 \\
NORDEA GLOBAL NOK                             &     -0.0016 &  1.0671*** &     -0.1185 &     -0.0373 &     0.0389 &     0.915 \\
NORDEA INTERNASJONALE AKSJER                  &     -0.0003 &   1.013*** &     -0.0718 &      0.0429 &    -0.0753 &     0.881 \\
NORDEA INTERNASJONALE AKSJER II               &     -0.0008 &  1.0317*** &     -0.0768 &      0.0654 &    -0.0709 &     0.885 \\
NORDEA INTERNASJONALE AKSJER III              &     -0.0007 &  1.0341*** &     -0.0865 &      0.0643 &    -0.0679 &     0.883 \\
NORDEA STABILE AKSJER GLOBAL                  &   -0.0051** &  1.2971*** &     -0.2028 &   0.4355*** &     0.1533 &     0.848 \\
NORDEA STABILE AKSJER GLOBAL ETISK            &      0.0011 &  0.8073*** &  -0.2386*** &   0.2183*** &    0.1037* &     0.846 \\
ODIN GLOBAL C                                 &      0.0012 &  1.0215*** &      0.0289 &  -0.3057*** &    -0.0909 &     0.880 \\
ODIN GLOBAL II DEAD - Merged:74930E           &      0.0006 &  1.2175*** &     -0.2186 &      0.7665 &     0.1145 &     0.713 \\
ODIN FORVALTNING AS MARITIM NOK               &     -0.0077 &  1.2034*** &   1.2266*** &      0.5185 &    -0.1984 &     0.638 \\
PLUSS UTLAND AKSJE                            &     -0.0011 &  1.0614*** &  -0.2144*** &     -0.0438 &    -0.0033 &     0.939 \\
PLUSS UTLAND ETISK DEAD - Merged:88728F       &      -0.001 &  1.0515*** &   -0.1775** &    -0.0878* &     0.0139 &     0.922 \\
PARETO GLOBAL A                               &     -0.0002 &  1.0835*** &      0.0579 &   0.1862*** &    -0.0826 &     0.910 \\
SKAGEN GLOBAL A NOK                           &     -0.0011 &  1.0163*** &  -0.3924*** &  -0.2174*** &    -0.0829 &     0.878 \\
SKAGEN GLOBAL II NOK                          &     -0.0002 &  0.9927*** &  -0.4446*** &  -0.2743*** &    -0.0556 &     0.892 \\
SKAGEN INSIGHT DEAD - Liquidated              &     -0.0054 &  1.3464*** &      0.3842 &   0.8019*** &     0.1294 &     0.875 \\
SKAGEN VEKST A NOK                            &     -0.0022 &  1.0808*** &    0.2056** &   0.3501*** &    -0.0066 &     0.855 \\
SR-UTBYTTE A                                  &     -0.0002 &  1.1922*** &      0.1758 &   0.5393*** &    0.1779* &     0.841 \\
SPARE BANK 1 VERDEN VERDI C                   &     -0.0006 &  0.9874*** &      0.0539 &   0.4033*** &     0.1477 &     0.859 \\
STOREBRAND INT INV.FUND BARNESPAR             &     -0.0009 &  1.0323*** &     -0.0554 &    0.4044** &    -0.1704 &     0.882 \\
STOREBRAND EQUAL OPPORTUNITIES A              &  -0.0129*** &  0.9621*** &     -0.2173 &  -0.3054*** &     0.1627 &     0.920 \\
STOREBRAND GLOBAL ESG                         &     -0.0002 &  0.9964*** &  -0.2065*** &   -0.0574** &     0.0307 &     0.988 \\
STOREBRAND GLOBAL MULTIFACTOR A               &      0.0005 &  1.0046*** &    0.2382** &   0.2773*** &    0.0856* &     0.942 \\
STOREBRAND INTL.INV.FD. GLOBAL SRI            &     -0.0027 &  0.9655*** &      -0.284 &       0.352 &    -0.0617 &     0.808 \\
STOREBRAND GLOBAL SOLUTIONS A                 &      0.0011 &  0.9835*** &      0.1176 &    -0.1494* &      -0.04 &     0.869 \\
STOREBRAND GLOBAL VALUE A                     &      0.0002 &  1.0542*** &   0.2204*** &   0.4741*** &    -0.0795 &     0.937 \\
STOREBRAND INTL.INV.FD. PENSJONSPAR           &     -0.0012 &   1.058*** &     -0.0335 &    0.4218** &    -0.1857 &     0.888 \\
STOREBRAND SMART CITIES A                     &      0.0037 &  1.0247*** &       0.325 &    -0.1986* &    -0.1992 &     0.930 \\
TERRA GLOBAL DEAD - Merged:88738D             &     -0.0003 &  0.9698*** &     -0.0704 &      0.0445 &     0.0278 &     0.890 \\
\bottomrule
\end{tabular}

Robustness Outliers¶

In this section, we removed outliers from our main dataset and performed some of the analyses already conducted above.

Making the dataset without outliers¶

In [ ]:
no_outlier = res_FFC[(res_FFC['Alpha'] > res_FFC['Alpha'].quantile(0.05)) & (res_FFC['Alpha'] < res_FFC['Alpha'].quantile(0.95))]
no_outlier_GROSS = res_FFC_GROSS[(res_FFC_GROSS['Alpha'] > res_FFC_GROSS['Alpha'].quantile(0.05)) & (res_FFC_GROSS['Alpha'] < res_FFC_GROSS['Alpha'].quantile(0.95))]

no_outlier_outliers = res_FFC_GROSS[(res_FFC_GROSS['Alpha'] < res_FFC_GROSS['Alpha'].quantile(0.05)) | (res_FFC_GROSS['Alpha'] > res_FFC_GROSS['Alpha'].quantile(0.95))]
no_outliers_outliers = pd.concat([pd.DataFrame(exp.mean()),no_outlier_outliers],axis=1).dropna()

no_outliers = pd.concat([pd.DataFrame(exp.mean()),no_outlier],axis=1).dropna()
no_outliers_GROSS = pd.concat([pd.DataFrame(exp.mean()),no_outlier_GROSS],axis=1).dropna()

robust_funds = no_outliers.index
cheap_fund_no_outliers = [i for i in no_outliers.index if i in cheap_funds] 
medium_fund_no_outliers = [i for i in no_outliers.index if i in medium_funds] 
expensive_fund_no_outliers = [i for i in no_outliers.index if i in expensive_funds] 

Carhart 4 Alphas on Expense Ratio¶

Gross return Carhart 4 Alphas on Expense Ratio - No outliers¶

In [ ]:
reg(no_outliers_GROSS[0]/100, (no_outliers_GROSS['Alpha']+1)**12-1, h=True)
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  Alpha   R-squared:                       0.010
Model:                            OLS   Adj. R-squared:                 -0.013
Method:                 Least Squares   F-statistic:                    0.3379
Date:                Sun, 25 Jun 2023   Prob (F-statistic):              0.564
Time:                        15:40:04   Log-Likelihood:                 119.31
No. Observations:                  46   AIC:                            -234.6
Df Residuals:                      44   BIC:                            -231.0
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0123      0.008     -1.582      0.114      -0.028       0.003
0              0.3456      0.595      0.581      0.561      -0.820       1.511
==============================================================================
Omnibus:                       10.902   Durbin-Watson:                   1.734
Prob(Omnibus):                  0.004   Jarque-Bera (JB):               10.528
Skew:                          -1.027   Prob(JB):                      0.00517
Kurtosis:                       4.128   Cond. No.                         194.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction

Net return Carhart 4 Alphas on Expense Ratio - No outliers¶

In [ ]:
reg(no_outliers[0]/100, (no_outliers['Alpha']+1)**12-1, h=True)
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  Alpha   R-squared:                       0.033
Model:                            OLS   Adj. R-squared:                  0.011
Method:                 Least Squares   F-statistic:                     1.175
Date:                Sun, 25 Jun 2023   Prob (F-statistic):              0.284
Time:                        15:40:04   Log-Likelihood:                 119.75
No. Observations:                  46   AIC:                            -235.5
Df Residuals:                      44   BIC:                            -231.9
Df Model:                           1                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0123      0.008     -1.594      0.111      -0.028       0.003
0             -0.6392      0.590     -1.084      0.278      -1.795       0.517
==============================================================================
Omnibus:                       10.866   Durbin-Watson:                   1.735
Prob(Omnibus):                  0.004   Jarque-Bera (JB):               10.480
Skew:                          -1.025   Prob(JB):                      0.00530
Kurtosis:                       4.125   Cond. No.                         194.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction

Plotting Gross return Carhart 4 Alphas on Expense Ratio¶

In [ ]:
from scipy.interpolate import UnivariateSpline
# Plotting and uses a basic Regression line based on the output from the Regression above
coef = reg(no_outliers_GROSS[0]/100, (no_outliers_GROSS['Alpha']+1)**12-1, returns=True)
plt.xlabel('Expense ratio')
plt.ylabel('Annualized 4-Factor Alpha')
line = lambda x: coef.params['const']+x*coef.params[0]
plt.scatter(no_outliers_GROSS[0]/100, (no_outliers_GROSS['Alpha']+1)**12-1,label='Fund',color='grey')
plt.scatter(no_outliers_outliers[0]/100, (no_outliers_outliers['Alpha']+1)**12-1,color='red',label='Outlier')

# Plotting Non-parametric line
spl = UnivariateSpline(no_outliers_GROSS.sort_values(0)[0]/100,(no_outliers_GROSS.sort_values(0)['Alpha']+1)**12-1)

v = np.linspace(0.2,2,100)/100

ys = spl(v)

plt.plot(v,ys, label='Non-parametric line')
plt.plot(v,line(v), color='black', label='Linear Regression line')
plt.ylim(-0.3,0.2)
plt.xlim(0.1/100, 2.2/100)
plt.axvline(x=cheap/100, c='g', ls='--',label='Low/Medium cost')
plt.axvline(x=medium/100, c='y', ls='--',label='Medium/High cost')
plt.title(f'Carhart 4 Alpha on Expense Ratio')
plt.legend()
Out[ ]:
<matplotlib.legend.Legend at 0x7fc80a4db190>

Equally Weighted Portfolios - FFC - No outliers - Cost groups¶

All funds (without outliers)¶

In [ ]:
EW(FAMAC, returns=ret[robust_funds],h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.975
Model:                            OLS   Adj. R-squared:                  0.974
Method:                 Least Squares   F-statistic:                     1488.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          5.50e-105
Time:                        15:40:04   Log-Likelihood:                 468.91
No. Observations:                 131   AIC:                            -927.8
Df Residuals:                     126   BIC:                            -913.4
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0018      0.001     -3.147      0.002      -0.003      -0.001
Mkt-RF         1.0208      0.015     68.066      0.000       0.991       1.050
SMB           -0.0418      0.043     -0.971      0.332      -0.126       0.043
HML            0.0787      0.021      3.793      0.000       0.038       0.119
MOM            0.0426      0.030      1.415      0.157      -0.016       0.102
==============================================================================
Omnibus:                        0.192   Durbin-Watson:                   2.207
Prob(Omnibus):                  0.908   Jarque-Bera (JB):                0.340
Skew:                          -0.068   Prob(JB):                        0.844
Kurtosis:                       2.791   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc7d8523280>

Low-cost funds¶

In [ ]:
EW(FAMAC, returns=ret[cheap_fund_no_outliers],h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.976
Model:                            OLS   Adj. R-squared:                  0.975
Method:                 Least Squares   F-statistic:                     1253.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          2.18e-100
Time:                        15:40:04   Log-Likelihood:                 469.57
No. Observations:                 131   AIC:                            -929.1
Df Residuals:                     126   BIC:                            -914.8
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0013      0.001     -2.225      0.026      -0.002      -0.000
Mkt-RF         1.0469      0.017     62.956      0.000       1.014       1.079
SMB           -0.0648      0.045     -1.432      0.152      -0.154       0.024
HML            0.1117      0.021      5.393      0.000       0.071       0.152
MOM            0.0300      0.030      1.003      0.316      -0.029       0.089
==============================================================================
Omnibus:                        3.272   Durbin-Watson:                   2.430
Prob(Omnibus):                  0.195   Jarque-Bera (JB):                3.544
Skew:                           0.065   Prob(JB):                        0.170
Kurtosis:                       3.795   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a6f8b50>

Medium-cost funds¶

In [ ]:
EW(FAMAC, returns=ret[medium_fund_no_outliers],h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.961
Model:                            OLS   Adj. R-squared:                  0.960
Method:                 Least Squares   F-statistic:                     657.7
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           2.31e-83
Time:                        15:40:04   Log-Likelihood:                 443.64
No. Observations:                 131   AIC:                            -877.3
Df Residuals:                     126   BIC:                            -862.9
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0018      0.001     -2.457      0.014      -0.003      -0.000
Mkt-RF         0.9927      0.019     50.929      0.000       0.955       1.031
SMB           -0.1317      0.051     -2.573      0.010      -0.232      -0.031
HML           -0.0762      0.030     -2.553      0.011      -0.135      -0.018
MOM            0.0489      0.042      1.175      0.240      -0.033       0.130
==============================================================================
Omnibus:                        1.782   Durbin-Watson:                   2.066
Prob(Omnibus):                  0.410   Jarque-Bera (JB):                1.735
Skew:                          -0.276   Prob(JB):                        0.420
Kurtosis:                       2.887   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc80a4822e0>

High-cost funds¶

In [ ]:
EW(FAMAC, returns=ret[expensive_fund_no_outliers],h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.960
Model:                            OLS   Adj. R-squared:                  0.959
Method:                 Least Squares   F-statistic:                     842.3
Date:                Sun, 25 Jun 2023   Prob (F-statistic):           7.49e-90
Time:                        15:40:04   Log-Likelihood:                 438.00
No. Observations:                 131   AIC:                            -866.0
Df Residuals:                     126   BIC:                            -851.6
Df Model:                           4                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0023      0.001     -2.956      0.003      -0.004      -0.001
Mkt-RF         1.0191      0.019     52.333      0.000       0.981       1.057
SMB            0.0498      0.052      0.958      0.338      -0.052       0.152
HML            0.1805      0.028      6.384      0.000       0.125       0.236
MOM            0.0568      0.038      1.492      0.136      -0.018       0.131
==============================================================================
Omnibus:                        0.406   Durbin-Watson:                   2.154
Prob(Omnibus):                  0.816   Jarque-Bera (JB):                0.564
Skew:                           0.070   Prob(JB):                        0.754
Kurtosis:                       2.710   Cond. No.                         69.3
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc8189c5100>

Fama-French five-factor regression¶

In this section, we ran the Fama-french five-factor regression on our dataset. This is a part of the appendix in our thesis, therefor the section is last in our code.

In [ ]:
res_FF5 = factor(res_FF5_,FAMA5,ret,h=True)
res_FF5_GROSS = factor(res_FF5_,FAMA5,GROSS,h=True)

res_FF5_level = factor(res_FF5_,FAMA5,ret,h=True,level=0.1)
res_FF5_GROSS_level = factor(res_FF5_,FAMA5,GROSS,h=True,level=0.1)
In [ ]:
print(f'''There are {len(res_FF5)} individual funds, from these {len(res_FF5[res_FF5['Alpha'] > 0])} generated alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF5_GROSS[res_FF5_GROSS['Alpha'] > 0])} funds''')


print(f'''There are {len(res_FF5)} individual funds, from these {len(res_FF5[res_FF5['Alpha'] < 0])} negative alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF5_GROSS[res_FF5_GROSS['Alpha'] < 0])} funds''')


print(f'''

10% significance

There are {len(res_FF5_level)} individual funds, from these {len(res_FF5_level[res_FF5_level['Alpha'] > 0])} generated alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF5_GROSS_level[res_FF5_GROSS_level['Alpha'] > 0])} funds''')


print(f'''There are {len(res_FF5_level)} individual funds, from these {len(res_FF5_level[res_FF5_level['Alpha'] < 0])} negative alpha if we looking 
at after fee numbers
Before fee there are {len(res_FF5_GROSS_level[res_FF5_GROSS_level['Alpha'] < 0])} funds''')
There are 52 individual funds, from these 8 generated alpha if we looking 
at after fee numbers
Before fee there are 16 funds
There are 52 individual funds, from these 44 negative alpha if we looking 
at after fee numbers
Before fee there are 36 funds


10% significance

There are 52 individual funds, from these 0 generated alpha if we looking 
at after fee numbers
Before fee there are 1 funds
There are 52 individual funds, from these 14 negative alpha if we looking 
at after fee numbers
Before fee there are 7 funds
In [ ]:
res_FF5.describe()
Out[ ]:
Alpha Mkt-RF SMB HML RMW CMA ADJ_R_SQ
count 52.000 52.000 52.000 52.000 52.000 52.000 52.000
mean -0.002 1.052 0.029 0.129 0.008 -0.014 0.877
std 0.003 0.158 0.299 0.466 0.425 0.454 0.089
min -0.014 0.787 -0.416 -1.285 -0.951 -1.285 0.565
25% -0.003 0.982 -0.156 -0.157 -0.209 -0.308 0.865
50% -0.002 1.026 -0.055 0.068 0.008 -0.002 0.897
75% -0.001 1.083 0.179 0.321 0.183 0.182 0.938
max 0.010 1.549 0.985 1.353 1.246 1.064 0.988
In [ ]:
res_FF5_GROSS.describe()
Out[ ]:
Alpha Mkt-RF SMB HML RMW CMA ADJ_R_SQ
count 52.000 52.000 52.000 52.000 52.000 52.000 52.000
mean -0.001 1.052 0.028 0.129 0.007 -0.014 0.877
std 0.003 0.158 0.299 0.466 0.425 0.454 0.089
min -0.013 0.787 -0.417 -1.285 -0.951 -1.285 0.565
25% -0.002 0.982 -0.155 -0.157 -0.209 -0.305 0.865
50% -0.001 1.025 -0.055 0.068 0.009 0.000 0.897
75% 0.000 1.084 0.180 0.321 0.182 0.182 0.938
max 0.011 1.549 0.985 1.353 1.246 1.064 0.988
In [ ]:
EW(FAMA5,h=True)
EW(FAMA5,returns=GROSS,h=True)
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.974
Model:                            OLS   Adj. R-squared:                  0.973
Method:                 Least Squares   F-statistic:                     1514.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          5.59e-110
Time:                        15:40:05   Log-Likelihood:                 462.89
No. Observations:                 131   AIC:                            -913.8
Df Residuals:                     125   BIC:                            -896.5
Df Model:                           5                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0023      0.001     -4.078      0.000      -0.003      -0.001
Mkt-RF         1.0408      0.015     67.950      0.000       1.011       1.071
SMB            0.0413      0.050      0.822      0.411      -0.057       0.140
HML            0.0667      0.059      1.131      0.258      -0.049       0.182
RMW            0.0556      0.061      0.915      0.360      -0.063       0.175
CMA            0.0570      0.086      0.659      0.510      -0.112       0.226
==============================================================================
Omnibus:                        0.491   Durbin-Watson:                   2.309
Prob(Omnibus):                  0.782   Jarque-Bera (JB):                0.396
Skew:                           0.134   Prob(JB):                        0.820
Kurtosis:                       2.982   Cond. No.                         141.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Equaly weighted
                            OLS Regression Results                            
==============================================================================
Dep. Variable:                  EW-RF   R-squared:                       0.974
Model:                            OLS   Adj. R-squared:                  0.973
Method:                 Least Squares   F-statistic:                     1522.
Date:                Sun, 25 Jun 2023   Prob (F-statistic):          3.96e-110
Time:                        15:40:05   Log-Likelihood:                 463.10
No. Observations:                 131   AIC:                            -914.2
Df Residuals:                     125   BIC:                            -897.0
Df Model:                           5                                         
Covariance Type:                  HAC                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -0.0013      0.001     -2.297      0.022      -0.002      -0.000
Mkt-RF         1.0408      0.015     68.128      0.000       1.011       1.071
SMB            0.0408      0.050      0.815      0.415      -0.057       0.139
HML            0.0665      0.059      1.126      0.260      -0.049       0.182
RMW            0.0550      0.061      0.906      0.365      -0.064       0.174
CMA            0.0573      0.086      0.664      0.507      -0.112       0.227
==============================================================================
Omnibus:                        0.501   Durbin-Watson:                   2.316
Prob(Omnibus):                  0.778   Jarque-Bera (JB):                0.408
Skew:                           0.136   Prob(JB):                        0.815
Kurtosis:                       2.980   Cond. No.                         141.
==============================================================================

Notes:
[1] Standard Errors are heteroscedasticity and autocorrelation robust (HAC) using 1 lags and without small sample correction
Out[ ]:
<statsmodels.regression.linear_model.RegressionResultsWrapper at 0x7fc8189b6b20>
In [ ]:
 
In [ ]: