Description Usage Arguments Value Examples
Calculate the odds that a bookie will likely give for a certain trifecta pick. Also calculate the probability of a trifecta pick happening, using the same method that we do in the win function. We make these calculations using the Harville method (Journal of the Amer. Stat. Assn. 1973), which states that trifecta probability can be calculated by the formula:
(p1 * p2 * p3)/((1 - p1)*(1 - p1 - p2))
where p1, p2, and p3 are the odds that horse 1, horse 2, and horse 3 have to win first place. Making this calculation using the bookies' p1, p2, and p3 will give us odds that we would likely see from a bookie. We will perform the same calculation substituting the sum of all bookies' odds for 1 (which is always greater than 1). This is analagous to the calculations we perform to find the true probability of an individual horse winning in the win function.
1 | trifecta(race_df, picks)
|
race_df, |
a data frame that has been passed through generate_psodds, so it has columns for each horse's odds of winning 1st, 2nd, and 3rd |
picks |
character vector containing the better's picks for 1st, 2nd, and 3rd place, in that order |
a vector containing odds and our calculation of probability
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.