# Optimization for media channels without reach and frequency data

Suppose you want to compute a budget optimization for $$M$$ media channels for a set of regions $$G$$ and time interval $$[t_0,t_1]$$. Consider any budget vector $$b=(b_1,\ldots b_M)$$ where $$b_m \geq 0$$ denotes the total budget allocated to channel $$m$$ over these regions and time periods. Let $$c_m=\sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}\ \ddot{x}_{g,t,m} u_{g,t,m}^{(x)}$$ be the actual historical budget for each channel $$m$$ over the optimization regions and time periods. To obtain the media units for each geo and time period under the budget vector $$b$$, you scale each channel's historical media units by the ratio $$\frac{b_m}{c_m}$$.

Accordingly, you define the raw media units under a given budget vector $$b$$ as:

$$\ddot{x}_{g,t,m}^{(b)} = \dfrac{ \ddot{x}_{g,t,m}b_m }{c_m}$$ for $$t \in [t_0-L,t_1]$$

and the corresponding transformed media units as:

$$x_{g,t,m}^{(b)} = L_{g,m}^{(x)}\left( \ddot{x}_{g,t,m}^{(b)} \right) = \dfrac{x_{g,t,m}b_m}{c_m}$$

The media units are scaled for all time periods, including time periods prior to $$t_0$$. The budget $$C$$ corresponds to the time interval $$[t_0,t_1],$$ and this scenario captures the expected revenue generated during the same interval $$[t_0,t_1]$$. This includes revenue driven by media executed prior to $$t_0$$, but excludes the lagged effect of media beyond $$t_1$$. As such, the expected revenue does not exactly correspond to the budget but it should be similar if the time interval is long, or if the media execution during $$[t_0-L,t_0-1]$$ is similar to the media execution during $$[t_1+1,t_1+L]$$. There are advantages and disadvantages to this definition, but an advantage is that the expected revenue does not depend on future media execution beyond $$t_1$$, which might be unknown. This is particularly an issue when hill_before_adstock=False, in which case media execution after $$t_1$$ can alter the lagged effect of media executed during $$[t_1+1,t_1+L]$$.

## Fixed budget optimization

Consider a fixed budget optimization with total budget $$C$$. Define the set of all budget vectors with this total budget as $$B_C = \left\{ b: \sum\limits_{m=1}^M b_m=C \right\}$$. The quantity being optimized is expected revenue, defined as follows:

$$\begin{multline*} \text{ExpectedSales}(b) = \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1} E \left( \overset \sim Y_{g,t}^{ \left( \left\{ x_{g,t,m}^{(b)} \right\} \right) } \Bigg| \{z_{g,t,c}\} \right) \\ = \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1} u_{g,t}^{(y)}L_g^{(y)-1} \left( \mu_t + \tau_g + \sum\limits_{c=1}^C \gamma_{g,c}z_{g,t,c}\ + \sum\limits_{m=1}^M \beta_{g,m} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m, ec_m, \text{slope}_m \right) \right) \end{multline*}$$

The true parameter values are unknown. Because Meridian is a Bayesian model, the expected sales has a posterior distribution. The objective function of the budget optimization is chosen to be the posterior mean of the expected sales, which is equivalent to the mean of the posterior predictive sales distribution. The optimal budget vector is defined as:

\begin{align*} b_{optimal} = \underset{b \in B_C}{\text{argmax}}\ & E\left[ \text{ExpectedSales}(b) | \text{Data} \right] \\ = \underset{b \in B_C}{\text{argmax}}\ & \frac{1}{J} \sum\limits_{j=1}^J \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}u_{g,t}^{(y)}L_g^{(y)-1} \Biggl( \mu_t^{(j)} + \tau_g^{(j)} + \sum\limits_{c=1}^C \gamma_{g,c}^{(j)}z_{g,t,c} \\& + \sum\limits_{m-1}^M \beta_{g,m}^{(j)} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m^{(j)}, ec_m^{(j)}, \text{slope}_m^{(j)} \right) \Biggl) \\ = \underset{b \in B_C}{\text{argmax}}\ & \frac{1}{J} \sum\limits_{j=1}^J \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}u_{g,t}^{(y)}L_g^{(y)-1} \left( \sum\limits_{m=1}^M \beta_{g,m}^{(j)} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m^{(j)}, ec_m^{(j)}, \text{slope}_m^{(j)} \right) \right) \end{align*}

Where:

• $$J$$ is the total number of Markov Chain Monte Carlo (MCMC) posterior draws.
• The $$j$$th posterior draw of each parameter is denoted with the superscript $$^{(j)}$$.

## Flexible budget optimization

For flexible budget optimization, the expected revenue is optimized while allowing the total budget to vary. The optimization is constrained on either the minimal marginal ROI or the target ROI constraints.

### Target ROI constraint

When the target ROI is specified, Meridian searched over all budget vectors $$b=(b_1,\ldots ,b_M)$$ such that the total ROI $$\text{ROI} \geq \text{ROI}_{target}\ \forall m$$, while allowing the total budget $$\sum\limits_{m=1}^M b_m$$ to vary. The optimal budget vector is defined as follows:

\begin{align*} b_{optimal} = \underset{b}{\text{argmax}}\ & E\left[ \text{ExpectedSales}(b) | \text{Data} \right] \\ = \underset{b}{\text{argmax}}\ & \frac{1}{J} \sum\limits_{j=1}^J \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}u_{g,t}^{(y)}L_g^{(y)-1} \Biggl( \mu_t^{(j)} + \tau_g^{(j)} + \sum\limits_{c=1}^C \gamma_{g,c}^{(j)}z_{g,t,c} \\ & + \sum\limits_{m-1}^M \beta_{g,m}^{(j)} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m^{(j)}, ec_m, \text{slope}_m^{(j)} \right) \Biggl) \\ = \underset{b}{\text{argmax}}\ & \frac{1}{J} \sum\limits_{j=1}^J \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}u_{g,t}^{(y)}L_g^{(y)-1} \left( \sum\limits_{m=1}^M \beta_{g,m}^{(j)} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m^{(j)},ec_m^{(j)},\text{slope}_m^{(j)} \right) \right) \\ \end{align*}

$$s.t.\ \dfrac{ \sum\limits_{m=1}^M \text{IncrementalSales}_m }{ \sum\limits_{m=1}^M b_m } > \text{ROI}_{target}$$

Where the target ROI constraint is applied at the total marketing ROI level, and not at channel level.

### Minimal mROI constraint

When the minimal marginal ROI is specified, Meridian searches over all budget vectors $$b=(b_1,\dots,b_M)$$ such that the marginal ROI $$\text{mROI}_m \geq \text{mROI}_{minimal}\ \forall m$$, while allowing the total budget $$\sum\limits_{m=1}^M b_m$$ to vary. The optimal budget vector is defined as follows:

\begin{align*} b_{optimal} = \underset{b}{\text{argmax}}\ & E\left[ \text{ExpectedSales}(b) | \text{Data} \right] \\ = \underset{b}{\text{argmax}}\ & \frac{1}{J} \sum\limits_{j=1}^J \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}u_{g,t}^{(y)}L_g^{(y)-1} \Biggl( \mu_t^{(j)} + \tau_g^{(j)} + \sum\limits_{c=1}^C \gamma_{g,c}^{(j)}z_{g,t,c} \\ & + \sum\limits_{m-1}^M \beta_{g,m}^{(j)} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m^{(j)}, ec_m, \text{slope}_m^{(j)} \right) \Biggl) \\ = \underset{b}{\text{argmax}}\ & \frac{1}{J} \sum\limits_{j=1}^J \sum\limits_{g \in G} \sum\limits_{t=t_0}^{t_1}u_{g,t}^{(y)}L_g^{(y)-1} \left( \sum\limits_{m=1}^M \beta_{g,m}^{(j)} \text{HillAdstock} \left( \left\{ x_{g,t-s,m}^{(b)} \right\}_{s=0}^L; \alpha_m^{(j)},ec_m^{(j)},\text{slope}_m^{(j)} \right) \right) \\ \end{align*}

$$s.t.\ \text{mROI}_m(b_m) > \text{mROI}_{minimal}\ \forall m$$

Where the minimal mROI is applied at channel level, and not at the total marketing level.

## Channel-level spend constraints

Channel-level spend constraints are available for both fixed and flexible budget optimization to prevent unreasonable optimization outcomes such as putting all spend into one single channel. The channel-level spend constraint is defined as:

$$(b_m^{'} \times LB_m) \leq b_m \leq (b_m^{'} \times UB_m) \space \forall m$$

Where:

• $$b_m^{'}$$ is the non-optimized spend for channel $$m$$.
• $$LB_m$$ is the user-specified lower bound with the value between $$0$$ and $$1$$.
• $$UB_m$$ is the user-specified upper bound with the value greater than $$1$$.
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]