方法“fixation_probabilities”在 Nashpy 库中找不到
我正在尝试使用莫兰过程获得注视概率。
我已从该网站复制了示例(https:// /nashpy.readthedocs.io/en/stable/how-to/obtain-fixation-probabilities.html),但将其更改为我的矩阵和初始总体,但出现错误
np.random.seed(0)
repetitions = 2000
initial_population = (10,0)
A = np.array([[1, 2], [2, 1]])
game = nash.Game(A)
probabilities = game.fixation_probabilities(initial_population= (10,0), repetitions = 2000)
probabilities
并出现此错误:
“Game”对象没有属性“fixation_probabilities”
我该如何解决这个问题?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找的函数是
nashpy.game.Game
https://nashpy.readthedocs.io/en/stable/reference/source/nashpy.html?highlight=Game#nashpy.game.Game尝试使用
game = nash.game.Game (一)
The function you are looking for is
nashpy.game.Game
https://nashpy.readthedocs.io/en/stable/reference/source/nashpy.html?highlight=Game#nashpy.game.GameTry with
game = nash.game.Game(A)
Nashpy 版本 fixation_probabilities 方法>0.0.27。
它需要 Python 3.8。如果您使用 pip 和 Python 3.8 安装 Nashpy,那么您当前已经获得了 0.0.30 版本。
当使用 pip 和 Python 3.7 安装 Nashpy 时,您只能获得版本 0.0.21,因此您应该将 Python 版本升级到 3.8。
The method
fixation_probabilities
was added in Nashpy version 0.0.27.It requires Python 3.8. If you install Nashpy using pip with Python 3.8 you are currently already getting version 0.0.30.
When installing Nashpy using pip with Python 3.7 you only get version 0.0.21, so you should upgrade your Python version to 3.8.