Skip to main content
Version: Latest (3.20.2)

mmm_attribution

mmm_attribution estimates attribution from aggregated marketing signals. The function separates the structural variable mapping from measure-level aggregation weights:

  • D_variables maps each raw input variable to a final channel and measure.
  • D_measures is optional and can define global aggregation_weight values by measure. If D_measures is not provided, the function uses automatic measure handling.
PARAMETERTYPEDEFAULTDESCRIPTION
Datadata.frame / tablerequiredAggregated dataset containing a timestamp column, the target column, and the marketing or business signal columns used for attribution.
D_variablesdata.frame / tablerequiredMapping table with one row per input signal. It must contain variable, channel, and measure. The target column must not be included.
D_measuresdata.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.
targetstringrequiredName of the target column in Data. The target must exist in Data and must not be included in D_variables.
modelstring"linear"Attribution engine. Allowed values are "linear", "reward", and "copula".
max_pinteger12Maximum lag depth considered when evaluating the relationship between input signals and the target.
nsiminteger1000Simulation parameter used by model components that require simulation, kept for API consistency.
seedinteger1234567Random seed used for reproducible results where random or simulation-based components are involved.
return_diagnosticsboolFalseIf True, returns additional diagnostic tables useful to inspect signal weights, scoring, saturation, and attribution shares.
verboseinteger / bool1Controls runtime logging. Use 0 or False to reduce printed output.
ncoreinteger1Number of cores used by supported computation steps.
passwordstringoptionalChannelAttributionPro license token.

Example structure for D_variables:

variablechannelmeasure
google_clicksgoogle_adsclicks
google_impressionsgoogle_adsimpressions
facebook_clicksfacebook_adsclicks
facebook_impressionsfacebook_adsimpressions
direct_searchesdirectdirect_searches

Example structure for D_measures:

measureaggregation_weight
direct_searches0.45
clicks0.45
impressions0.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.