I am using the glmnet package in R. When I set the alpha value = 0, I would expect that no variables are selected. When I look at the coefficients some of them are set to zero. What could be the explanation for this behaviour?
I found an explanation why I get some coefficients set to zero in my empirical data set. The reason seems to be, that some of my variables have the same information content over rows. I am working with SNP data. So in the case where a variable is set to zero they are e.g. homozygous for all indviduals. If I remove all this "monomorphic" positions I end up with the same amount of variables, which remain after fitting the ridge model and removing coefficients which were set to zero. So my assumption now is, as some predictors have no variance, the respective regression coefficients are not assessable and thus set to zero.
You should have a look at the glmnet's vignette. Having alpha set to zero does not mean that no variables are selected. It means that you only use the $\ell_2$-penalization. Let me know if you need more explanation ?
In fact, $\ell_1$ penalization tends to give you sparse estimates. If you have a look on the picture, you can see that it usually goes on the edge (i.e. forcing some coefficients to be zero). The $\ell_2$ penalization is supposed to "regroup variables" (harder to explain it with this picture).
Maybe I don't understand your question, but why did you think it would not select variables ?