Interpolation Functions

Bicubic2D(vx, vy, Z, p, q) Takes two sorted vectors of real points vx and vy, their corresponding matrix of real values, Z, and two real scalars p and q containing an intermediate point within the range of vx and vy. Returns the scalar interpolated value at (p,q).

polycoeff(vx, vy) Takes two real vectors of the same length vx and vy and returns the coefficients of the interpolating polynomial function.

Returns a vector of length(vx)-1 containing the polynomial coefficients, beginning with the lowest order coefficient.

polyint(vx, vy, x) Takes two real-valued vectors of the same length vx and vy, and a real scalar point, x, at which to interpolate a value using a polynomial function, then returns a two-element vector containing the interpolated value of the function and an estimate of the error.

polyiter(vx, vy, x, N, e) Takes two real vectors of the same length vx and vy; a real scalar point, x, at which to interpolate a value using a polynomial function; the integer maximum order of the polynomial, N, which cannot be larger than one less than the number of points in vx; and an error, e, which is a real scalar.

rationalint(vx, vy, x) Takes two real vectors of the same length, vx and vy, and a real scalar x, the point at which to interpolate a value using rational functions.

Spline2(vx, vy, n, [vw], [u], [level]) Takes two real vectors vx and vy, of identical length; n, an integer indicating the degree (1, 2, or 3) of polynomials used for the Bspline; an optional vector of weights for the spline, vw, of the same length as vx and vy; an optional vector of user-defined knots for the Bspline, u, which should be shorter than vx; and an optional argument level, the reject level expressed as a percentage between 0 and 1, inclusive.

Results vector contains the new knots for interpolation, coefficients for the bsplines, and other statistical information. Results are used with Binterp to get interpolated values.

Binterp(x, b) The interpolation routine for Spline2; takes a real scalar x to interpolate and the output vector, b, of Spline2, and returns a four-element vector containing the interpolated value, and its first, second, and third derivatives.

DWS(b) Takes a vector, b, the result vector from the Spline2 function and returns the Durbin-Watson statistic of the spline.

Thiele(vx, coeff, x) Takes a real vector vx, the output vector of Thielecoeff, coeff, and the evaluation point x, and returns the interpolated y-value at x. x must be a real scalar.

Thielecoeff(vx, vy) Takes two real vectors of the same length, vx and vy, and returns a vector of the same length as vx containing the continued fraction coefficients to interpolate the data.