Thursday, October 29, 2020

Shannon-Fano_Crowd-Handicapping.md

Shannon-Fano Crowd Handicapping

Let us indulge ourselves in a thought experiment on how we might handicap the Crowd!

We have access to a betting-line (Betfair) for a graded-stakes race - with a low WCMI - as well as some simple, publicly-available data. Can we reverse-engineer what the Crowd is most likely factoring into its calculation?

Granted this is no Schrödinger's Cat, but nevertheless it might enlighten us as to whether or not the betting-line is vulnerable?

As outlined in Handicapping Twenty Questions Benford's Law And Shannon Entropy, taking our lead from Shannon-Fano Coding, we should iteratively divide the entrants into two approximately equal groups of win probabilities (i.e. 50%) and use Pairwise Comparison to eliminate the non-contenders using at most four questions.".

When the sub-divisions produced by the splits are approximately equal (50%) in terms of implied probability, then the one bit of information (question) used to distinguish them is maximally efficient. So, using the implied probability (I/P) of the betting-line odds (B/X) as our starting point, we can make an initial split into two groups:

  • Alpha, Bravo; and
  • Charlie, Delta, Echo, Foxtrot, Golf, Hotel.

Keeping our interpretation as simple as possible, it looks like the initial division is based on speed ratings. Then, in deciding between Alpha and Bravo, trainer rating appears to clinch it.

The next sub-division is:

  • Charlie, Delta; and
  • Echo, Foxtrot, Golf, Hotel.

Here, form ratings are the most likely rationale for the split with trainer rating again deciding the rank order within the group.

Next, we split the four remaining horses:

  • Echo, Foxtrot; and
  • Golf, Hotel.

Weight (proxy for fillies allowance) is the deciding factor here but it is not possible to easily account for the final, rank orders within these two groups. We have reached the limits of our simplistic approach. Obviously, the betting-line accounts for more factors than used by our naive approach. But, just because our model is wrong does not mean it is not useful!

In summary, speed ratings appear to be the primary driving factor for the betting-line with trainer rating as the qualifier. Given the likely high correlation between speed and form ratings, the fact that both are used suggests an element of double-counting by the Crowd and, consequently, may indicate a vulnerable betting-line.

Is Schrödinger's cat alive, dead or both?

Wednesday, September 30, 2020

Variable Weights - Entropy Method

Variable Weights - Entropy Method

In horse-racing, using fundamental handicapping, we try to derive predictor variables from mining past-performance data. As ever, our starting-point is to ask Bill Benter's fundamental question of handicapping:

What additional variables (if any) explain a significant proportion of the variance in results to date that is not already accounted for by the public odds (Wisdom of Crowds)?

Assuming that we have already identified a number of such variables that appear to influence the outcome of races, how do we weight those variables? Do we weight them separately for different codes (Flat, Jumps), different types (Maiden, Handicap), or different distances (Sprints, Routes) of races?

Obviously, we could use some form of Regression Analysis to derive the necessary weights but, perhaps, a simpler option presents itself! In the Multiple Criteria Decision Analysis process TOPSIS, the Entropy Weight method is used to objectively derive criteria (variables) weights based on the dispersion of scores across the alternatives being analysed. Translating into a handicapping scenario, the underlying assumption of this method is that the greater the difference in scores for contestants across multiple criteria, the greater the difference in predicted outcome for some future event! In other words, we are operationalizing the belief that it is the differences between horses on some key variables and not their similarities (or the differences between race codes, types, distances, and so on) that best determines the winner. Also, all races generate their own unique set of weights and there can be a mixture of positive (1,3,4,5,6) and negative (2,7) weights.

This method has some limitations (particularly relating to scores of zero and entropy values close to one). A number of solutions have been recommended to resolve these issues and the following approach shows promise - New Entropy Weight-Based TOPSIS for Evaluation of Multi-objective Job-Shop Scheduling Solutions.

Friday, July 24, 2020

WASP Trainers

WASP_Trainers.md

