An additive MMM with finite geometric adstock and selectable media response.
A model owns its fixed channel layout, scaling and compiled numerical block. Observations and experimental contrasts are runtime inputs. Default priors: alpha ~ Beta(2,2), beta ~ HalfNormal(1), lambda ~ Gamma(3,rate=1), intercept ~ Normal(0,1), sigma ~ HalfNormal(0.5), controls ~ Normal(0,1).
An additive MMM with finite geometric adstock and selectable media response. A model owns its fixed channel layout, scaling and compiled numerical block. Observations and experimental contrasts are runtime inputs. Default priors: alpha ~ Beta(2,2), beta ~ HalfNormal(1), lambda ~ Gamma(3,rate=1), intercept ~ Normal(0,1), sigma ~ HalfNormal(0.5), controls ~ Normal(0,1).
(build prepared)(build prepared
{:keys [density-kernel gradient-parameter-layout data-layout]
:or {density-kernel :lagged
gradient-parameter-layout :auto
data-layout :auto}})Compile a prepared model. :data-layout :auto retains the qualified split ABI for small models and packs larger inputs; :packed removes the public arity cap.
Compile a prepared model. :data-layout :auto retains the qualified split ABI for small models and packs larger inputs; :packed removes the public arity cap.
(control-names spec)Control column names of a specification: :controls followed by any
generated seasonality columns.
Control column names of a specification: `:controls` followed by any generated seasonality columns.
(inference-block model backend)The requested gradient backend. AOT compilation is cached per built model.
The requested gradient backend. AOT compilation is cached per built model.
(initial-position model)A finite unconstrained starting position; init is not a prior draw.
A finite unconstrained starting position; init is not a prior draw.
(mean-response model theta)Conditional mean in original target units at natural parameter values.
Conditional mean in original target units at natural parameter values.
(pointwise-log-likelihood model theta)Original-unit observation log densities, excluding priors and experiments.
Original-unit observation log densities, excluding priors and experiments.
(prepare spec
{:keys [x y controls lift dates time-index] :or {lift []} :as data})Prepare row-major business-unit :x, :y, optional :controls and :lift rows. Lift rows describe effective-spend contrasts, not arbitrary experiment totals. Missing or nonfinite data are rejected; missing spend is never inferred as zero.
Prepare row-major business-unit :x, :y, optional :controls and :lift rows. Lift rows describe effective-spend contrasts, not arbitrary experiment totals. Missing or nonfinite data are rejected; missing spend is never inferred as zero.
Default priors by parameter group, in scaled model coordinates.
Default priors by parameter group, in scaled model coordinates.
(specification {:keys [channels controls l-max scaling priors likelihood
seasonality saturation]
:or {controls [] l-max 6}
:as opts})Validate a fixed layout and positive business-unit scaling constants.
:channels is required. :saturation is :logistic (default), :none or :michaelis-menten;
:none uses beta * normalized-adstock and has no lambda parameter/prior.
Validate a fixed layout and positive business-unit scaling constants. `:channels` is required. `:saturation` is :logistic (default), :none or :michaelis-menten; :none uses beta * normalized-adstock and has no lambda parameter/prior.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |