bebi103.viz.parcoord

bebi103.viz.parcoord(samples=None, parameters=None, palette=None, omit=None, include_ppc=False, include_log_lik=False, transformation=None, color_by_chain=False, line_kwargs=None, divergence_kwargs=None, xtick_label_orientation=0.7853981633974483, **kwargs)

Make a parallel coordinate plot of MCMC samples. The x-axis is the parameter name and the y-axis is the value of the parameter, possibly transformed to so the scale of all parameters are similar.

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.

  • transformation (function, str, or dict, default None) – A transformation to apply to each set of samples. The function must take a single array as input and return an array as the same size. If None, nor transformation is done. If a dictionary, each key is the variable name and the corresponding value is a function for the transformation of that variable. Alternatively, if transformation is ‘minmax’, the data are scaled to range from zero to one, or if transformation is ‘rank’, the rank of the each data is used.

  • color_by_chain (bool, default False) – If True, color the lines by chain.

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

  • divergence_kwargs (dict) – Dictionary of kwargs to be passed to p.multi_line() in making the plot of divergent samples.

  • xtick_label_orientation (str or float, default π/4.) – Orientation of x tick labels. In some plots, horizontally labeled ticks will have label clashes, and this can fix that.

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

Returns

output – Parallel coordinates plot.

Return type

Bokeh plot