# Lasso (statistics)

__: Statistical method__

**Short description**

In statistics and machine learning, **lasso** (**least absolute shrinkage and selection operator**; also **Lasso** or **LASSO**) is a regression analysis method that performs both variable selection and regularization in order to enhance the prediction accuracy and interpretability of the resulting statistical model. It was originally introduced in geophysics,^{[1]} and later by Robert Tibshirani,^{[2]} who coined the term.

Lasso was originally formulated for linear regression models. This simple case reveals a substantial amount about the estimator. These include its relationship to ridge regression and best subset selection and the connections between lasso coefficient estimates and so-called soft thresholding. It also reveals that (like standard linear regression) the coefficient estimates do not need to be unique if covariates are collinear.

Though originally defined for linear regression, lasso regularization is easily extended to other statistical models including generalized linear models, generalized estimating equations, proportional hazards models, and M-estimators.^{[2]}^{[3]} Lasso's ability to perform subset selection relies on the form of the constraint and has a variety of interpretations including in terms of geometry, Bayesian statistics and convex analysis.

The LASSO is closely related to basis pursuit denoising.

## History

Lasso was introduced in order to improve the prediction accuracy and interpretability of regression models. It selects a reduced set of the known covariates for use in a model.^{[2]}^{[1]}

Lasso was developed independently in geophysics literature in 1986, based on prior work that used the [math]\displaystyle{ \ell^1 }[/math] penalty for both fitting and penalization of the coefficients. Statistician Robert Tibshirani independently rediscovered and popularized it in 1996, based on Breiman's nonnegative garrote.^{[1]}^{[4]}

Prior to lasso, the most widely used method for choosing covariates was stepwise selection. That approach only improves prediction accuracy in certain cases, such as when only a few covariates have a strong relationship with the outcome. However, in other cases, it can increase prediction error.

At the time, ridge regression was the most popular technique for improving prediction accuracy. Ridge regression improves prediction error by shrinking the sum of the squares of the regression coefficients to be less than a fixed value in order to reduce overfitting, but it does not perform covariate selection and therefore does not help to make the model more interpretable.

Lasso achieves both of these goals by forcing the sum of the absolute value of the regression coefficients to be less than a fixed value, which forces certain coefficients to zero, excluding them from impacting prediction. This idea is similar to ridge regression, which also shrinks the size of the coefficients, however Ridge Regression tends to set far fewer coefficients to zero.

## Basic form

### Least squares

Consider a sample consisting of *N* cases, each of which consists of *p* covariates and a single outcome. Let [math]\displaystyle{ y_i }[/math] be the outcome and [math]\displaystyle{ x_i:=(x_1,x_2,\ldots,x_p)_i^T }[/math] be the covariate vector for the *i* ^{th} case. Then the objective of lasso is to solve

- [math]\displaystyle{ \min_{ \beta_0, \beta } \left\{ \sum_{i=1}^N (y_i - \beta_0 - x_i^T \beta)^2 \right\} \text{ subject to } \sum_{j=1}^p |\beta_j| \leq t. }[/math]
^{[2]}

Here [math]\displaystyle{ \beta_0 }[/math] is the constant coefficient, [math]\displaystyle{ \beta:=(\beta_1,\beta_2,\ldots, \beta_p) }[/math] is the coefficient vector, and [math]\displaystyle{ t }[/math] is a prespecified free parameter that determines the degree of regularization.

Letting [math]\displaystyle{ X }[/math] be the covariate matrix, so that [math]\displaystyle{ X_{ij} = (x_i)_j }[/math] and [math]\displaystyle{ x_i^T }[/math] is the *i* ^{th} row of [math]\displaystyle{ X }[/math], the expression can be written more compactly as

- [math]\displaystyle{ \min_{ \beta_0, \beta } \left\{ \left\| y - \beta_0 - X \beta \right\|_2^2 \right\} \text{ subject to } \| \beta \|_1 \leq t, }[/math]

where [math]\displaystyle{ \| u \|_p = \left( \sum_{i=1}^N | u_i |^p \right)^{1/p} }[/math] is the standard [math]\displaystyle{ \ell^p }[/math] norm.

Denoting the scalar mean of the data points [math]\displaystyle{ x_i }[/math] by [math]\displaystyle{ \bar{x} }[/math] and the mean of the response variables [math]\displaystyle{ y_i }[/math] by [math]\displaystyle{ \bar{y} }[/math], the resulting estimate for [math]\displaystyle{ \beta_0 }[/math] is [math]\displaystyle{ \hat{\beta}_0 = \bar{y} - \bar{x}^T \beta }[/math], so that

- [math]\displaystyle{ y_i - \hat{\beta}_0 - x_i^T \beta = y_i - ( \bar{y} - \bar{x}^T \beta ) - x_i^T \beta = ( y_i - \bar{y} ) - ( x_i - \bar{x} )^T \beta, }[/math]

and therefore it is standard to work with variables that have been made zero-mean. Additionally, the covariates are typically standardized [math]\displaystyle{ \textstyle \left( \sum_{i=1}^N x_{i}^2 = 1 \right) }[/math] so that the solution does not depend on the measurement scale.

It can be helpful to rewrite

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| y - X \beta \right\|_2^2 \right\} \text{ subject to } \| \beta \|_1 \leq t. }[/math]

in the so-called Lagrangian form

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| y - X \beta \right\|_2^2 + \lambda \| \beta \|_1 \right\} }[/math]

where the exact relationship between [math]\displaystyle{ t }[/math] and [math]\displaystyle{ \lambda }[/math] is data dependent.

### Orthonormal covariates

Some basic properties of the lasso estimator can now be considered.

