Which of these functions are convex, and why: (a) ; (b) ; (c) on ; (d) ; (e) the hinge loss as a function of ?
Linear algebra and optimisation, Convexity
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can pick the right convexity test for each kind of function: the definition, the second derivative, the Hessian, or the composition rules.
Key idea
is convex if for all and : the chord lies above the graph. For smooth functions, check , or a PSD (positive semidefinite) Hessian in several variables. For norms, use the triangle inequality. For piecewise functions, use “a maximum of convex functions is convex”.
Steps
- (a) Convex. By the triangle inequality and scaling, , which is exactly the definition. The norm has no derivative at 0, so the Hessian test cannot be used there.
- (b) Convex. , where is the sigmoid, and .
- (c) Not convex. , which is negative for . It is convex only on .
- (d) Not convex. The Hessian is , with eigenvalues and . One negative eigenvalue means it is not PSD; the origin is a saddle. Along the line , curves downwards.
- (e) Convex. is linear in , the constant 0 is linear, and the maximum of convex functions is convex. At the kink, use subgradients instead of a derivative.
Common mistakes
- Calling convex because it is convex (in fact linear) in each variable separately. Convexity in both together needs the full Hessian.
- Using the second-derivative test at points where the function has no derivative.
- Confusing convex with increasing. is increasing but not convex.
How long your answer should be
One or two lines per function; about 3 minutes.
Read this
Previous in Linear algebra and optimisation: What are for a square matrix and , and how do you derive them?
Next in Linear algebra and optimisation: How is the SVD of a matrix related to the eigendecomposition of ? What are the singular values of , and what is the error of its best rank-1 approximation?