title: penalty.factor with model matrix input
body: <p>I am trying to fit a model using glmnet. For the data input I am converting my data to sparse.model.matrix format using a model formula. I am trying to de-regularize one of the variables I wish to include as a control but I can not get the penalty.factor argument to work! First I am not sure how long the vector needs to be, the model matrix has columns for each level of my original variable, do i need to specify a penalty.factor for each level? I believe I have tried both, the longer penalty vector seems to do nothing while the shorter one results in an convergence error. The code is set up as below:</p>
  
  <pre><code>    X &lt;- sparse.model.matrix(model.formula, data)
     fit &lt;- glmnet::cv.glmnet(X, y, family = "poisson", type.multinomial = "ungrouped" , penalty.factor = reg.weights)
  </code></pre>