Closed aakhmetz closed 4 years ago
With dev version from github, I have another error
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-5-9641094159ee> in <module>
----> 1 az.plot_trace(cmdstan_data,var_names=pars)
~/anaconda3/lib/python3.6/site-packages/arviz/plots/traceplot.py in plot_trace(data, var_names, coords, divergences, figsize, textsize, rug, lines, compact, combined, legend, plot_kwargs, fill_kwargs, rug_kwargs, hist_kwargs, trace_kwargs, backend, **kwargs)
111 """
112 if backend is None or backend.lower() in ("mpl", "matplotlib"):
--> 113 from .backends.matplotlib.mpl_traceplot import _plot_trace_mpl
114
115 axes = _plot_trace_mpl(
ModuleNotFoundError: No module named 'arviz.plots.backends.matplotlib'
Dev version is currently a bit wip.
What does your R0 and kappa look (e.g. data.posterior.R0
)
What does data.posterior.draw
and data.posterior.chain
say?
I can't say what is going on, but I suspect that there might be some kind of error in from_cmdstan or your data is ragged (there are some nan in some chains)
I see - good to know.
My code is here: https://gist.github.com/aakhmetz/d726e9bc362b399ed6494f4144d65141 I would say nothing special about samples-file. It is a usual format for cmdstan I think.
I just updated my gist with the output from the stable version of arviz. Thank you for checking in advance.
cmdstan_data.posterior.draw
gives:
<xarray.DataArray 'draw' (draw: 1250)>
array([ 0, 1, 2, ..., 1247, 1248, 1249])
Coordinates:
* draw (draw) int64 0 1 2 3 4 5 6 7 ... 1243 1244 1245 1246 1247 1248 1249
cmdstan_data.posterior.chain
gives:
<xarray.DataArray 'chain' (chain: 1)>
array([0])
Coordinates:
* chain (chain) int64 0
Yes, there is an error in from_cmdstan
where part of the sample_stats items are float
(they should be int
or bool
).
The quick fix to plot your results is
az.plot_trace(cmdstan_data,var_names=pars, divergences=False)
Thanks!
I can't plot the trace plot from cmdstan
which results in
I can get density_plot with no problems, but trace plot does not work. It shows the first subplot for R0, but then displays the error.
Additional context Stable version 0.5.1 installed via pip-command