On Thu, 26 Dec 2019, Ivan Falconi wrote:
Please, I need ssome help.
I am trying to obtain the parameters of the Bass model (p, q , m are
coefficient of innovation, coefficient of imitation and market potential,
respectively) . The message I got was that after 800 iterations convergence
was not reached.
The initial parameters were obtained with Excel's Solver. I had the same
issue before and I used the program NELREG which gave me same error but I
used a script and was able to find convergence. I am sure the same will
happen with greatl provided I use proper script.
This seems to work (with some help from
# use quarterly iPhone sales data
smpl 2007:2 ;
series s = iPhone
series S = cum(s)
series S2 = S^2
# regress sales on cumulated sales and its square
ols s const S S2
matrix b = $coeff
# unscramble m, p and q
m1 = (-b + sqrt(b^2 - 4*b*b)) / (2*b)
m2 = (-b - sqrt(b^2 - 4*b*b)) / (2*b)
m = m1 > m2 ? m1 : m2
p = b/m
q = -m*b
# index starting in 2007Q2
series idx = seq(1,$T)'
nls s = (m*((p+q)^2/p)*empqi)/(1+(q/p)*empqi)^2
series empqi = exp(-(p+q)*idx)
params m p q