title: Standardization and inclusion of intercept in sparse lasso GLM
body: <p>I found some problems while practicing the sparse group lasso method using the <code>cvSGL</code> function forom the <code>SGL</code> package.</p>
  
  <p>My questions are as follows:</p>
  
  <ol>
  <li>Looking at the code for <code>SGL:::center_scale</code>, it doesn't seem to consider the sample size of the data.</li>
  </ol>
  
  <pre><code>SGL:::center_scale
  #Output
  function (X, standardize) {
      means &lt;- apply(X, 2, mean)
      X &lt;- t(t(X) - means)
      X.transform &lt;- list(X.means = means)
      if (standardize == TRUE) {
          var &lt;- apply(X, 2, function(x) (sqrt(sum(x^2))))
          X &lt;- t(t(X)/var)
          X.transform$X.scale &lt;- var
      }
      else {
          X.transform$X.scale &lt;- 1
      }
      return(list(x = X, X.transform = X.transform))
  }
  </code></pre>
  
  <p>Therefore, the sample standard deviation of the predicted variable is measured somewhat larger. </p>
  
  <p>Is my understanding correct that this may cause the coefficients to be excessively large?</p>
  
  <ol start="2">
  <li>whether the model can be estimated by SGL package with intercept term (or constant term)</li>
  </ol>
  
  <p>The <code>SGL</code> package does not seem to provide a function for estimating by including a intercept term.</p>
  
  <p>In <code>cvFit[["fit"]]</code>, I can see only the beta of the predict variables according to the <code>lambda</code>'s except for the constant term. The value of <code>cvFit[["fit"]][["intercept"]]</code> is the mean of the <code>y</code> variable. </p>
  
  <p>It can be estimated by adding <code>1</code> to first column  of predict variable <code>X</code>, but in this case, it is expected to cause problems in centering and standardizing predict variables.</p>
  
  <p>In addition, the <code>SPG</code> package seems to add a penalty to all predict variables. Even if the estimation is performed by adding <code>1</code> to the first column of the explanatory variable <code>X</code> as described above, the constant term may be estimated as <code>0</code>.</p>