When I am using trace data for posterior calculations like -

- generating trace summary - az.summary(trace)
- Converting to a dataframe - az.convert_to_inference_data(obj=trace).to_dataframe(include_coords=False,groups=“posterior”)
- Plotting trace - az.plot_trace(trace)

For each of these functions, I am getting the following error -

Got error No model on context stack. trying to find log_likelihood in translation.

The error goes away if I give the with model context like this -

with model_factory(df):

az.plot_trace(trace)

Can someone explain what that error is? and is it required to give context stack while using trace for posterior calculations?