Initialises a handicap by splitting a dataframe of races into groups of similar class/type, then for each race in the group it calculates a rating using the remaining races in the group. The result is a skeleton handicap from which further handicapping/analysis can be performed. See the Handicapping using zipf_race vignette for a detailed explanation of the use of Zipfs Law, and also Initialising a Handicap to see zipf_hcp in use.
zipf_init(races, group_by, race_id, btn_var, .progress = "none")
param | details |
---|---|
races | dataframe of races |
group_by | name of variable(s) to group races found in races, eg. for US races perhaps group all Claiming races together, all Stakes races, etc, in UK group all Class 4 races, all Listed races, etc. |
race_id | name of variable to split races up by so each split is one race |
btn_var | name of variable in races that contains the margins (in lbs) between the horses |
.progress | plyr’s progress bar, default is “none”, options inc. “text”, “time”, “tk” or “win” |
Related to zipf_race and zipf_hcp, this function will initialise a handicap. It will split a dataframe of races into groups according to the group_by param, these groups should be races of similar class/type (so runners are of a similar ability), most (all?) racing jurisdictions employ a type of classification. For each race (identified by the race_id param), in each group, the winner is assigned a rating based on the other races in the same group.
A list is returned consisting of:
An article by Simon Rowlands explaining his use of Zipfs Law and race standardisation can be found here