plotting time-series-based posterior samples #2075
-
Hi there, I’m interested in plotting time-series-based posterior samples (plots of distributions) and am trying to figure out if it is appropriate for inclusion in ArViz and, if it is, how? This is an example of the plotting feature in pymc3-hmm (vertically aligned histograms at each time). I want to visualize each distribution at each point in time, like one would if they plotted a standard time-series with only a single point at each time, and we want it to work for a large series (e.g. 10-100k time points and large sample sizes). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If I understand correctly, this is already possible (but tricky and needs way more documentation!). ArviZ has some "full blown figures" but it also builds on top of xarray which already supports some plotting capabilities. Moreover, we recently released xarray-einstats which allows to easily generate histograms over a subset of the data dimensions. I took a similar model (I think) I had at hand, the one from this blog post I wrote recently. The model and posterior sampling use cmdstanpy, but after that we get an InferenceData, so it doesn't matter anymore which was the PPL used, once you get an InferenceData you should be able to use all the same. I updated the last plot of the "Simple HMM Example" to the following code:
which generates what I believe is the plot you want: Useful references:
|
Beta Was this translation helpful? Give feedback.
If I understand correctly, this is already possible (but tricky and needs way more documentation!). ArviZ has some "full blown figures" but it also builds on top of xarray which already supports some plotting capabilities. Moreover, we recently released xarray-einstats which allows to easily generate histograms over a subset of the data dimensions.
I took a similar model (I think) I had at hand, the one from this blog post I wrote recently. The model and posterior sampling use cmdstanpy, but after that we get an InferenceData, so it doesn't matter anymore which was the PPL used, once you get an InferenceData you should be able to use all the same.
I updated the last plot of the "Simple HM…