Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-reg-mmm-hill
description: REG_MMM_HILL — media-mix regression fitting every channel's coefficient and Hill curve (half-saturation k, shape s) jointly, plus linear controls. Params, coefficient names, standard-error rule, failures. Always buffered.
kind: operator
category: REG
operator: REG_MMM_HILL
type: reference
applies_to: process, compose, predict
examples_tags: [regression, time-series, buffered-pipeline]

REG_MMM_HILL models y = β0 + Σ βc·hill(ac, kc, sc) + Σ γj·zj: ac is spend adstocked upstream (WIN_DISTRIBUTED_LAG), or with adstock raw spend, its kernel fitted jointly; zj linear controls.

Use when

Fits a media-mix model: each marketing channel’s effect and response curve (where its spend stops paying off), jointly with linear controls.

Questions it answers:

  • What does each marketing channel contribute to sales, holding price and the other channels fixed?
  • At what weekly spend does each channel saturate?

Use something else:

  • REG_OLS when the outcome moves in a straight line with spend, with no saturation.

Params

channels through carryover sit under params; shared keys: regression-spec.

NameTypeDefaultDescription
targetfield(required)Response (numeric).
predictors[]field(required)Channels and controls.
channelslist(required)Hill-curve predictors; the rest are controls.
nonnegativebooltrueChannel β ≥ 0.
priorobject—Gaussian {channel, mean, precision} on one β.
adstockstring—geometric, delayed, weibull_cdf, weibull_pdf: in-model.
max_lagint13Window; non-geometric needs it.
carryoverbooltrueHoldout carries adstock.
resampleenum—bootstrap, jackknife.
bootstrap_itersint1000Resample.
jackknife_groupsint—Resample.
jackknife_byfield—Resample.
rng_seedint—Resample.
conf_levelfloat0.95CI coverage.
vcovboolfalsevcov, correlation, dispersion.
multiplicityobject—Replicate p-values join a family.
holdoutexpr—Held-out rows → holdout.
savestring—Writes a model file.
orderobject—Row order.
namestring—Result / model name.

Inputs

Numeric target; channels ≥ 0 (else PROCESSING_CONFIG). Null rows drop listwise. Rows > 1 + 3·channels + controls (+ kernel).

Output

coefficients in this order: (intercept), channel betas, controls, k:<channel>, s:<channel>, then the kernel’s: decay: (+peak: delayed) or shape:, scale: (Weibull). coef("fit", "k:tv_ad") reads one; predict knows them; an inline models entry declares them with no fit. k ∈ [0.02, 20]× channel mean, s ∈ [0.5, 5].

Each channel records its kernel (adstock.<ch>, saved too) for response(): the fitted one, or its WIN_DISTRIBUTED_LAG’s.

std_errors: Gauss-Newton, joint with kernel; null on a bound and a β-0 channel’s k / s / kernel. p_values: resample. vcov: null where held. outputs.condition_number (adstock) above 1e6 adds PULSE_ADVISORY_MMM_ADSTOCK_ILL_CONDITIONED.

Reading the output

  • std_errors.*: How much the parameter would vary from sample to sample, from the curvature of the least-squares fit at its optimum (Gauss-Newton), mapped onto k and s.
  • p_values.*: a p-value. Below alpha (0.05 unless the request sets another) the result is called significant; that is not the same as important, so read the effect size for how big it is.
  • statistics.*: The Wald statistic: the parameter divided by its standard error, null where the standard error is.
  • n_obs: Rows used in the fit, after rows with a null target or predictor were dropped.

Contract

  • Types (target, predictor): date, datetime, decimal128, f32, f64, packed_bool, u16, u32, u4, u64, u8; any other scalar type is PULSE_FIELD_TYPE_UNSUPPORTED.
  • Weight: refused under any weight in force, an instance default included (PULSE_WEIGHT_UNSUPPORTED); weight: null on the slot runs it unweighted.
  • Multiplicity: its own multiplicity block (an inherited one never reaches it) adds per-coefficient p_adjusted and significant_adjusted beside the raw p; families request (default), compose (inside Compose).
  • Streaming: buffered only. Always buffered: the model fits over every admitted row.

Gotchas

  • Spend below k: β/k^s ridge, judge contribution.
  • No convergence in 1000 iterations: PROCESSING_REGRESSION_NO_CONVERGE (slot fails alone).
  • penalty, selection, covariance, family, a weight are refused. holdout, resample, save work, as does ATTR_REG_PREDICT (whole model).
  • adstock needs order (one series), refuses an upstream-adstocked channel; holdout / scoring carry it in (regression-order).

See

mmm-workflow · op-reg-mmm-bayes · regression-model-options · regression-spec · compose-sweep-sampling · compose-optimize