\Header{predict.bSpline}{Evaluate a spline at new values of x}
\alias{plot.spline}{predict.bSpline}
\alias{predict.nbSpline}{predict.bSpline}
\alias{predict.npolySpline}{predict.bSpline}
\alias{predict.pbSpline}{predict.bSpline}
\alias{predict.ppolySpline}{predict.bSpline}
\keyword{models}{predict.bSpline}
\begin{Description}\relax
The \code{predict} methods for the classes that inherit from the
virtual classes \code{bSpline} and \code{polySpline} are used to
evaluate the spline or its derivatives.  The \code{plot} method for a
spline object first evaluates \code{predict} with the \code{x}
argument missing, then plots the resulting \code{xyVector} with
\code{type = "l"}.\end{Description}
\begin{Usage}
\begin{verbatim}
predict(object, x, nseg=50, deriv=0, ...)
plot.spline(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] An object that inherits from the \code{bSpline} or the
\code{polySpline} class.  For \code{plot.spline} this argument is
called \code{x}.
\item[\code{x}] A numeric vector of \code{x} values at which to evaluate the
spline.  If this argument is missing a suitable set of \code{x}
values is generated as a sequence of \code{nseq} segments spanning
the range of the knots.  For \code{plot.spline} the \code{x}
argument is as described under \code{object} above.
\item[\code{nseg}] A positive integer giving the number of segments in a set
of equally-spaced \code{x} values spanning the range of the knots
in \code{object}.  This value is only used if \code{x} is missing.
\item[\code{deriv}] An integer between 0 and \code{splineOrder(object) - 1}
specifying the derivative to evaluate.
\item[\code{...}] \code{predict}: further arguments passed to or from other methods.

\code{plot}: additional graphical parameters (see \code{link\{par\}}).

\end{ldescription}
\end{Arguments}
\begin{Value}
an \code{xyVector} with components
\begin{ldescription}
\item[\code{x}] the supplied or inferred numeric vector of \code{x} values
\item[\code{y}] the value of the spline (or its \code{deriv}'th derivative)
at the \code{x} vector
\end{ldescription}
\end{Value}
\begin{Author}\relax
Douglas Bates and Bill Venables\end{Author}
\begin{SeeAlso}\relax
\code{\Link{xyVector}},
\code{\Link{interpSpline}},
\code{\Link{periodicSpline}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data( women )
ispl <- interpSpline( weight ~ height,  women )
opar <- par(mfrow = c(2, 2), las = 1)
plot(predict(ispl, nseg = 201),     # plots over the range of the knots
     main = "Original data with interpolating spline", type = "l",
     xlab = "height", ylab = "weight") 
points(women$height, women$weight, col = 4)
plot(predict(ispl, nseg = 201, deriv = 1),
     main = "First derivative of interpolating spline", type = "l",
     xlab = "height", ylab = "weight") 
plot(predict(ispl, nseg = 201, deriv = 2),
     main = "Second derivative of interpolating spline", type = "l",
     xlab = "height", ylab = "weight") 
plot(predict(ispl, nseg = 401, deriv = 3),
     main = "Third derivative of interpolating spline", type = "l",
     xlab = "height", ylab = "weight") 
par(opar)
\end{ExampleCode}
\end{Examples}

