gambit icon indicating copy to clipboard operation
gambit copied to clipboard

[ENH] Revise API of mixed strategy/behaviour profiles to be products of distributions

Open tturocy opened this issue 9 months ago • 1 comments

At present, the interface for MixedStrategyProfile/MixedBehaviorProfile (and their Python equivalents) allow the setting of a probability of an individual strategy/action. Based on some discussions, it seems that this is probably not an ideal way to express these objects.

Both of these are actually products of multinomial probability distributions. It is difficult to think of a legitimate use case in which the probability of just one action/strategy would need to be set, as opposed to setting the whole vector of probabilities.

We do support counts/weights data for the components of these profiles. This is useful as a convenience, but also it is essential for estimation - for example the counts are needed as inputs to logit_estimate in order to return the correct log-likelihoods.

This therefore suggests the following:

  • We have a concept of a "multinomial distribution". In our case, we would allow weights/counts, similar to Python's random.choices. for example. So any distribution of non-negative numbers would be valid, except for all zeroes.
  • We remove setters that set the probability of an individual strategy or action, and set only the distribution over a player or an information set. As our current (and intended) API treats strategies and actions as being ordered, this is not ambiguous (although we might also allow a mapping-like objects of labels to values as well in Python).
  • We retain the existing normalize operation for explicit normalisation.
  • For computing expected payoffs, weights would be implicitly normalised to proper probability distributions.

Perhaps the open question is whether to have different setters for a proper probability distribution versus weights, or to have a separate concept of mixed profiles versus "weight" profiles - where the former would insist on sum-to-one as a way to help calling code avoid subtle bugs if it intends to have probability distributions but for some reason does not.

tturocy avatar Feb 09 '26 16:02 tturocy

im working on this issue and implementing changes on the wrappers for restricted access to every particular player/infoset and change helper methods and test cases accordingly.

ill submit a pr for this

hardikxk avatar Feb 20 '26 10:02 hardikxk