MHB Uniqueness of Cubic Spline Interpolation: How Can We Prove It?

  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Cubic Uniqueness
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! 😊

Show that the interpolation exercise for cubic splines with $s(x_0), s(x_1), , \ldots , s(x_m)$ at the points $x_0<x_1<\ldots <x_m$, together with one of $s'(x_0)$ or $s''(x_0)$ and $s'(x_m)$ or $s''(x_m)$ has exactly one solution.

Could you give me a hint how we could show that? Do wwe have to assume that we have two different solutions annd get a contradiction? :unsure:
 
Mathematics news on Phys.org
A cubic spline for a segment has 4 coefficients. Since we have $m$ segments, we have $4m$ coefficients.
To find them, we need $4m$ independent equations.
Which equations do we have? 🤔
 
Klaas van Aarsen said:
A cubic spline for a segment has 4 coefficients. Since we have $m$ segments, we have $4m$ coefficients.
To find them, we need $4m$ independent equations.
Which equations do we have? 🤔

We have the equations $s(x_0), s(x_1), \ldots , s(x_m)$, then we have also conditions of continuity, or not? And we have also the conditions $s'(x_0)=s'(x_m)$ or $s''(x_0)=s''(x_m)$.

Is that correct? :unsure:
 
Yes, we have the conditions of continuity.
Each of the $m$ segments must have the given starting and ending points, which gives us $2m$ independent equations, doesn't it? 🤔

Don't we also have the condition that the derivative must be continuous? That is, no angles in the resulting spline? 🤔
 
Last edited:
Klaas van Aarsen said:
Yes, we have the conditions of continuity.
Each of the $m$ segments must have the given starting and ending points, which gives us $2m$ independent equations, doesn't it? 🤔

Don't we also have the condition that the derivative must be continuous? That is, no angles in the resulting spline? 🤔

I got stuck right now. We don't have an index at $s(x)$. Does this mean that at each segment we have the same function? Shouldn't it be $s_i(x)$ ? :unsure:
 
mathmari said:
I got stuck right now. We don't have an index at $s(x)$. Does this mean that at each segment we have the same function? Shouldn't it be $s_i(x)$ ?

Hmm... your OP says "the interpolation exercise for cubic splines". Which interpolation exercise is that? 🤔

Note that a "cubic" spline is a third order polynomial, which means that it has 4 coefficients.
Consequently if there are more than 4 points, we cannot find one that has all points on its curve.
So either the spline is actually of $m$-th order, or the spline consists of $m$ segments each with its own coefficients, or the spline is a best-fit function.
Btw, even if it is a best-fit function, a "cubic" spline should still have only at most 4 points given and not $m+1$ points.
And if it were an $m$-th order polynomial, then there is no need to set constraints on the first or second derivative at the end points.
So I assumed we have a set of $m$ cubic splines, which I guess may not be what is intended.

If not, can you tell that kind of spline we are talking about then? 🤔
There are many types after all.
 
mathmari said:
I got stuck right now. We don't have an index at $s(x)$. Does this mean that at each segment we have the same function? Shouldn't it be $s_i(x)$ ?

The spline function $s$ would be a composite function.
That is:
$$s(x)=\begin{cases}s_1(x)&\text{if } 0\le x < 1 \\ s_2(x-1) &\text{if } 1\le x < 2 \\\ldots\\ s_m(x-m+1) &\text{if } m-1\le x \le m\end{cases}$$
where $s_i(u)=a_{i,3} u^3 + a_{i,2} u^2 + a_{i,1} u + a_{i,0}$ for $i=1,\ldots,m$.

So we don't simply have $s_i(x)$ since it depends on the value of $x$, which $s_i$ we need. 🤔

Suppose we assume that this is indeed what was intended. Then a solution is a set of coefficients $a_{i,j}$.

To ensure continuity, we need that $s_i(0)=s(i-1)$ and $s_i(1)=s(i)$ for $i=1,\ldots,m$. These are $2m$ independent equations.
To ensure continuity of the derivative, we need $s_i'(1)=s_{i+1}'(0)$ for $i=1,\ldots,m-1$. These are $2m-2$ independent equations.
So we are 2 equations short to find all coefficients.
If we add equations with the values of $s_1'(0)$ and $s_m'(1)$ we have a complete independent set with a unique solution.
Alternatively we can add equations with the values of $s_1''(0)$ and $s_m''(1)$ and we have again a complete independent set with a unique solution. 🤔

