swh:1:snp:81eadaa089e8253d8469bcef66aa332632c6c669
Tip revision: 6b5162225f1e90f742ac53c32bf06c8053cff577 authored by HwB on 26 July 2011, 00:00:00 UTC
version 0.7.5
version 0.7.5
Tip revision: 6b51622
pchip.Rd
\name{pchip}
\alias{pchip}
\title{Hermitean Interpolation Polynomials}
\description{
Piecewise Cubic Hermitean Interpolation Polynomials.
}
\usage{
pchip(xi, yi, x)
}
\arguments{
\item{xi, yi}{x- and y-coordinates of supporting nodes.}
\item{x}{x-coordinates of interpolation points.}
}
\details{
\code{pchip} is a `shape-preserving' piecewise cubic Hermite polynomial
approach that apptempts to determine slopes such that function values do
not overshoot data values.
}
\value{
Values of interpolated data at points \code{x}.
}
\references{
Moler, C. (2004). Numerical Computing with Matlab. Revised Reprint, SIAM.
}
\author{
Copyright of the Matlab version from Cleve Moler in his book ``Numerical
Computing with Matlab'', Chapter 3 on Interpolation.
R Version by Hans W. Borchers, 2011.
}
\note{
TODO: A `pchipfun' should be provided.
}
\seealso{
\code{\link{interp1}}
}
\examples{
\dontrun{
x <- c(1, 2, 3, 4, 5, 6)
y <- c(16, 18, 21, 17, 15, 12)
plot(x, y, col="red", xlim=c(0,7), ylim=c(10,22),
main = "Spline and 'pchip' Interpolation Polynomials")
grid()
xs <- seq(1, 6, len=51)
ys <- interp1(x, y, xs, "spline")
lines(xs, ys, col="cyan")
yp <- pchip(x, y, xs)
lines(xs, yp, col = "magenta")}
}
\keyword{ math }