In Lasso regression the L1 constraint is used:
I'm trying to plot the constraint using R. An example looks like:
Here is the simple R code I wrote:
beta= seq(-1, 1, length=100)
lambda=2
penalty=lambda*abs(beta)
plot(penalty, type="l")
It draws only the lower part of the plot. How could I plot the upper part too in one plot? Here is the plot: