Why standardization of design matrix $X$ with factor $\frac{1}{n}$ instead of $\frac{1}{n-1}$ in lasso/glmnet? I'm a little bit puzzled by the default standardization of the lasso/elastic net/ridge regression algorithms implemented in the (great!) glmnet package.
In most other applications, people would standardize a data matrix $X$ by centering all columns $j$ around the mean ($\sum_{i=1}^n x_{ij}=0$) and scaling columns to unit variance, meaning:
$\frac{1}{n-1}\sum_{i=1}^nx_{ij}^2=1$. (a)
In the original glmnet and lasso papers, they state instead a normalization with factor $\frac{1}{n}$, that is, the biased estimator of the variance:
$\frac{1}{n}\sum_{i=1}^nx_{ij}^2=1$. (b)
The original ridge regression paper, on the other hand, states that $X^TX$ should have $1$s on the diagonal like a correlation matrix, leading to
$\sum_{i=1}^nx_{ij}^2=1$, (c)
without any multiplying factor. Now comes the most puzzling part, checking the Fortran code of the glmnet package in R (see lines 116 to 140), I cannot shake the feeling that they are actually standardizing such that:
$\frac{n}{n-1}\sum_{i=1}^nx_{ij}^2=1$, (d)
leading to the entries of the diagonal of $X^TX$ being just a little bit below $1$. 
Now, I'm not fit in Fortran and I might read something wrong, but I've got two open questions now:


*

*Why do they use the biased estimate of the variance/standard deviation for standardization in glmnet?

*Or do they actually use the standardization with $\frac{n}{n-1}$?


The standardization in 2.) would actually make sense, since the diagonal of $X^TX$ would not depend on the number of observations anymore.
 A: @whuber's comments led me to the solution: Yes, it doesn't matter. Scaling of the design matrix by a constant does not change the underlying optimization problem.
More precisely:
Suppose we are given some data matrix $X_0$ and a scaled design matrix $X=c\cdot X_0$, where $c>0$ is some real constant. E.g. $X_0$ could be such that (c) holds: $X_0^TX_0$ has $1$s on the diagonal, and with $c=\sqrt{1/n}$ we have $X$ such that (b) holds.
The glmnet optimization problem for $X_0$ would be to find the $\beta_0$ that minimizes $||y-X_0\beta_0||_2^2+\lambda_0||\beta_0||_p$, where $p$ is either $1$ (lasso) or $2$ (ridge). Elastic net is a combination of lasso and ridge, so I'm pretty sure the next step holds true anyway.
We have now the following:
$$
||y-X_0\beta_0||_2^2+\lambda_0||\beta_0||_p\\
= ||y-cX_0\cdot \frac{\beta_0}{c}||_2^2+\lambda_0c||\frac{\beta_0}{c}||_p\\
= ||y-X\beta||_2^2+\lambda||\beta||_p
$$
where $\lambda=\lambda_0\cdot c$ and $\beta=\beta_0/c$. That means the optimization problem is the same for both $X_0$ and $X$, but the lambdas and betas will live on a different scale. The solution for either $X_0$ or $X$ is equivalent to the solution for the other one.
