bebi103.viz.sbc_rank_ecdf

bebi103.viz.sbc_rank_ecdf(sbc_output=None, parameters=None, diff=True, ptile=99.0, bootstrap_envelope=False, n_bs_reps=None, show_envelope=True, show_envelope_line=True, color_by_warning_code=False, staircase=False, p=None, marker_kwargs=None, envelope_patch_kwargs=None, envelope_line_kwargs=None, palette=None, show_legend=True, **kwargs)

Make a rank ECDF plot from simulation-based calibration.

Parameters
  • sbc_output (DataFrame) – Output of bebi103.stan.sbc() containing results from an SBC calculation.

  • parameters (list of str, or None (default)) – List of parameters to include in the SBC rank ECDF plot. If None, use all parameters. For multidimensional parameters, each entry must be given separately, e.g., [‘alpha[0]’, ‘alpha[1]’, ‘beta[0,1]’].

  • diff (bool, default True) – If True, plot the ECDF minus the ECDF of a Uniform distribution. Otherwise, plot the ECDF of the rank statistic from SBC.

  • ptile (float, default 99) – Which precentile to use as the envelope in the plot.

  • bootstrap_envelope (bool, default False) – If True, use bootstrapping on the appropriate Uniform distribution to compute the envelope. Otherwise, use the Gaussian approximation for the envelope.

  • n_bs_reps (bool, default None) – Number of bootstrap replicates to use when computing the envelope. If None, n_bs_reps is determined from the formula int(max(n, max(L+1, 100/(100-ptile))) * 100), where n is the number of simulations used in the SBC calculation.

  • show_envelope (bool, default True) – If True, display the envelope encompassing the ptile percent confidence interval for the SBC ECDF.

  • show_envelope_line (bool, default True) – If True, and show_envelope is also True, plot a line around the envelope.

  • color_by_warning_code (bool, default False) – If True, color glyphs by diagnostics warning code instead of coloring the glyphs by parameter

  • staircase (bool, default False) – If True, plot the ECDF as a staircase. Otherwise, plot with dots.

  • p (bokeh.plotting.Figure instance, default None) – Plot to which to add the SBC rank ECDF plot. If None, create a new figure.

  • marker_kwargs (dict, default None) – Dictionary of kwargs to pass to p.circle() or p.line() when plotting the SBC ECDF.

  • envelope_patch_kwargs (dict, default None) – Any kwargs passed into p.patch(), which generates the fill of the envelope.

  • envelope_line_kwargs (dict, default None) – Any kwargs passed into p.line() in generating the line around the fill of the envelope.

  • 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.

  • show_legend (bool, default True) – If True, show legend.

  • kwargs (dict) – Any kwargs passed to bokeh.plotting.figure() when creating the plot.

Returns

output – A plot containing the SBC plot.

Return type

bokeh.plotting.Figure instance

Notes

You can see example SBC ECDF plots in Fig. 14 b and c in this paper: https://arxiv.org/abs/1804.06788