Custom report: Variance in hands dealt

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Custom report: Variance in hands dealt

Postby feint06 » Mon Nov 17, 2008 6:34 pm

I hadn't played around with the custom statistics/reports before and I think its the coolest thing. I'd like to try to make a custom report, but I'm afraid its a bit over my head at the moment and am hoping some of you guys can help guide me on the way.


What I would like is to have a report list all the times I've been dealt each holdem hand and then have a column next to it showing the probability of being dealt that hand that number of times based on the total hands dealt.


For example,

I was dealt AKs 488 times in 170,302 hands. I would have expected AKs 1 out of every 331 hands, or 514.5 times.

But just showing that as a percentage doesn't really do much, I'd rather base it on a percentage +/- of standard deviation since this should be a random distribution. The standard deviation is approximated by be the square root of the expected value -- so in this case sqrt(514.5) or 22.7.

514-488=26, and 26/22.7 = 1.15 so I am about 115% of 1 SD "unlucky" in getting AKs.

The 1st SD accounts for a 34.1% range in probability, the 2nd SD accounts for 13.6%, and the 3rd SD accounts for 2.1% (If I found myself beyond a 3rd SD over a significant sample, I'd assume the RNG was flawed and switch sites!). Anyway, 15% of 13.6% (for the 2nd SD) is 2% plus the 34.1% (from the 1st SD) bring the total to 36.1% "unlucky".

So I would want my report to be like the following:

AA XXX XX.X%
AKs 488 -36.1%
.
.
.
.
170,302


I've done some programming before in matlab, and a tiny bit on TI- calculators so I'm not a total noob. But I suspect this will be a little bit of an undertaking due to the whole SD thing...





So I guess the first question is 'is it even possible to make this report?"

Assuming the answer is yes, the next questions would be:

What are the names of each different hand called in the database? I don't care if it is Ah Ks -- AKo is all I'd need to know.
Is there a name for the total number of hands in the database? If so what is it, if not, what db parameter would you sum to get it? (Ideally I'd like this to be filterable so I could see how I'm running over the last month vs last year).
Is there a classification for just pocket pairs, just suited cards, and just unsuited non-paired hands (since the expected value/SD would be the same for each of those 3 groups)

Is there a place I can see what the programming code format should be? IE
If SD >3 fprintf"pick a new site!"
elseIf SD >2
n=(3-SD)
p=(0.021*n+0.477)*100
elseif SD >1
n=(2-SD)
p=(0.136*n+0.341)*100
else
n=SD
p=(0.341*n)*100
feint06
 
Posts: 859
Joined: Fri Feb 01, 2008 10:18 pm

Re: Custom report: Variance in hands dealt

Postby WhiteRider » Tue Nov 18, 2008 5:50 am

I think you ought to be able to do this, although it's not straightforward.

You can get AKo type representation using:
lookup_from_id(id_holecard, 'cardpair')
(see the HoleCards stat)
..or you could construct each card pair like Ah Ks using:
lookup_from_id(id_holecard1, 'card')

Working out how often you should get each combination of XYo / XYs / PP could be tricky (I mean, knowing which it is) so using the Ah Ks pairs might be easier, but then you would need to sum up the combinations afterwards since you'd have each pair that makes up AKo individually.

Sorting it out by date should be fine afterwards because you can just use filters.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 50 guests