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

st: Nonlinear regression and constraints


From   "Daniel Schneider" <[email protected]>
To   <[email protected]>
Subject   st: Nonlinear regression and constraints
Date   Tue, 28 Jun 2005 21:04:32 -0700

I have a question again, and I hope someone can help me on this.

I am running a non-linear regression:

nl (diff_diff = {alpha}*X1MX1SQDIVX3 + {beta}*X2SQMX2DIVX3 +
({alpha}-{beta})*X1X2DIVX3),  noconstant variables(X1MX1SQDIVX3
X2SQMX2DIVX3 X1X2DIVX3) 

(don't bother with the strange variable names, they make sense to me).

As you can see, I have two parameters "alpha" and "beta". I would like
to limit both to a range from 0 to 1. I tried to use constraints(1-4)
with these pre-commands:

constraint define 1 X1MX1SQDIVX3 >= 0
constraint define 2 X2SQMX2DIVX3 >= 0
constraint define 3 X1MX1SQDIVX3 <= 1
constraint define 4 X2SQMX2DIVX3 <= 1

Unfortunately, constraints() seems not to work with -nl-?

Is there any other way to to do the constraints with -nl-? 

If not, is it correct (and the best way) that I should set up the
Maximum-likelihood estimation behind the -nl- command by hand and use
the constraints then? 


Thanks in advance to whoever can help me on this one.


Daniel Schneider

*
*   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