SensitivityPlots.analysis#

SensitivityPlots.analysis(idata=None, dims=None, aggregation=None, x_sweep_axis='relative', apply_cost_per_unit=True, hdi_prob=0.94, figsize=None, backend=None, return_as_pc=False, line_kwargs=None, hdi_kwargs=None, **pc_kwargs)[source]#

Plot sensitivity analysis sweep results (idata.sensitivity_analysis["x"]).

Parameters:
idataaz.InferenceData, optional

Override instance data. When provided, an MMMIDataWrapper is constructed from this idata and used for this call only.

dimsdict, optional

Dimension filters, e.g. {"channel": ["tv", "radio"]}.

aggregationdict, optional

Aggregation to apply before plotting, e.g. {"sum": "channel"} or {"mean": ["channel"]}.

x_sweep_axis{“relative”, “absolute”}, default “relative”

"relative" plots sweep multipliers on the x-axis. "absolute" scales multipliers by total channel spend/data.

apply_cost_per_unitbool, default True

When x_sweep_axis="absolute", use spend (True) or raw channel data (False) for x-axis scaling.

hdi_probfloat, default 0.94

Credible interval probability for the HDI band.

figsizetuple[float, float], optional

Convenience shorthand injected into figure_kwargs.

backendstr, optional

Rendering backend ("matplotlib", "plotly", "bokeh").

return_as_pcbool, default False

If True, return the PlotCollection instead of the matplotlib tuple.

line_kwargsdict, optional

Extra keyword arguments forwarded to the mean line visual.

hdi_kwargsdict, optional

Extra keyword arguments forwarded to the HDI band visual.

**pc_kwargs

Forwarded to PlotCollection.grid(). Use cols= / rows= to override the default panel layout.

Returns:
tuple[Figure, NDArray[Axes]] or PlotCollection