Presentation is loading. Please wait.

Presentation is loading. Please wait.

Steve Grilli Life Office Management Association

Similar presentations


Presentation on theme: "Steve Grilli Life Office Management Association"— Presentation transcript:

1 Steve Grilli Life Office Management Association
Chula! Using all sorts of SAS to simulate and handicap jai-alai games for fun (and profit ???) Steve Grilli Life Office Management Association Copyright 2006 by Steve Grilli/RSB Associates (may not be displayed without this notice)

2 Presentation Outline Intro: Steven Skiena’s Calculated Bets Jai Alai
-- The Game -- Betting Terminology -- Pari-mutuel Wagering -- How Games are Scored Using SAS to Engineer the System -- Simulating Games -- Parsing Internet Files -- Bet Selection Analysis SAS and Selected Research Issues -- Confidence Limits on small proportions -- “Hot hands” and players’ skill levels -- Modelling mean payouts Conclusions

3 DISCLAIMER “Fun” SAS application Not advocating gambling ! ! !
Internet gambling is considered illegal by US Dept. of Justice, and State of Georgia ! ! !

4 THE BOOK Calculated Bets: Computers, Gambling, and Mathematical Modeling to Win by Steven Skiena Professor of Computer Science SUNY Stony Brook (Cambrigde University Press and Mathematical Association of America, 2001) Wonderful, personal, non-technical description of how to apply math, stats, and computer programming to gaming and sports problems. At heart of book is description of his jai alai betting system, Maven (Yiddesh for “self-proclaimed expert”). He uses PERL to parse interent files and C++ to simulate the jai alai games, combined with the fact that off-track gambling is legal in NY, he and his crew turned $250 into over $1,500 (he gave the money to charity) Why not try his approach in SAS?

5 THE GAME OF JAI ALAI Originated in the Basque Region
Players use a “basket” (cesta) to fire a hard ball (pelota) against a wall. Must be caught and returned on the fly or one bounce In U.S. eight players or doubles teams rotate Pari-mutuel gambling allowed at fronton and off-site betting establishments (Goikoetxea on right may be the best player in the world) Pelota has been clocked at over 180 mph. Pictures courtesy of Tiger’s Jai Alai Heaven.

6 BETTING TERMINOLOGY Money goes into POOLS Win, Place, Show Quinella
Exacta (Perfecta) Trifecta Also, more exotic bets: boxes, wheels

7 PARI-MUTUEL WAGERING Different from casino games where you play against the house No fixed odds Fronton (Jai Alai Stadium and its operators) take a cut of each pool off the top Quite high (over 20%) Good news: they don’t care who wins More that’s wagered, the more the fronton makes Plenty of games – Dania Jai Alai has 8 performances/wk – matinees and evenings -- of 13 or 14 games (109 games/wk)

8 How Games Are Scored Eight players (or double teams)
Color-coded Posts 1-8 Player 1 serves to Player 2 Winner of point stays on the court Loser goes to the end of the line Next player in the queue takes the court First time through rotation points worth one After all 8 players have taken the court points worth two Games played to 7 or 9 points Tiebrakers for place and show. Posts position very important to success

9 Simulating Games 1: What Do We Need?
A basic player skill measure: Point-win Percentage (PTWPER) A probability function that generates the probability that Player A with PTWPER-A wins the point against Player B with PTWPER-B PTWPER not kept by frontons; must be imputed by w,p,s, out-of-money results by POST position Steve Skiena: prob function should have integrity, symmetry, monotonicity, generality, equality, simplicity

10 Simulating Games 2: The Probability Function
Alpha is the key Ex: Player A PTWPER = 0.525 Player B PTWPER = 0.475 Alpha= 1.0; A wins 52.5% Alpha= 0.4; A wins 65.1% Difference between Poisson variates – 1948 J Royal Statistical Society

