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
Generate a new variable by counting character ( "/" ) Code: . list country +------------------------------+ | country | …
How to show countriesHello, I'm running a mixed effect model using this command Code: xi: mixed reconsumption CL PR i…
Newey Regression for panel dataHello, I wanted to know whether the newey-west command can be used for panel data or not? If no, th…
Drawing random sample multiple times from a large data setHi, I would like to know how can I draw a smaller sample (of say 20000) from an already existing lar…
Explaining output from replace commandThis uses the "sysuse auto" stata dataset. The command I was intending to type was replace price=1…
Subscribe to:
Post Comments (Atom)
0 Response to How to perform NLS estimation with a complex function
Post a Comment