4

For my understanding, multinomial logit model requires to restrict the parameters for one category to zeros. However, package{glmnet} seems to allow different parameters to every class. Could someone explain this reason?

Thank you very much in advance.

example:

#Reading packages
library(glmnet)
library(nnet)

## Testing
lasso <- glmnet(as.matrix(iris[,-5]), iris$Species, family = "multinomial") 
    lasso.cv <- cv.glmnet(as.matrix(iris[,-5]), iris$Species, family = "multinomial")

## Coef. of explanatory
lasso$a0[,which(lasso$lambda == lasso.cv$lambda.min)]
    lasso$beta$setosa[, which(lasso$lambda == lasso.cv$lambda.min)]
    lasso$beta$versicolor[, which(lasso$lambda == lasso.cv$lambda.min)]
    lasso$beta$virginica[, which(lasso$lambda == lasso.cv$lambda.min)]

### Why {glmnet} can calculate parameters of "all" category?

## comparison with result of {nnet}
nnetRes <- multinom(formula = iris$Species ~
                    iris$Sepal.Length + iris$Sepal.Width + iris$Petal.Length + 
                iris$Petal.Width, iris)
    nnetSummary <- summary(nnetRes)
    nnetSummary$coefficients

### Generally, like {nnet}, multinomial logit model can not calculate 
### parameters of a reference category.
Sycorax
  • 76,417
  • 20
  • 189
  • 313
Tky
  • 135
  • 2
  • 7
  • 1
    Can you provide an example? It's very hard for me to understand what you are describing. It is possible that some software may not normalize a reference alternative to zero, though this would be very odd. – gregmacfarlane Aug 16 '13 at 19:38
  • Related: http://stats.stackexchange.com/questions/121155/glmnet-how-to-make-sense-of-multinomial-parameterization – Andrew M Dec 03 '14 at 21:32
  • 1
    I posted an answer here http://stats.stackexchange.com/questions/121155/glmnet-how-to-make-sense-of-multinomial-parameterization?lq=1 – KH Kim Dec 26 '15 at 14:48
  • Does this answer your question? [glmnet: How to make sense of multinomial parameterization?](https://stats.stackexchange.com/questions/121155/glmnet-how-to-make-sense-of-multinomial-parameterization) – Johan Larsson Dec 13 '19 at 07:54

0 Answers0