Dear Stata users,
I need to use NLS to estimate the following equation describing the so-called Bass diffusion model:
yt = 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)))) ] + ut
where m,p, and q are parameters and t indicates time. As initial values for these parameters, I am to use those obtained with OLS applied to:
yt = β0 + β1 x1, t-1 + β2 x2, t-1 + ϵt
where β0 = m * p
β1 = q - p
β2= - q/m
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.
Related Posts with How to perform NLS estimation with a complex function
Including an extra independent variable in a panel regression reports missing t-statistics/std. errorsHello everyone, I have a panel dataset, where the panel variable is industry code (I am doing an in…
Presenting industry and year coefficient using a 3D graphHi all I regress y on X1 and X2 per each industry and year group. My coefficient of interest is the…
Help with creating a dummy variable that depends on the last integer of a dateHey y'all. I've been stuck on creating a dummy variable called summer that's 1 when the integer end…
bar chart width of barsHi i created this bar chart using the bar chart option within the data tab in stata and i produced t…
Estimating Incidence Rate using poisson regressionHi All, Up to now I have benefitted a lot from this forum. One question I can’t get my head around …
Subscribe to:
Post Comments (Atom)
0 Response to How to perform NLS estimation with a complex function
Post a Comment