The single most important influence on a horse's performance is the trainer. Current stable form can help explain some of the strange race results we observe daily. To that end, WASP (Winners Above Starting Price), can help us stay current with how in-form trainers are on a rolling weekly, fortnightly, or monthly basis.
  • Using historical database of past performances, calculate wins per starting-price using Juvenile Finish Position Ratings algorithm.
  • For each yard:
    • For each race in past performances during period
    • Sum over all races and calculate both actual and expected win percentages.
    • Subtract expected win percentage from actual win percentage to calculate WASP.
The calculated difference tells us (if positive) that the stable is ahead of the market in terms of percentage of opponents beaten or conversely (if negative) that the stable is behind the market.

Thus, WASP informs us of both current stable form and stable value in a single number.

Thursday, June 25, 2020

Longshot Stakes: Probability Or Edge

Longshot Stakes: Probability Or Edge


Notwithstanding the specifc advice outlined in Kelly's Multiple Personality Disorder and Kelly And Mutually-Exclusive Outcomes relating to AvK events, consider an idealized horse-racing scenario where you have identified two selections: High Expectations at 2/1 with a 40% win probability and In With A Chance at 20/1 and a 10% chance of winning. Assume further that you are planning to bet ¤50 (Bankroll: ¤500) on High Expectations. How much should you bet on In With A Chance?

Win Probability Stakes

Selection S/P Win% Edge Stake Profit
High Expectations 2/1 40% 0.20 ¤50.00 ¤100.00
In With A Chance 20/1 10% 1.10 ¤12.50 ¤250.00

Edge Stakes

Selection S/P Win% Edge Stake Profit
High Expectations 2/1 40% 0.20 ¤50.00 ¤100.00
In With A Chance 20/1 10% 1.10 ¤27.50 ¤550.00

If your answer is ¤12.50, then your handicapping is driven by win probability as High Expectations (40%) is four times more likely to win than In With A Chance (10%). Alternatively, if your answer is ¤27.50, then your handicapping is driven by edge as In With A Chance (1.10) has 5.5 times more edge than High Expectations (0.20).

The Kelly Criterion advises that you choose the stake so that the amount you win is proportional to your edge. Most punters choose stakes based on win probability and, as a result, they are not exploiting their advantage and are 'leaving money on the table'!

Saturday, May 23, 2020

Session Handicapping: Stop Or Continue?

Intellectually speaking, we are value handicappers and if a market offers at least one value bet then we are prepared to trade it. However, psychologically speaking, we are session handicappers and we want to maximize our winnings at each session to minimize feelings of regret. These feelings can result from either getting ahead early and then losing later in the session or, alternatively, feeling that we are leaving money on the table because we quit the session too soon.

Bruss (2006) provides us with an approximation to an optimal stopping algorithm in these circumstances. For example, let us assume that we are trading multiple, sequential, sports markets on any given Sunday. We have completed seven markets of an eleven-market session and have accumulated two wins. Should we continue to the next market or stop for the day?

The decision formula is, as follows:
If (N – K) < ((K + 1 - G) / G) Then "Stop" Else "Continue"
In our example, with [N = 11, K = 7, and G = 2]  the decision is to continue. But, if after the next market, we have not secured another win [N = 11, K = 8, and G = 2] then the decision is to stop!

Sunday, April 12, 2020

Kalman Filter Handicapping

Last Performance Or Median Performance

With respest to historical results, performance ratings and time ratings are routinely calculated, by various organizations, using proprietary formulae or algorithms that are unknown to the average handicapper. Given a track record of such past results, how should we evaluate a horse's latent ability:.
  • last performance, or
  • median performance.
Last performance captures current form but what if that last result was an unusually good or an unusually bad performance? In that context, we rely more heavily on median performance to better reflect latent ability!

As a guide to which is a better overall indicator (signal) of ability, we can adapt a Kalman Filter to track a dynamic model (changing ability of horse) using an error-prone, measurement process (time ratings: 67..115) to guide our intuitions. The filter predicts the next performance level (ratings: 90..116) beginning with an arbitrary starting-point (90), and proceeds through a series of predict-measure-update iterations using a Bayesian-like updating algorithm (predict=prior, measure=likelihood, update=posterior).
We are probably making unwarranted assumptions about the levels of process noise and measurement error in applying this filter to the current scenario. Plus, we are using a changing time interval between measurements that is non-standard. Nevertheless, we can see from the worked example that the last prediction (116) is a more accurate reflection of current ability than the median performance (108).
In order to experiment with the embedded worksheet, you may need to alter the parameters, as follows:
  • X0 = Initial estimated rating,
  • P = Average estimated rating error,
  • Q = Average rating change per race, and
  • R = Average calculated rating error.
