| Spline Toolbox | ![]() |
Syntax
Description
Assume that tau has at least k entries, is nondecreasing, and satisfies tau(i)<tau(i+k-1) for all i. Then the knot sequence knots returned by the command aptknt(tau,k) is acceptable for interpolation to data at the sites tau in the sense that there is exactly one spline of order k with knot sequence knots that matches given data at those sites. This is so because the sequence knots returned satisfies the Schoenberg-Whitney conditions
with equality only at the extreme knots, each of which occurs with exact multiplicity k.
If tau has fewer than k entries, then k is reduced to the value length(tau); the k used is optionally returned. An error results if tau fails to be nondecreasing and/or tau(i) equals tau(i+k-1) for some i.
Examples
If tau is equally spaced, e.g., equal to linspace(a,b,n) for some n>=4, and y is a sequence of the same size as tau, then sp = spapi(aptknt(tau,4),tau,y) gives the cubic spline interpolant with the not-a-knot end condition. This is the same cubic spline as produced by the command spline(tau,y), but in B-form rather than ppform.
Algorithm
The (k-1)-point averages sum(tau(i+1:i+k-1))/(k-1) of the sequence tau, as supplied by aveknt(tau,k), are augmented by a k-fold tau(1) and a k-fold tau(end). In other words, the command gives the same result as augknt([tau(1),aveknt(tau,k),tau(end)],k), provided tau has at least k entries and k is greater than 1.
See Also
augknt, aveknt, newknt, optknt, spline
Cautionary Note
If tau is very nonuniform, then use of the resulting knot sequence for interpolation to data at the sites tau may lead to unsatisfactory results.
| Functions - Alphabetical List | augknt | ![]() |