I want to calculate the subgradient of $$f(x) = \begin{cases} 0& |x|\le 1\\ |x|-1& 1<|x|\le2\\ +\infty& x > 2 \end{cases}$$

but I do not know how to start and want to plot $f(x)$ first. Then, I think it is easier to imagine? Do you admit with me or should I start different?

  • $\begingroup$ Sure, visualization is almost certain to help. Go for it! What do you get when you look at it that way? $\endgroup$ – Michael Grant May 6 '18 at 19:41
  • $\begingroup$ Subgradients really aren't that hard. After all, if a function is convex, it's going to have a gradient at all but a countable number of points. So if you can differentiate, you can find a subgradient, almost everywhere. Don't be surprised that it seems easy. $\endgroup$ – Michael Grant May 6 '18 at 20:09
  • $\begingroup$ if I take the point x=-1 then the intervallis between [-1,0]? x=1: [0,1]. x=-2: [-inf,-1]. x=2: [1,inf]... $\endgroup$ – Peter May 7 '18 at 20:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.