Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
What do you mean by least square in this context, i.e. what objective are you minimizing? – Robert Israel Dec 31 '12 at 2:06
I would like to minimize the $l_2$-norm of $(f-g)$ – tatterdemalion Dec 31 '12 at 2:11
Given the examples below, perhaps you want to restrict the function to a bounded interval? – user53153 Dec 31 '12 at 4:55
Yes. It would be more interesting if the supports of $f$ and $g$ are bounded intervals. – tatterdemalion Dec 31 '12 at 5:20

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.