Beispiel #1
0
                                        min_periods)
    cum_return_df_other = m.cumulative_return(df_data_other,
                                              columns_name_other,
                                              window_length, min_periods)
    ### Rolling sortino ratio
    rolling_sortino_ratio_df = m.rolling_sortino_ratio(df_data, columns_name,
                                                       window_length,
                                                       min_periods, MAR,
                                                       threshold)
    ### Rolling omega ratio
    rolling_omega_ratio_df = m.rolling_omega_ratio(df_data, columns_name,
                                                   window_length, min_periods,
                                                   MAR)
    ### Rolling sharp ratio
    rolling_sharpe_ratio_df = m.rolling_sharpe_ratio(df_data, columns_name,
                                                     window_length,
                                                     min_periods, benchmark)
    ### Rolling alpha
    rolling_alpha_df = m.rolling_alpha(df_data, columns_name, window_length,
                                       min_periods)
    ### Rolling correlation
    rolling_corr_df = m.rolling_corr(df_data, columns_name, market_index,
                                     window_length_corr, min_periods_corr)

    ### Calculate the correlation with other fund's mean return
    # Modify the market data, replace it with mean of other fund's return
    df_data_corr = df_data.copy()
    df_data_corr['Russell 3000'] = df_data_other.mean(
        axis=1)  # replace with population mean
    final_cum_return = cum_return_df_other.iloc[-1, :-1]
Beispiel #2
0
     min_periods=36,
     start_gap=6,
     MAR=0,
     threshold=0,
     order=2)
 ### Rolling omega ratio
 rolling_omega_ratio_df = m.rolling_omega_ratio(df_data,
                                                columns_name=columns_name,
                                                window_length=36,
                                                min_periods=36,
                                                start_gap=6,
                                                MAR=0)
 ### Rolling sharp ratio
 rolling_sharpe_ratio_df = m.rolling_sharpe_ratio(df_data,
                                                  columns_name=columns_name,
                                                  window_length=36,
                                                  min_periods=36,
                                                  start_gap=6,
                                                  benchmark=0.02)
 ### Rolling alpha
 rolling_alpha_df = m.rolling_alpha(df_data,
                                    columns_name=columns_name,
                                    window_length=36,
                                    min_periods=36,
                                    start_gap=6)
 ### Rolling correlation
 rolling_corr_df = m.rolling_corr(df_data,
                                  columns_name=columns_name,
                                  target_benchmark='Russell 3000',
                                  window_length=36,
                                  min_periods=36,
                                  start_gap=6)
Beispiel #3
0
    ### Summary table
    Summary_table_df = r.summary_table(df_data,index_name, summary_columns, market_index, MAR)

    ### Rolling beta
    rolling_beta_df = m.rolling_beta(df_data, columns_name, window_length, min_periods)
    ### Rolling annulized return
    rolling_annual_return_df = m.rolling_annulized_return(df_data, columns_name, window_length, min_periods)
    ### Cummulative return
    cum_return_df = m.cumulative_return(df_data, columns_name, window_length, min_periods)
    cum_return_df_other = m.cumulative_return(df_data_other, columns_name_other, window_length, min_periods)
    ### Rolling sortino ratio
    rolling_sortino_ratio_df = m.rolling_sortino_ratio(df_data, columns_name, window_length, min_periods, MAR, threshold)
    ### Rolling omega ratio
    rolling_omega_ratio_df = m.rolling_omega_ratio(df_data, columns_name, window_length, min_periods, MAR)
    ### Rolling sharp ratio
    rolling_sharpe_ratio_df = m.rolling_sharpe_ratio(df_data, columns_name, window_length, min_periods, benchmark)
    ### Rolling alpha
    rolling_alpha_df = m.rolling_alpha(df_data, columns_name, window_length, min_periods)
    ### Rolling correlation
    rolling_corr_df = m.rolling_corr(df_data, columns_name, market_index, window_length_corr, min_periods_corr)
   
    ### Calculate the correlation with other fund's mean return
    # Modify the market data, replace it with mean of other fund's return
    df_data_corr = df_data.copy()
    df_data_corr['Russell 3000'] = df_data_other.mean(axis=1) # replace with population mean    
    final_cum_return = cum_return_df_other.iloc[-1,:-1]
    
    quantile = pd.qcut(final_cum_return.T,4, labels=['Q1','Q2','Q3','Q4'])
    Q1 = quantile[quantile.values == 'Q1'].index
    Q2 = quantile[quantile.values == 'Q2'].index
    Q3 = quantile[quantile.values == 'Q3'].index