link_var_model
Link a VAR model to an MMM to merge long-run elasticities with short-term revenue. Optionally map VAR series to MMM channels for accurate allocation.
Instructions
Link a completed VAR model to an MMM (#569).
After linking, the MMM's get_model_results long_run_rollup section
joins the VAR's long-run elasticities with the MMM's short-term revenue.
A VAR links to at most one MMM at a time — the error names the current
owner if it is already linked elsewhere.
The join is by exact name unless channel_map declares which MMM channels each VAR exogenous series stands for (#682) — required whenever the VAR is fitted on group spends (e.g. four spend groups) while the MMM is tactic-level. Each group's elasticity is allocated across its member channels pro-rata by KPI short-term contribution, so the group's long-run effect is counted exactly once. Validation is strict: keys must be VAR exogenous series, values must be channel names of the (completed) MMM, and no channel may belong to two groups. The map belongs to the link: every link replaces it (omitting channel_map clears any stored map) and unlink clears it.
Args: model_hash: The MMM to attach the long-run view to. var_model_hash: The VAR model (from create_var_model). channel_map: Optional {var_exogenous_series: [mmm_channel, ...]} mapping for group-level VARs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_hash | Yes | ||
| channel_map | No | ||
| var_model_hash | Yes |