aligned_posterior#
- pymc_marketing.pytensor_utils.aligned_posterior(name, posterior_da, layout, *, sample_dims)[source]#
Return
posterior_dalaid out and checked againstlayout.The layout comes from the posterior a graph was constructed with, so a variable is validated against its own construction geometry, not against the whole posterior.
- Parameters:
- Return type:
xr.DataArray- Returns:
posterior_dawith the sample dims first, then the layout’s dims in the layout’s order, each labeled dim in the layout’s label order.- Raises:
ValueError – If the dims differ, a dimension is labeled on one side only, a label set differs (or the layout’s labels are duplicated), or a non-sample length differs. The sample dimension may change length freely.