I’m pretty new to PyMC and ArviZ. Using versions pymc => 4.2.2
and arviz => 0.12.1
. I’m exploring arviz.compare. The first argument is a dictionary of InferenceData
objects, which coincides with the return type of pymc.sample. However the following simple example blows up with a TypeError. It looks like another post may contain a solution, but my setup is managed by conda, not pip. Any recommendations?
y_obs = stats.norm.rvs(size=100)
# Normal with fixed μ=0 and σ free.
with pm.Model() as model:
σ = pm.HalfNormal('σ', 1)
y = pm.Normal('y', 0, sigma=σ, observed=y_obs)
idata_1 = pm.sample(1000)
# SkewNormal with μ=0, α=1 and σ free.
with pm.Model() as model:
σ = pm.HalfNormal('σ', 1)
y = pm.SkewNormal('y', sigma=σ, observed=y_obs)
idata_2 = pm.sample(1000)
az.compare({'1': idata_1, '2': idata_2})
TypeError Traceback (most recent call last)
File ~/miniconda3/envs/pymc/lib/python3.10/site-packages/pandas/core/indexes/base.py:3803, in Index.get_loc(self, key, method, tolerance)
3802 try:
-> 3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
File ~/miniconda3/envs/pymc/lib/python3.10/site-packages/pandas/_libs/index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~/miniconda3/envs/pymc/lib/python3.10/site-packages/pandas/_libs/index.pyx:144, in pandas._libs.index.IndexEngine.get_loc()
TypeError: 'slice(None, None, None)' is an invalid key
...