Obviously, you will also have to provide the calculated ratings for all past performances of interest!

Wednesday, March 18, 2020

Practical Dominance (PD)

In terms of our ongoing efforts to improve the handicapping process, we can strongly assert that it is easier to evaluate a four horse race than a nine horse race (all other things being equal). Keeping in mind our strong preference for eliminating alternatives over confirming selections, we can look to the Even Swaps Method (ESM) for a useful concept called practical dominance.
  • Select specific race using WCMI.
  • For each horse in race (using past performances):
    * Evaluate each contestant's form on at most five to seven attributes. See Tsai et al, 2008, Slovic,  1973 and Do You Really Need More Information from the CIA on the positive impact of additional information on confidence (Figure 5).
    * Convert the absolute ratings on each attribute into rankings across contestants.
    * Eliminate those contestants that are either completely dominated (unlikely) or practically dominated (likely) by another entrant.
    • In the sample race below, Alpha practically dominates Charlie as his rankings are superior on all attributes except A6.
    • Foxtrot, Golf, Hotel, and Juliet are similarly dominated.
  • Consider remaining contestants as potential trades using Kelly Criterion.

As ever, if we cannot find variables that account for sufficient variance in outcomes over and above that provided by market prices then we will not have an edge and we will lose our bankroll.

Saturday, December 22, 2018

Automatic Trading Using WCMI

Automatic Trading Using WCMI

Explore And Exploit

On which sports-trading events should we risk our capital? A good starting point is to ask the fundamental question of sports markets:

"Is the public market well-informed with respect to a specific event (Wisdom of Crowd)?"

Our proxy for identifying such events is to calculate the Wisdom of Crowd Market Index (WCMI) for all markets and to select only those events for which the market falls below a specific WCMI threshold (for example, 0.15). By focusing on these less well-informed markets, we are dramatically increasing the chances of identifying at least one overlay. In other words, the guiding principle is to explore all markets but only exploit those markets with low WCMIs. For UK Flat horse-racing markets, FlatStats is the logical starting point in this process.

Market Selection Using WCMI

The following Betfair simulation shows how an automated trading solution would first filter those markets with low WCMI and then, having identified at least one overlay, bet on one or more selections as calculated by the Single Event Multiple Selections variant of the Kelly Criterion:
  • Filter markets (e.g. identify 5f sprints);
  • Calculate WCMI for each filtered market;
  • Rank contenders in market on fundamental factors;
  • Create odds-line for contenders based on ratings;
  • Check market contains at least one overlay;
  • Make selections using Kelly Criterion; and
  • Submit bets.

Monday, November 26, 2018

Kelly's Multiple Personality Disorder

For the professional sports-trader, Kelly has three separate mathematical forms:
  1. Single Event, Single Selection;
  2. Single Event, Multiple Selections; and
  3. Multiple Events, Multiple Selections.

Single Event, Single Selection

This is the basic case as outlined in cursory descriptions of the Kelly Criterion. We identify a selection, which gives us an edge over the market and calculate the optimal stake to maximize that advantage. For this purpose, the Excel Add-In offers the KellySingleStake sports-trading function that accepts Decimal OddsWin Probability, and Multiplier parameters. The KellySingleStake function is the correct formula for AvB events such as moneyline markets in MLBNBA, and the NFL.

Decimal OddsWin ProbabilityStake
2.0053%6.00%

Single Event, Multiple Selections

In AvB events, the general advice to only bet the overlay is technically correct. However, in an AvK event, such as horse-racing and golf with a number of mutually-exclusive outcomes this advice is not strictly correct. Kelly betting is predicated on maximizing the logarithm of the handicapper's bankroll over the long-term. But, in the short-term, that goal is translated into not losing specific events when the price is right! The key role played by overlays in mutually-exclusive events is that there must be at least one such betting option available in any event on which we wish to bet. Beyond that, the specific choices will only be governed by maximizing the logarithm of our bankroll! The sports-trading function, KellyMutExStakes (array formula), with Decimal Odds Range and Win Probability Range inputs will identify the optimal selections and stakes.

