MMMPlotSuite.sensitivity_analysis#

MMMPlotSuite.sensitivity_analysis(hdi_prob=0.94, ax=None, aggregation=None, subplot_kwargs=None, *, plot_kwargs=None, ylabel='Effect', xlabel='Sweep', title=None, add_figure_title=False, subplot_title_fallback='Sensitivity Analysis')[source]#

Plot sensitivity analysis results.

Parameters:
hdi_probfloat, default 0.94

HDI probability mass.

axplt.Axes, optional

The axis to plot on.

aggregationdict, optional

Aggregation to apply to the data. E.g., {“sum”: (“channel”,)} to sum over the channel dimension.

Other Parameters:
plot_kwargsdict, optional

Keyword arguments forwarded to the underlying line plot. Defaults include {"color": "C0"}.

ylabelstr, optional

Y-axis label. Defaults to “Effect”.

xlabelstr, optional

X-axis label. Defaults to “Sweep”.

titlestr, optional

Figure-level title to add when add_figure_title=True.

add_figure_titlebool, optional

Whether to add a figure-level title. Defaults to False.

subplot_title_fallbackstr, optional

Fallback title used for subplot titles when no plotting dims exist. Defaults to “Sensitivity Analysis”.

Examples

Basic run using stored results in idata:

# Assuming you already ran a sweep and stored results
# under idata.sensitivity_analysis via SensitivityAnalysis.run_sweep(..., extend_idata=True)
ax = mmm.plot.sensitivity_analysis(hdi_prob=0.9)

With aggregation over dimensions (e.g., sum over channels):

ax = mmm.plot.sensitivity_analysis(
    hdi_prob=0.9,
    aggregation={"sum": ("channel",)},
)