petitRADTRANS.sbi.plotting#
Lightweight plotting helpers for SBI outputs.
Functions#
|
Plot one histogram per posterior dimension. |
|
Plot a lower-triangular corner view of posterior structure. |
|
Plot whitened Jacobian heatmaps for each representative point. |
Plot Fisher-correlation heatmaps for each representative point. |
|
|
Plot singular spectra of the whitened Jacobian for each point. |
|
Plot observed values against posterior-predictive means and intervals. |
|
Plot one SBC rank histogram per inferred parameter. |
Module Contents#
- petitRADTRANS.sbi.plotting.plot_posterior_marginals(samples: Any, parameter_names: Sequence[str] | None = None, bins: int = 40, figsize: tuple[float, float] | None = None) tuple[Any, numpy.ndarray]#
Plot one histogram per posterior dimension.
Parameters#
- samples:
Posterior samples with shape
(n_samples, n_dim)or a scalar-vector equivalent.- parameter_names:
Optional display names for each posterior dimension.
- bins:
Number of histogram bins per dimension.
- figsize:
Optional Matplotlib figure size.
Returns#
- tuple[Any, np.ndarray]
Matplotlib figure and axes array for further customization or saving.
- petitRADTRANS.sbi.plotting.plot_posterior_corner(samples: Any, parameter_names: Sequence[str] | None = None, bins: int = 40, figsize: tuple[float, float] | None = None, max_points: int = 8192) tuple[Any, numpy.ndarray]#
Plot a lower-triangular corner view of posterior structure.
Parameters#
- samples:
Posterior samples with shape
(n_samples, n_dim)or a scalar-vector equivalent.- parameter_names:
Optional display names for each posterior dimension.
- bins:
Number of bins used for one- and two-dimensional histograms.
- figsize:
Optional Matplotlib figure size.
- max_points:
Maximum number of posterior draws plotted. Larger sample sets are evenly subsampled to keep rendering costs bounded.
Returns#
- tuple[Any, np.ndarray]
Matplotlib figure and axes array for further customization or saving.
- petitRADTRANS.sbi.plotting.plot_local_sensitivity_jacobians(report: petitRADTRANS.sbi.calibration.LocalSensitivityReport, figsize: tuple[float, float] | None = None) tuple[Any, numpy.ndarray]#
Plot whitened Jacobian heatmaps for each representative point.
- petitRADTRANS.sbi.plotting.plot_local_sensitivity_fisher_correlations(report: petitRADTRANS.sbi.calibration.LocalSensitivityReport, figsize: tuple[float, float] | None = None) tuple[Any, numpy.ndarray]#
Plot Fisher-correlation heatmaps for each representative point.
- petitRADTRANS.sbi.plotting.plot_local_sensitivity_singular_values(report: petitRADTRANS.sbi.calibration.LocalSensitivityReport, figsize: tuple[float, float] | None = None) tuple[Any, numpy.ndarray]#
Plot singular spectra of the whitened Jacobian for each point.
- petitRADTRANS.sbi.plotting.plot_posterior_predictive_report(report: petitRADTRANS.sbi.calibration.PosteriorPredictiveReport, dataset_names: Sequence[str] | None = None, figsize: tuple[float, float] | None = None) tuple[Any, numpy.ndarray]#
Plot observed values against posterior-predictive means and intervals.
Parameters#
- report:
Posterior-predictive report to visualize.
- dataset_names:
Optional subset of dataset names to plot. Defaults to all datasets in the report.
- figsize:
Optional Matplotlib figure size.
Returns#
- tuple[Any, np.ndarray]
Matplotlib figure and axes array.
Notes#
For batched reports the helper currently visualizes only the first case for each dataset, which keeps the plot compact for quick inspection.
- petitRADTRANS.sbi.plotting.plot_sbc_rank_histograms(report: petitRADTRANS.sbi.calibration.SimulationBasedCalibrationReport, parameter_names: Sequence[str] | None = None, figsize: tuple[float, float] | None = None) tuple[Any, numpy.ndarray]#
Plot one SBC rank histogram per inferred parameter.
Parameters#
- report:
SBC report containing per-parameter rank histogram counts.
- parameter_names:
Optional display names for each inferred parameter.
- figsize:
Optional Matplotlib figure size.
Returns#
- tuple[Any, np.ndarray]
Matplotlib figure and axes array.