Dear Stata users,

I need to use NLS to estimate the following equation describing the so-called Bass diffusion model:

y

where

y

where β

β

β

Note that m = 41302528

p = 0.024

q = 0.194

To perform this NLS estimation, I tried to follow the example that was given in the Stata forum (https://www.stata.com/features/overv...ar-regression/) in order to create a program that defines my function.Then, I used the nl command and specified the initial values.

When I run the command, I get the following message:

verify that nlces is a function evaluator program

r(198);

Would you please help me figure out what the problem is? I am a beginner in Stata software.

Thanks in advance.

I need to use NLS to estimate the following equation describing the so-called Bass diffusion model:

y

_{t}= m * [**(**(1 - exp (-(p+q) * t)) / (1 + q/p * exp (-(p+q) * t))**)**-**(**(1 - exp (-(p+q) * (t-1))) / (1 + q/p * exp (-(p+q) * (t-1)))**)**] + u_{t}where

**, and***m,p**are parameters and***q***indicates time. As initial values for these parameters, I am to use those obtained with OLS applied to:***t**y

_{t}= β_{0}+ β_{1}x_{1, t-1 }+ β_{2}x_{2, t-1}+ ϵ_{t}where β

_{0 }= m * pβ

_{1 }= q - pβ

_{2}= - q/mNote that m = 41302528

p = 0.024

q = 0.194

To perform this NLS estimation, I tried to follow the example that was given in the Stata forum (https://www.stata.com/features/overv...ar-regression/) in order to create a program that defines my function.Then, I used the nl command and specified the initial values.

When I run the command, I get the following message:

verify that nlces is a function evaluator program

r(198);

Would you please help me figure out what the problem is? I am a beginner in Stata software.

Thanks in advance.

## Comment