reno.viz.compare_posterior#
- reno.viz.compare_posterior(varname, traces, prior_trace=None, smoothing=0.1, ax=None, legend=True, title=None, per_dim=None, **figargs)#
Plot the sampled distribution densities for the specified variable from each of the passed traces + prior trace.
- Parameters:
varname (str) – The name of the variable in the xr.Datasets to plot
traces (list[az.InferenceData | xr.Dataset] | dict[str, az.InferenceData | xr.Dataset) – A list or dictionary of traces or dataset to plot the variable from. Passed traces will plot from the posterior, pass the specific dataset if you need the priors (
pymc_trace.prior). If a dictionary is used, the legend will use the specified keys.prior_trace (az.InferenceData | xr.Dataset) – A trace or dataset to plot with the ‘prior’ key.
smoothing (float) – What degree of smoothing to apply to the density plot. Lower = more bumpy.
ax – Optionally pass an axis if one already exists, otherwise this function will create a new one, using any additional figargs passed.
legend (bool) – Whether to render a legend or not. If
Trueand traces is a dictionary, the keys will be used as the legend labels.title (str) – Optional title to set on the axis.
per_dim (str) – TODO
**figargs – Parameters to pass to
plt.subplots(**figargs)if no axis passed in.