BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
anonysas
Calcite | Level 5

Hi ,

Please tell me how to put a non-negative constraint on the regression coefficient in Lasso regression.
I use ETS or STAT.

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

You can use HPGENSELECT to fit your model using the LASSO method in the SELECTION statement. It also has a RESTRICT statement that can be used to restrict parameters in the model. Unfortunately, model selection methods cannot be used together with parameter restrictions. However, after selecting a model, you can try refitting it by adding one or more RESTRICT statements to restrict parameters. For example, the following restricts the X4 parameter to be positive.

proc hpgenselect;
model y=x1 x2 x3 x4;
restrict x4 1 > 0;
run;

View solution in original post

4 REPLIES 4
japelin
Rhodochrosite | Level 12

Here is a Japanese community, so you may find it easier to get answers if you post here.
https://communities.sas.com/t5/SAS-Programming/bd-p/programming 

anonysas
Calcite | Level 5
Thank you for your concern.
StatDave
SAS Super FREQ

You can use HPGENSELECT to fit your model using the LASSO method in the SELECTION statement. It also has a RESTRICT statement that can be used to restrict parameters in the model. Unfortunately, model selection methods cannot be used together with parameter restrictions. However, after selecting a model, you can try refitting it by adding one or more RESTRICT statements to restrict parameters. For example, the following restricts the X4 parameter to be positive.

proc hpgenselect;
model y=x1 x2 x3 x4;
restrict x4 1 > 0;
run;
anonysas
Calcite | Level 5
I understood that it would be done in two steps.
Thank you.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 969 views
  • 0 likes
  • 3 in conversation