对于 pymc3 的命令 pm.plot_posterior

问题描述

通常,我发现我们使用 pm.binomial() 等等。并使用 pm.plot_posterior 我们得到离散图,我的问题是为什么我必须得到的图是曲线?有人能指教我吗?

我想得到:

enter image description here

但我得到了图表:

enter image description here

解决方法

kind 参数接受 "kde"(连续的默认值)或 "hist"

import arviz as az

az.plot_posterior(trace,kind="hist")

请参阅the documentation