James McCool commited on
Commit
9356756
·
1 Parent(s): ee5f819

Adjust median calculation in MMA ROO functions to account for knockout variance

Browse files
Files changed (1) hide show
  1. function_hold/MMA_functions.py +2 -0
function_hold/MMA_functions.py CHANGED
@@ -104,6 +104,7 @@ def DK_MMA_ROO_Build(projections_file, std_var, distribution_type):
104
 
105
  flex_file = basic_own_df[['Player', 'Salary', 'Median', 'KO_var']]
106
  flex_file = flex_file.rename(columns={"Agg": "Median"})
 
107
  flex_file['Floor'] = flex_file['Median'] * (1-flex_file['KO_var'])
108
  flex_file['Ceiling'] = flex_file['Median'] * (1+flex_file['KO_var'])
109
  flex_file['STD'] = (flex_file['Median'] / std_var)
@@ -322,6 +323,7 @@ def FD_MMA_ROO_Build(projections_file, std_var, distribution_type):
322
 
323
  flex_file = basic_own_df[['Player', 'Salary', 'Median', 'KO_var']]
324
  flex_file = flex_file.rename(columns={"Agg": "Median"})
 
325
  flex_file['Floor'] = flex_file['Median'] * (1-flex_file['KO_var'])
326
  flex_file['Ceiling'] = flex_file['Median'] * (1+flex_file['KO_var'])
327
  flex_file['STD'] = (flex_file['Median'] / std_var)
 
104
 
105
  flex_file = basic_own_df[['Player', 'Salary', 'Median', 'KO_var']]
106
  flex_file = flex_file.rename(columns={"Agg": "Median"})
107
+ flex_file['Median'] = flex_file['Median'] - (flex_file['Median'] * (flex_file['KO_var']-.5))
108
  flex_file['Floor'] = flex_file['Median'] * (1-flex_file['KO_var'])
109
  flex_file['Ceiling'] = flex_file['Median'] * (1+flex_file['KO_var'])
110
  flex_file['STD'] = (flex_file['Median'] / std_var)
 
323
 
324
  flex_file = basic_own_df[['Player', 'Salary', 'Median', 'KO_var']]
325
  flex_file = flex_file.rename(columns={"Agg": "Median"})
326
+ flex_file['Median'] = flex_file['Median'] - (flex_file['Median'] * (flex_file['KO_var']-.5))
327
  flex_file['Floor'] = flex_file['Median'] * (1-flex_file['KO_var'])
328
  flex_file['Ceiling'] = flex_file['Median'] * (1+flex_file['KO_var'])
329
  flex_file['STD'] = (flex_file['Median'] / std_var)