I am trying to calculate the sharpe ratio for a set of loans. These loans have already matured and I know if they were good or not: grades are the different grades of the loans. interest rate is the floating point value:
12.12 13.11 7.90 8.90 15.31 14.33 11.14 16.29 17.27 10.99
this is the python code that tries to compute the sharpe ratio for each grade.
for grade,name in enumerate(grades): print name, grade if pd.isnull(name): continue grade = float(grade) positive = (df_loans_completed.ix[s_grade_stats.groups[(grade, True)]]['interest_rate'] - R) negative = (df_loans_completed.ix[s_grade_stats.groups[(grade, False)]]['interest_rate'] - R) sigma = positive.append(negative).std() avg_return = positive.mean() print "sharpe:", (avg_return -R) / sigma
- should I consider the fact that I know which loans returned an interest positive and which did not ?