Skip to content
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

game_theory: Add vertex_enumeration #326

Merged
merged 2 commits into from
Aug 18, 2017
Merged

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented Aug 18, 2017

Implement "vertex enumeration", using scipy.spatial.ConvexHull to compute convex hull, or facet enumeration, of the polars of the (translated) best response polytopes.

  • This is faster than support_enumeration:

    ns = [10, 11, 12]
    seed = 1234
    for n in ns:
        g = gt.random_game((n, n), random_state=seed)
        %timeit gt.support_enumeration(g)
        %timeit gt.vertex_enumeration(g)
    • support_enumeration:

      • n=10: 124 ms
      • n=11: 528 ms
      • n=12: 2.17 s
    • vertex_enumeration:

      • n=10: 8.95 ms
      • n=11: 21.8 ms
      • n=12: 64.4 ms
  • For some degenerate games, vertex_enumeration finds all the extreme equilibria, while support_enumeration fails:

    g = gt.NormalFormGame(
        [[(3, 3), (3, 3)],
         [(2, 2), (5, 6)],
         [(0, 3), (6, 1)]]
    )
    • support_enumeration:

      [(array([ 1.,  0.,  0.]), array([ 1.,  0.])),
       (array([ 0.        ,  0.33333333,  0.66666667]),
        array([ 0.33333333,  0.66666667]))]
    • vertex_enumeration:

      [(array([ 0.        ,  0.33333333,  0.66666667]),
        array([ 0.33333333,  0.66666667])),
       (array([ 1.,  0.,  0.]), array([ 1.,  0.])),
       (array([ 1.,  0.,  0.]), array([ 0.66666667,  0.33333333]))]
  • For highly degenerate games where some action is weakly dominated or payoff equivalent to some other mixed action, vertex_enumeration may return fewer equilibria than support_enumeration:

    g = gt.NormalFormGame(np.zeros((2, 2)))
    • support_enumeration:

      [(array([ 1.,  0.]), array([ 1.,  0.])),
       (array([ 1.,  0.]), array([ 0.,  1.])),
       (array([ 0.,  1.]), array([ 1.,  0.])),
       (array([ 0.,  1.]), array([ 0.,  1.]))]
    • vertex_enumeration:

      [(array([ 1.,  0.]), array([ 1.,  0.]))]

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 92.613% when pulling c276fd1 on oyamad:vert_enum into 188e5ba on QuantEcon:master.

@mmcky
Copy link
Contributor

mmcky commented Aug 18, 2017

Thanks @oyamad this PR looks like it is already in great shape. Are you happy for this to be merged?

@oyamad
Copy link
Member Author

oyamad commented Aug 18, 2017

@mmcky Yes, thanks.

@mmcky mmcky merged commit f9eb6a2 into QuantEcon:master Aug 18, 2017
@oyamad oyamad deleted the vert_enum branch August 18, 2017 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants