Python 中的纳什均衡
是否有一个 Python 库可以解决两人零博弈的纳什均衡?我知道解决方案可以用线性约束来写,理论上,scipy 应该能够优化它。然而,对于两人零博弈,解是精确且唯一的,但某些求解器对于某些问题无法收敛。
我不想在 Python 网站上的 线性编程 上列出任何库,而是想知道哪个库是什么在易用性和速度方面最有效。
Is there a Python library out there that solves for the Nash equilibrium of two-person zero-games? I know the solution can be written down in terms of linear constraints and, in theory, scipy should be able to optimize it. However, for two-person zero-games the solution is exact and unique, but some of the solvers fail to converge for certain problems.
Rather than listing any of the libraries on Linear programing on the Python website, I would like to know what library would be most effective in terms of ease of use and speed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Raymond Hettinger 写了解决零和支付矩阵的方法。它应该可以满足您的目的。
至于用于解决博弈论的更通用的库,没有专门为此设计的库。但是,就像你说的,scipy 可以解决这样的优化问题。您也许可以使用 GarlicSim 做一些事情,它声称适用于“任何模拟类型:物理、博弈论……”但我以前从未使用过它,所以我不能推荐它。
Raymond Hettinger wrote a recipe for solving zero-sum payoff matrices. It should serve your purposes alright.
As for a more general library for solving game theory, there's nothing specifically designed for that. But, like you said, scipy can tackle optimization problems like this. You might be able to do something with GarlicSim, which claims to be for "any kind of simulation: Physics, game theory..." but I've never used it before so I can't recommend it.
还有 Gambit,它设置起来有点困难,但是有一个 python API。
There is Gambit, which is a little difficult to set up, but has a python API.
我刚刚开始编写一些博弈论Python代码: http://drvinceknight.github.com/Gamepy/< /a>
有这样的代码:
这些代码都可以在 github 上找到,该网站(本答案开头的第一个链接)解释了代码的工作原理并提供了用户示例。
您可能还想看看我从未使用过的“Gambit”。
I've just started putting together some game theory python code: http://drvinceknight.github.com/Gamepy/
There's code which:
The code is all available on github and that site (the first link at the beginning of this answer) explains how the code works and gives user examples.
You might also want to check out 'Gambit' which I've never used.