# Estimating incremental KPI using regression

Under the exchangeability and consistency assumptions, the conditional expectation of any KPI potential outcome $$\overset \sim Y_{g,t}^{ \left(\left\{ x_{g,t,m}^{(\ast)} \right\}\right) }$$ can be written in terms of a conditional expectation that can be estimated by a regression model.

From the definitions described in Input data, this can be written as:

\begin{align*} \overset \sim Y_{g,t} &= u_{g,t}^{(y)} \overset {\cdot \cdot} Y_{g,t} \\ &= u_{g,t}^{(y)}L_g^{(y)-1}(Y_g,t) \end{align*}

Meridian also makes use of the fact that the pre-modeling sales transformation function $$L_g^{(y)}(\cdot)$$ is linear and therefore can be passed outside the conditional expectation operator. This ends up with the following equality, where the result is a quantity that can be estimated from a regression model, such as the Meridian model:

\begin{align*} E\left(\overset \sim Y_{g,t}^{(\left\{ x_g,t,m^{(\ast)} \right\})} \Big| \bigl\{ z_{g,t,c} \bigr\} \right) &= E\left( \overset \sim Y_{g,t} \Big| \bigl\{x_{g,t,m}^{(\ast)}\bigr\}, \bigl\{z_{g,t,c}\bigr\} \right) \\ &= E\left( u_{g,t}^{(y)}L_g^{(y)-1}(Y_{g,t}) \Big| \bigl\{ x_{g,t,m}^{(\ast)} \bigr\}, \bigl\{z_{g,t,c}\bigr\} \right) \\ &= u_{g,t}^{(y)}L_g^{(y)-1} E\left( Y_{g,t} \Big| \bigl\{ x_{g,t,m}^{(\ast)} \bigr\}, \bigl\{z_{g,t,c}\bigr\} \right) \end{align*}

Based on this, regression can be used to estimate the incremental KPI between any two counterfactual scenarios $$\left\{ x_{g,t,m}^{(1)} \right\}$$ and $$\left\{ x_{g,t,m}^{(0)} \right\}$$:

\begin{align*} IncrementalSales \left( \bigl\{ x_{g,t,m}^{(1)} \bigr\}, \bigl\{ x_{g,t,m}^{(0)} \bigr\} \right) &= E\left( \sum\limits_{g,t}\left( \overset \sim Y_{g,t}^{ \left( \left\{ x_{g,t,m}^{(1)} \right\} \right) } - \overset \sim Y_{g,t}^{ \left( \left\{ x_{g,t,m}^{(0)} \right\} \right) } \right) \Bigg| \bigl\{ z_{g,t,c} \bigr\} \right) \\ &= \sum\limits_{g,t}u_{g,t}^{(y)}L_g^{(y)-1} \left( E\left( Y_{g,t} \Big| \bigl\{ x^{(1)} \bigr\}, \bigl\{ z_{g,t,c} \bigr\} \right)\right) - \sum\limits_{g,t}u_{g,t}^{(y)}L_g^{(y)-1} \left( E\left( Y_{g,t} \Big| \bigl\{ x^{(0)} \bigr\}, \bigl\{ z_{g,t,c} \bigr\} \right) \right) \end{align*}

Under the Meridian model specification:

\begin{align*} E\left( Y_{g,t} \Big| \bigl\{ x_{g,t,m}^{(\ast)} \bigr\}, \bigl\{ z_{g,t,c} \bigr\} \right) = \mu_t &+ \tau_g + \sum\limits_{c=1}^C \gamma_{g,c}z_{g,t,c} \\ &+ \sum\limits_{m=1}^M \beta_{g,m} HillAdstock \left( \bigl\{ x_{g,t-s,m}^{(\ast)} \bigr\}^L_{s=0};\ \alpha_m, ec_m, slope_m \right) \end{align*}

This quantity is a function of the model parameters, and therefore has a posterior distribution which Meridian can sample using Markov Chain Monte Carlo (MCMC). ROI, mROI, and response curves can all be calculated based on the incremental KPI definition, and each of these quantities also has a posterior distribution.

[{ "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" }]