# Determining whether a function is Piecewise Polynomial

I am trying to determine whether or not a function is piecewise polynomial. The function is as below:

Let $\ X$ be a continuous random variable with support on $\ \Omega_x$, and with corresponding cdf $\ F$. Is the function $g_r$, $r\geq 1$, piecewise polynomial?

$\ g_r(x) = x\sum_{k=0}^{r-1} \left( (-1)^{r-1-k} {r-1 \choose k}{r-1+k \choose k}(F(x)^k)\right)$

If it helps (though I doubt it makes a difference) then $\ \Omega_x$ could be restricted to the positive reals.

I am not exactly sure of what I would need to do to prove this is (or isn't) the case. I have spent some time reading on the subject but it is not at all clear to me. My initial guess is yes, since the function is smooth, but I would be grateful for any thoughts.

The definition I have found for a function to be piecewise-polynomial is:

"A piecewise polynomial function is a continuous function $\ f : A \rightarrow \mathbb{R}$ for which there exist finitely many polynomials $\ p_1, \ldots , p_k$ such that for every $\ a \in A$, $\ f(a) = p_i(a)$ for some $i$."

Many thanks for all the help.

-
That definition of piecewise polynomial looks suspect. Usually one requires each "piece" to be an interval; otherwise, the Dirichlet function (1 on the rationals, 0 on the irrationals) is nowhere continuous but piecewise constant! –  Rahul Feb 3 '12 at 10:20
Anyway, don't you have any more conditions on $F(x)$? For $r = 2$, your $g_r(x)$ reduces to $x(-1 + 2F(x))$, and if say $X$ is normally distributed, this is not piecewise polynomial in any sense. –  Rahul Feb 3 '12 at 10:30
Many thanks for your response. Clearly I do not know what it means for a function to be piecewise polynomial. I thought it meant that you could split $\ \Omega_x$ up into lots of small intervals and approximate the function $\ g_r(x)$ by a polynomial function over each interval. And thus, since the function was smooth you can use Bernstein polynomials on each interval to approximate the function. Could you explain why $\ x(-1+2F(x))$ is not piecewise polynomial when $X$ is, say, normally distributed? Thanks! –  mfrmn Feb 3 '12 at 11:07

## 1 Answer

According to the definition that I am familiar with, a function on $\mathbb R$ is piecewise $P$ (for some property $P$, e.g. continuous, differentiable, constant, linear, polynomial, ...) if its domain can be divided into a union of non-degenerate intervals such that the function is $P$ over each interval.

Fix $r = 2$, so that $g_r(x) = x(-1 + 2F(x))$. Suppose $X$ follows an exponential distribution with parameter $\lambda = 1$. Then $F(x) = 1 - e^{-x}$, and $g_2(x) = x - 2xe^{-x}$. The function $g_2$ has an infinite Taylor expansion about any $x$, so it cannot be polynomial in any neighbourhood.

Of course, if the distribution of $X$ is such that $F(x)$ itself is piecewise polynomial, then so is $g_r$ for any $r$. However, I'm not sure if there are any $F$ and $r$ such that $F$ is not piecewise polynomial but $g_r$ is.

-
I see now, thank you very much. –  mfrmn Feb 3 '12 at 12:30
As a very quick follow up, currently I am trying to solve an optimisation problem over $\ F \in \mathcal{D}$ where $\mathcal{D}$ is a convex set of distributions subject to some contraints. To convert this into a semidefinite program I needed to show that $g_r(x)$ was piecewise polynomial. So, if I were to restrict $\mathcal{D}$ to the class of piecewise polynomial distributions, then $F(x)$ would itself be piecewise polynomial, and so $g_r$ would be piecewise polynomial also? –  mfrmn Feb 3 '12 at 12:51
Yes, I think that's right. And the class of piecewise polynomial functions is closed under convex combinations, so everything should be fine. Of course, the degree of the polynomial pieces of $g_r$ goes up roughly as $r$ times the degree of the corresponding pieces of $F$, but I don't know if that's going to be a problem for you. –  Rahul Feb 3 '12 at 12:59