python – module ‘pymc3.stats’ has no attribute ‘hpd’

I am trying to calculate highest posterior density (HPD) but it is giving this error. Also I already installed pymc3 using pip install pymc3 on jupyter notebook and the code will be ran on jupyter notebook.

from statsmodels.stats.proportion import proportion_confint
proportion_confint(814,1142,method='jeffreys')
import pymc3
from scipy.stats import beta
beta_dist=beta.rvs(size= 5000000, a=814.5,b=328.5)
print(pymc3.stats.hpd(beta_dist,alpha=0.05))

But it is showing this error

Input In [22], in <cell line: 1>()
----> 1 print(pymc3.stats.hpd(beta_dist,alpha=0.05))

AttributeError: module 'pymc3.stats' has no attribute 'hpd'

enter image description here

Read more here: Source link