Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I am looking for some open source or an existing library I can use. As far as I tell the glmnet package isn't very easily extensible to cover the non negative case. I may be wrong, Any one with any ideas much appreciated.

By non-negative I mean that all coefficients are constrained to be positive (> 0).

share|improve this question
Pardon me for asking, but what exactly do you mean with non-negative lasso? To keep all coefficients > 0 or only allow positive predictions? Googling didn't enlighten me but it sounds like something I'd like to know about. – Backlin Oct 8 '12 at 7:28
Sorry for closing your question, but it is better asked and answered at www.crossvalidated.com I flagged the question for migration, so the mods will take care of it shortly. This said, please make your question clear and explain exactly what you want. The lasso expert in our research group couldn't possibly figure out what you were aiming at... – Joris Meys Oct 8 '12 at 8:48
Sorry about that. Non negative means all coefficients are positive. I tried using the package glmnet but that only solves for the general case. – ganesh reddy Oct 16 '12 at 14:24

migrated from stackoverflow.com Oct 8 '12 at 13:55

2 Answers

See the penalized package for one option. The Vignette (PDF!) that comes with the package has an example of this in section 3.9.

Essentially set argument positive = TRUE in the call to the penalized() function.

share|improve this answer

This and this paper demonstrate that under some general conditions, hard thresholding of the non-negative least squares solution is equivalent or better than L1 regularization (LASSO), in terms of performance. One example is if your design matrix is has only non-negative entries, which is often the case.

Worth checking out, as NNLS is very widely supported and will also be easier/faster to solve.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.