accessing value of a random variable in PyMC3

蹲街弑〆低调 提交于 2019-12-23 11:52:30

问题


In PyMC2, there are methods random() and value() to generate a random value, and get the current value of random variables. Is there any way to do the same in PyMC3?

p = pm.Dirichlet('p', theta=np.array([1., 1., 1.]))
p.random()
p.value

回答1:


Not quite yet, but there is an almost done PR here: https://github.com/pymc-devs/pymc3/pull/784

There is no real .value as we store state outside of the RVs now.



来源:https://stackoverflow.com/questions/31485354/accessing-value-of-a-random-variable-in-pymc3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!