Assuming first that the covariates are orthonormal so that [math]\displaystyle{ ( x_i \mid x_j ) = \delta_{ij} }[/math], where [math]\displaystyle{ ( \cdot \mid \cdot ) }[/math] is the inner product and [math]\displaystyle{ \delta_{ij} }[/math] is the Kronecker delta, or, equivalently, [math]\displaystyle{ X^T X = I }[/math], then using subgradient methods it can be shown that

- [math]\displaystyle{
\begin{align}
\hat{\beta}_j = {} & S_{N \lambda}( \hat{\beta}^\text{OLS}_j ) = \hat{\beta}^\text{OLS}_j \max \left( 0, 1 - \frac{ N \lambda }{ |\hat{\beta}^\text{OLS}_j| } \right) \\
& \text{ where } \hat{\beta}^\text{OLS} = (X^T X)^{-1} X^T y
\end{align}
}[/math]
^{[2]}

[math]\displaystyle{ S_\alpha }[/math] is referred to as the *soft thresholding operator*, since it translates values towards zero (making them exactly zero if they are small enough) instead of setting smaller values to zero and leaving larger ones untouched as the *hard thresholding operator*, often denoted [math]\displaystyle{ H_\alpha }[/math], would.

In ridge regression the objective is to minimize

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \| y - X \beta \|_2^2 + \lambda \| \beta \|_2^2 \right\} }[/math]

yielding

- [math]\displaystyle{ \hat{\beta}_j = ( 1 + N \lambda )^{-1} \hat{\beta}^\text{OLS}_j. }[/math]

Ridge regression shrinks all coefficients by a uniform factor of [math]\displaystyle{ (1 + N \lambda)^{-1} }[/math] and does not set any coefficients to zero. [Edit: This is not correct. The correct solution to ridge regression is : [math]\displaystyle{ \hat{\beta} = \left( (X^T X)^{-1} + N\lambda I \right) X^T y }[/math] ]

It can also be compared to regression with best subset selection, in which the goal is to minimize

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| y - X \beta \right\|_2^2 + \lambda \| \beta \|_0 \right\} }[/math]

where [math]\displaystyle{ \| \cdot \|_0 }[/math] is the "[math]\displaystyle{ \ell^0 }[/math] norm", which is defined as [math]\displaystyle{ \| z \| = m }[/math] if exactly m components of z are nonzero. In this case, it can be shown that

- [math]\displaystyle{ \hat{\beta}_j = H_{ \sqrt{ N \lambda } } \left( \hat{\beta}^\text{OLS}_j \right) = \hat{\beta}^\text{OLS}_j \mathrm{I} \left( \left| \hat{\beta}^\text{OLS}_j \right| \geq \sqrt{ N \lambda } \right) }[/math]

where [math]\displaystyle{ H_\alpha }[/math] is the so-called hard thresholding function and [math]\displaystyle{ \mathrm{I} }[/math] is an indicator function (it is 1 if its argument is true and 0 otherwise).

Therefore, the lasso estimates share features of both ridge and best subset selection regression since they both shrink the magnitude of all the coefficients, like ridge regression and set some of them to zero, as in the best subset selection case. Additionally, while ridge regression scales all of the coefficients by a constant factor, lasso instead translates the coefficients towards zero by a constant value and sets them to zero if they reach it.

In one special case two covariates, say *j* and *k*, are identical for each observation, so that [math]\displaystyle{ x_{(j)} = x_{(k)} }[/math], where [math]\displaystyle{ x_{(j),i} = x_{(k),i} }[/math]. Then the values of [math]\displaystyle{ \beta_j }[/math] and [math]\displaystyle{ \beta_k }[/math] that minimize the lasso objective function are not uniquely determined. In fact, if some [math]\displaystyle{ \hat{\beta} }[/math] in which [math]\displaystyle{ \hat{\beta}_j \hat{\beta}_k \geq 0 }[/math], then if [math]\displaystyle{ s \in [0,1] }[/math] replacing [math]\displaystyle{ \hat{\beta}_j }[/math] by [math]\displaystyle{ s ( \hat{\beta}_j + \hat{\beta}_k ) }[/math] and [math]\displaystyle{ \hat{\beta}_k }[/math] by [math]\displaystyle{ (1 - s ) ( \hat{\beta}_j + \hat{\beta}_k ) }[/math], while keeping all the other [math]\displaystyle{ \hat{\beta}_i }[/math] fixed, gives a new solution, so the lasso objective function then has a continuum of valid minimizers.^{[5]} Several variants of the lasso, including the Elastic net regularization, have been designed to address this shortcoming.

## General form

Lasso regularization can be extended to other objective functions such as those for generalized linear models, generalized estimating equations, proportional hazards models, and M-estimators.^{[2]}^{[3]} Given the objective function

- [math]\displaystyle{ \frac{1}{N} \sum_{i=1}^N f( x_i, y_i, \alpha, \beta ) }[/math]

the lasso regularized version of the estimator *s* the solution to

- [math]\displaystyle{ \min_{ \alpha, \beta } \frac{1}{N} \sum_{i=1}^N f( x_i, y_i, \alpha, \beta ) \text{ subject to } \| \beta \|_1 \leq t }[/math]

where only [math]\displaystyle{ \beta }[/math] is penalized while [math]\displaystyle{ \alpha }[/math] is free to take any allowed value, just as [math]\displaystyle{ \beta_0 }[/math] was not penalized in the basic case.

## Interpretations

### Geometric interpretation

Lasso can set coefficients to zero, while the superficially similar ridge regression cannot. This is due to the difference in the shape of their constraint boundaries. Both lasso and ridge regression can be interpreted as minimizing the same objective function

- [math]\displaystyle{ \min_{ \beta_0, \beta } \left\{ \frac{1}{N} \left\| y - \beta_0 - X \beta \right\|_2^2 \right\} }[/math]

