Intereting Posts

How many non-rational complex numbers $x$ have the property that $x^n$ and $(x+1)^n$ are rational?
Optimal assumptions for a theorem of differentiation under the integral sign
Which of the following form an ideal in this ring?
Prove that a continuous image of a closed subset of a compact space is a closed subset
Distributing 6 oranges, 1 apple, 1 banana and 1 pineapple among 3 children
Evalute $ \lim_{n\rightarrow \infty}\sum^{n}_{k=0}\frac{\binom{n}{k}}{n^k(k+3)} $
How can I prove this combinatorial identity $\sum_{j=0}^n j\binom{2n}{n+j}\binom{m+j-1}{2m-1}=m\cdot4^{n-m}\cdot\binom{n}{m}$?
Sheafs of abelian groups are the same as $\underline{\mathbb{Z}}$-modules
Show that $ a，b, \sqrt{a}+ \sqrt{b} \in\mathbb Q \implies \sqrt{a},\sqrt{b} \in\mathbb Q $
Examples of the Mathematical Red Herring principle
How to find inverse of function?
Compact connected spaces have non- cut points
Wedge sum of circles and Hawaiian earring
Inference Regarding Definite Integral of Product of Two Functions
I need help with this geometry question.

I’m in need to implement Monotone Cubic Interpolation for interpolate a sequence of points.

The information I have about the points are x,y and timestamp.

I’m much more an IT guy rather than a mathematical person, so I’m looking for an example of implementation.

What I need to do with the resulting functions is store them for future analysis.

My favorite syntax are PHP, Python, Java, Delphi, VB or a generic algorithmic language of your choice.

- Convert a Pair of Integers to a Integer, Optimally?
- Fermats Little Theorem
- Efficient computation of $\sum_{k=1}^n \lfloor \frac{n}{k}\rfloor$
- Detecting perfect squares faster than by extracting square root
- Given $N$, what is the next prime $p$ greater than $N$?
- Why does this algorithm to plot implicit equations work?

- Detecting polygon self intersection
- Is it possible to draw this picture without lifting the pen?
- Count arrays with each array elements pairwise coprime
- Math Analysis Designing Algorithms
- Correspondence between eigenvalues and eigenvectors in ellipsoids
- Determine the centre of a circle
- Prove the statement 'World is not flat'
- Why is $S^1 \times S^1$ a Torus?
- How to compare points in multi-dimensional space?
- Calculator algorithms

Not terribly hard to do; as a matter of fact, even if you just limit yourself to Hermite interpolation, there are a number of methods. I shall discuss the three which I have most experience with.

Recall that given points $(x_i,y_i),\quad i=1\dots n$, and assuming no two $x_i$ are the same, one can fit a piecewise cubic Hermite interpolant to the data. (I gave the form of the Hermite cubic in this previous answer.)

To use the notation of that answer, you already have $x_i$ and $y_i$ and require an estimate of the $y_i^\prime$ from the given data. There are at least three schemes for doing this: Fritsch-Carlson, Steffen, and Stineman.

(In the succeeding formulae, I use the notation $h_i=x_{i+1}-x_i$ and $d_i=\frac{y_{i+1}-y_i}{h_i}$.)

The method of Fritsch-Carlson computes a weighted harmonic mean of slopes:

$$y_i^\prime = \begin{cases}3(h_{i-1}+h_i)\left(\frac{2h_i+h_{i-1}}{d_{i-1}}+\frac{h_i+2h_{i-1}}{d_i}\right)^{-1} &\text{ if }\mathrm{sign}(d_{i-1})=\mathrm{sign}(d_i)\\ 0&\text{ if }\mathrm{sign}(d_{i-1})\neq\mathrm{sign}(d_i)\end{cases}$$

the method of Steffen is based on a weighted mean (alternatively, a parabolic fit within the interval):

$$y_i^\prime = (\mathrm{sign}(d_{i-1})+\mathrm{sign}(d_i))\min\left(|d_{i-1}|,|d_i|,\frac12 \frac{h_i d_{i-1}+h_{i-1}d_i}{h_{i-1}+h_i}\right)$$

and the method of Stineman fits to circles:

$$y_i^\prime = \frac{h_{i-1} d_{i-1}h_i^2(1+d_i^2)+h_i d_i h_{i-1}^2(1+d_{i-1}^2)}{h_{i-1} h_i^2(1+d_i^2)+h_i h_{i-1}^2(1+d_{i-1}^2)}$$

The formulae I have given are applicable only to “internal” points; you’ll have to consult those papers for the slope formulae for handling the endpoints.

As a demonstration of these three methods, consider these two datasets due to Akima:

$$\begin{array}{|l|l|}

\hline x&y\\

\hline 1&10\\2&10\\3&10\\5&10\\6&10\\8&10\\9&10.5\\11&15\\12&50\\14&60\\15&95\\ \hline

\end{array}$$

and Fritsch and Carlson:

$$\begin{array}{|l|l|}

\hline x&y\\

\hline 7.99&0\\8.09&2.7629\times 10^{-5}\\8.19&4.37498\times 10^{-3}\\8.7&0.169183\\9.2&0.469428\\10&0.94374\\12&0.998636\\15&0.999919\\20&0.999994\\ \hline

\end{array}$$

Here are plots of these two datasets:

Here are plots of the cubic spline fits to these two sets:

Note the wiggliness that was not present in the original data; this is the price one pays for the second-derivative continuity the cubic spline enjoys.

Here now are plots of interpolants using the three methods mentioned earlier.

This is the Fritsch-Carlson result:

This is the Steffen result:

This is the Stineman result:

(The not-too-good result for the Fritsch-Carlson data set might be due to the use of a cubic Hermite interpolant instead of the rational interpolant Stineman recommended to be used with his derivative prescription.)

As I said, I’ve had good experience with these three; however, you will have to experiment in your environment on which of these is most suitable to your needs.

- Visualizing Balls in Ultrametric Spaces
- When can a real Banach space be made into a complex Banach space?
- Factor $x^4 + 64$
- Can a group of order $55$ have exactly $20$ elements of order $11$?
- Compute the infinite product $\prod\limits_{n=2}^\infty \left(1+\frac{1}{2^n-2}\right)$
- Learning projective geometry
- Open Set and Measure Theory
- Riemann Zeta Function Manipulation
- Example of a an endomorphism which is not a right divisor of zero and not onto
- with this inequality $\ln{x}\ln{(1-x)}<\sqrt{x(1-x)}$
- Induction proof that $\sum_{j=n}^{2n-1} (2j + 1) = 3n^2$ – what happened?
- Five Cubes in Dodecahedron
- Finding $g_i:\mathbb{R}^n\to\mathbb R$ s.t $f(x)=\sum\limits_{i=1}^nx_i\cdot g_i(x)$
- Textbooks on set theory
- Books for combinatorial thinking