\HeaderA{gam.check}{Some diagnostics for a fitted gam model}{gam.check}
\keyword{models}{gam.check}
\keyword{smooth}{gam.check}
\keyword{regression}{gam.check}
\begin{Description}\relax
Takes a fitted \code{gam} object produced by \code{gam()} and produces some diagnostic information
about the fitting procedure and results. The default is to produce 4 residual
plots, and some information about the convergence of the smoothness selection optimization.
\end{Description}
\begin{Usage}
\begin{verbatim}
gam.check(b)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{b}] a fitted \code{gam} object as produced by \code{gam()}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function plots 4 standard diagnostic plots, and some other
convergence diagnostics. Usually the 4 plots are various residual plots. The
printed information relates to the optimization used to select smoothing
parameters. For the default optimization methods the information is summarized in a
readable way, but for other optimization methods, whatever is returned by way of
convergence diagnostics is simply printed.
\end{Details}
\begin{Author}\relax
Simon N. Wood \email{simon.wood@r-project.org}
\end{Author}
\begin{References}\relax
Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman
and Hall/CRC Press.


\url{http://www.maths.bath.ac.uk/~sw283/}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{choose.k}{choose.k}},  \code{\LinkA{gam}{gam}}, \code{\LinkA{mgcv}{mgcv}}, \code{\LinkA{magic}{magic}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
library(mgcv)
set.seed(0)
dat <- gamSim(1,n=200)
b<-gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)
plot(b,pages=1)
gam.check(b)
\end{ExampleCode}
\end{Examples}

