How can I jitter the values in InferenceData object so I can plot without degeneracy issues? (aka map a function that outputs random values for each element)

I think the .map approach is the closer you’ll get to this. To have the exact same transformation applied every time you’d need to include the seed inside the function, something like:

choices = np.linspace(-1e-10, 1e-10, 100)
idata = mdl.idata.map(lambda x: x + np.random.default_rng(seed=42).choice(choices), groups='prior')

regarding lazy operations, ArviZ does nothing on this and delegates everything to xarray, so you’d have to convert the datasets inside inferencedata to dask (you can use the .chunk method for this) so computations won’t actually be evaluated until you call .compute or access the data as a numpy array with .values for example.

Another option you might want to consider is excluding the diagonal from plotting. The Label guide — ArviZ 0.15.1 documentation covers this using precisely a covariance matrix as example, 3x3 in that case, not sure how bit yours is.

1 Like