but with respect to different constraints: [math]\displaystyle{ \| \beta \|_1 \leq t }[/math] for lasso and [math]\displaystyle{ \| \beta \|_2^2 \leq t }[/math] for ridge. The figure shows that the constraint region defined by the [math]\displaystyle{ \ell^1 }[/math] norm is a square rotated so that its corners lie on the axes (in general a cross-polytope), while the region defined by the [math]\displaystyle{ \ell^2 }[/math] norm is a circle (in general an *n*-sphere), which is rotationally invariant and, therefore, has no corners. As seen in the figure, a convex object that lies tangent to the boundary, such as the line shown, is likely to encounter a corner (or a higher-dimensional equivalent) of a hypercube, for which some components of [math]\displaystyle{ \beta }[/math] are identically zero, while in the case of an *n*-sphere, the points on the boundary for which some of the components of [math]\displaystyle{ \beta }[/math] are zero are not distinguished from the others and the convex object is no more likely to contact a point at which some components of [math]\displaystyle{ \beta }[/math] are zero than one for which none of them are.

### Making λ easier to interpret with an accuracy-simplicity tradeoff

The lasso can be rescaled so that it becomes easy to anticipate and influence the degree of shrinkage associated with a given value of [math]\displaystyle{ \lambda }[/math].^{[6]} It is assumed that [math]\displaystyle{ X }[/math] is standardized with z-scores and that [math]\displaystyle{ y }[/math] is centered (zero mean). Let [math]\displaystyle{ \beta_0 }[/math] represent the hypothesized regression coefficients and let [math]\displaystyle{ b_{OLS} }[/math] refer to the data-optimized ordinary least squares solutions. We can then define the Lagrangian as a tradeoff between the in-sample accuracy of the data-optimized solutions and the simplicity of sticking to the hypothesized values.^{[7]} This results in

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{(y-X\beta)'(y-X\beta)}{(y-X\beta_0)'(y-X\beta_0)}+ 2\lambda \sum_{i=1}^p \frac{|\beta_i-\beta_{0,i}|}{q_{i}} \right\} }[/math]

where [math]\displaystyle{ q_i }[/math] is specified below. The first fraction represents relative accuracy, the second fraction relative simplicity, and [math]\displaystyle{ \lambda }[/math] balances between the two.

Given a single regressor, relative simplicity can be defined by specifying [math]\displaystyle{ q_i }[/math] as [math]\displaystyle{ |b_{OLS}-\beta_{0}| }[/math], which is the maximum amount of deviation from [math]\displaystyle{ \beta_0 }[/math] when [math]\displaystyle{ \lambda=0 }[/math]. Assuming that [math]\displaystyle{ \beta_{0}=0 }[/math], the solution path can be defined in terms of [math]\displaystyle{ R^2 }[/math]:

- [math]\displaystyle{ b_{\ell_1} = \begin{cases} (1-\lambda/R^{2})b_{OLS} & \mbox{if } \lambda \leq R^{2}, \\ 0 & \mbox{if } \lambda\gt R^{2}. \end{cases} }[/math]

If [math]\displaystyle{ \lambda=0 }[/math], the ordinary least squares solution (OLS) is used. The hypothesized value of [math]\displaystyle{ \beta_0=0 }[/math] is selected if [math]\displaystyle{ \lambda }[/math] is bigger than [math]\displaystyle{ R^2 }[/math]. Furthermore, if [math]\displaystyle{ R^2=1 }[/math], then [math]\displaystyle{ \lambda }[/math] represents the proportional influence of [math]\displaystyle{ \beta_0=0 }[/math]. In other words, [math]\displaystyle{ \lambda\times100\% }[/math] measures in percentage terms the minimal amount of influence of the hypothesized value relative to the data-optimized OLS solution.

If an [math]\displaystyle{ \ell_2 }[/math]-norm is used to penalize deviations from zero given a single regressor, the solution path is given by

[math]\displaystyle{ b_{\ell_2}=\bigg(1+\frac{\lambda}{R^{2}(1-\lambda)}\bigg)^{-1}b_{OLS} }[/math]. Like [math]\displaystyle{ b_{\ell_1} }[/math], [math]\displaystyle{ b_{\ell_2} }[/math] moves in the direction of the point [math]\displaystyle{ (\lambda = R^2, b=0) }[/math] when [math]\displaystyle{ \lambda }[/math] is close to zero; but unlike [math]\displaystyle{ b_{\ell_1} }[/math], the influence of [math]\displaystyle{ R^2 }[/math] diminishes in [math]\displaystyle{ b_{\ell_2} }[/math] if [math]\displaystyle{ \lambda }[/math] increases (see figure).

Given multiple regressors, the moment that a parameter is activated (i.e. allowed to deviate from [math]\displaystyle{ \beta_0 }[/math]) is also determined by a regressor's contribution to [math]\displaystyle{ R^2 }[/math] accuracy. First,

- [math]\displaystyle{ R^2=1-\frac{(y-Xb)'(y-Xb)}{(y-X\beta_0)'(y-X\beta_0)}. }[/math]

An [math]\displaystyle{ R^2 }[/math] of 75% means that in-sample accuracy improves by 75% if the unrestricted OLS solutions are used instead of the hypothesized [math]\displaystyle{ \beta_0 }[/math] values. The individual contribution of deviating from each hypothesis can be computed with the [math]\displaystyle{ p }[/math] x [math]\displaystyle{ p }[/math] matrix

- [math]\displaystyle{ R^{\otimes}=(X'\tilde y_0)(X'\tilde y_0)' (X'X)^{-1}(\tilde y_0'\tilde y_0)^{-1}, }[/math]

where [math]\displaystyle{ \tilde y_0=y-X\beta_0 }[/math]. If [math]\displaystyle{ b=b_{OLS} }[/math] when [math]\displaystyle{ R^2 }[/math] is computed, then the diagonal elements of [math]\displaystyle{ R^{\otimes} }[/math] sum to [math]\displaystyle{ R^2 }[/math]. The diagonal [math]\displaystyle{ R^{\otimes} }[/math] values may be smaller than 0 or, less often, larger than 1. If regressors are uncorrelated, then the [math]\displaystyle{ i^{th} }[/math] diagonal element of [math]\displaystyle{ R^{\otimes} }[/math] simply corresponds to the [math]\displaystyle{ r^2 }[/math] value between [math]\displaystyle{ x_i }[/math] and [math]\displaystyle{ y }[/math].

A rescaled version of the adaptive lasso of can be obtained by setting [math]\displaystyle{ q_{\mbox{adaptive lasso},i}=|b_{OLS,i}-\beta_{0,i}| }[/math].^{[8]} If regressors are uncorrelated, the moment that the [math]\displaystyle{ i^{th} }[/math] parameter is activated is given by the [math]\displaystyle{ i^{th} }[/math] diagonal element of [math]\displaystyle{ R^{\otimes} }[/math]. Assuming for convenience that [math]\displaystyle{ \beta_0 }[/math] is a vector of zeros,

- [math]\displaystyle{ b_{i} = \begin{cases} (1-\lambda/R_{ii}^{\otimes})b_{OLS,i} & \mbox{if } \lambda \leq R_{ii}^{\otimes}, \\ 0 & \mbox{if } \lambda\gt R_{ii}^{\otimes}. \end{cases} }[/math]

That is, if regressors are uncorrelated, [math]\displaystyle{ \lambda }[/math] again specifies the minimal influence of [math]\displaystyle{ \beta_0 }[/math]. Even when regressors are correlated, the first time that a regression parameter is activated occurs when [math]\displaystyle{ \lambda }[/math] is equal to the highest diagonal element of [math]\displaystyle{ R^{\otimes} }[/math].

These results can be compared to a rescaled version of the lasso by defining [math]\displaystyle{ q_{\mbox{lasso},i}=\frac{1}{p} \sum_{l} |b_{OLS,l}-\beta_{0,l}| }[/math], which is the average absolute deviation of [math]\displaystyle{ b_{OLS} }[/math] from [math]\displaystyle{ \beta_0 }[/math]. Assuming that regressors are uncorrelated, then the moment of activation of the [math]\displaystyle{ i^{th} }[/math] regressor is given by

- [math]\displaystyle{ \tilde \lambda_{\text{lasso},i} = \frac{1}{p}\sqrt{R^{\otimes}_i} \sum_{l=1}^p\sqrt{R^{\otimes}_{l}}. }[/math]

For [math]\displaystyle{ p=1 }[/math], the moment of activation is again given by [math]\displaystyle{ \tilde \lambda_{\text{lasso},i}=R^2 }[/math]. If [math]\displaystyle{ \beta_0 }[/math] is a vector of zeros and a subset of [math]\displaystyle{ p_B }[/math] relevant parameters are equally responsible for a perfect fit of [math]\displaystyle{ R^2=1 }[/math], then this subset is activated at a [math]\displaystyle{ \lambda }[/math] value of [math]\displaystyle{ \frac{1}{p} }[/math]. The moment of activation of a relevant regressor then equals [math]\displaystyle{ \frac{1}{p}\frac{1}{\sqrt{p_B}}p_B\frac{1}{\sqrt{p_B}}=\frac{1}{p} }[/math]. In other words, the inclusion of irrelevant regressors delays the moment that relevant regressors are activated by this rescaled lasso. The adaptive lasso and the lasso are special cases of a '1ASTc' estimator. The latter only groups parameters together if the absolute correlation among regressors is larger than a user-specified value.^{[6]}

### Bayesian interpretation

Just as ridge regression can be interpreted as linear regression for which the coefficients have been assigned normal prior distributions, lasso can be interpreted as linear regression for which the coefficients have Laplace prior distributions. The Laplace distribution is sharply peaked at zero (its first derivative is discontinuous at zero) and it concentrates its probability mass closer to zero than does the normal distribution. This provides an alternative explanation of why lasso tends to set some coefficients to zero, while ridge regression does not.^{[2]}

### Convex relaxation interpretation

Lasso can also be viewed as a convex relaxation of the best subset selection regression problem, which is to find the subset of [math]\displaystyle{ \leq k }[/math] covariates that results in the smallest value of the objective function for some fixed [math]\displaystyle{ k \leq n }[/math], where n is the total number of covariates. The "[math]\displaystyle{ \ell^0 }[/math] norm", [math]\displaystyle{ \| \cdot \|_0 }[/math], (the number of nonzero entries of a vector), is the limiting case of "[math]\displaystyle{ \ell^p }[/math] norms", of the form [math]\displaystyle{ \textstyle \| x \|_p = \left( \sum_{i=1}^n | x_j |^p \right)^{1/p} }[/math] (where the quotation marks signify that these are not really norms for [math]\displaystyle{ p \lt 1 }[/math] since [math]\displaystyle{ \| \cdot \|_p }[/math] is not convex for [math]\displaystyle{ p \lt 1 }[/math], so the triangle inequality does not hold). Therefore, since p = 1 is the smallest value for which the "[math]\displaystyle{ \ell^p }[/math] norm" is convex (and therefore actually a norm), lasso is, in some sense, the best convex approximation to the best subset selection problem, since the region defined by [math]\displaystyle{ \| x \|_1 \leq t }[/math] is the convex hull of the region defined by [math]\displaystyle{ \| x \|_p \leq t }[/math] for [math]\displaystyle{ p \lt 1 }[/math].

## Generalizations

Lasso variants have been created in order to remedy limitations of the original technique and to make the method more useful for particular problems. Almost all of these focus on respecting or exploiting dependencies among the covariates.

Elastic net regularization adds an additional ridge regression-like penalty that improves performance when the number of predictors is larger than the sample size, allows the method to select strongly correlated variables together, and improves overall prediction accuracy.^{[5]}

Group lasso allows groups of related covariates to be selected as a single unit, which can be useful in settings where it does not make sense to include some covariates without others.^{[9]} Further extensions of group lasso perform variable selection within individual groups (sparse group lasso) and allow overlap between groups (overlap group lasso).^{[10]}^{[11]}

Fused lasso can account for the spatial or temporal characteristics of a problem, resulting in estimates that better match system structure.^{[12]} Lasso-regularized models can be fit using techniques including subgradient methods, least-angle regression (LARS), and proximal gradient methods. Determining the optimal value for the regularization parameter is an important part of ensuring that the model performs well; it is typically chosen using cross-validation.

### Elastic net

In 2005, Zou and Hastie introduced the elastic net.^{[5]} When *p* > *n* (the number of covariates is greater than the sample size) lasso can select only *n* covariates (even when more are associated with the outcome) and it tends to select one covariate from any set of highly correlated covariates. Additionally, even when *n* > *p*, ridge regression tends to perform better given strongly correlated covariates.

The elastic net extends lasso by adding an additional [math]\displaystyle{ \ell^2 }[/math] penalty term giving

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \left\| y - X \beta \right\|_2^2 + \lambda_1 \| \beta \|_1 + \lambda_2 \| \beta \|_2^2 \right\}, }[/math]

