arviz_plots.plot_trace

Contents

arviz_plots.plot_trace#

arviz_plots.plot_trace(dt, var_names=None, filter_vars=None, group='posterior', coords=None, sample_dims=None, plot_collection=None, backend=None, labeller=None, aes_map=None, plot_kwargs=None, pc_kwargs=None)[source]#

Plot iteration versus sampled values.

Parameters:
dtdatatree.DataTree

Input data

var_names: str or list of str, optional

One or more variables to be plotted. Prefix the variables by ~ when you want to exclude them from the plot.

filter_vars: {None, “like”, “regex”}, optional, default=None

If None (default), interpret var_names as the real variables names. If “like”, interpret var_names as substrings of the real variables names. If “regex”, interpret var_names as regular expressions on the real variables names.

sample_dimsiterable, optional

Dimensions to reduce unless mapped to an aesthetic. Defaults to rcParams["data.sample_dims"]

plot_collectionPlotCollection, optional
backend{“matplotlib”, “bokeh”}, optional
labellerlabeller, optional
aes_mapmapping, optional

Mapping of artists to aesthetics that should use their mapping in plot_collection when plotted. Defaults to only mapping properties to the trace lines.

plot_kwargsmapping of {strmapping or False}, optional

Valid keys are:

pc_kwargsmapping

Passed to arviz_plots.PlotCollection

Returns:
PlotCollection

Examples

The following examples focus on behaviour specific to plot_trace. For a general introduction to batteries-included functions like this one and common usage examples see Introduction to batteries-included plots in arviz_plots

Default plot_trace

>>> from arviz_plots import plot_trace, style
>>> style.use("arviz-clean")
>>> from arviz_base import load_arviz_data
>>> centered = load_arviz_data('centered_eight')
>>> plot_trace(centered)
../../_images/arviz_plots-plot_trace-1.png