\HeaderA{null.space.dimension}{The basis of the space of un-penalized functions for a TPRS}{null.space.dimension}
\keyword{models}{null.space.dimension}
\keyword{regression}{null.space.dimension}
\begin{Description}\relax
The thin plate spline penalties give zero penalty to some
functions. The space of these functions is spanned by a set of
polynomial terms. \code{null.space.dimension} finds the dimension of this space, \eqn{M}{M}, given
the number of covariates that the smoother is a function of, \eqn{d}{d},
and the order of the smoothing penalty, \eqn{m}{m}. If \eqn{m}{m} does not
satisfy \eqn{2m>d}{2m>d} then the smallest possible dimension
for the null space is found given \eqn{d}{d} and the requirement that
the smooth should be visually smooth.
\end{Description}
\begin{Usage}
\begin{verbatim}
null.space.dimension(d,m)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{d}] is a positive integer - the number of variables of which the
t.p.s. is a function. 
\item[\code{m}] a non-negative integer giving the order of the penalty
functional, or signalling that the default order should be used.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Thin plate splines are only visually smooth if the order of the
wiggliness penalty, \eqn{m}{m}, satisfies \eqn{2m > d+1}{2m >
d+1}. If \eqn{2m<d+1}{2m<d+1} then this routine finds the smallest
\eqn{m}{m} giving visual smoothness
for the given \eqn{d}{d}, otherwise the supplied \eqn{m}{m} is used. The null space dimension is given by:

\eqn{M=(m+d+1)!/(d!(m-d)!)}{M=(m+d+1)!/(d!(m-d)!}

which is the value returned.
\end{Details}
\begin{Value}
An integer (array), the null space dimension
\eqn{M}{M}.
\end{Value}
\begin{Author}\relax
Simon N. Wood \email{simon.wood@r-project.org}
\end{Author}
\begin{References}\relax
Wood, S.N. (2003) Thin plate regression splines. J.R.Statist.Soc.B 65(1):95-114

\url{http://www.stats.gla.ac.uk/~simon/}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{gam}{gam}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
null.space.dimension(2,0)
\end{ExampleCode}
\end{Examples}