which is equivalent to solving

- [math]\displaystyle{ \begin{align} \min_{ \beta_0, \beta } \left\{ \left\| y - \beta_0 - X \beta \right\|_2^2 \right\} & \text{ subject to } ( 1 - \alpha ) \| \beta \|_1 + \alpha \| \beta \|_2^2 \leq t, \\ & \text{ where } \alpha = \frac{\lambda_2}{\lambda_1 + \lambda_2}. \end{align} }[/math]

This problem can be written in a simple lasso form

- [math]\displaystyle{ \min_{ \beta^* \in \mathbb{R}^p } \left\{ \left\| y^* - X^* \beta^* \right\|_2^2 + \lambda^* \| \beta^* \|_1 \right\} }[/math]

letting

- [math]\displaystyle{ X_{(n+p) \times p}^* = ( 1 + \lambda_2 )^{-1/2} \binom{X}{ \lambda_2^{1/2} I_{p \times p} } }[/math], [math]\displaystyle{ y_{(n+p)}^* = \binom{y}{0^p}, \qquad \lambda^* = \frac{ \lambda_1 }{ \sqrt{ 1 + \lambda_2 } } }[/math], [math]\displaystyle{ \beta^* = \sqrt{ 1 + \lambda_2 } \beta. }[/math]

Then [math]\displaystyle{ \hat{\beta} = \frac{ \hat{\beta}^* }{ \sqrt{ 1 + \lambda_2 } } }[/math], which, when the covariates are orthogonal to each other, gives

- [math]\displaystyle{ \hat{\beta}_j = \frac{ \hat{\beta}^\text{*,OLS}_j }{ \sqrt{ 1 + \lambda_2 } } \max \left( 0, 1 - \frac{ \lambda^* }{ \left| \hat{\beta}^\text{*,OLS}_j \right| } \right) = \frac{ \hat{\beta}^\text{OLS}_j }{ 1 + \lambda_2 } \max \left( 0, 1 - \frac{ \lambda_1 }{ \left| \hat{\beta}^\text{OLS}_j \right| } \right) = ( 1 + \lambda_2 )^{-1} \hat{\beta}^\text{lasso}_j. }[/math]

So the result of the elastic net penalty is a combination of the effects of the lasso and ridge penalties.

Returning to the general case, the fact that the penalty function is now strictly convex means that if [math]\displaystyle{ x_{(j)} = x_{(k)} }[/math], [math]\displaystyle{ \hat{\beta}_j = \hat{\beta}_k }[/math], which is a change from lasso.^{[5]} In general, if [math]\displaystyle{ \hat{\beta}_j \hat{\beta_k} \gt 0 }[/math]

- [math]\displaystyle{ \frac{ | \hat{\beta}_j - \hat{\beta_k} | }{ \| y \| } \leq \lambda_2^{-1} \sqrt{ 2 ( 1 - \rho_{jk} ) }, \text{ where } \rho = X^t X, }[/math]

is the sample correlation matrix because the [math]\displaystyle{ x }[/math] 's are normalized.

Therefore, highly correlated covariates tend to have similar regression coefficients, with the degree of similarity depending on both [math]\displaystyle{ \| y \|_1 }[/math] and [math]\displaystyle{ \lambda_2 }[/math], which is different from lasso. This phenomenon, in which strongly correlated covariates have similar regression coefficients, is referred to as the grouping effect. Grouping is desirable since, in applications such as tying genes to a disease, finding all the associated covariates is preferable, rather than selecting one from each set of correlated covariates, as lasso often does.^{[5]} In addition, selecting only one from each group typically results in increased prediction error, since the model is less robust (which is why ridge regression often outperforms lasso).

### Group lasso

In 2006, Yuan and Lin introduced the group lasso to allow predefined groups of covariates to jointly be selected into or out of a model.^{[9]} This is useful in many settings, perhaps most obviously when a categorical variable is coded as a collection of binary covariates. In this case, group lasso can ensure that all the variables encoding the categorical covariate are included or excluded together. Another setting in which grouping is natural is in biological studies. Since genes and proteins often lie in known pathways, which pathways are related to an outcome may be more significant than whether individual genes are. The objective function for the group lasso is a natural generalization of the standard lasso objective

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \left\| y - \sum_{j=1}^J X_j \beta_j \right\|_2^2 + \lambda \sum_{j=1}^J \| \beta_j \|_{K_j} \right\}, \qquad \| z \|_{K_j} = ( z^t K_j z )^{1/2} }[/math]

