inequality constraints and linreg (or nlls)

Econometrics questions and discussions
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

inequality constraints and linreg (or nlls)

Unread post 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,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: inequality constraints and linreg (or nlls)

Unread post 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
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

Re: inequality constraints and linreg (or nlls)

Unread post by fioramanti »

Thanks,
It works.
Post Reply