![]() |
From | "E. Paul Wileyto" <epw@mail.med.upenn.edu> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: boundary constraints within nl |
Date | Fri, 06 Jun 2008 13:36:24 -0400 |
An easy way to impose b>0 is to substitute b=exp(c). c is unconstrained, and would have a range from minus to plus infinity, but b would be greated than 0.
Likewise, for k substitute k=((k2-k1)/(1+exp(m))+k1. m is unconstrained, but k would fall between k1 and k2.
I use these tricks all the time and they work very well. To get back estimates and standard errors for b and k, use nlcom.
P
Olga Lyashevska wrote:
Dear all,
We have a negative exponential growth model.
y=a exp(-kx)+b
Is there is a way to impose constrains on model parameters such as b>0 and
k1<k<k2?
Thank you in advance,
Olga
Marc Keuschnigg wrote:
Hey,--
I am estimating non linear least squares models (nl) using equations like: nl (y = ({a}+{b}* x) * (1-x)).
My question is, how do I impose parameter restrictions like a >=0 and b >=0?
I could log-transform the parameters, but I don't know how to do it technically within the nl command.
Thanks for helping,
Marc
*
* 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–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |