Page 1 of 1

inequality constraints and linreg (or nlls)

Posted: Tue Oct 11, 2016 8:19 am
by fioramanti
Dear all,
I have the following problem:
I want to estimate a linear model of the form

Code: Select all

linreg DW
# DW{1} UR_CYC_SUR{0 to 2} DLP DTOT DWS
but under the constraints that the sum of the coefficients of CYC_SUR is not negative. Someting like:

Code: Select all

nonlin(parmset=decl) a0 b0 b1 b2 b3 b4 b5
nonlin(parmset=constr1) b0+b1+b2>=0
frml PC DW=a0*DW{1}+b0*UR_CYC_SUR+b1*UR_CYC_SUR{1}+b2*UR_CYC_SUR{2} $
+b3*DLP+b4*DTOT+b5*DWS
Which is the correct way to specify the inequality constraint and add them to the estimate? Is that possible with "linreg" or do I have to use "nlls"?

Thanks,

Re: inequality constraints and linreg (or nlls)

Posted: Tue Oct 11, 2016 8:59 am
by TomDoan
You have to use NLLS. (LQPROG could be used, but that's much harder to set up for a problem like this).

nlls(parmset=decl+constr1,frml=pc) dw

Re: inequality constraints and linreg (or nlls)

Posted: Tue Oct 11, 2016 9:05 am
by fioramanti
Thanks,
It works.