In practice the boundary condition $s_1''(0)=s_m''(1)=0$ is a typical choice.
 
Klaas van Aarsen said:
The spline function $s$ would be a composite function.
That is:
$$s(x)=\begin{cases}s_1(x)&\text{if } 0\le x < 1 \\ s_2(x-1) &\text{if } 1\le x < 2 \\\ldots\\ s_m(x-m+1) &\text{if } m-1\le x \le m\end{cases}$$
where $s_i(u)=a_{i,3} u^3 + a_{i,2} u^2 + a_{i,1} u + a_{i,0}$ for $i=1,\ldots,m$.

Why is the function defined in that form, I mean the argument is "x-something" and not $$s(x)=\begin{cases}s_1(x)&\text{if } 0\le x < 1 \\ s_2(x) &\text{if } 1\le x < 2 \\\ldots\\ s_m(x) &\text{if } m-1\le x \le m\end{cases}$$
Klaas van Aarsen said:
To ensure continuity, we need that $s_i(0)=s(i-1)$ and $s_i(1)=s(i)$ for $i=1,\ldots,m$. These are $2m$ independent equations.

Do we not get from the continuity the condition $s_i(x_i)=s_{i+1}(x_i)$ ? :unsure:
 
mathmari said:
Why is the function defined in that form, I mean the argument is "x-something" and not $$s(x)=\begin{cases}s_1(x)&\text{if } 0\le x < 1 \\ s_2(x) &\text{if } 1\le x < 2 \\\ldots\\ s_m(x) &\text{if } m-1\le x \le m\end{cases}$$
My mistake, it should be:
$$s(x)=\begin{cases}s_1(x)&\text{if } x_0\le x < x_1 \\ s_2(x) &\text{if } x_1\le x < x_2 \\\ldots\\ s_m(x) &\text{if } x_{m-1}\le x \le x_m\end{cases}$$
🤔

Do we not get from the continuity the condition $s_i(x_i)=s_{i+1}(x_i)$ ?
Yes, with the new version of the function $s$ that is indeed the continuity condition. 🤔
 
  • #10
Klaas van Aarsen said:
My mistake, it should be:
$$s(x)=\begin{cases}s_1(x)&\text{if } x_0\le x < x_1 \\ s_2(x) &\text{if } x_1\le x < x_2 \\\ldots\\ s_m(x) &\text{if } x_{m-1}\le x \le x_m\end{cases}$$
🤔

Yes, with the new version of the function $s$ that is indeed the continuity condition. 🤔

So we have the following:
\begin{equation*}s(x)=\begin{cases}s_1(x)&\text{wenn } x_0\le x < x_1 \\ s_2(x) &\text{wenn } x_1\le x < x_2 \\\ldots\\ s_m(x) &\text{wenn } x_{m-1}\le x \le x_m\end{cases}\end{equation*}
with $s_i(x)=a_{i,3} x^3 + a_{i,2} x^2 + a_{i,1} x + a_{i,0}$ for $i=1,\ldots,m$.

A cibic spline is $C^2$, so the second derivative must be continuous.

So that the function is continuous we need $s_i(x_i)=s_{i+1}(x_i)$ for $i=1,\ldots,m-1$ and $s_i(x_{i-1})=s(x_{i-1})$ for $i=1,\ldots,m+1$.
So we have $(m-1)+(m+1)=2m$ independent equations.

So that the first derivative is continuous we need $s_i'(x_i)=s_{i+1}'(x_i)$ for $i=1,\ldots,m-1$.
So we have $m-1$ independent equations.

So that the second derivative is continuous we need $s_i''(x_i)=s_{i+1}''(x_i)$ for $i=1,\ldots,m-1$.
So we have $m-1$ independent equations.

Till now we have $2m+(m-1)+(m-1)=4m-2$ conditions (equations).

The remaining two conditions are the two possible pairs given at the statement. Is everything correct? :unsure:
 
  • #11
Looks good enough to me. (Nod)
 
  • #12
Klaas van Aarsen said:
Looks good enough to me. (Nod)

Great! Thank you very much! (Smile)
 

Similar threads

Replies
8
Views
2K
Replies
1
Views
2K
Replies
4
Views
985
Replies
10
Views
1K
Replies
4
Views
2K
Replies
4
Views
2K
Replies
8
Views
3K
Back
Top