3

As the title indicates, I'm wondering what the exact impact of defining weights is in the glmnet package for R.

I'm working with survey data that contains design weights to correct for low/high probability that a certain individual will be sampled. I am (also) estimating a Weighted Least Squares (WLS) model, in which the weights are multiplied on the sum of squared residuals : Wiki side for WLS

What I'm not sure about is where in the objective function the weights are applied in the glmnet package. In the vignette for glmnet, the authors specify the objective function as: link to Vignette, in which a term "w_i" is multiplied to the sum of squared residuals. The authors (it seems to me) do not specify if these w's are weights, but I assume they are. Therefore, this seems to me to be similar to WLS just with an added penalisation term. However, I don't think it's clear whether these w's are the same as the weight argument to the glmnet() function.

My question is: Are the weights in the weight argument to glmnet() multiplied to the sum of squared residuals? If no, what does the argument do?

And a side question: What is the best way to deal with survey design weights (or other weights) in lasso or elastic net - should they be multiplied to the sum of squared residuals, the penalisation term, or possibly both?

Thanks in advance!

Frederik

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
FSS
  • 31
  • 2

0 Answers0