where the design matrix [math]\displaystyle{ X }[/math] and covariate vector [math]\displaystyle{ \beta }[/math] have been replaced by a collection of design matrices [math]\displaystyle{ X_j }[/math] and covariate vectors [math]\displaystyle{ \beta_j }[/math], one for each of the J groups. Additionally, the penalty term is now a sum over [math]\displaystyle{ \ell^2 }[/math] norms defined by the positive definite matrices [math]\displaystyle{ K_j }[/math]. If each covariate is in its own group and [math]\displaystyle{ K_j = I }[/math], then this reduces to the standard lasso, while if there is only a single group and [math]\displaystyle{ K_1 = I }[/math], it reduces to ridge regression. Since the penalty reduces to an [math]\displaystyle{ \ell^2 }[/math] norm on the subspaces defined by each group, it cannot select out only some of the covariates from a group, just as ridge regression cannot. However, because the penalty is the sum over the different subspace norms, as in the standard lasso, the constraint has some non-differential points, which correspond to some subspaces being identically zero. Therefore, it can set the coefficient vectors corresponding to some subspaces to zero, while only shrinking others. However, it is possible to extend the group lasso to the so-called sparse group lasso, which can select individual covariates within a group, by adding an additional [math]\displaystyle{ \ell^1 }[/math] penalty to each group subspace.^{[10]} Another extension, group lasso with overlap allows covariates to be shared across groups, e.g., if a gene were to occur in two pathways.^{[11]}

### Fused lasso

In some cases, the phenomenon under study may have important spatial or temporal structure that must be considered during analysis, such as time series or image-based data. In 2005, Tibshirani and colleagues introduced the fused lasso to extend the use of lasso to this type of data.^{[12]} The fused lasso objective function is

- [math]\displaystyle{ \begin{align} & \min_\beta \left\{ \frac{1}{N} \sum_{i=1}^N \left( y_i - x_i^t \beta \right)^2 \right\} \\[4pt] & \text{ subject to } \sum_{j=1}^p |\beta_j| \leq t_1 \text{ and } \sum_{j=2}^p |\beta_j - \beta_{j-1}| \leq t_2. \end{align} }[/math]

The first constraint is the lasso constraint, while the second directly penalizes large changes with respect to the temporal or spatial structure, which forces the coefficients to vary smoothly to reflect the system's underlying logic. Clustered lasso^{[13]} is a generalization of fused lasso that identifies and groups relevant covariates based on their effects (coefficients). The basic idea is to penalize the differences between the coefficients so that nonzero ones cluster. This can be modeled using the following regularization:

- [math]\displaystyle{ \sum_{i\lt j}^p |\beta_i - \beta_j| \leq t_2. }[/math]

In contrast, variables can be clustered into highly correlated groups, and then a single representative covariate can be extracted from each cluster.^{[14]}

Algorithms exist that solve the fused lasso problem, and some generalizations of it. Algorithms can solve it exactly in a finite number of operations.^{[15]}

### Quasi-norms and bridge regression

Lasso, elastic net, group and fused lasso construct the penalty functions from the [math]\displaystyle{ \ell^1 }[/math] and [math]\displaystyle{ \ell^2 }[/math] norms (with weights, if necessary). The bridge regression utilises general [math]\displaystyle{ \ell^p }[/math] norms ([math]\displaystyle{ p \geq 1 }[/math]) and quasinorms ([math]\displaystyle{ 0\lt p \lt 1 }[/math]).^{[17]} For example, for *p*=1/2 the analogue of lasso objective in the Lagrangian form is to solve

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| y - X \beta \right\|_2^2 + \lambda \sqrt{\| \beta \|_{1/2}} \right\}, }[/math]

where

- [math]\displaystyle{ \| \beta \|_{1/2}=\left(\sum_{j=1}^p \sqrt{|\beta_j|} \right)^2 }[/math]

It is claimed that the fractional quasi-norms [math]\displaystyle{ \ell^p }[/math] ([math]\displaystyle{ 0\lt p \lt 1 }[/math]) provide more meaningful results in data analysis both theoretically and empirically.^{[18]} The non-convexity of these quasi-norms complicates the optimization problem. To solve this problem, an expectation-minimization procedure is developed^{[19]} and implemented^{[16]} for minimization of function

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| y - X \beta \right\|_2^2 + \lambda \sum_{j=1}^p \vartheta(\beta_j^2)\right\}, }[/math]

where [math]\displaystyle{ \vartheta(\gamma) }[/math] is an arbitrary concave monotonically increasing function (for example, [math]\displaystyle{ \vartheta(\gamma)=\sqrt{\gamma} }[/math] gives the lasso penalty and [math]\displaystyle{ \vartheta(\gamma)=\gamma^{1/4} }[/math] gives the [math]\displaystyle{ \ell^{1/2} }[/math] penalty).

The efficient algorithm for minimization is based on piece-wise quadratic approximation of subquadratic growth (PQSQ).^{[19]}

### Adaptive lasso

The adaptive lasso was introduced by Zou in 2006 for linear regression^{[20]} and by Zhang and Lu in 2007 for proportional hazards regression.^{[21]}

### Prior lasso

The prior lasso was introduced for generalized linear models by Jiang et al. in 2016 to incorporate prior information, such as the importance of certain covariates.^{[22]} In prior lasso, such information is summarized into pseudo responses (called prior responses) [math]\displaystyle{ \hat{y}^{\mathrm{p}} }[/math] and then an additional criterion function is added to the usual objective function with a lasso penalty. Without loss of generality, in linear regression, the new objective function can be written as

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| y - X \beta \right\|_2^2 + \frac{1}{N} \eta \left\| \hat{y}^{\mathrm{p}} - X \beta \right\|_2^2 + \lambda \| \beta \|_{1} \right\}, }[/math]

which is equivalent to

- [math]\displaystyle{ \min_{ \beta \in \mathbb{R}^p } \left\{ \frac{1}{N} \left\| \tilde{y} - X \beta \right\|_2^2 + \frac{\lambda}{1 + \eta} \| \beta \|_{1} \right\}, }[/math]

the usual lasso objective function with the responses [math]\displaystyle{ y }[/math] being replaced by a weighted average of the observed responses and the prior responses [math]\displaystyle{ \tilde{y} = (y + \eta\hat{y}^{\mathrm{p}}) / (1 + \eta) }[/math] (called the adjusted response values by the prior information).

In prior lasso, the parameter [math]\displaystyle{ \eta }[/math] is called a balancing parameter, in that it balances the relative importance of the data and the prior information. In the extreme case of [math]\displaystyle{ \eta = 0 }[/math], prior lasso is reduced to lasso. If [math]\displaystyle{ \eta = \infty }[/math], prior lasso will solely rely on the prior information to fit the model. Furthermore, the balancing parameter [math]\displaystyle{ \eta }[/math] has another appealing interpretation: it controls the variance of [math]\displaystyle{ \beta }[/math] in its prior distribution from a Bayesian viewpoint.

Prior lasso is more efficient in parameter estimation and prediction (with a smaller estimation error and prediction error) when the prior information is of high quality, and is robust to the low quality prior information with a good choice of the balancing parameter [math]\displaystyle{ \eta }[/math].

## Computing lasso solutions

^{[23]}subgradient methods, least-angle regression (LARS), and proximal gradient methods.^{[24]}Subgradient methods are the natural generalization of traditional methods such as gradient descent and stochastic gradient descent to the case in which the objective function is not differentiable at all points. LARS is a method that is closely tied to lasso models, and in many cases allows them to be fit efficiently, though it may not perform well in all circumstances. LARS generates complete solution paths.^{[24]}Proximal methods have become popular because of their flexibility and performance and are an area of active research. The choice of method will depend on the particular lasso variant, the data and the available resources. However, proximal methods generally perform well. The loss function of the lasso is not differentiable, but a wide variety of techniques from convex analysis and optimization theory have been developed to compute the solutions path of the lasso. These include coordinate descent,

## Choice of regularization parameter

Choosing the regularization parameter ([math]\displaystyle{ \lambda }[/math]) is a fundamental part of lasso. A good value is essential to the performance of lasso since it controls the strength of shrinkage and variable selection, which, in moderation can improve both prediction accuracy and interpretability. However, if the regularization becomes too strong, important variables may be omitted and coefficients may be shrunk excessively, which can harm both predictive capacity and inferencing. Cross-validation is often used to find the regularization parameter.

Information criteria such as the Bayesian information criterion (BIC) and the Akaike information criterion (AIC) might be preferable to cross-validation, because they are faster to compute and their performance is less volatile in small samples.^{[25]} An information criterion selects the estimator's regularization parameter by maximizing a model's in-sample accuracy while penalizing its effective number of parameters/degrees of freedom. Zou et al. proposed to measure the effective degrees of freedom by counting the number of parameters that deviate from zero.^{[26]} The degrees of freedom approach was considered flawed by Kaufman and Rosset^{[27]} and Janson et al.,^{[28]} because a model's degrees of freedom might increase even when it is penalized harder by the regularization parameter. As an alternative, the relative simplicity measure defined above can be used to count the effective number of parameters.^{[25]} For the lasso, this measure is given by

- [math]\displaystyle{ \hat{\mathcal{P}} = \sum_{i=1}^p \frac{|\beta_i-\beta_{0,i}|}{\frac{1}{p} \sum_{l} |b_{OLS,l}-\beta_{0,l}|} }[/math],

which monotonically increases from zero to [math]\displaystyle{ p }[/math] as the regularization parameter decreases from [math]\displaystyle{ \infty }[/math] to zero.

## Selected applications

LASSO has been applied in economics and finance, and was found to improve prediction and to select sometimes neglected variables, for example in corporate bankruptcy prediction literature,^{[29]} or high growth firms prediction.^{[30]}

## See also

## References