11 Simulating Games 3: SAS Code
else Sc(Op1)+2; if Sc(Op1) ge game then do; win=Op1; Sc(Op1)=-1; end; else do; Ppt(Op1)+1; Ppt(Op2)+1; Pptw(Op2)+1; q(pt+6)=Op1; if pt le 7 then Sc(Op2)+1; else Sc(Op2)+2; if Sc(Op2) ge game then do; win=Op2; Sc(Op2)=-1; Op1=Op2; Op2=q(pt); /* simulate winner */; do until(win gt 0); pt+1; alpha=&alph; if wper(Op1) ge wper(Op2) then winop12= .5*(1 + (wper(Op1)-wper(Op2))**alpha); else winop12= .5*(1 - (wper(Op2)-wper(Op1))**alpha); if ranuni(0) lt winop12 then do; Ppt(Op1)+1; Ppt(Op2)+1; Pptw(Op1)+1; q(pt+6)=Op2; Op2=q(pt); if pt le 7 then Sc(Op1)+1; queue q initialized Monte Carlo simulation – random number generation on uniform(0,1) distribution

12 Simulating Games 4: Some SAS Output
PTWPER GACT TEAM POST JAIRO-LARREA LECUE-CHASIO TOTO-MADARIETA SCOTTY-ERKIAGA II 4 OCHOA-PEDRO OLATE-CARVALHO BARRE-AZPIRI ARECHA-URTARAN

13 Simulating Games 4: More SAS Output
The FREQ Procedure Cumulative Cumulative EX Frequency Percent Frequency Percent

14 Simulating Games 4: Bet Selection
GAME 6 EXACTA SELECTIONS GDATE GTIME GM GT GPTS TYP SEL PR RET EVE D E EVE D E Expected Value of a dollar bet on Exacta x

15 Parsing Internet Files: Results Files
GAME 6 2 Lecue-Chasio 1 Jairo-Larrea 5 Ochoa-Pedro QUINIELA EXACTA TRIFECTA SAS FUNCTIONS INDEX () SCAN () Also, conditional input statements Dania – Parse Entries, Changes, Results. From Results we want win, place, show team, posts, date, game number, pool payouts. Use the standard character functions to parse.

16 Bet Selection Analysis
GAME 6 ANALYSIS OF RET CUTOFFS RET N MEANPROF PERCOR TPROF COR LOWER UPPER Sort by descending MEANPROF (per $2 bet)

17 System Structure Summary
Parse entries .txt file from fronton website Simulate games; select bets Parse entry changes .txt file; resimulate any games with changes Finalize bets Parse results .txt file Update SAS data sets (PTWPER, Mean Payouts, et. al.) Change file: Grilli’s No. 1 rule of sports handicapping: never bet on a horse who isn’t running in the race.

18 Research 1: Confidence Interval on Small Proportions
95% Jeffreys interval: LOWER=BETAINV(.025,COR+0.50 ,N-COR+0.50); UPPER= BETAINV(.975,COR+0.50, N-COR+0.50); Beta distribution is conjugate prior for parameter p for binomial data. Source: Brown, Cai, and DasGupta “Interval estimation for a binomial proportion” Statistical Science, 2001

19 Research 2: “Hot Hand” and Player Skill Estimation
Statisticians still argue about the existence of streaks in sports If we had actual point-win data, we can conduct research Use GEE option in PROC GENMOD Use PROC FACTOR to build a weighed index of long and short term PTWPER Model win proportion on a game basis (correlated obs) as a function of long, short term PTWPER.

20 Research 3: Improving the Estimate of Mean Payout
Model coefficients B1, B2 significant at p < Improves estimate of actual payout in 58% of 5,936 cases

21 CONCLUSIONS SAS works for the three major areas of this type of gaming application: parsing internet files, simulation of the games, and analysis & research Profit? System is still under construction, but profitable in terms of personal development as statistician and SAS programmer Final quote from “Fast Eddie” Felsen: “Money won is twice as sweet as money earned.” Take questions


Download ppt "Steve Grilli Life Office Management Association"

Similar presentations


Ads by Google