Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: Bounded Inequality Constraints


From   "Feiveson, Alan H. (JSC-SK311)" <alan.h.feiveson@nasa.gov>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Bounded Inequality Constraints
Date   Tue, 6 Dec 2011 09:02:10 -0600

Dmitriy, Nick   -  

Sorry, but I think I "solved" the problem "backwards" in the sense that my parameters c1, c2, c3 lie in the required bounds, but not the coefficients of weight, mpg and length, which are the transformed parameters.

I tried doing it the other way, to constrain the coefficients; e.g.

nl  (price = {A=14500} + (2+3*invlogit( {c1=-.187} )*weight )  + (-100+30*invlogit( {c2=-.24} )*mpg )    +   (-120+30*invlogit( {c3=0} )*length )                          )


but I get garbage, even when I cheated and modified the constraints so that the coefficients are in the range of what you get with OLS.


OLS results:
. reg price weight mpg length

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  3,    70) =   12.98
       Model |   226957412     3  75652470.6           Prob > F      =  0.0000
    Residual |   408107984    70  5830114.06           R-squared     =  0.3574
-------------+------------------------------           Adj R-squared =  0.3298
       Total |   635065396    73  8699525.97           Root MSE      =  2414.6

------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      weight |   4.364798   1.167455     3.74   0.000     2.036383    6.693213
         mpg |  -86.78928   83.94335    -1.03   0.305     -254.209    80.63046
      length |  -104.8682   39.72154    -2.64   0.010    -184.0903   -25.64607
       _cons |   14542.43   5890.632     2.47   0.016      2793.94    26290.93
------------------------------------------------------------------------------


So I constrained the coefficient for mpg to lie between -100 and -70, and the coefficent for length to lie between -120 and -90. The initial values are what transforms to the OLS estimates. Still I get convergence problems.

Al


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dmitriy Glumov
Sent: Tuesday, December 06, 2011 7:52 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: Bounded Inequality Constraints

Al,

Thank you very much for showing the tranformation, this is very
helpful. However, I have some trouble understanding the values you
chose in the transformation (I apologize for using a bad example), so
would it be possible for you to briefly go over them. In particular
would this transformation account for the upper bound of 5, if the
coefficients were to go that far? Again, thank you for the help and
consideration.

Dmitriy

On Mon, Dec 5, 2011 at 12:09 PM, Feiveson, Alan H. (JSC-SK311)
<alan.h.feiveson@nasa.gov> wrote:
> Dmitriy - The example from the auto data doesn't work very well, but if you want to crank it out by brute force, you could use nonlinear least squares with a logit transformation:
>
> nl  (price = {A} + logit( ( {c1=3.5}-2)/3) * weight  + logit( ( {c2=3.5}-2)/3) * mpg   +   logit( ( {c3=3.5}-2)/3) * length  )
>
>
>
>     Source |       SS       df       MS
> -------------+------------------------------         Number of obs =        74
>       Model | -2.6420e+09     3  -880670066         R-squared     =   -4.1602
>    Residual |  3.2771e+09    70  46815365.6         Adj R-squared =   -4.3814
> -------------+------------------------------         Root MSE      =  6842.176
>       Total |   635065396    73  8699525.97         Res. dev.     =  1512.858
>
> ------------------------------------------------------------------------------
>       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -------------+----------------------------------------------------------------
>          /A |   1677.936   5890.632     0.28   0.777    -10070.56    13426.43
>         /c1 |   3.870228    .822251     4.71   0.000       2.2303    5.510156
>         /c2 |   2.000028   .0023649   845.71   0.000     1.995311    2.004744
>         /c3 |   2.000001   .0000529 37836.18   0.000     1.999896    2.000106
> ------------------------------------------------------------------------------
>  Parameter A taken as constant term in model & ANOVA table
>
>
>
> The coefficients c2 and c2 are estimated at their lowest allowable value (2.0) because they are negative in the unrestricted model. In this example, I didn't try to restrict the constant term ("A").
>
> Al Feiveson
>
>
>
>
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dmitriy Glumov
> Sent: Monday, December 05, 2011 8:21 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Bounded Inequality Constraints
>
> Dear Statalist Users,
>
> I need to include inequality constraints into the regression I am
> working on. In particular, I would like the coefficients of all the
> independent variables to be between 2.5 and 5. To provide you with an
> example, suppose I was using an Auto dataset and running the following
> simple regression:
>
> regress price mpg weight length
>
> This regression needs to be constrained in such a way so that the
> coefficients for mpg, weight, and length all stay bounded between 2.5
> and 5 (and disregarded if they are outside this range). I know there
> has been a fair amount of discussion in regards to this topic and
> Maarten has posted this solution
> (http://www.stata.com/support/faqs/stat/intconst.html), but I wasn't
> sure if there's potentially an another, perhaps more appropriate way,
> to solve the problem I am dealing with - one that requires bounding
> (rather than a one-sided inequality). Moreover, I could not figure out
> how to transform the solution that Maarten posted into the one where
> both bounds are accounted for. Hence, any help with this would be
> greatly appreciated. Thank you for your consideration.
>
> Regards,
> Dmitriy
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index