meridian.model.equations.ModelEquations

Provides core, stateless mathematical functions for Meridian MMM.

Methods

adstock_hill_media

View source

Transforms media or using Adstock and Hill functions in the desired order.

Args

media
Tensor of dimensions (n_geos, n_media_times, n_media_channels) containing non-negative media execution values. Typically this is impressions, but it can be any metric, such as media_spend . Clicks are often used for paid search ads.
alpha
Uniform distribution for Adstock and Hill calculations.
ec
Shifted half-normal distribution for Adstock and Hill calculations.
slope
Deterministic distribution for Adstock and Hill calculations.
decay_functions
String or sequence of strings denoting the adstock decay function(s) for each channel. Default: 'geometric'.
n_times_output
Number of time periods to output. This argument is optional when the number of time periods in media equals n_media_times , in which case n_times_output defaults to n_times .

Returns
Tensor with dimensions [..., n_geos, n_times, n_media_channels] representing Adstock and Hill-transformed media.

adstock_hill_rf

View source

Transforms reach and frequency (RF) using Hill and Adstock functions.

Args

reach
Tensor of dimensions (n_geos, n_media_times, n_rf_channels) containing non-negative media for reach.
frequency
Tensor of dimensions (n_geos, n_media_times, n_rf_channels) containing non-negative media for frequency.
alpha
Uniform distribution for Adstock and Hill calculations.
ec
Shifted half-normal distribution for Adstock and Hill calculations.
slope
Deterministic distribution for Adstock and Hill calculations.
decay_functions
String or sequence of strings denoting the adstock decay function(s) for each channel. Default: 'geometric'.
n_times_output
Number of time periods to output. This argument is optional when the number of time periods in reach equals n_media_times , in which case n_times_output defaults to n_times .

Returns
Tensor with dimensions [..., n_geos, n_times, n_rf_channels] representing Hill and Adstock-transformed RF.

calculate_beta_x

View source

compute_non_media_treatments_baseline

View source

linear_predictor_counterfactual_difference_media

View source

linear_predictor_counterfactual_difference_rf

View source

Design a Mobile Site
View Site in Mobile | Classic
Share by: