dollarbillstern
New member
- Joined
- Jun 26, 2020
- Messages
- 4
Hi all, as stated in the title, I'm attempting to solve for the first partial derivative for the expected return of a group of wagers in a parimutuel pool.
Wikipedia describes parimutuel betting as "a betting system in which all bets of a particular type are placed together in a pool; taxes and the "house-take" or "vigorish" are deducted, and payoff odds are calculated by sharing the pool among all winning bets." (link).
The expected return of a series of potential bets into a parimutuel pool with N combinations can then be calculated by the formula:
[MATH] \sum_{i=1}^N(\frac{Q(W + \sum_{j=1}^Nb_j)}{w_i + b_i} - 1)b_ip_i - (b_i(1 - p_i)) [/MATH]where [MATH]N[/MATH] is the number of combinations, [MATH]Q[/MATH] is the money returned to bettors by the house after taxes and vig (expressed as a percentage), [MATH]W[/MATH] is the total money wagered into the pool prior to our proposed bets, [MATH]w_i[/MATH] and [MATH]b_i[/MATH] are the money wagered on combination [MATH]i[/MATH] by the public (not including our wager) and on our wager, respectively (both values are in the range 0+), and [MATH]p_i[/MATH] is the probability that combination [MATH]i[/MATH] is the winner.
My first attempt at the partial derivative, after pushing the [MATH]b_ip_i[/MATH] term into the quotient, was:
[MATH]\frac{Q(Wp_i+\sum_{j\ne i}^N(b_j)p_i+2b_ip_i)(w_i+b_i)-Q(Wb_ip_i+\sum_{j=1}^N(b_j)b_ip_i))}{(w_i+b_i)^2}-1[/MATH]However, I checked the gradient using python's scipy package (scipy.optimize.check_grad), which compares the derived gradient with the numerically estimated version. The results were significantly different. After some attempts, I realized I calculated the gradient of the quotient
[MATH]Q(Wb_ip_i + (\sum_{j=1}^Nb_j)b_ip_i)[/MATH]incorrectly. With some help from friends, I was able to solve it as
[MATH]Q(Wp_i+\sum_{j=1}^N(b_jp_i+b_jp_j))[/MATH]However, when I replaced that in the application of the quotient rule from my original attempt, the check_grad result was still significantly different.
At this point, I'm stuck and wondering if pushing the [MATH]b_ip_i[/MATH] term into the quotient was appropriate given the interaction of [MATH]b_i[/MATH] in the summation. Any pointers or help would be greatly appreciated!
Wikipedia describes parimutuel betting as "a betting system in which all bets of a particular type are placed together in a pool; taxes and the "house-take" or "vigorish" are deducted, and payoff odds are calculated by sharing the pool among all winning bets." (link).
The expected return of a series of potential bets into a parimutuel pool with N combinations can then be calculated by the formula:
[MATH] \sum_{i=1}^N(\frac{Q(W + \sum_{j=1}^Nb_j)}{w_i + b_i} - 1)b_ip_i - (b_i(1 - p_i)) [/MATH]where [MATH]N[/MATH] is the number of combinations, [MATH]Q[/MATH] is the money returned to bettors by the house after taxes and vig (expressed as a percentage), [MATH]W[/MATH] is the total money wagered into the pool prior to our proposed bets, [MATH]w_i[/MATH] and [MATH]b_i[/MATH] are the money wagered on combination [MATH]i[/MATH] by the public (not including our wager) and on our wager, respectively (both values are in the range 0+), and [MATH]p_i[/MATH] is the probability that combination [MATH]i[/MATH] is the winner.
My first attempt at the partial derivative, after pushing the [MATH]b_ip_i[/MATH] term into the quotient, was:
[MATH]\frac{Q(Wp_i+\sum_{j\ne i}^N(b_j)p_i+2b_ip_i)(w_i+b_i)-Q(Wb_ip_i+\sum_{j=1}^N(b_j)b_ip_i))}{(w_i+b_i)^2}-1[/MATH]However, I checked the gradient using python's scipy package (scipy.optimize.check_grad), which compares the derived gradient with the numerically estimated version. The results were significantly different. After some attempts, I realized I calculated the gradient of the quotient
[MATH]Q(Wb_ip_i + (\sum_{j=1}^Nb_j)b_ip_i)[/MATH]incorrectly. With some help from friends, I was able to solve it as
[MATH]Q(Wp_i+\sum_{j=1}^N(b_jp_i+b_jp_j))[/MATH]However, when I replaced that in the application of the quotient rule from my original attempt, the check_grad result was still significantly different.
At this point, I'm stuck and wondering if pushing the [MATH]b_ip_i[/MATH] term into the quotient was appropriate given the interaction of [MATH]b_i[/MATH] in the summation. Any pointers or help would be greatly appreciated!