0

What are some package for generalized linear models that give non-negative regression coefficients without regularization? I checked the thread (Nonnegative generalized linear model), but many packages mentioned there have some properties that make them hard to use for my case:

  • the glm.cons function from zetadiv uses the nnls package, which minimizes the mean squared errors. However, in glm, the loss functions are different from the mse used in ordinary least squares

  • the glmnet package involves regularization

  • the addreg library doesn't seem to support Negative Binomial 2 models

Any recommendations for R packages that could be used for this purpose?

Edit: I have checked the similar question at Nonnegative generalized linear model, but as described above, methods mentioned in the said thread have different traits unsuitable for my intention.

zhli12
  • 21
  • 4
    glm() will fit generalized linear models without regularization. Nonnegativity of predictions is automatic if you choose an appropriate distributional family, see ?family, for instance family=Gamma. Alternatively, MASS::glm.nb() does negative binomial regression. Can you be a little more explicit as to what you want to do? Do you have count data? Do you want to predict, or do inferential testing? – Stephan Kolassa Oct 12 '22 at 06:38
  • 2
    Sorry for the confusion. By non-negativity I meant the nonnegative regression coefficients rather than the outcome variables. – zhli12 Oct 12 '22 at 21:46

0 Answers0