-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the "imitation game algorithm" by McLennan-Tourky #273
Conversation
08d0264
to
c73ab02
Compare
Also add
|
And do not raise a warning when
|
The issue #267 still remains with the default method
|
Print messages upon return (if verbose==2)
Because of KeyError from Numba
c73ab02
to
e35b46f
Compare
5f27eb9
to
1f50ffa
Compare
As a straightforward application of the imitation game algorithm to the best response correspondence, I added a function Example: In [1]: import quantecon as qe
In [2]: g = qe.game_theory.random_game((2, 2, 2), random_state=111111)
In [3]: print(g)
3-player NormalFormGame with payoff profile array:
[[[[ 0.57640636, 0.71718743, 0.3026873 ], [ 0.39465697, 0.65071946, 0.22605961]],
[[ 0.52818592, 0.38285955, 0.04301255], [ 0.09786016, 0.93869429, 0.32395105]]],
[[[ 0.82034185, 0.44532268, 0.41417313], [ 0.90843274, 0.94248307, 0.27377222]],
[[ 0.00997283, 0.8286954 , 0.50344024], [ 0.70533234, 0.54602381, 0.35982827]]]]
In [4]: epsilon = 1e-3
In [5]: NE = qe.game_theory.mclennan_tourky(g, epsilon=epsilon)
In [6]: NE
Out[6]:
(array([ 0.3473267, 0.6526733]),
array([ 0.04723827, 0.95276173]),
array([ 0.55683899, 0.44316101]))
In [7]: g.is_nash(NE, tol=epsilon)
Out[7]: True |
# Conflicts: # quantecon/game_theory/__init__.py
Hi @oyamad. Is this PR ready for review? |
@mmcky Yes, reviewing would be appreciated. |
@oyamad @mmcky This looks really nice to me. I like the way that the fixed point routine is built into the functions in I showed Rabee and Andy the code and they didn't provide detailed feedback but both seemed happy. I think this is good to merge. |
Do you guys have any opinion about #273 (comment) (or #267)? This is a minor point, but the two methods |
Based on #268.
Implement the fixed point computation algorithm by McLennan and Tourky "From Imitation Games to Kakutani."
It computes an approximate fixed point of a function that satisfies the assumptions of Brouwer's fixed point theorem, i.e., a continuous function that maps a compact convex set to itself.
For contraction mappings, the generated sequence is the same as that by function iteration, so for those functions there is no improvement.
An example from McLennan and Tourky (Example 4.6):
(It runs faster in a second run or later.)
With the default method
'iteration'
: