# Convex basis of functions

I'm looking for a set of convex functions which is forms a basis for $C^1(\mathbb{R})$?

Most of the basises I know are polynomials or Fourier basis but I was wondering if there was a basis of convex functions.

A basis of convex functions is a tricky concept. Convexity is not closed under operations over vector spaces: a linear superposition of convex functions does not have to be convex (in fact, it most likely isn't). So... the entire formalism of vector spaces (Hilbert spaces actually) goes through the window and the concept of a basis doesn't make much sense.

The problem is, that when you develop something over a basis, you may get negative coefficients. The question is actually exactly the same as asking for a basis of positive functions (you get the basis of convex functions by integrating the basis of positive functions twice).

I don't know exactly what you want to achieve. It's of course possible to have a decomposition of a positive-definite function into a sum of positive definite functions, it's just not a vector-space based decomposition, so there is no orthogonality, superposition principle, guarantee of completeness, and so on. Maybe one of the other readers knows an example of this. In discrete world, you'd just get a linear programming question, but I don't know how to deal with the continuous version.

Sorry for the necromancy, but this was the first google result for me on this topic, so I want to improve its status.

As noted, the question needs to be slightly modified. Indeed, the space of convex functions $$\mathbb R \mapsto \mathbb R$$ is not a vectorial space, but it is instead a convex cone:

• for any positive scalars $$\alpha, \beta$$
• for any convex functions $$c_1, c_2$$
• it is immediate that the function $$x \rightarrow \alpha c_1(x) + \beta c_2(x)$$ is also convex

This then raises the question of whether that space can be generated as a convex hull of convex functions.

"Theorem": let c(x) be a twice-differentiable convex function. Assume that c''(x) is bounded and is 0 outside of some bounded interval. Then:

$$c(x) = a + bx + \int_{t\in\mathbb R} c''(t) \frac{|x-t|}{2} dt$$

ie, c(x) can be expressed as a combination of a linear function and a convolution / average / integral of simple convex functions $$x \rightarrow |x-t|$$. The linear coefficients are:

\begin{align} a &= c(0) - \int_{t\in\mathbb R} c''(t) \frac{|t|}{2} dt \\ b &= c'(0) - \int_{t\in\mathbb R} c''(t) \frac{\text{sign}(t)}{2} dt \end{align}

NB: the proof doesn't require convexity. Convex functions are a combination with positive coefficients, whereas standard functions can have both negative and positive coefficients.

Sketch of the proof: for a reader familiar with distributions, this is straightforward. The value at 0 and the first derivative at 0 are correct. Computing the second derivative at any x of the convolution yields the convolution of c''(t) with the dirac(x-t) function which is c''(x).

Otherwise, this is a cheeky rewriting of the integral form of the remainder of the Taylor series which reads:

$$c(x) = c(0) + c'(0) + \int_0^x c''(t) (x-t) dt$$

Without loss of generality, we can focus on the case $$x \geq 0$$. Then consider the function:

$$x \rightarrow \frac{|x-t|}{2} - \frac{x \text{sign}(t)}{2} - \frac {|t|} {2}$$

For $$0 \leq t \leq x$$ it is equal to $$(x-t)$$. For $$t\leq 0$$ and $$t \geq x$$ it is $$0$$. We can thus rewrite the integral over $$[0,x]$$ as an integral over $$\mathbb R$$ instead. This yields:

$$c(x) = c(0) + c'(0) + \int_{t \in \mathbb R} [c''(t) \frac{|x-t|}{2} - \frac{x \text{sign}(t)}{2} - \frac {|t|} {2}] dt$$

which simplifies, if I haven't messed up, into the claimed formula.