# Is there a closed-form solution for the lasso term in optimization problem?

This is a optimization problem.

$$\arg\min\limits_{x}|X-B|_2^2+\lambda|X|_1$$

Apparently,the lasso term isn't derivable.

But if we discuss it by category, we can get the following results.

For the i-th demension,we have

$$x_i^*=\begin{cases}B_i+\lambda/2,&B_i<-\lambda/2\\0,&|B_i|<\lambda/2\\B_i-\lambda/2,&B_i>\lambda/2 \end{cases}$$

$$x_i^*=\arg\min\limits_{x_i}|X_i-B|_2^2+\lambda|X_i|_1$$

This form is called "Soft Thresholding",and it is a closed form solution.

In practice, we use subgradient descent algorithm or near proximal algorithm to solve this problem and get an approximate solution.

I also see the soft thresholding form in the process by using above two algorithms.But these two methods are iterative processes step by step and then get an approximate solution.

I don't know why since there is a closed form solution we still need two iterative algorithms to find an approximate solution

I don't know either what is the relationship between subgradient descent algorithm and near proximal algorithm——they all get the soft thresholding form

The closed-solution needs some conditions.For example,the $$x$$ is a vector or the coefficient matrix is ones matrix.In other condition,you must seek an approximate solution.