gambit icon indicating copy to clipboard operation
gambit copied to clipboard

ENH: Add tests for profile regrets

Open tturocy opened this issue 2 years ago • 2 comments

We are not yet testing these functions directly in pygambit:

  • MixedStrategyProfile.player_regret
  • MixedStrategyProfile.max_regret
  • MixedBehaviorProfile.infoset_regret
  • MixedBehaviorProfile.max_regret

There are three kinds of tests that can and should be written:

  1. Testing that these functions take on expected values in known cases. We call these "reference" tests, and they exist already in the test suite for MixedStrategyProfile.strategy_regret and MixedBehaviorProfile.action_regret, which tests can be used as example starting points.

  2. Testing these functions are internally consistent. strategy_regret/player_regret/max_regret satisfy some simple identities, as do action_regret/infoset_regret/max_regret. These can be independently computed easily in Python and checked.

  3. In the tests so far for the Nash equilibrium computation methods, we do not check for Nash-ness of the output. max_regret can be added to these tests. In particular, for Nash algorithms that take a maxregret acceptance parameter, the value of `max_regret for any returned mixed profile must be no more than the specified acceptance value.

tturocy avatar Feb 09 '24 13:02 tturocy

With regard to Ted's point 1: There are lots of examples of reference tests for liap_value, which is 0 if and only if the corresponding profile is a Nash equilibrium, that use Nash equilibria and test for the Liapanov value being 0. Any such example can be used as a reference test for max regret and player regret (for all players) being zero.

rahulsavani avatar Feb 11 '24 08:02 rahulsavani

hey @tturocy can you assign this issue to me... i am working on it

ankur-kalita avatar Aug 06 '24 18:08 ankur-kalita