[R] Glmnet penalty.factor with multigaussian response

Maria Vila Casadesús maria.vila at ciberehd.org
Wed Nov 18 16:35:10 CET 2015


Hi all,
I'm trying to use glmnet with penalty factors in a multigaussian response
model.

In case of the gaussian response the input for penalty factors is a vector,
but I haven't figured out how can I use penalty factors with a
multigaussian response, and even if it's possible. I've tried to use a
matrix of values, it doesn't give any error or warning but it seems to be
using only part of the data: the first column.

Do you know if it's possible to use penalty factors in this case? Or are
there any other alternatives?

So far, I've tried this:

cv<-cv.glmnet(x,y,alpha=.5,family = "mgaussian", penalty.factor=pen.matrix.tot)

Where:

> dim(x)[1]  40 723> dim(y)[1] 40  7

Penalty matrix looks like:

> pen.matrix.tot[1:5,1:5]
            NAT2 CYP1A2 CYP2A6 CYP2A7 CYP2A13
hsa-let-7a     1      0      1      1       1
hsa-let-7a*    1      1      1      1       1
hsa-let-7b     0      0      1      1       1
hsa-let-7b*    1      1      1      1       1
hsa-let-7c     0      0      1      1       1
> dim(pen.matrix.tot)[1] 723   7

The coefficients for lambda.min:

 > fullcoefs[1:5,1:5]
                    NAT2      CYP1A2       CYP2A6     CYP2A7     CYP2A13
 hsa-let-7a           NA          NA           NA         NA          NA
 hsa-let-7a*          NA          NA           NA         NA          NA
 hsa-let-7b   0.10222788  0.06621902  0.064668084  0.3887164  0.06369455
 hsa-let-7b*          NA          NA           NA         NA          NA
 hsa-let-7c  -0.06436899 -0.03362183 -0.007440406 -0.2581606
-0.01517728> dim(fullcoefs)[1] 723   7


More speciffically, in this case I would expect some value for
"hsa-let-7a":"CYP1A2", as the penalty for it is 0.

Many thanks!

Maria

	[[alternative HTML version deleted]]



More information about the R-help mailing list