Approximating a function with a convex function

222 Views Asked by At

Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a continuous, differentiable function. Is there a known algorithm that fits $f$ with $g$, which is an order-$n$ polynomial that is convex, in the least square sense?

1

There are 1 best solutions below

0
On

I don't think so. For any convex function $g$, $\|\sin x-g(x)\|_{l_2} = \infty$. Similarly I'm not sure how you would want to fit a convex function to $f(x)=-x^2$.

Locally you can always approximate a function by its convex truncated Taylor series $$f(x_0 + y) \approx f(x_0) + y f'(x_0) + \frac{1}{2}y^2 f''(x_0)$$ provided that $f''(x_0)>0$. The same can be done in higher dimensions at points where the Hessian of $f$ is positive-definite.