Some code to check your historical payout using only CORR or MMC or CORR+MMC:
#!/usr/bin/env python3
import numerapi
import matplotlib.pyplot as plt
import pandas as pd
import sys
import numpy as np
api = numerapi.NumerAPI()
# metrictoplot = 'corr'
# metrictoplot = 'mmc'
# metrictoplot = 'comb'
# metrictoplot = 'all'
metrictoplot = sys.argv[1]
username_list = ['integration_test', 'sugaku']
fig1 = plt.figure()
cmap = plt.cm.get_cmap('tab20b', len(username_list)*3)
i = 0
for user in username_list:
print("Collecting data for: ", user)
user_df = pd.DataFrame(api.daily_submissions_performances(user)).sort_values(by="date").groupby("roundNumber").last()
start_round=np.min(user_df.index)
end_round=np.max(user_df.index) # most recent resolved round
stake_corr = 1.0 # initial stake
stake_mmc = 1.0
stake_comb = 1.0
for r in range(start_round, end_round):
if r in user_df.index:
corr_score = user_df.loc[r, "correlation"]
mmc_score = user_df.loc[r, "mmc"]
else:
corr_score = 0.0
mmc_score = 0.0
if np.isnan(user_df.loc[r, "correlation"]) or np.isnan(user_df.loc[r, "mmc"]):
corr_score = 0.0
mmc_score = 0.0
if corr_score:
stake_corr *= 1.0 + corr_score*1.0
stake_mmc *= 1.0 + mmc_score*2.0 #2x leverage for mmc
stake_comb *= 1.0 + corr_score+mmc_score
user_df.loc[r, "weekly_stakes_corr"] = stake_corr
user_df.loc[r, "weekly_stakes_mmc"] = stake_mmc
user_df.loc[r, "weekly_stakes_comb"] = stake_comb
color = cmap(float(i)/len(username_list))
if metrictoplot == "corr":
plt.title('Expected CORR payout for models', fontsize=17)
user_df.weekly_stakes_corr.plot(label=user, color=color)
plt.text(end_round-0.75, user_df.loc[r, "weekly_stakes_corr"], user, color=color, fontweight="bold")
if metrictoplot == "mmc":
plt.title('Expected MMC payout for models', fontsize=17)
user_df.weekly_stakes_mmc.plot(label=user, color=color)
plt.text(end_round-0.75, user_df.loc[r, "weekly_stakes_mmc"], user, color=color, fontweight="bold")
if metrictoplot == "comb":
plt.title('Expected CORR+MMC payout for models', fontsize=17)
user_df.weekly_stakes_comb.plot(label=user+'_comb', color=color)
plt.text(end_round-0.75, user_df.loc[r, "weekly_stakes_comb"], user+'_COMB', color=color, fontweight="bold")
if metrictoplot == "all":
plt.title('Expected CORR and MMC payout for models', fontsize=17)
user_df.weekly_stakes_corr.plot(label=user+'_corr', color=color)
plt.text(end_round-0.75, user_df.loc[r, "weekly_stakes_corr"], user+'_CORR', color=color, fontweight="bold")
user_df.weekly_stakes_mmc.plot(label=user+'_mmc', color=color)
plt.text(end_round-0.75, user_df.loc[r, "weekly_stakes_mmc"], user+'_MMC', color=color, fontweight="bold")
user_df.weekly_stakes_comb.plot(label=user+'_comb', color=color)
plt.text(end_round-0.75, user_df.loc[r, "weekly_stakes_comb"], user+'_COMB', color=color, fontweight="bold")
i += 1
plt.grid(linestyle='--', linewidth=0.5, color="black")
plt.xlabel('Round number')
plt.ylabel('Expected payout factor')
plt.xticks(np.arange(start_round, end_round, 1), rotation=60)
ax = plt.gca()
ax.set_facecolor((0.9, 0.9, 0.9))
plt.show()
sys.exit()