plot_pairs()

Contents

plot_pairs()#

liesel.goose.summary_viz.plot_pairs(results, params=None, param_indices=None, chain_indices=None, max_chains=5, alpha=0.2, title=None, title_spacing=0.9, style='whitegrid', diag_kind='kde', color_palette=None, height=3, aspect_ratio=1, save_path=None, include_warmup=False)[source]#

Produces a pairplot panel.

Parameters:
  • results (SamplingResults) – Result object of the sampling process. Must have a method get_posterior_samples() which extracts all samples from the posterior distribution.

  • params (Union[str, list[str], None]) – Names of the model parameters that are contained in the plot. Must coincide with the dictionary keys of the Position with the posterior samples. If None, all parameters are included. (default: None)

  • param_indices (Union[int, Sequence[int], None]) – Indices of each model parameter that are contained in the plot. Selects e.g. beta[0] out of a beta parameter vector. A single index can be specified as an integer or a sequence containing one integer. If None, all subparameters are included. (default: None)

  • chain_indices (Union[int, Sequence[int], None]) – Indices of chains for each model subparameter that are contained in the plot. Selects e.g. chain 0 and chain 2 out of multiple chains. A single index can be specified as an integer or a sequence containing one integer. If None, all chains are included. (default: None)

  • max_chains (int | None) – Upper bound how many chains are included within each subplot/facet. Avoids overplotting. If None, all chains contained in the results input are plotted. Always starts chain selection from the lowest chain index upwards. For selecting specific chains use the argument chain_indices. (default: 5)

  • alpha (float) – Amount of transparency; a float between 0 and 1. (default: 0.2)

  • title (Optional[str]) – Plot title. (default: None)

  • title_spacing (float) – Determines the margin/whitespace between the plot title (set with fig.suptitle()) and the first row of subplots/facets. Passed to the top argument of fig.subplots_adjust(). (default: 0.9)

  • style (str) – Passed to the style argument of sns.set_theme(). Valid options are darkgrid, whitegrid, dark, white, and ticks. (default: 'whitegrid')

  • diag_kind (str) – Kind of plot for the diagonal subplots. Can be ‘kde’ (default) for kernel density estimates or ‘hist’ for histograms. (default: 'kde')

  • color_palette (Union[str, list[str], dict[int, str], None]) – Passed to the palette argument of sns.pairplot(). String values must be valid inputs of sns.color_palette() such as a seaborn color palette or a matplotlib colormap. Custom colors can be set with a list of color strings or a dictionary with the chain indices as keys and color strings as values. The number of color strings must coincide with the number of plotted chains. If None, the default tab10 matplotlib colormap is chosen. (default: None)

  • height (int) – Height in inches of each subplot/facet within the grid. (default: 3)

  • aspect_ratio (int) – Ratio of width / height of each subplot/facet within the grid, i.e. width = aspect_ratio * height. (default: 1)

  • legend_position – Determines the color legend position. Coordinates are relative to the upper panel within the plot grid. The first coordinate specifies the horizontal, the second coordinate the vertical position. Might require an adjustment when changing the figure_size values or the number of chains.

  • save_path (Optional[str]) – File path where the plot is saved. (default: None)

  • include_warmup (bool) – Include the warmup samples in the trace plot. (default: False)