What does this expression do

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

What does this expression do

Postby hudplz » Sun Feb 08, 2009 9:52 am

Hi, I am looking at this Player Statistics column:

sum(if[(holdem_hand_player_statistics.flg_p_first_raise) AND (holdem_hand_player_statistics.flg_p_fold) and (holdem_hand_player_statistics.position = 2),1,0])


I know nothing about this stuff so am looking at different expressions/stats etc. to understand how its done. The description for the above expression is "Number of times player fold to a 3bet when raised first in from the HJ." (Its from the repository.) Is that really exactly what it shows? Looking at it as a noob it seems like it might also include the situation where the player opened HJ, got 3bet, decided to 4bet, then folded to a push. And also the situation where he got 3bet, then someone cold 4bet, then he folded when it got back to him. Is this the situation, or does it strictly show open from HJ, then fold to 3bet?

Dont laugh; this is as foreign to me as brain surgery :D
Thanks.
hudplz
 
Posts: 33
Joined: Mon Mar 10, 2008 11:46 am

Re: What does this expression do

Postby kraada » Sun Feb 08, 2009 11:13 am

Let me help you break the expression down:

The if[] statement is if[condition, then, else] so in the sum(if[condition, 1, 0]) construction each time the condition is true, the value of the column is incremented. Otherwise it's left alone. So basically we get a number which is the count of how many times the condition is true.

So the condition here is:

(holdem_hand_player_statistics.flg_p_first_raise) AND (holdem_hand_player_statistics.flg_p_fold) and (holdem_hand_player_statistics.position = 2)

flg_p_first_raise is true if you were the first raiser into a hand preflop. flg_p_fold means you folded preflop. position = 2 is two off the button, or the hijack.

So this whole thing is true if you: raised first in from the hijack and folded preflop. This doesn't mean you folded to exactly a 3bet, just folded at all, so if you raised from the HJ the button 3bet and the BB shoved and you folded that would be counted here as well. Or as you say, if you did 4bet but fold to a 5bet shove that would also be included here. If you wanted to filter out those other situations you could add: AND NOT(holdem_hand_player_statistics.flg_p_4bet) which would mean "and you don't 4bet" or you could specifically look for a fold to an exact 3bet . . .

These stats can be very nuanced and it depends exactly what you're looking for, so you do have to be careful sometimes.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: What does this expression do

Postby hudplz » Sun Feb 08, 2009 2:57 pm

Gotcha. So I guess you could say a more accurate description of the stat is "made first raise, folded to further action."

Im trying to figure out how to have a "fold to 3bet in position" and a "fold to 3bet out of position." This is what I have so far. Am I on the right lines?

sum(If[holdem_hand_player_statistics.flg_p_first_raise AND holdem_hand_player_statistics.enum_p_3bet_action = 'F'], 1, 0)

To get the number of times I make the first raise then fold to a 3bet.

sum(If[holdem_hand_player_statistics.flg_p_first_raise AND holdem_hand_player_statistics.flg_p_3bet_def_opp], 1, 0)

To get the number of times I made the first raise and faced a 3bet. So the first divided by the second * 100 would give a version of "fold to 3bet %" would it not? (No doubt there are errors?)

How would I make it a "fold to 3bet OOP %? Can I somehow compare "holdem_hand_player_statistics.position" and "holdem_hand_player_detail.val_p_raise_aggressor_pos"?
hudplz
 
Posts: 33
Joined: Mon Mar 10, 2008 11:46 am

Re: What does this expression do

Postby kraada » Mon Feb 09, 2009 10:11 am

Your two definitions you have correct: one thing to note, though is that this doesn't distinguish between open raises that are steals and open raises that aren't.

That's why I have Fold to 3-bet PF NvBS (not vs a blind steal), which gives me the percent that someone open raises, folds to a 3bet and they weren't stealing. Some people do things pretty differently if they're stealing, so it's something to keep in mind.

