Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: nonlinear least squares


From   Henrik Andersson <[email protected]>
To   [email protected]
Subject   st: nonlinear least squares
Date   Sat, 29 Jun 2002 11:57:13 +0200

Hi,

I am having problem using nonlinear least squares. It seems to work when I do the programming, I do not get any "error message" when running the funtion that I have programmed. The problem occure when I try to estimate the function. I even have used one of the examples from the "reference guide" to see if it was my function that was the problem, but the result is the same, I get an error message. My programming for the example from the book looks like, where x is my dependent varialbe:

program define nltest
version 7.0
if "`1�" == "?" {
global S_1 "B0 B1"
global B0=1
global B1=.1
exit
}
replace `1�=$B0*(1-exp(-$B1*x))
end

I then give the command,

nl test y

which produces the error message:

nltest refused query, rc=198
r(196);

Under r(196) one can read, "Your nlfunc program did not work properly with the nl command."

What do I do wrong?

Henrik Andersson


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index