I'm dealing with the adstock model and try to find the best alpha in the formula of adstock_t=ad_t+alpha*adstock_t-1. I found the following relevant code in R to solve this question:
Here, for the modeling, the guy used nls function, I have several questions about it: first, it seems that the function sales~b0+bi*adstock is a linear function why we use the nonlinear fitting model nls here. secondly, I'm wondering how the model choose the best b0,b1 and alpha(rate here). We only specify the start point of each parameter, how does the model go through all possible value and choose the best ones? Is there upper bound for the range of parameters? Does it choose the best parameters based on R square(minimize SSR)? But in our course, the instructor mentioned that we estimate the best rate using maximize likelihood, which makes me confused because the nls uses least square rule. Is that inconsistent?
Thanks for any help!
Jie