Huber penalty function

The Huber penalty function is a robust penalty function, an alternative to the $$\ell_2$$ norm which is sensitive to outliers; it is defined as:

$$\phi_{\text{hub}}(x) = \begin{cases}x^2 & |x|\le M\\M(2|x| - M) & |x|>M\end{cases}.$$

Note that the function behaves like an $$\ell_2$$ penalty function inside a range close to 0, and for larger values it behaves like an $$\ell_1$$ norm, which is less sensitive to outliers than the $$\ell_2$$ norm.