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.