I've sampled data points using NUTS for a nested model that includes a cholesky decomposition and covariance matrices. One part of the model uses continuous variables while another one uses binomial logistic regression. I modeled different subjects and runs so I get a lot of variables. When I run pm.forestplot(trace_model) I get a forestplot and the following error:
ValueError Traceback (most recent call last)
<ipython-input-38-104bdf2c5589> in <module>()
----> 1 pm.forestplot(trace_m1_fa);
/data/p_nmc002/anaconda3-4.4.0/lib/python3.6/site-packages/pymc3/plots/forestplot.py in forestplot(trace_obj, varnames, transform, alpha, quartiles, rhat, main, xtitle, xlim, ylabels, chain_spacing, vline, gs, plot_transformed, plot_kwargs)
325 if plot_rhat:
326 _make_rhat_plot(trace_obj, plt.subplot(gs[1]), "R-hat", labels,
--> 327 varnames, plot_transformed)
328
329 return gs
/data/p_nmc002/anaconda3-4.4.0/lib/python3.6/site-packages/pymc3/plots/forestplot.py in _make_rhat_plot(trace, ax, title, labels, varnames, include_transformed)
65
66 if k > 1:
---> 67 ax.plot([min(r, 2) for r in R[varname]],
68 [-(j + i) for j in range(k)], 'bo', markersize=4)
69 else:
/data/p_nmc002/anaconda3-4.4.0/lib/python3.6/site-packages/pymc3/plots/forestplot.py in <listcomp>(.0)
65
66 if k > 1:
---> 67 ax.plot([min(r, 2) for r in R[varname]],
68 [-(j + i) for j in range(k)], 'bo', markersize=4)
69 else:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
A minimum working example would be difficult. Instead you can access an ipython notebook here (I didn't upload it to github as the pickled traces are over 100 MB:
https://owncloud.gwdg.de/index.php/s/tG1UQxteWb46B28
Thanks for reporting. @aloctavodia I assigned this to you if you dont mind.
I can confirm this is a problem in PyMC3 3.2, but it has been solved in PyMC3 3.3. @gladomat let us know if you still have this problem after upgrading.
Works like a charm. Thanks!
Most helpful comment
I can confirm this is a problem in PyMC3 3.2, but it has been solved in PyMC3 3.3. @gladomat let us know if you still have this problem after upgrading.