Returns the ordinate of a monotonicity-preserving interpolating spline.

Category: | Mathematical |

is a numeric constant, variable, or expression that specifies the abscissa for which the ordinate of the spline is to be computed.

is a numeric constant, variable, or expression that specifies the number of knots. N must be a positive integer.

are numeric constants,
variables, or expressions that specify the abscissas of the knots.
These values must be non-missing and listed in nondecreasing order.
Otherwise, the result is undefined. MSPLINT does not check the order
of the X_{1} through X_{n} arguments.

are numeric constants,
variables, or expressions that specify the ordinates of the knots.
The number of Y_{1} through Y_{n} arguments must be the same as the number of X_{1} throughX_{n} arguments.

The MSPLINT function
returns the ordinate of a monotonicity-preserving cubic interpolating
spline for a single abscissa, X.

An interpolating spline
is a function that passes through each point that is specified by
the ordered pairs (X_{1}, Y_{1}), (X_{2}, Y_{2}), …, (X_{n}, Y_{n}). These points are called knots.

However, if you specify
values of D_{1} or D_{n} with the wrong sign, monotonicity will not be preserved for values
that are less than X_{2} or greater than
${X}_{n-1}$ .

If the arguments D_{1} and D_{n} have non-missing values,
or if n >= 3, then the following
actions occur:

If two knots have equal
abscissas but different ordinates, then the spline will be discontinuous
at that abscissa. If two knots have equal abscissas and equal ordinates,
then the spline will be continuous at that abscissa, but the first
derivative will usually be discontinuous at that abscissa. Otherwise,
the spline is continuous and has a continuous first derivative.

If X is missing, or if any other arguments required
to compute the result are missing, then MSPLINT returns a missing
value. MSPLINT does not check all of the arguments for missing values.
Because the arguments D_{1} and D_{n} are optional, and they are not required to compute
the result, if one or both are missing and no errors occur, then MSPLINT
returns a non-missing result.

The following is an
example of the MSPLINT function.

data msplint; do x=0 to 100 by .1; msplint=msplint(x, 9, 10, 20, 25, 50, 55, 70, 70, 80, 90, 20, 30, 30, 40, 70, 60, 50, 40, 40); output; end; run; data knots; input x y; datalines; 10 20 20 30 25 30 50 40 55 70 70 60 70 50 80 40 90 40 ; data plot; merge knots msplint; by x; run; title "Comparison of Splines"; title2 "Non-monotonicity-preserving and Monotonicity-preserving Splines"; legend1 value=('Non-monotonicity-preserving spline' 'Monotonicity-preserving spline') label=none; symbol1 value=dot interpol=spline color=black width=5; symbol2 value=none interpol=join color=red; proc gplot data=plot; plot y*x=1 msplint*x=2/overlay legend=legend1; run; quit;

“A method for constructing
local monotone piecewise cubic interpolants.” 1984. Siam Journal
of Scientific and Statistical Computing 5:2: 300-304.

Copyright © SAS Institute Inc. All rights reserved.