bebi103.viz.trace

bebi103.viz.trace(samples=None, parameters=None, palette=None, omit=None, include_ppc=False, include_log_lik=False, line_kwargs=None, **kwargs)

Make a trace plot of MCMC samples.

Parameters
  • samples (ArviZ InferenceData instance or xarray Dataset instance) – Result of MCMC sampling.

  • parameters (list of str, or None (default)) – Names of parameters to include in the plot. If None, use all parameters. For multidimensional parameters, each entry must be given separately, e.g., [‘alpha[0]’, ‘alpha[1]’, ‘beta[0,1]’]. If a given entry is a 2-tuple, the first entry is the variable name, and the second entry is the label for the parameter in plots.

  • palette (list of strings of hex colors, or single hex string) – If a list, color palette to use. If a single string representing a hex color, all glyphs are colored with that color. Default is colorcet.b_glasbey_category10 from the colorcet package.

  • omit (str, re.Pattern, or list or tuple of str and re.Pattern) – If parameters is not provided, all parameters are used in the parallel coordinate plot. We often want to ignore samples of some variables. For each string entry in omit, the variable given by the string is omitted. For each entry that is a compiled regular expression patters (re.Pattern), any variable name matching the pattern is omitted.

  • include_ppc (bool, default False) – If True, include variables ending in _ppc, which denotes posterior predictive checks, in the plot.

  • include_log_lik (bool, default False) – If True, include variables starting with log_lik or loglik. These denote log-likelihood contributions.

  • line_kwargs (dict, default None) – Dictionary of kwargs to be passed to p.multi_line() in making the plot of non-divergent samples.

  • kwargs – Any kwargs to be passed to bokeh.plotting.figure().

Returns

output – Set of chain traces as a Bokeh gridplot.

Return type

Bokeh gridplot