Access data from trace pymc4

I’m a beginner in pymc and bayesian modeling.
I watched a tutorial on youtube using Pymc3 for time series. That guy did like this:

np.mean(trace[‘delta’], axis=0)

and got the mean for the parameter ‘delta’. This however dosen’t work in Pymc4. How do I access the data variable ‘delta’ in a trace object from pymc4?

You can do trace.posterior["delta"].mean(("chain", "draw")). The output is now InferenceData. There is more info on working with InferenceData at Working with InferenceData — ArviZ dev documentation (I recommend you install arviz dev version to follow the tutorial)