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

Re: st: Inequality constraints and quadratic programming


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: Inequality constraints and quadratic programming
Date   Thu, 29 Jul 2004 17:42:37 -0400 (EDT)

Matt,

if I were dealing with this problem, I'd use a low level -ml- programming
restricting the range of possible parameters. When you compute your
likelihood (which here would be the normal density of the residual), you
have an option of specifying something like

if !( (0 <= b1) & (b1<=1) & (0<=b2) & (b2<=1) ) {
   replace likelihood = .
}

which singals to Stata the likelihood cannot be evaluated. But then,
Stata's -ml- most likely would crash saying -cannot compute numeric
derivatives nearby- or something of that kind.

Other than that, if you are absolutely sure that the residual sum of
squares is concave in the parameters (think about it carefully... it is a
quadratic function of them, but who knows), then your intuition is 100%
correct.

> Is there a way to estimate a quadratic programming model in Stata using
> both inequality and equality constraints on the estimated coefficients?
>
> I am trying to estimate:
>
> y=b1x1+b2x2+e
> s.t.
> (1) b1+b2=1
> (2) 0<=b1<=1
> (3) 0<=b2<=1
>
> As an aside, it is simple enough to estimate a cnsreg model with only
> the first constraint...Now, my intuition is telling me that in this
> particular case:
>
> a) if OLS using only the first constraint yields b1 and b2 between 0 and
> 1, then the other two constraints are non-binding so the estimates from
> a regression using just the first constraint should be the same as a
> regression using all three.
>
> b) if OLS using only the first constraint yields (say) b1<0 and b2>1,
> then the best fit for a regression using all three constraints should be
> b1=0 and b2=1.
>
> Admittedly, my intuition on these matters has a very large error term
> and is often biased, which is likely compounded in this case by the fact
> that my knowledge of quadratic programming is limited.  Any comments on
> either the initial question or my (likely erroneous) intuition would be
> greatly appreciated!


 ---                                    Stas Kolenikov
 --       Ph.D. student in Statistics at UNC-Chapel Hill
 - http://www.komkon.org/~tacik/  -- [email protected]

* This e-mail and all attachments to it are not intended to provide any
* reasonable point of view and was transmitted to you in error. It
* should be immediately deleted by all recipients unless they really
* enjoy communicating with the author :). Other restrictions apply.

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