Poker-AI.org
http://poker-ai.org/phpbb/

Simple questions
http://poker-ai.org/phpbb/viewtopic.php?f=24&t=2957
Page 1 of 1

Author:  karma [ Sat Jan 09, 2016 6:11 pm ]
Post subject:  Simple questions

Hello, i have some doubts(?) about Weighting the enumerations..

first of all.. the weight table is used when is calculated the potential and strength of the hand, right?.. then

Code:
 if(ourrank>opprank){
    ahead += weightTable[i];
 }
 else if(ourrank==opprank){
    tied += weightTable[i];
 }
 total += weightTable[i];
 ...               
 strength = (ahead+tied/2)/total;


is this code right? or "total += weightTable[i]" should be "total += 1"

second..
According to Davidson paper:

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }
}

"The relative value for each hand is increased or decreased to be consistent with every opponent action."

i can't see the way of increase the value with WT[E] = WT[E] * PT[A], if WT[E] is between 0 to 1, and in each street is mutiplied by other value between 0 to 1... how this work?

Thanks

Author:  spears [ Sun Jan 10, 2016 3:37 pm ]
Post subject:  Re: Simple questions

karma wrote:
Hello, i have some doubts(?) about Weighting the enumerations..

first of all.. the weight table is used when is calculated the potential and strength of the hand, right?.. then

Code:
 if(ourrank>opprank){
    ahead += weightTable[i];
 }
 else if(ourrank==opprank){
    tied += weightTable[i];
 }
 total += weightTable[i];
 ...               
 strength = (ahead+tied/2)/total;


is this code right? or "total += weightTable[i]" should be "total += 1"

If you believe opponent holds a uniformly distributed hand then every weightTable[i] is the same and could be 1. If you believe opponent is more likely to hold some cards than others then some weightTable[i] are greater than others.

karma wrote:
second..
According to Davidson paper:

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }
}

"The relative value for each hand is increased or decreased to be consistent with every opponent action."

i can't see the way of increase the value with WT[E] = WT[E] * PT[A], if WT[E] is between 0 to 1, and in each street is mutiplied by other value between 0 to 1... how this work?

Thanks

To get the correct probabilities you would just normalise WT. As it is the the relative values of WT are correct.

Author:  karma [ Sun Jan 10, 2016 5:35 pm ]
Post subject:  Re: Simple questions

spears wrote:
If you believe opponent holds a uniformly distributed hand then every weightTable[i] is the same and could be 1. If you believe opponent is more likely to hold some cards than others then some weightTable[i] are greater than others.

Yes, I understand it, I do this thinking that is more likely to hold some cards than others, my question is more stupid, for example:
weightTable lenght = 3.. I lost (with 0.50 prob. hold it), won (with 0.75 prob. hold it) and tie (with 0.25 prob. hold it)..
then is..
strength = (0.75+0.25/2) / (0.50+0.75+0.25)
or
strength = (0.75+0.25/2) / (1+1+1)
??

spears wrote:
To get the correct probabilities you would just normalise WT. As it is the the relative values of WT are correct.

Then for example.. if opp hold 72 preflop and call a raise, WT[72] was equal to 1, becomes 0.1.. in flop 725, opp raise, then.. WT[72] = 0.1 * 0.9 = 0.09 ??

Thanks so much

Author:  spears [ Sun Jan 10, 2016 6:11 pm ]
Post subject:  Re: Simple questions

Consider a toy game where both players can hold only A, K, Q or J.
- Hero holds K.
- Villain's weight table is {0.15, 0.5, 0.25, 0.1}.
- Hero's strength = (0.5/2 + 0.25 + 0.1) / (0.15 + 0.5 + 0.25 + 0.1)


Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }


     /* Normalise WT */
     TotalWeight = 0
     for each (E in WT) {
         TotalWeight = TotalWeight + WT[E]
     }
     for each (E in WT) {
         WT[E] = WT[E] / TotalWeight
     }
}

Author:  karma [ Sun Jan 10, 2016 7:06 pm ]
Post subject:  Re: Simple questions

thank you, i still confused with the updated method.. for me is more logic this..
Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = (WT[E] + PT[A]) / 2
     }

}

I will continue reading.. thanks

It is hard but i love this, all about AI in general, I hope I can contribute in the future

Author:  spears [ Sun Jan 10, 2016 10:24 pm ]
Post subject:  Re: Simple questions

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = (WT[E] + PT[A]) / 2
     }

}
E WT[E]old  PT[Raise]  WT[E]new
--------------------------------
A    0.25       1.0         0.625
K    0.25       1.0         0.625
Q    0.25        0.0        0.125
J    0.25         0.0        0.125
---------------------------------------
                              1.5 ????


The following is just Bayes Theorem. https://en.wikipedia.org/wiki/Bayes%27_theorem
probability of villain holding ace given action is raise = probability of action is raise given villain is holding ace * probability of villain holding ace / probability of action is raise

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }


     /* Normalise WT */
     TotalWeight = 0
     for each (E in WT) {
         TotalWeight = TotalWeight + WT[E]
     }
     for each (E in WT) {
         WT[E] = WT[E] / TotalWeight
     }
}

E WT[E]old  PT[Raise]  WT[E]new
--------------------------------
A    0.25       1.0         0.5
K    0.25        1.0        0.5
Q    0.25        0.0        0.0
J    0.25         0.0        0.0
--------------------------------------
                              1.0

Author:  eiisolver [ Mon Jan 11, 2016 12:59 am ]
Post subject:  Re: Simple questions

karma wrote:
Hello, i have some doubts(?) about Weighting the enumerations..

first of all.. the weight table is used when is calculated the potential and strength of the hand, right?.. then

Code:
 if(ourrank>opprank){
    ahead += weightTable[i];
 }
 else if(ourrank==opprank){
    tied += weightTable[i];
 }
 total += weightTable[i];
 ...               
 strength = (ahead+tied/2)/total;


is this code right? or "total += weightTable[i]" should be "total += 1"

Yes, that code looks right, and "total += 1" looks wrong.

karma wrote:
second..
According to Davidson paper:

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }
}

"The relative value for each hand is increased or decreased to be consistent with every opponent action."

i can't see the way of increase the value with WT[E] = WT[E] * PT[A], if WT[E] is between 0 to 1, and in each street is mutiplied by other value between 0 to 1... how this work?

Thanks


With that algorithm, you are right, WT[x] will only decrease. But the word "relative" is crucial here.

Example: suppose there are only two cards, Ace and King, and initially WT[K] = 0.5, WT[A] = 0.5. And suppose that the opponent calls, and the opponent model says that PT[call] for Ace is 40%, PT[call] for King is 80%, so now WT[A] = 0.5*0.4 = 0.2, WT[K] = 0.5*0.8 = 0.4. The probability that the opponent has ace is 0.2/(0.2+0.4) = 33%, king: 0.4/(0.2+0.4) = 67%. And if we have an ace (supposing ace is better than king), then with your strength computation algorithm, total becomes 0.4+0.2 = 0.6, ahead = WT[K] = 0.4, tied = WT[A] = 0.2 so strength = (ahead+tied/2)/total = (0.4+0.2/2)/0.6 = 83%.

Author:  karma [ Mon Jan 11, 2016 1:19 am ]
Post subject:  Re: Simple questions

aaaaah, i now understand, especially the meaning of normalise :mrgreen: ...
Thank you so much :)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/