arviz
arviz copied to clipboard
Misspecified var_names
In certain cases, if an element of var_names
is not in the dataset, should we should throw an exception? Right not, it will plot any var_names it can find, and ignore the others. This behavior has actually been kind of nice when plotting a centered eight trace vs a non-centered eight trace, but confusing if you typo one of the var_names.
Could it throw warning? Sometimes there are "missing" parameters.
Also can do some word2vec similarity scoring what was probably meant? This could be helpful for complex names?
Have been convinced that this is ok.
I have same sentiment as @ahartikainen Should we at least print something to the console? Right now behavior is confusing if you don't remember the exact var_name.
right now the behavior is equivalent to data.posterior[var_names]
(and specifically, data.posterior[var_names].sel(**coords)
, though, which I like: i.e., matching xarray's behavior.
Fair point, matching xarrays behavior is good idea! We can focus this discussion on how verbose we want to be to user.
Is it still relevant? I'd like to add this check and warnings if it's still needed
Try someting like:
idata = az.load_arviz_data("rugby")
az.plot_posterior(idata, var_names=("atts", "unexisting_var"))
and see what happens