You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Weird issue with fresh installation.
Using cmdstanpy.
I created two mcmc objects from cmdstanpy. Both stan codes used default names for log likelihood.
I put both of them into a dictionary, converting them to inference data object.
Both are proper objects when displayed everything is ok.
Individual loo and waic using az.loo and az.waic also work.
When submitted to az.compare exception is raised.
To Reproduce
Two cmdstanpy sampling objects are needed
File ~/opt/anaconda3/envs/stan_sep2022/lib/python3.10/site-packages/pandas/_libs/index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~/opt/anaconda3/envs/stan_sep2022/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
During handling of the above exception, another exception occurred:
InvalidIndexError Traceback (most recent call last)
Cell In [45], line 1
----> 1 az.compare(comp_dict)
File ~/opt/anaconda3/envs/stan_sep2022/lib/python3.10/site-packages/arviz/stats/stats.py:306, in compare(compare_dict, ic, method, b_samples, alpha, seed, scale, var_name)
304 std_err = ses.loc[val]
305 weight = weights[idx]
--> 306 df_comp.at[val] = (
307 idx,
308 res[ic],
...
5961 # if key is not a scalar, directly raise an error (the code below
5962 # would convert to numpy arrays and raise later any way) - GH29926
-> 5963 raise InvalidIndexError(key)
InvalidIndexError: slice(None, None, None)
Expected behavior
I'd expect a dataframe with loo comparison, especially that individually values can be computed. Additional context
Arviz version:0.12.1
CmdStanPy version:1.0.7
Python version:3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:41:54) [Clang 13.0.1 ]
M1 Mac Mini
macOS Monterey 12.5.1
The text was updated successfully, but these errors were encountered:
It works now, but with one minor problem. When displaying warnings there is some weird artefact (bolded):
/opt/anaconda3/envs/stan_sep2022/lib/python3.10/site-packages/arviz/stats/stats.py:802: UserWarning: Estimated shape parameter of Pareto distribution is greater than 0.7 for one or more samples. You should consider using a more robust model, this is because importance sampling is less likely to work well if the marginal posterior and LOO posterior are very different. This is more likely to happen with a non-robust model and highly influential observations. warnings.warn(
It works now, but with one minor problem. When displaying warnings there is some weird artefact (bolded):
/opt/anaconda3/envs/stan_sep2022/lib/python3.10/site-packages/arviz/stats/stats.py:802: UserWarning: Estimated shape parameter of Pareto distribution is greater than 0.7 for one or more samples. You should consider using a more robust model, this is because importance sampling is less likely to work well if the marginal posterior and LOO posterior are very different. This is more likely to happen with a non-robust model and highly influential observations. warnings.warn(
This warning comes from loo code, maybe it should not be a warnings.warn
Describe the bug
Weird issue with fresh installation.
Using cmdstanpy.
I created two mcmc objects from cmdstanpy. Both stan codes used default names for log likelihood.
I put both of them into a dictionary, converting them to inference data object.
Both are proper objects when displayed everything is ok.
Individual loo and waic using
az.loo
andaz.waic
also work.When submitted to
az.compare
exception is raised.To Reproduce
Two cmdstanpy sampling objects are needed
Both work and contain log_lik object.
returns:
Expected behavior
I'd expect a dataframe with loo comparison, especially that individually values can be computed.
Additional context
Arviz version:0.12.1
CmdStanPy version:1.0.7
Python version:3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:41:54) [Clang 13.0.1 ]
M1 Mac Mini
macOS Monterey 12.5.1
The text was updated successfully, but these errors were encountered: