| cardinalBasis_ceschino | R Documentation | 
Cardinal Basis for cubic Ceschino interpolation.
cardinalBasis_ceschino(x, xout, cubic = TRUE, deriv = 0)
x | 
 Numeric vector of design points.  | 
xout | 
 Numeric vector giving new points.  | 
cubic | 
 Logical. Use cubic interpolation or basic linear?  | 
deriv | 
 Integer or logical. Compute the derivative?  | 
This is a simple and raw interface to alterp Fortran
subroutine.
A list with the following elements
x | 
 Numeric vector of abscissas at which the basis is evaluated. This
is a copy of   | 
CB | 
 Matrix of the Cardinal Basis function values.  | 
deriv, cubic | 
 Copy of input.  | 
method | 
 Character description of the method involved in the CB determination.  | 
This function does not allow extrapolation, so an error will
result when xout contains element outside of the range of
x.
Alain Hebert for Fortran code.
Yves Deville for R interface.
interp_ceschino for the related interpolation
function, cardinalBasis_natSpline and cardinalBasis_lagrange
for other Cardinal Basis constructions.
set.seed(123)
n <- 16L; nout <- 300L
x <- sort(runif(n))
## let 'xout' contain n + nout points including nodes 
xout <- sort(c(x, runif(nout, min = x[1], max = x[n])))
y <- sin(2 * pi * x)
res  <- cardinalBasis_ceschino(x, xout = xout, deriv = 0)
matplot(res$x, res$CB, type = "n", main = "Cardinal Basis")
abline(v = x, h = 1.0, col = "gray")
points(x = x, y = rep(0, n), pch = 21, col = "black",
       lwd = 2, bg = "white")
matlines(res$x, res$CB, type = "l")
## interpolation error should be fairly small
max(abs(sin(2 * pi * xout) - res$CB %*% y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.