EntryDecimal OddsWin ProbabilityTrader EdgeStake
Charlie5.5020.00%10.00%5.96%
Alpha2.62540.00%5.00%10.59%
Bravo3.2530.00%-2.50%6.25%
Delta6.008.00%-52.00%0.00%
Echo21.002.00%-58.00%0.00%

Multiple Events, Multiple Selections

For Nx(AvB) events, such as trading Ryder Cup golf singles matches or NFL games on Any Given Sunday, we need the sports-trading function, KellySimEvtStakes (array formula), with Decimal Odds Range and Win Probability Range parameters to identify the optimal stakes.

EntryDecimal OddsWin ProbabilityTrader EdgeStake
SvWH1.5075.00%12.50%9.10%
BHAvB1.4080.00%12.00%11.70%
DvAV1.6070.00%12.00%6.825%
LvCP1.3085.00%10.50%14.70%

Note that Example #2 in the Pinnacle Guest article - The real Kelly Criterion - calculates the wrong stakes as can easily be confirmed by entering the decimal odds and win probabilities into the SBR Kelly Calculator for four independent events.

Saturday, July 07, 2018

Betting Strategy Calculator (Itty.Bitty.Site)

Itty.Bitty.Site is a new URL-based microsite generator, created by Nicholas Jitkoff, that is sure to revolutionise the web in ways that we cannot yet imagine (hopefully, in positive ways).

To that end, we have created one of the first Itty.Bitty HTML5 apps (calculator) that runs a simple assessment of your  Betting Strategy. Enjoy!

Thursday, June 28, 2018

Speed-Stamina Course Profiles And Juvenile Races

In an earlier posting, Speed-Stamina Fingerprints, we outlined an approach to "hoof-printing" racecourses in terms of their speed-stamina profiles based on the best times for various distances using a power-law equation, approximately of the form: Time=Speed*DistanceStamina. This approach also allows us to effectively project performances by inexperienced 2yo and 3yo horses, as follows.

For example, supposing a 2yo colt turns in an eye-catching performance in a novice race and is entered in a graded stakes race 10 days later. Historical data tells us that the median winning time of this future event is
73.57s. The question we want to ask: Is the maiden winning colt likely to be competitive in the graded stakes event? One way of answering this question is to translate the maiden performance into an equivalent performance at the graded stakes course and distance. Using our hoof-printing technique produces a time of 73.40s telling us that this promising colt is likely to be an above average contender for the graded stakes event. Fast-forward to race day and our selection wins in a time of 73.51s (just 0.10s slower than projected). (Note that we were not restricted to choosing performances at the same distance as the future event).

Obviously, this technique has restrictions in terms of producing realistic projections. It works best with:
  • Maiden 2yo and 3yo races at sprint distances;
  • Races on “Good” or “Good-To-Firm” going; 
  • Recent “In-The-Money” races;
  • Projections from one graded stakes racecourse to another (e.g. Newmarket to York); and
  • Horses that race prominently and do not require "luck in running".

That said, it has potential for projecting future times based on performances at racecourses with vastly different configurations, a goal which cannot be achieved by speed figures!

Thursday, May 31, 2018

CsvPredictor: Turns Historical Record Into Mini Prediction System

CsvPredictor turns a historical record in CSV format into a mini prediction system. The program is completely agnostic with respect to the domain knowledge captured in the file (e.g. weather conditions, successful movies, past performances). 
Running CsvPredictor.exe with a valid csv file will result in a QnA session based on the salience of the features (columns), effectively, turning a standard flat file into a data mining classification tree
For example, whether or not to play ball given current weather conditions:
    C:\CsvPredictor>CsvPredictor.exe PlayBall.csv
    CsvPredictor v2.41
    Input File: "PlayBall.csv" (14 records and 4 features)
    Top Features (Salience)
    Outlook   0.46176
    Humidity  0.36618
    Wind      0.11693
    Q. Is Outlook  =  ["Overcast"; "Rainy"; "Sunny"]?  Sunny
    Q. Is Humidity =  ["High"; "Normal"]?  Normal
    A. Predict: PlayBall = True
    C:\CsvPredictor>
