\Header{splineDesign}{Design Matrix for B-splines}
\alias{spline.des}{splineDesign}
\keyword{models }{splineDesign}
\begin{Usage}
\begin{verbatim}
splineDesign(knots, x, ord, derivs)
spline.des(knots, x, ord, derivs)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{knots}] a numeric vector of knot positions with non-decreasing values.
\item[\texttt{x}] a numeric vector of values at which to evaluate the B-spline
functions or derivatives. The values in \texttt{x} must be between
\texttt{knots[ord]} and \texttt{knots[ length(knots) + 1 - ord ]}.
\item[\texttt{ord}] a positive integer giving the order of the spline function.
This is the number of coefficients in each piecewise polynomial
segment, thus a cubic spline has order 4.  Defaults to 4.
\item[\texttt{derivs}] an integer vector of the same length as \texttt{x} and with
values between \texttt{0} and \texttt{ord - 1}.  The derivative of the
given order is evaluated at the \texttt{x} positions.  Defaults to a
vector of zeroes of the same length as \texttt{x}.
\end{ldescription}
\end{Arguments}
\begin{Description}
Evaluate the design matrix for the B-splines defined by \texttt{knots}
at the values in \texttt{x}.\end{Description}
\begin{Value}
A matrix with \texttt{length( x )} rows and \texttt{length( knots ) - ord}
columns.  The i'th row of the matrix contains the coefficients of the
B-splines (or the indicated derivative of the B-splines) defined by
the \texttt{knot} vector and evaluated at the i'th value of \texttt{x}.
Each B-spline is defined by a set of \texttt{ord} successive knots so
the total number of B-splines is \texttt{length(knots)-ord}.\end{Value}
\begin{Note}
The older \texttt{spline.des} function takes the same argument but
returns a list with several components including \texttt{knots},
\texttt{ord}, \texttt{derivs}, and \texttt{design}.  The \texttt{design}
component is the same as the value of the \texttt{splineDesign}
function.\end{Note}
\begin{Author}
Douglas Bates and Bill Venables\end{Author}
\begin{Examples}
\begin{ExampleCode}
splineDesign(knots = 1:10, x = 4:7)
\end{ExampleCode}
\end{Examples}

