Solution (source code)

= Solution

For fixed $\lambda_2$, letting $\lambda_1\downarrow0$ gives <ridge regression>, including ordinary least squares when $\lambda_2=0$; letting $\lambda_1\to\infty$ forces every coefficient to zero. For fixed $\lambda_1$, letting $\lambda_2\downarrow0$ gives the <Lasso>. Letting both penalties vanish gives an <ordinary least squares> solution, unique when $X$ has full column rank and otherwise potentially nonunique or path-dependent.

When $\lambda_2>0$, the term $\lambda_2\lVert\beta\rVert_2^2$ is strictly convex. Its sum with the convex squared loss and $\ell^1$ penalty is strictly convex and coercive, so the <elastic net> solution exists and is unique.