aggregate_idata_time#
- pymc_marketing.data.idata.utils.aggregate_idata_time(idata, period, method='sum')[source]#
Aggregate InferenceData over time periods.
- Parameters:
- idata
az.InferenceData InferenceData object to aggregate
- period{“weekly”, “monthly”, “quarterly”, “yearly”, “all_time”}
Time period to aggregate to. Use “all_time” to aggregate over the entire time dimension (removes the date dimension).
- method{“sum”, “mean”}, default “sum”
Aggregation method
- idata
- Returns:
az.InferenceDataNew InferenceData with aggregated groups
Examples
>>> monthly = aggregate_idata_time(idata, "monthly", method="sum") >>> total = aggregate_idata_time(idata, "all_time", method="sum")