The position information is really tricky. There's a flg_f_has_position flag for whether or not someone has absolute position on the flop -- but that requires there to be a flop.

val_p_raise_aggressor_pos is also a bit non-obvious in how it works:

If you make the only raise preflop, val_p_raise_aggressor_position (hereinafter RAP) is -1. If there is no raise RAP is an empty string. If there is ever a raise by anybody other than you, RAP is the value of the position of the last non-you person to raise, regardless of whether you reraise.

So if someone opens UTG and you call and it goes to a flop and you're 9 handed, RAP is 6. If someone opens UTG you reraise, he calls and you go to a flop, RAP is still 6. If someone opens UTG you reraise and the SB comes over the top and you call, RAP is 9. If UTG opens, the HJ reraises, it folds to UTG who pushes and HJ calls, RAP is 6.

It took me a while to get used to how that field works, so I wanted to make sure you had the cases clear before moving forward. I think you can manage something about 3betting OOP vs IP using it, but I'd have to think quite a bit more to make sure I got it right. Hopefully that clarification will help you on your way to figuring it out, also :)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: What does this expression do

Postby hudplz » Tue Feb 10, 2009 2:04 pm

Well, I have gotten more familiar with making custom stats over the last day and have completed some on my own. But this positional fold to 3bet I believe simply cannot be done with whats available. Not with complete accuracy. There is this situation:

We open CO, BTN cold calls, SB 3bets, we call, BTN pushes...

using "val_p_raise_aggressor_position," we will be flagged as calling OOP when I would consider us to be IP even though we have BTN behind. We will be IP on the 3bettor. (Who we would usually expect to be the final aggressor.)

However, this specific and probably very rare. I havent thought of another situation that would mess things up. Can you think of any? If this is the only time it breaks I will still use it.

There is no way to specify a non-multiway pot, is there? Or that "nobody 4bet?" Or that the last raise was a 3bet?
hudplz
 
Posts: 33
Joined: Mon Mar 10, 2008 11:46 am

Re: What does this expression do

Postby kraada » Tue Feb 10, 2009 3:27 pm

You're right that there are going to be some very specific spots that you just can't pick out uniquely, like the one you mentioned. The good news is, as you said, it doesn't come up much; multiway 4-bet pots happen awfully rarely. You could make sure you never faced a 4bet though: holdem_hand_player_statistics.flt_p_4bet_def_opp would be false in that case (you never had a chance to defend against a 4bet). This will pick up cases where you raise, get 3bet and you 4bet though as you never have a 4bet defense opportunity (it would keep you from facing 5 bets too, which may come up in weird multiway spots I suppose). If you never faced a 4bet but you called a 3bet then that must mean no 4bet happened (if you fold to the 3bet of course, then there could be a 4bet that you never faced . . .).
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: What does this expression do

Postby hudplz » Tue Feb 10, 2009 7:31 pm

How do I work out the position bit? For the out of position stat I am trying to put this:

"...AND holdem_hand_player_statistics.position > holdem_hand_player_details.val_p_raise_aggressor_pos"

and this is making it say the expression is not valid SQL. If I remove the above part, the expression is valid.
hudplz
 
Posts: 33
Joined: Mon Mar 10, 2008 11:46 am

Re: What does this expression do

Postby WhiteRider » Wed Feb 11, 2009 7:56 am

You have an extra 's' on the end of "holdem_hand_player_details".
When you get something like this that won't validate, the best thing I find to do is to recreate the whole expression using the 'insert' link rather than typing it yourself - it's easy to make that sort of mistake.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: What does this expression do

Postby hudplz » Wed Feb 11, 2009 8:50 am

Ah yes, that fixed it. Thanks for the help both you guys. Good job.
hudplz
 
Posts: 33
Joined: Mon Mar 10, 2008 11:46 am


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

Who is online

Users browsing this forum: No registered users and 1 guest

cron
highfalutin