mmm_attribution
mmm_attribution estimates attribution from aggregated marketing signals. The function requires a D_variables table with variable, channel, measure, and prior_weight, so signals measured on different scales can be compared more realistically. prior_weight: business weight assigned to each raw signal. A common way to estimate it is conversions / touchpoints or conversions / cost, but it can also be set from domain knowledge or historical benchmarks. Use the parameters below to select the model, lag depth, diagnostics, and runtime options.
| 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, measure, and prior_weight. prior_weight is the business weight assigned to each raw signal. A common way to estimate it is conversions / touchpoints or conversions / cost, but it can also be set from domain knowledge or historical benchmarks. |
| 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 | prior_weight |
|---|---|---|---|
google_clicks | google_ads | clicks | 0.25 |
google_impressions | google_ads | impressions | 0.015 |
facebook_impressions | facebook_ads | impressions | 0.015 |
email_clicks | email | clicks | 0.30 |
direct_searches | direct | searches | 0.50 |