reorder_to_model_coords#
- pymc_marketing.pytensor_utils.reorder_to_model_coords(posterior, model_coords)[source]#
Return
posteriorwith each labeled non-sample dim in the model’s order.A graph reads draws and data by position in the model’s coord order, so the model is the reference layout.
ConditionedModelapplies this to every posterior it receives, andIncrementalityto the channel data its baseline is evaluated on. A dim whose labels differ from the model’s in value or length – a refit window, a thinned posterior – is left as given, for whatever reads it to validate.chainanddraware never reordered.- Parameters:
- Return type:
xr.Dataset- Returns:
posteriorin the model’s label order on every dim whose labels equal the model’s (unique) labels as a set; other dims keep their order.