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でかける方が良いです。