The reference is this website: The `family` Argument for `glmnet` • glmnet
glmnet can fit penalized GLMs for any family as long as the family can be expressed as a family object. In fact, users can make their own families, or customize existing families, just as they can for regular GLMs.
Now I need to create my own family. It's gamma family with the shape parameter is fixed at 1. And the link function is standard log function.
I try this code first:
cv.glmnet(x=as.matrix(all_datasets[,c("V1","V2")]), y=all_datasets$V4, family= Gamma(link="log"), type.measure = "mse", alpha = 1, nlambda = 100)
The above code works. But I am not sure whether its shape parameter is fixed at 1. The tutorial on the website lack the clear relevant information.