Welcome to hypercone.com on July 9 2009.
This is an internet experiment running to monitor browsing habbits of individuals through wikipedia contents.

Monotone cubic interpolation

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In the mathematical subfield of numerical analysis, monotone cubic interpolation is a variant of cubic interpolation that preserves monotonicity of the data set being interpolated.

Monotonicity is preserved by linear interpolation but not guaranteed by cubic interpolation.

Contents

[edit] Monotone cubic Hermite interpolation

Example showing cubic and monotone cubic interpolation of a monotone data set. Note that the red line is not monotone.

Monotone interpolation can be accomplished using cubic Hermite spline with the tangents mi modified to ensure the monotonicity of the resulting Hermite spline.

[edit] Data preprocessing

Let the data points be (xk,yk) for k = 1,...,n

  1. Compute the slopes of the secant lines between successive points:

    \Delta_k =\frac{y_{k+1}-y_k}{x_{k+1}-x_k}

    for k=1,\dots,n-1.
  2. Initialize the tangents at every data point as the average of the secants,

    m_k = \frac{\Delta_{k-1}+\Delta_k}{2}

    for k=2,\dots,n-1; these may be updated in further steps. For the endpoints, use one-sided differences:

    m_1 = \Delta_1 \quad \text{and} \quad m_n = \Delta_{n-1}

  3. For k=1,\dots,n-1, if Δk = 0 (if two successive yk = yk + 1 are equal), then set mk = mk + 1 = 0, as the spline connecting these points must be flat to preserve monotonicity. Ignore step 4 and 5 for those k.
  4. Let αk = mk / Δk and βk = mk + 1 / Δk.
  5. Now, since to prevent overshoot or undershoot, we are trying to restrict the position vector kk) to a circle of radius 3, if \alpha_k^2 + \beta_k^2 > 9, then set mk = τkαkΔk and mk + 1 = τkβkΔk where \tau_k = \frac{3}{\sqrt{\alpha_k^2 + \beta_k^2}}.

Note that only one pass of the algorithm is required.

[edit] Cubic interpolation

After the preprocessing, evaluation of the interpolated spline is equivalent to cubic Hermite spline, using the data xk, yk, and mk for k = 1,...,n.

To evaluate at x, find the largest xlower and smallest xupper among xk such that x_\text{lower} \leq x \leq x_\text{upper}. Calculate

h = xupperxlower and t = \frac{x - x_\text{lower}}{h}

then the interpolant is

finterpolated(x) = ylowerh00(t) + hmlowerh10(t) + yupperh01(t) + hmupperh11(t)

where hii are the basis functions for the cubic Hermite spline.

[edit] References

Personal tools

Visit joltnews for the latest headlines
Visit bloit.com for company information
Geed Media does computer consulting on long island.
This page viewed times. See Logs