or checking the likelihood of a new movie being a blockbuster!
    C:\CsvPredictor>CsvPredictor.exe Movies.csv
    CsvPredictor v2.41
    Input File: "Movies.csv" (2690 records and 5 features)
    Top Features (Salience)
    Budget              0.34871
    Genre               0.26719
    Production Country  0.24084
    Runtime             0.11430
    Q. Is Budget =  ["<=15000000.00"; "<=44263333.33"; "<=380000000.00"]? 
                    <=15000000.00
    Q. Is Genre =  ["Action"; "Adventure"; "Animation"; "Comedy"; "Crime"; 
                    "Documentary"; "Drama"; "Family"; "Fantasy"; "Foreign"; 
                    "History"; "Horror"; "Music"; "Mystery"; "Romance"; 
                    "Science Fiction"; "Thriller"; "War"; "Western"]?  
                    Action
    Q. Is Production Country =  ["Australia"; "Canada"; "Hong Kong"; 
                                 "Ireland"; "United Kingdom";
                                 "United States of America"]?  
                                 United States of America
    Q. Is Runtime =  ["<=99.47"; "<=115.00"; "<=248.00"]?  <=115.00
    Q. Is Release Month =  ["<=5.00"; "<=9.00"; "<=12.00"]?  <=12.00
    A. Predict: Success = True
    C:\CsvPredictor>
Note, it is very important to state that this program is only intended to provide an easy entry-point to data analytics for handicappers and is, in no way, intended to replace the advice and expertise of professional data analysts and statisticians!

Sunday, May 06, 2018

ExMachina Handicapping Rules (Excel Add-In)

Many of us spend countless hours trawling through historical records in a vain attempt to gain new insights into the key fundamental factors that will enhance our sports handicapping. Unfortunately, our innate cognitive biases (e.g. anchoring, availability, confirmation) continually invade all attempts at a quasi-scientific approach to data mining. Ideally, we would like a quick-fix solution to this dilemma – no new learning required and automatically works with available tools!

To that end, enter the ExMachina Excel Add-In (32-bit and 64-bit), which takes as input a CSV file of historical data and outputs a set of decision rules. In brief, the goal is to identify the most salient attributes in the data file and to create a set of rules based on that specific subset. Note, it is very important to state that this Excel Add-In is only intended to provide an easy entry-point to data analytics for handicappers and is, in no way, intended to replace the advice and expertise of professional data analysts and statisticians.

If you are interested in reviewing how the Excel Add-In works, then download the following MP4 file – ExMachina Handicapping Rules.

Monday, March 12, 2018

Cheltenham 2018: Supreme Novices Hurdle Handicapping

It is time once again for our annual attempt to find live longshots to finish in the money in the Supreme Novices Hurdle (G1) at Cheltenham 2018.

As ever, our approach is based on the following premises:
1. Supreme Novices Hurdle is similar to Kentucky Derby - young horses, many 
attempting graded stakes, championship race for first-time with little form in book.
2. Eliminate non-contenders and whatever remains, no matter how improbable, are our selections. 
Horses are only eliminated under one heading even though they may qualify for elimination under 
multiple headings:
    a. Pedigree mismatch to former winners [Sharjah].
    b. Small fields [Slate House].
    c. Poor "Late-Speed" [First Flow, Shoal Bay].
    d. Poor Cheltenham Form [Golden Jeffrey].
    e. Not suited by Going [Saxo Jack, Trainwreck].
    f. Not suited by L-H track [Getabird].
    g. Poor FPR [Khudha, Lostintranslation, Mengli Khan].
    h. Over-exposed form [Claimantakinforgan, Dame Rose, Western Ryder].
    i. Weak "Strength-Of-Schedule" [Simply The Betts].
8. Minimum price 10/1 [Kalashnikov, Summerville Boy].
This leaves Paloma Blue 13/1Us And Them 33/1, and Debuchet 40/1 as our selections with Kalashnikov 4/1 and Summerville Boy 8/1 only eliminated on price!

Note: Given the limited exposure of all the runners, we are not saying that those we have eliminated are not going to win - simply that they did not meet our criteria for live longshots to run in the money. The key takeaway, as always, is using a process of elimination not selection for identifying contenders.