0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PyMC3でsample_posterior_predictiveが使えない

Posted at

Abstract

PyMCでMCMCをやるときに、時々遭遇するこのエラー。
度々調べて、もう調べたくないのでメモ。

AttributeError: 'module' object has no attribute 'sample_posterior_predictive'

やること

pip install -U pymc3

とりあえず、普通にこれで使えるようになります。
もしバージョンをあげたくないなら、

# pm.sample_posterior_predictive(trace, sample=1000, model=model) 
pm.sample_ppc(trace, sample, model=model)

でいけます。

ただし、注意が必要です。本当は、sample_ppcは廃止なので
本当はsample_posterior_predictiveでかける方が良いです。

Ref

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?