I generally recommend using
...
idata = pm.sample(...
trace = idata.posterior # optionally add .stack(sample=("chain", "draw"))
trace
is then an xarray.Dataset
which has a lot of features, you can select variables with ["var-name"]
, compute means, quantiles, plot the variables…
Here are some docs that showcase InferenceData capabilities:
- A Primer on Bayesian Methods for Multilevel Modeling — PyMC3 3.11.2 documentation
- Rugby analytics case study (docs will be updated with these changes with next release)
- Introduction to xarray, InferenceData, and NetCDF for ArviZ — ArviZ dev documentation
- Working with InferenceData — ArviZ dev documentation