sbi.analysis.marginal_plot

Navigation

sbi.analysis.marginal_plot#

marginal_plot(samples, points=None, limits=None, subset=None, diag='hist', figsize=(10, 2), labels=None, ticks=None, diag_kwargs=None, fig_kwargs=None, fig=None, axes=None, **kwargs)[source]#

Plot samples in a row showing 1D marginals of selected dimensions.

Each of the plots can be interpreted as a 1D-marginal of the distribution that the samples were drawn from.

Parameters:
  • samples (List[ndarray] | List[Tensor] | ndarray | Tensor) – Samples used to build the histogram.

  • points (List[ndarray] | List[Tensor] | ndarray | Tensor | None) – List of additional points to scatter.

  • limits (List | Tensor | None) – Array containing the plot xlim for each parameter dimension. If None, just use the min and max of the passed samples

  • subset (List[int] | None) – List containing the dimensions to plot. E.g. subset=[1,3] will plot plot only the 1st and 3rd dimension but will discard the 0th and 2nd (and, if they exist, the 4th, 5th and so on).

  • diag (str | List[str | None] | None) – Plotting style for 1D marginals, {hist, kde cond, None}.

  • figsize (Tuple | None) – Size of the entire figure.

  • labels (List[str] | None) – List of strings specifying the names of the parameters.

  • ticks (List | Tensor | None) – Position of the ticks.

  • diag_kwargs (List[Dict | DiagOptions | None] | Dict | DiagOptions | None) – Additional arguments to adjust the diagonal plot, see the source code in KdeDiagOptions, HistDiagOptions or ScatterDiagOptions.

  • fig_kwargs (Dict | FigOptions | None) – Additional arguments to adjust the overall figure, see the source code in FigOptions.

  • fig (FigureBase | None) – matplotlib figure to plot on.

  • axes (Axes | None) – matplotlib axes corresponding to fig.

  • **kwargs (Any | None) – Additional arguments to adjust the plot (deprecated)

Return type:

Tuple[FigureBase, Axes]

Returns: figure and axis of posterior distribution plot