I have $f(x)=\max{(5x_1,0)}$ in $\mathbb{R}^ n$ and want to compute the subgradients. Can someone explain me the process of doing this? Thank you!
Subgradients of function
-
0subgradient at x are all vectors r with r*(y- x)+f(x) <= f(y) for all y. – 2012-11-04
1 Answers
Suppose $f(x) = \max_{1 \leq i \leq p} f_i(x)$, where the functions $f_i$ are convex. Then \begin{equation} \partial f (x) = \textbf{conv} \left(\cup_{i \in I(x)} \partial f_i(x) \right) \end{equation} where $I(x) = \{ i | f_i(x) = f(x) \}$. ("$\textbf{conv}$" means "convex hull". See slide 4-15 entitled "pointwise maximum" in Vandenberghe's 236c notes here. )
So, in your problem... Let $g(x) = x_1$ and $h(x) = 0$, so $f(x) = \max \{g(x),h(x)\}$.
If $x_1 > 0$, then $\partial f(x) = \partial g(x) = \{ \nabla g(x) \} = \{ e_1 \}$, where $e_1 = \begin{bmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix}$.
If $x_1 < 0$, then $\partial f(x) = \partial h(x) = \{ \nabla h(x) \} = \{ 0 \}$.
Finally, if $x_1 = 0$, then \begin{align*} \partial f(x) &= \textbf{conv}\left(\partial g(x) \cup \partial h(x) \right) \\ &= \textbf{conv} \left( \{ \nabla g(x), \nabla h(x) \} \right) \\ &= \textbf{conv} \left( \{ e_1, 0 \} \right) \\ &= \{ \alpha e_1 | 0 \leq \alpha \leq 1 \}. \end{align*}
-
0@901301 hmm, good question, I'm not sure I even noticed that $5$ there. Might be an error. I'll look at it again later today. – 2013-11-04