To estimate the parameters of a model in which all parameters are constrained to be greater than zero and to sum to one, you can use PROC FMM in SAS/STAT®, PROC MODEL in SAS/ETS®, or PROC NLP in SAS/OR®.
These statements create a data set with normally-distributed response, R, whose values are generated from a model with parameters 0.2, 0.3, 0.1, and 0.4 for the predictors X1 through X4, respectively.
data test; array xarray {4} x1-x4; do i=1 to 50; do j=1 to 4; xarray{j}=0.8+0.4*ranuni(55555); end; r = 0.2*x1 + 0.3*x2 + 0.1*x3 + 0.4*x4 + 0.0001*rannor(99999); output; end; run;
The following statements fit the model using PROC FMM in SAS/STAT software. The first four RESTRICT statements constrain each predictor parameter to be positive. The last RESTRICT statement constrains their sum to equal one.
proc fmm data=test; model r = x1 x2 x3 x4; restrict x1 1 >= 0; restrict x2 1 >= 0; restrict x3 1 >= 0; restrict x4 1 >= 0; restrict x1 1 x2 1 x3 1 x4 1 = 1; run;
Note that the estimated parameters are positive, essentially equal to the true values, and sum to one. The Linear Constraints table shows that the sum-to-one constraint was active at the solution. The four positivity constraints were not active, presumably because their unconstrained estimates were already positive.
|
These statements estimate the model parameters using the SAS/ETS procedure MODEL. The BOUNDS statement requires each of the parameters to be positive and the RESTRICT statement requires the parameters to sum to one.
proc model data=test; parms b1 .25 b2 .25 b3 .25 b4 .25; bounds b1>=0, b2>=0, b3>=0, b4>=0; restrict b1+b2+b3+b4=1; r = b1*x1 + b2*x2 + b3*x3 + b4*x4; fit r; run; quit;
The results show the estimated parameters to be quite close to the true parameters and that they sum to one. Notice that a test of the sum-to-one restriction is also provided.
|
The following statements use PROC NLP in SAS/OR Software to fit the same model.
proc nlp data=test cov=2; lsq z; array b{4} b1-b4; parms b1-b4=.25; bounds b1-b4>=0; lincon b1+b2+b3+b4=1; z = r - (b1*x1 + b2*x2 + b3*x3 + b4*x4); run;
Again, the estimated parameters are close to their true values and sum to one. However, a test of the restriction is not available.
|
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/STAT | All | n/a | |
SAS System | SAS/ETS | z/OS | ||
OpenVMS VAX | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
Microsoft Windows XP 64-bit Edition | ||||
Microsoft® Windows® for x64 | ||||
OS/2 | ||||
Microsoft Windows 95/98 | ||||
Microsoft Windows 2000 Advanced Server | ||||
Microsoft Windows 2000 Datacenter Server | ||||
Microsoft Windows 2000 Server | ||||
Microsoft Windows 2000 Professional | ||||
Microsoft Windows NT Workstation | ||||
Microsoft Windows Server 2003 Datacenter Edition | ||||
Microsoft Windows Server 2003 Enterprise Edition | ||||
Microsoft Windows Server 2003 Standard Edition | ||||
Microsoft Windows XP Professional | ||||
Windows Millennium Edition (Me) | ||||
Windows Vista | ||||
64-bit Enabled AIX | ||||
64-bit Enabled HP-UX | ||||
64-bit Enabled Solaris | ||||
ABI+ for Intel Architecture | ||||
AIX | ||||
HP-UX | ||||
HP-UX IPF | ||||
IRIX | ||||
Linux | ||||
Linux on Itanium | ||||
OpenVMS Alpha | ||||
OpenVMS on HP Integrity | ||||
Solaris | ||||
Solaris for x64 | ||||
Tru64 UNIX | ||||
SAS System | SAS/OR | z/OS | ||
OpenVMS VAX | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
Microsoft Windows XP 64-bit Edition | ||||
Microsoft® Windows® for x64 | ||||
OS/2 | ||||
Microsoft Windows 95/98 | ||||
Microsoft Windows 2000 Advanced Server | ||||
Microsoft Windows 2000 Datacenter Server | ||||
Microsoft Windows 2000 Server | ||||
Microsoft Windows 2000 Professional | ||||
Microsoft Windows NT Workstation | ||||
Microsoft Windows Server 2003 Datacenter Edition | ||||
Microsoft Windows Server 2003 Enterprise Edition | ||||
Microsoft Windows Server 2003 Standard Edition | ||||
Microsoft Windows XP Professional | ||||
Windows Millennium Edition (Me) | ||||
Windows Vista | ||||
64-bit Enabled AIX | ||||
64-bit Enabled HP-UX | ||||
64-bit Enabled Solaris | ||||
ABI+ for Intel Architecture | ||||
AIX | ||||
HP-UX | ||||
HP-UX IPF | ||||
IRIX | ||||
Linux | ||||
Linux on Itanium | ||||
OpenVMS Alpha | ||||
OpenVMS on HP Integrity | ||||
Solaris | ||||
Solaris for x64 | ||||
Tru64 UNIX |
Type: | Usage Note |
Priority: | low |
Topic: | Analytics ==> Regression Analytics ==> Mathematical Optimization SAS Reference ==> Procedures ==> FMM SAS Reference ==> Procedures ==> NLP SAS Reference ==> Procedures ==> MODEL |
Date Modified: | 2019-05-03 14:17:00 |
Date Created: | 2002-12-16 10:56:39 |