mmm_attribution
mmm_attribution estimates attribution from aggregated marketing signals. The function separates the structural variable mapping from measure-level aggregation weights:
D_variablesmaps each raw input variable to a finalchannelandmeasure.D_measuresis optional and can define globalaggregation_weightvalues by measure. IfD_measuresis not provided, the function uses automatic measure handling.
| PARAMETER | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
| Data | data.frame / table | required | Aggregated dataset containing a timestamp column, the target column, and the marketing or business signal columns used for attribution. |
| D_variables | data.frame / table | required | Mapping table with one row per input signal. It must contain variable, channel, and measure. The target column must not be included. |
| D_measures | data.frame / table / "auto" | "auto" | Optional measure-level weighting table. The recommended user-facing structure contains columns measure and aggregation_weight. If omitted or set to "auto", measure handling is estimated automatically. |
| target | string | required | Name of the target column in Data. The target must exist in Data and must not be included in D_variables. |
| model | string | "linear" | Attribution engine. Allowed values are "linear", "reward", and "copula". |
| max_p | integer | 12 | Maximum lag depth considered when evaluating the relationship between input signals and the target. |
| nsim | integer | 1000 | Simulation parameter used by model components that require simulation, kept for API consistency. |
| seed | integer | 1234567 | Random seed used for reproducible results where random or simulation-based components are involved. |
| return_diagnostics | bool | False | If True, returns additional diagnostic tables useful to inspect signal weights, scoring, saturation, and attribution shares. |
| verbose | integer / bool | 1 | Controls runtime logging. Use 0 or False to reduce printed output. |
| ncore | integer | 1 | Number of cores used by supported computation steps. |
| password | string | optional | ChannelAttributionPro license token. |
Example structure for D_variables:
| variable | channel | measure |
|---|---|---|
google_clicks | google_ads | clicks |
google_impressions | google_ads | impressions |
facebook_clicks | facebook_ads | clicks |
facebook_impressions | facebook_ads | impressions |
direct_searches | direct | direct_searches |
Example structure for D_measures:
| measure | aggregation_weight |
|---|---|
direct_searches | 0.45 |
clicks | 0.45 |
impressions | 0.10 |
aggregation_weight is used when variable-level attributions sharing the same channel are aggregated into final channel-level attribution. The internal signal scaling is estimated automatically from the data.