Poker Predictor: Matlab Version
The finest poker brains on your side!
Go to main post
What is Texas Hold’em Poker:
- 2+5 cards each player
- 52 total number of cards
- 1326 starting hand configurations
- 207025 distinct head-to-head match ups
- 1712304 possible boards
- 690900 hands configurations with a single opponent
- over 6.22 e26 with 9 opponents
- ……………..
All of them are in Poker Predictor: a Texas Hold’ em Probability and Odds Calculator.
What can Poker Predictor Do:
Poker Predictor is a Matlab tool to calculate poker games probabilities from whatever cards configuration which could come in handy at http://www.partypoker.com/poker. Probability are computed with random cards permutation, they are not the exact ones but the high simulations numbers ensure the error to be less than 1%. Thanks to his strong computational engine, It can simulate 100′000 10 players Texas hold’em games in a matters of 0.3 seconds, so it is actually a real time tool, very useful for on line games, especially with high level players. It is possible to choose both players and opponents cards.
Although a little rough in the graphics (I am not a software developer, neither a programmer, just an engineer with poker passion) Poker predictor is a powerful tool, I am myself using it. Here there is graphical explanation:
Collaborators Wanted:
I’d like to compile Poker predictor on different platforms. If you want to join the project your help will be greatly appreciated. I need people with the following requirements:
- Different platform than than Win32, with Matlab installed.
- Capable of building an external Matlab application.
Briefly I need to build an external Matlab application (MCR compiler included), I ‘ll give you all required files, if you are interested contact me at giaccariluigi@msn.com.
Extensions:
Maybe you need something different, look at this extensions or propose something yourself! Need a :
- different languages
- different cards design/colors
- different poker games
- poker tables
- others functionalities
- explanations on something unclear Propose !!!!!!!!!! your request may sounds very interesting, send everything you want on my e-mail.
Download Poker Predictor for free:
Matlab users instructions:
- Download here the basic package.
- Download the handranks file and unzip it (it was too big for Matlab Central)

- Compile C++ files using TestMexFiles.m, or
download precompiled files for Win32

or download precompiled files for Linux32

- Run PokerPredictor.m
- Win a lot of money!
- Donate parts of your earnings!

You don’t have Matlab? Get the standalone version HERE
Win32 download
This work is free thanks to users gratitude. If you find it useful please consider making a donation. Help me developing future versions.
No need to tell you good luck if you have poker predictor on your side !
Popularity: 11% [?]
Related Posts
Comments
31 Comments on Poker Predictor: Matlab Version
-
NLC on
Fri, 11th Dec 2009 08:31
-
Rocko Chen on
Sat, 12th Dec 2009 00:00
-
DOn on
Sat, 12th Dec 2009 05:29
-
Henry on
Sat, 12th Dec 2009 13:50
-
Henry on
Sat, 12th Dec 2009 14:11
-
Horst Borst on
Tue, 15th Dec 2009 19:53
-
jose on
Mon, 28th Dec 2009 15:12
-
antoine on
Wed, 6th Jan 2010 16:41
-
Guille on
Fri, 26th Feb 2010 20:16
-
Guille on
Fri, 26th Feb 2010 20:21
-
clockmaker22 on
Sun, 21st Mar 2010 17:23
-
john on
Sat, 1st May 2010 21:38
-
Tom on
Wed, 12th May 2010 08:57
-
Justin on
Sun, 20th Jun 2010 06:12
-
Roger on
Mon, 5th Jul 2010 17:23
I get the following error when I hit “continue” on the startup menu, on Matlab 7.8.0.347 (R2009a)
”
??? Undefined function or variable ‘BuildTable’.
Error in ==> PokerPredictor at 53
TablePtr=BuildTable();%load the look up table;
“
[Reply]
Hi, I installed the common user package but unable to find to where the files have been installed!
[Reply]
Luigi Giaccari Reply:
December 12th, 2009 at 07:15
You don’t to know where the files have been installed.
In the folder where you unzipped the package there is an executable:
Run.exe
Click it and the work is done!
[Reply]
hello luigi, this is an excellent tool! always wanted to try playing with a genius tool like this by my side.
i do have one question. what formula did you use to determine max bet/pot? did you use the kelly criterion?
[Reply]
actually luigi. i did some calculations and see that you are not using the kelly criterion. I’d like to talk to you more about this through email. please drop me a line at henry.bee@gmail.com
thanks!
Henry
[Reply]
Luigi Giaccari Reply:
December 12th, 2009 at 16:02
HI Henry, thanks for your interesting comment.
Actually ti seems to me I made a little confusion about the english word “odd”.
This how data are computed, sorry if this not the technical terminology, not an expert of the field:
gain=win+tie/numtie
odd=1/gain (the italian “quota”)
in Italy we use to call “quota” the money bookmakers give you for a bet. For example if you have 50% of winning chance, the honest “quota” is 2. You bet 1 they pay 2.
odd is really intended as:
odd=(1-gain) /gain
so for 50% winning chance you get odd=1.
For the maxbet /pot ratio, I use this one:
maxbet=(gain)/(1-gain)
which is actually the inverse of the odd, what a mess!. Give me some time to look for some translation work and I will be able to tell you more.
The odd used in kelly’s formula need to know how much you gain if you win: you need to know the history of the game (folds and bets). There shold be a real time link with the pokerroom, but this not the case.
Please give me your opinion.
Luigi
[Reply]
Henry Reply:
December 15th, 2009 at 14:42
you did not make a mistake regarding odds. please do not change your calculations (although the spelling is “odds”, not “odd”)! the italian “quota” is the same definition as “gambling odds” in english.
for example, a payout of $2 for every $1 bet is an odds of 2:1. This is what’s used in poker as well. you are also right that there is another definition called the probability definition of odds. (1-p) / p is the “odds against”. and the inverse, p / (1-p) is the “odds in favour”. BUT the probability definition is NOT used in gambling and poker. =)
f = edge/odds
= EV / payout
= (p*payout-[(1-p)*losses])/payout
= (p*odds/(1-p*odds))/odds
= (p*(1+odds)-1)/odds
• f is fraction of bankroll to bet
• p is probability of winning
o in poker this is changed to probability of winning + tying
o
• odds here refers to gambling definition of odds
o i.e. a 2:1 odds refers to $2 payout for $1 bet on a win
• EV is the expected value.
Example
Assume p=50%, odds=2.
Then according to the Kelly criterion the player should bet 25% of his or her bankroll, where bankroll is the player’s current wealth and does not include any money in the pot (future wealth).
[Reply]
Luigi Giaccari Reply:
December 22nd, 2009 at 13:07
Thank you for the advise,
I am currently very busy but in the next release you will have your new tool.
Regards
Luigi
Hi,
I have an error while compiling the cpp files:
There’s probably something wrong on memset in line 50.
Unfortunately the error message is in german:
BuildTable.cpp: In function »void mexFunction(int, mxArray**, int)«:
BuildTable.cpp:50: Fehler: »memset« wurde in diesem Gültigkeitsbereich nicht definiert
I have run Matlab 7.7. on Ubuntu 9.04 gcc 4.3.3.
Best regards,
Horst
[Reply]
Luigi Giaccari Reply:
December 15th, 2009 at 20:52
I am sorry but I don’t have a linux system so I can not look for the error.
Just one thing, if I am not wrong gcc should be a C compiler not a c++ one.
I hope someone is able to compile linux files and send them to me. I will share those files avoiding this complicate compiling operation.
[Reply]
antoine Reply:
January 6th, 2010 at 05:34
same here… Any solution? I’ll look for one otherwise, but would be nice not to have to…
Cheers and big up for what looks like a pretty awesome tool.
Antoine
[Reply]
I keep getting invalid mex file or Mex file entry point is missing… Any suggestions? Please, make this work on mac and linux. I don’t know enough of C to translate to matlab etc, but maybe someone could do that and see if performance is still good?
[Reply]
Hello Luigi,
the link to the handranks file is broken, and I cannot run the program without it (I get an error when executing the function in BuildTable.mexw32). Could you please re-post it?
Regards,
Guille
[Reply]
Hello Luigi,
I just found that I could get the handranks.dat file from the stand-alone version in PokerPredictor_v1.0.zip
Regards,
Guille
[Reply]
Luigi Giaccari Reply:
February 26th, 2010 at 22:12
Thank you for the broken link report,
I just fixed it!
[Reply]
Hey Luigi,
How did you generate the handrank.dat file? It seems to me that you are using the array derived from this file when computing whether a hand has won or not (by computing an index into it). Is there any place I can find any info about how this mechanism works? There seems to be an evaluator help somewhere as you mention it in the code (in GameSimulation.cpp), e.g.:
rank5=53;//like the evaluator help says
Can I find this evaluator description/help somewhere?
Many thanks,
Jason
[Reply]
Luigi Giaccari Reply:
March 21st, 2010 at 18:01
The HandRanks File is an hash table with the handranks evaluated as integer number. The higher the integer the higher the hand value.
I found it on the p2p forum, there is a code to generate it and the explanation on how it works. Pretty interesting !
Can not find the link where I download it but you can try with this, it seems similar:
http://www.pst.ifi.lmu.de/~hammer/poker/handeval.html#source
Luigi
[Reply]
hello luigi,
i have a problem compiling the program on matlab:
while using this command : mex -setup
i have the following error
C:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: ‘BuildTable.cpp’ not found.
I have put the file BuildTable.cpp in the directory that is looking but i continue to have this error.
Can you help me compile the program?
I thing I’m missing something:S
Please answer asap (It’s for a survey about poker calculators:) )
Thanks in advance!
[Reply]
Luigi Giaccari Reply:
May 2nd, 2010 at 08:03
Please follow the Matlab users instructions in the post.
Mex-setup is not for mexing files, it is to configure the mex compiler. Once you have chosen a mex compiler you can compile all of them with testmexfiles.m script.
Otherwise you can download precompiled files from the download area in the post.
Luigi
[Reply]
Just trying to install the standalone version PokerPredictor_v1_2_Setup.exe and am receiving a “this file contains invalid data” error from the Poker Predictor Install Program. Any ideas what causes this?
[Reply]
Luigi Giaccari Reply:
May 12th, 2010 at 09:11
I have no idea, that’s the first time it happens.
Anyway you may want to try the new standalone (VB coded) version at:
http://www.advancedmcode.org/poker-predictor-a-free-texas-holdem-odds-and-probability-computer.html
Luigi
[Reply]
tom Reply:
May 13th, 2010 at 03:49
I get the same error with the vb version on two different computers. any ideas?
[Reply]
Luigi Giaccari Reply:
May 13th, 2010 at 07:38
Which OS?
I am afraid that’s a windows problem! some corruption somewhere in the OS….
Hi
Think this is great work!
However, when I click continue after running PokerPredictor.m in Matlab7.1.0.246 (R14) Service Pack 3
??? The class “handranks” is undefined.
Perhaps Java is not running.
Error in ==> PokerPredictor at 53
TablePtr=handranks.dat;%load the look up table;
Also even if I try and run TestMexFiles.m I get the following:
>> TestMexFiles
Error: Could not detect a compiler on local system
which can compile the specified input file(s) at D:\Matlab71/bin/mexsetup.pm line 501.
Before Compiling Files you need to download the HandRanks table,
Follow the Installation instructions on:
http://www.advancedmcode.org/poker-predictor.html
Any help would be appreciated. Thx
[Reply]
Luigi Giaccari Reply:
June 20th, 2010 at 09:31
To run poker predictor on matlab you have to do some operations, you can follow the links in this post in the matlab users section:
-download the handranks file
-download the poker predictor scripts
-compile c++ code into matlab binary files using testmexfiles.m
If you are not comfortable with mexfiles you can use this guide:
http://www.advancedmcode.org/writing-c-functions-in-matlab-mex-files.html
or alternatively you can download precompiled files (for win32 and linux) in the same sectiont.
If you want a matlab independent version you can find a a link for that too!
Hope everything is clear! Good Luck
Luigi
[Reply]
hello ,
first i wish to thank you in advance for this app it really looks great,
but I am also trying to install the standalone version PokerPredictor_v1_2_Setup.exe and am receiving a “this file contains invalid data”.
i tried the new version as well but same msg “this file contains invalid data”.
am using XP and win 7.
any suggestions ?
thanks
[Reply]
Luigi Giaccari Reply:
July 5th, 2010 at 20:08
I have no idea, it must be some usual windows compatibility problem!
I have tested it on several windows platform and it used to work good!
I am afraid I can not help!
Sorry!
Luigi
[Reply]
Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>



















































Luigi Giaccari Reply:
December 12th, 2009 at 07:10
You don’t have the following binary files:
-BuildTable
-GameSimulation
-DeleteTable
You can get them compiling the c++ included in the basic package or you can download precompiled files for Win32 :
download precompiled files for Win32
if you are not comfortable with MEX-files and you have Windows system.
Unfortunately I don’t have Precompiled for MAC or Linux.
[Reply]
Rocko Chen Reply:
December 13th, 2009 at 06:10
Just wanted to say thank you very much for making this available.
[Reply]