BudgetPlots.allocation_roas#
- BudgetPlots.allocation_roas(samples, dims=None, hdi_prob=0.94, figsize=None, backend=None, return_as_pc=False, **pc_kwargs)[source]#
Forest plot of per-channel ROAS from an optimised budget allocation.
One row per channel; x-axis is ROAS; thick bar = 50% HDI, thin bar =
hdi_probHDI; point = median; vertical reference line at x=1 marks break-even (ROAS < 1 means a money-losing channel at this allocation).- Parameters:
- samples
xr.Dataset Output of
sample_response_distribution(...)or equivalent. Must contain:channel_contribution_original_scale(dims:sampleor(chain, draw),date,channel, …)allocation(dims:channel, …)
- dims
dict, optional Dimension filters, e.g.
{"geo": ["CA"]}.- hdi_prob
float, default 0.94 Probability mass for the outer HDI bar.
- figsize
tuple, optional Injected into
figure_kwargs.- backend
str, optional Rendering backend. Non-matplotlib requires
return_as_pc=True.- return_as_pcbool, default
False Return the
PlotCollectioninstead of(Figure, NDArray[Axes]).- **pc_kwargs
Forwarded to
azp.plot_forest().
- samples
- Returns:
tuple[Figure,NDArray[Axes]] orPlotCollection