AttributeError: 'MultiTrace' object has no attribute 'posterior'

idata.posterior[“alpha”].sel(draw=slice(0, 4))


AttributeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_6648\586317849.py in
----> 1 idata.posterior[“alpha”].sel(draw=slice(0, 4))

D:\Users\admin\anaconda3\lib\site-packages\pymc3\backends\base.py in getattr(self, name)
365 if name in self.stat_names:
366 return self.get_sampler_stats(name)
→ 367 raise AttributeError(f"‘{type(self).name}’ object has no attribute ‘{name}’")
368
369 def len(self):

AttributeError: ‘MultiTrace’ object has no attribute ‘posterior’

How did you generate idata (i.e., what arguments did you pass to pm.sample())? And what version of pymc are you using? It looks like you are assuming a (v4-style) inferenceData object, but idata is instead a (v3-style) MultiTrace object.