- ↑
^{1.0}^{1.1}^{1.2}Santosa, Fadil; Symes, William W. (1986). "Linear inversion of band-limited reflection seismograms.".*SIAM Journal on Scientific and Statistical Computing*(SIAM)**7**(4): 1307–1330. doi:10.1137/0907087. - ↑
^{2.0}^{2.1}^{2.2}^{2.3}^{2.4}^{2.5}^{2.6}Tibshirani, Robert (1996). "Regression Shrinkage and Selection via the lasso".*Journal of the Royal Statistical Society*. Series B (methodological) (Wiley)**58**(1): 267–88. - ↑
^{3.0}^{3.1}Tibshirani, Robert (1997). "The lasso Method for Variable Selection in the Cox Model".*Statistics in Medicine***16**(4): 385–395. doi:10.1002/(SICI)1097-0258(19970228)16:4<385::AID-SIM380>3.0.CO;2-3. PMID 9044528. - ↑ Breiman, Leo (1995). "Better Subset Regression Using the Nonnegative Garrote".
*Technometrics***37**(4): 373–84. doi:10.1080/00401706.1995.10484371. - ↑
^{5.0}^{5.1}^{5.2}^{5.3}^{5.4}Zou, Hui; Hastie, Trevor (2005). "Regularization and Variable Selection via the Elastic Net".*Journal of the Royal Statistical Society*. Series B (statistical Methodology) (Wiley)**67**(2): 301–20. doi:10.1111/j.1467-9868.2005.00503.x. - ↑
^{6.0}^{6.1}Hoornweg, Victor (2018). "Chapter 8".*Science: Under Submission*. Hoornweg Press. ISBN 978-90-829188-0-9. http://www.victorhoornweg.com. - ↑ Motamedi, Fahimeh; Sanchez, Horacio; Mehri, Alireza; Ghasemi, Fahimeh (October 2021).
*Accelerating Big Data Analysis through LASSO-Random Forest Algorithm in QSAR Studies*.**37**. Bioinformatics. pp. 1-7. doi:10.1093/bioinformatics/btab659. ISSN 1367-4803. - ↑ Zou, Hui (2006). "The Adaptive Lasso and Its Oracle Properties". http://pages.cs.wisc.edu/~shao/stat992/zou2006.pdf.
- ↑
^{9.0}^{9.1}Yuan, Ming; Lin, Yi (2006). "Model Selection and Estimation in Regression with Grouped Variables".*Journal of the Royal Statistical Society*. Series B (statistical Methodology) (Wiley)**68**(1): 49–67. doi:10.1111/j.1467-9868.2005.00532.x. - ↑
^{10.0}^{10.1}Puig, Arnau Tibau, Ami Wiesel, and Alfred O. Hero III. "A Multidimensional Shrinkage-Thresholding Operator". Proceedings of the 15th workshop on Statistical Signal Processing, SSP'09, IEEE, pp. 113–116. - ↑
^{11.0}^{11.1}Jacob, Laurent, Guillaume Obozinski, and Jean-Philippe Vert. "Group Lasso with Overlap and Graph LASSO". Appearing in Proceedings of the 26th International Conference on Machine Learning, Montreal, Canada, 2009. - ↑
^{12.0}^{12.1}Tibshirani, Robert, Michael Saunders, Saharon Rosset, Ji Zhu, and Keith Knight. 2005. “Sparsity and Smoothness via the Fused lasso”. Journal of the Royal Statistical Society. Series B (statistical Methodology) 67 (1). Wiley: 91–108. https://www.jstor.org/stable/3647602. - ↑ She, Yiyuan (2010). "Sparse regression with exact clustering".
*Electronic Journal of Statistics***4**: 1055–1096. doi:10.1214/10-EJS578. - ↑ Reid, Stephen (2015). "Sparse regression and marginal testing using cluster prototypes".
*Biostatistics***17**(2): 364–76. doi:10.1093/biostatistics/kxv049. PMID 26614384. Bibcode: 2015arXiv150300334R. - ↑ Bento, Jose (2018). "On the Complexity of the Weighted Fused Lasso".
*IEEE Letters in Signal Processing***25**(10): 1595–1599. doi:10.1109/LSP.2018.2867800. Bibcode: 2018ISPL...25.1595B. - ↑
^{16.0}^{16.1}Mirkes E.M. PQSQ-regularized-regression repository, GitHub. - ↑ Fu, Wenjiang J. 1998. “The Bridge versus the Lasso”. Journal of Computational and Graphical Statistics 7 (3). Taylor & Francis: 397-416.
- ↑ Aggarwal C.C., Hinneburg A., Keim D.A. (2001) "On the Surprising Behavior of Distance Metrics in High Dimensional Space." In: Van den Bussche J., Vianu V. (eds) Database Theory — ICDT 2001. ICDT 2001. Lecture Notes in Computer Science, Vol. 1973. Springer, Berlin, Heidelberg, pp. 420-434.
- ↑
^{19.0}^{19.1}Gorban, A.N.; Mirkes, E.M.; Zinovyev, A. (2016) "Piece-wise quadratic approximations of arbitrary error functions for fast and robust machine learning." Neural Networks, 84, 28-38. - ↑ Zou (2006, JASA)
- ↑ Zhang and Lu (2007, Biometrika)
- ↑ Jiang, Yuan (2016). "Variable selection with prior information for generalized linear models via the prior lasso method".
*Journal of the American Statistical Association***111**(513): 355–376. doi:10.1080/01621459.2015.1008363. PMID 27217599. - ↑ Jerome Friedman, Trevor Hastie, and Robert Tibshirani. 2010. “Regularization Paths for Generalized Linear Models via Coordinate Descent”. Journal of Statistical Software 33 (1): 1-21. https://www.jstatsoft.org/article/view/v033i01/v33i01.pdf.
- ↑
^{24.0}^{24.1}Efron, Bradley, Trevor Hastie, Iain Johnstone, and Robert Tibshirani. 2004. “Least Angle Regression”. The Annals of Statistics 32 (2). Institute of Mathematical Statistics: 407–51. https://www.jstor.org/stable/3448465. - ↑
^{25.0}^{25.1}Hoornweg, Victor (2018). "Chapter 9".*Science: Under Submission*. Hoornweg Press. ISBN 978-90-829188-0-9. http://www.victorhoornweg.com. - ↑ Zou, Hui; Hastie, Trevor; Tibshirani, Robert (2007). "On the 'Degrees of Freedom' of the Lasso".
*The Annals of Statistics***35**(5): 2173–2792. doi:10.1214/009053607000000127. - ↑ Kaufman, S.; Rosset, S. (2014). "When does more regularization imply fewer degrees of freedom? Sufficient conditions and counterexamples".
*Biometrika***101**(4): 771–784. doi:10.1093/biomet/asu034. ISSN 0006-3444. - ↑ Janson, Lucas; Fithian, William; Hastie, Trevor J. (2015). "Effective degrees of freedom: a flawed metaphor".
*Biometrika***102**(2): 479–485. doi:10.1093/biomet/asv019. ISSN 0006-3444. PMID 26977114. - ↑ Shaonan, Tian; Yu, Yan; Guo, Hui (2015). "Variable selection and corporate bankruptcy forecasts".
*Journal of Banking & Finance***52**(1): 89–100. doi:10.1016/j.jbankfin.2014.12.003. - ↑ Coad, Alex; Srhoj, Stjepan (2020). "Catching Gazelles with a Lasso: Big data techniques for the prediction of high-growth firms".
*Small Business Economics***55**(1): 541–565. doi:10.1007/s11187-019-00203-3.

Original source: https://en.wikipedia.org/wiki/Lasso (statistics).
Read more |