PDA

View Full Version : Error in the way Rivercallnet$ and Rivercalleff are calculated



creedofhubris
03-02-2009, 11:11 AM
I'm working on some custom reports and have been picking over the formulas for HEM stats, and I've found a fairly significant error in the way the river call efficiency and net $ stats are calculated, because they use the net amount won as a baseline rather than the pot on the river. It's a big mistake to calculate the efficiency of a river call based on the net rather than the gross. The formulas correctly calculate the value of a losing call, but underestimate the value of a winning call.

Let's say I'm heads up with an opponent, and we each put in $5 preflop. On the river, the opponent bets $5 into a $10 pot. I call, and my hand is the best. I have won a $20 pot, of which $10 came from my opponent, so the formula would credit me with a $10 net win. However, the money we've put in on prior streets is dead and is not relevant to river decisionmaking. Our river call actually makes us $15, because that is the size of the pot before we make the call. If we make that call 3x and lose twice, the efficiency of our river call should be 15/10 = 1.5, not 10/10 = 1.

If I've got my syntax right, this can be mostly fixed by replacing "then ph.NetAmountWon" and "then ph.NetAmountWon + RIVER.CallAmount" with "then pkh.showdownpotsize - River.callamount".

This fix won't handle split pots and winning a side pot while losing the main pot correctly, but this should be a lot closer to reality than the current formulae.



Stat GroupName="River" ColumnName="RiverCallNet$" ValueExpressions="sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWOn < 0 then RIVER.CallAmount else 0 end) as CallAmountOnRiver;sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWon > 0 then ph.NetAmountWon else 0 end) as WonAmountOnRiverCall" Evaluate="(WonAmountOnRiverCall-CallAmountOnRiver)/100.0" ColumnHeader="River\nCall\nEff $" ColumnFormat="$0.00" ColumnWidth="61" Tooltip="Net $ won or lost making river calls (or check calls) on River. Calculated as (TotalAmountWon-CallAmount) when you won the hand - total CallAmount when you lost the hand"

Stat GroupName="River" ColumnName="RiverCallEff" ValueExpressions="sum(case when ph.riverplayeractiontype_id in (11,66) then RIVER.CallAmount else 0 end) as TotalCallAmountOnRiver;sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWon > 0 then ph.NetAmountWon + RIVER.CallAmount else 0 end) as TotalWonAmountOnRiverCall" Evaluate="(TotalWonAmountOnRiverCall/1.0/TotalCallAmountOnRiver)" ColumnHeader="River\nCall\nEfficiency" ColumnFormat="0.00" ColumnWidth="61" Tooltip="Shows average return per 1$ of river calls and check calls."

morny
03-02-2009, 01:21 PM
Escalated to Roy, hell respond asap

creedofhubris
03-02-2009, 10:22 PM
After further thought, I'm wrong about the correct implementation of the formula. The two relevant numbers are just the sum of all river calls vs the sum of the final size of pots when we win. (Again, ignoring split pots.) I was wrong about the efficiency of the calling in my example above; if we make 3 $5 calls and win one $20 pot, we've put in $15 and gotten back $20, so return is 20/15 on our money. The formulas below reflect this.

These formulas are working the way I think they should work when I plug them into my custom stats and handcheck them against some recent hands.

<Stat GroupName="Default" ColumnName="CorrectedRiverCallEff" ValueExpressions="sum(case when ph.riverplayeractiontype_id in (11,66) then RIVER.CallAmount else 0 end) as TotalCallAmountOnRiver;sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWon > 0 then pkh.showdownpotsize else 0 end) as TotalWonAmountOnRiverCall" Evaluate="(TotalWonAmountOnRiverCall/1.0/TotalCallAmountOnRiver)" ColumnHeader="River\nCall\nEfficiency" ColumnFormat="0.00" ColumnWidth="61" Tooltip="Shows average return per 1$ of river calls and check calls.">

<Stat GroupName="Default" ColumnName="CorrectedRiverCallNet$" ValueExpressions="sum(case when ph.riverplayeractiontype_id in (11,66) then RIVER.CallAmount else 0 end) as CallAmountOnRiver;sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWon > 0 then pkh.showdownpotsize else 0 end) as WonAmountOnRiverCall" Evaluate="(WonAmountOnRiverCall-CallAmountOnRiver)/100.0" ColumnHeader="River\nCall\nEff $" ColumnFormat="$0.00" ColumnWidth="61" Tooltip="Net $ won or lost making river calls (or check calls) on River. Calculated as (TotalAmountWon-CallAmount) when you won the hand - total CallAmount when you lost the hand">

creedofhubris
03-02-2009, 10:23 PM
Stat GroupName="Default" ColumnName="CorrectedRiverCallEff" ValueExpressions="sum(case when ph.riverplayeractiontype_id in (11,66) then RIVER.CallAmount else 0 end) as TotalCallAmountOnRiver;sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWon > 0 then pkh.showdownpotsize else 0 end) as TotalWonAmountOnRiverCall" Evaluate="(TotalWonAmountOnRiverCall/1.0/TotalCallAmountOnRiver)" ColumnHeader="River\nCall\nEfficiency" ColumnFormat="0.00" ColumnWidth="61" Tooltip="Shows average return per 1$ of river calls and check calls."

Stat GroupName="Default" ColumnName="CorrectedRiverCallNet$" ValueExpressions="sum(case when ph.riverplayeractiontype_id in (11,66) then RIVER.CallAmount else 0 end) as CallAmountOnRiver;sum(case when ph.riverplayeractiontype_id in (11,66) and ph.NetAmountWon > 0 then pkh.showdownpotsize else 0 end) as WonAmountOnRiverCall" Evaluate="(WonAmountOnRiverCall-CallAmountOnRiver)/100.0" ColumnHeader="River\nCall\nEff $" ColumnFormat="$0.00" ColumnWidth="61" Tooltip="Net $ won or lost making river calls (or check calls) on River. Calculated as (TotalAmountWon-CallAmount) when you won the hand - total CallAmount when you lost the hand"

Rvg72
03-03-2009, 07:59 PM
Thanks for the corrections, we have updated the stats in 1.08 Beta 16