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
Example of multilevel logistic regression with only level-2 predictorsHi there, I am building a multilevel logistic regression model without level-1 predictors. This mea…
Merging two continuous variables in the same datasetHi, I have two variables: 1) age of initiating cigarette use with values from 10-23 and 2) age of i…
nl problem with modified Richards equationDear Team, I'm trying to fit modified Richards equation to simulated cumulated volume (v_elong) data…
reghdfe errors message : class FixedEffects undefinedI tried reghdfe for the first time and I used the following code to use reghdfe But I get this error…
Create a variable that defines the value of the next rowHi, I am using long form data. I have a variable called ia_label that defines an area of interest a…
Subscribe to:
Post Comments (Atom)
0 Response to How to perform NLS estimation with a complex function
Post a Comment