In this post we take the basic model developed in Marketing Mix Modeling Explained – with R and add the non-linear effect of advertising. I distinguish between advertising and advertising returns. I call the later sales for ease of readability.

Advertising non-linearity beyond the adstock/carry-over idea comes from two concepts: (1) diminishing returns and (2) saturation. Diminishing returns means that advertising exhibits non-constant and a decreasing marginal return to scale. For example, sales from $200 of advertising are less than twice the sales of $100 of advertising. A subsequent part of diminishing returns is the saturation effect where sales reach a limit after which more advertising has near zero incremental effect.

There is a number of functions used to model this non-linear advertising – sales relationship. I present few that are the most popular. I also specify the parameters ranges usually used with each function where applicable. But like they say, a picture is worth a 1,000 words.

**Power Function**:*y*=*α*⋅*x*^{β}; 0 <*β*≤ 1

The power function has a the nice property that when*β*= 1 the function becomes linear.*β*= 1, of course, means that there is no diminishing returns within the observed data ranges. This function will never saturate as lim*y*= ∞ as*x*reaches ∞. This could be unreasonable for testing marketing outside of the observed ranges of modeled data. Aside from it’s use in advertising, the power function is also used to model price variable when*β*< 0.**Michaelis-Menten Function**:*y*=*(**α*⋅*x) / (*1 +;*β⋅*x)≥ 0*β*

The Michaelis-Menten function has a similar property to the power function as it becomes linear but when*β*= 0. This function has the added bonus of reaching a sales saturation of*β*/*α*.**Negative Exponential Function**:*y*=*α*⋅(1 −*e*^{−β⋅x}) ;0*β >*

This function is called the negative exponential function due the −*β*portion. It is also referred to as the 2-parameter asymptotic exponential. Maximum sales attained by this modeling form, i.e. saturation, is*α*.

There are three important questions to ask:

- What happens at zero level of advertising?
- What happens at very high level of advertising?
- What happens between zero and high level of advertising?

Naturally, zero level of advertising should produce no sales effect and higher level of advertising effect should reach an upper limit mathematically called an asymptote. What happens in between is up to a great debate and is the subject of next post but it suffices to say an S curve function is sometimes desired.

The input variable, *x*, in all of the three functions above can be one of three things (1) advertising, (2) advertising adstock or (3) cumulative advertising for a certain period of time.

Last thing I want to add is that these functions are monotonically increasing, i.e. sales for higher level of advertising units is always greater than sales for lower level of advertising. Mathematically, *f*(*x*+*ϵ*) > *f*(*x*). This, of course, means advertising can do no harm, which is a whole different topic on it’s own.

Sray AgarwalThis seems really interesting. can you help me in executing this in R

AnalyticsArtistPost authorUse nls() function.

LilLooking forward to your next post on the shape of the function!

DoroThank you for the interesting post Gabriel! Can you give an example of how to apply the functions to the adstock model illustrated in your previous post? I tried to use nls() to optimize the parameters of negative exponential function as well as the adstock decay rate but got this error:

Error in nlsModel(formula, mf, start, wts) :

singular gradient matrix at initial parameter estimates

AnalyticsArtistPost authorHi Doro,

The nls function will fail quite a bit. You can use the nlsLM function from the minpack.lm package. Here is an example I put in the comments of Adstock Rate – Deriving with Analytical Methods.

DoroThank you Gabriel. This is super helpful. Looking forward to your new posts!

JimHow does this show use of the the functions in the post with saturation etc?

AnalyticsArtistPost authorTry using nls(y ~ a + b * adstock(x, r)^p, …)

PrateekThanks a lot Gabriel, tried to used nlsLM function for the saturation effect but i am not getting exactly how to combine this with the original Sales equation. Can you please help me with its code in R.

AnalyticsArtistPost authorCan you put some data along with your model?

JeanHello Gabriel,

just wanted to ask about finding the parameters of these curves when we know, that these variables (spends/GRP etc.) are only a part of the model.

For example: Sales = A*constant + B*trend + C* Promotion(0,1) + D*f(TV) + E*f(Online).

We know the values of GRPs and Online spends. We also know that the f(TV) – based on GRPs – will probably be S-Shaped and f(Online) will be negative-exponential. How (and when – after defining the model or a t the very beginning) can we find the parameters of these functions?

Would really appreciate Your help

J.

AnalyticsArtistPost authorThe answers to these questions are defined in few blogs. If you know the functional form of the transformation then you’ll need to setup an optimization procedures. You can do it with with Excel like in this blog post. The trick is to write the function in the formula and let the optimization function choose the parameters. The

`nls()`

function or variations of it is usually what I use.