Skip to content

game_theory: Add vertex_enumeration - #326

Merged
mmcky merged 2 commits into
QuantEcon:masterfrom
oyamad:vert_enum
Aug 18, 2017
Merged

mmcky merged 2 commits into
QuantEcon:masterfrom
oyamad:vert_enum

Conversation

@oyamad

@oyamad oyamad commented Aug 18, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown

Coverage Status

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

@mmcky

mmcky commented Aug 18, 2017

Copy link
Copy Markdown
Contributor

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

@oyamad

oyamad commented Aug 18, 2017

Copy link
Copy Markdown
Member Author

@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.

3 participants