Predict Sagarin radio show forum blog
|
Point Spread Space
|
The Over/Under AlgorithmHere I will show you how the over/under algorithm is calculated in Predict. It is essentially the same as the algorithm used in Predict_Games, the download program. To get started, let's jump into a bunch of code. This is the Perl class method that calculates the over/under:
# calculate the program's estimate of the over/under
sub over_under_estimate {
# declare local copy of self, assigning with input parameters
my ($self, $index, $over_under_div, $over_under_pow) = @_;
# get the team names
my $team1 = $self->[$index]{'team1'};
my $team2 = $self->[$index]{'team2'};
# get the average points scored
my $average_points_scored1 = $self->[0]{'average_points_scored'}->{$team1};
my $average_points_scored2 = $self->[0]{'average_points_scored'}->{$team2};
# make initial estimate of over/under by adding up the average points scored
my $program_over_under = $average_points_scored1 + $average_points_scored2;
# get the team ratings
my $rating1 = $self->[0]{'ratings'}->{$team1};
my $rating2 = $self->[0]{'ratings'}->{$team2};
# add in more points if the rating difference is larger, to estimate running up the score
my $rutsing = abs($rating1 - $rating2) / $over_under_div;
$rutsing **= $over_under_pow;
$program_over_under += $rutsing;
# get the home team advantage
my $home_team_advantage = $self->[0]{'home_team_advantages'}->{$team2};
# get the game location
my $where = $self->[$index]{'where'};
# add the home team advantage to the over/under estimate
# note: it's a subtraction because the home team advantage is negative when good and positive when bad
if ($where eq 'at') {
$program_over_under -= $home_team_advantage;
}
# remember the program's estimate of the over/under
$self->[$index]{'program_over_under'} = $program_over_under;
return $program_over_under;
}
To begin with, the program keeps a running average of the points scored by a team in any of that team's previous games. Obviously a good place to start is the sum of those two values, so the program does that. Next the program calculates "rutsing", which is "running up the score". It does this with a divisor and an exponent, approximating rutsing with approximately a parabolic shape. This works because the bigger the rating difference between the two teams, the higher the rutsing will be. You can make it a "V" shape by changing pow to 1, but I usually use pow = 2. The divisor just normalizes the shape of the curve to the data. Finally the program adds in the home team advantage if there is a home team, of that team. Home team advantages are tracked individually by team. That's about it, the program then compares this to the vegas_over_under_odds and makes a bet decision based on that. I can't believe how well the program did with this algorithm on WNBA last year, but it did do well. In all truth I think it is a crude algorithm that is best used on more esoteric, less well-understood sports, but you never know. It has been suggested that I use my bet selection algorithms from the point spread on the over/under and I may do just that, but not for a while. Good luck and remember, always wager responsibly. pages: 1 |
| copyright 2007 Les Hall |
Hit Counters |
Contact me inventor-66@comcast.net |