\HeaderA{vcov.gam}{Extract parameter (estimator) covariance matrix from GAM fit}{vcov.gam}
\keyword{models}{vcov.gam}
\keyword{smooth}{vcov.gam}
\keyword{regression}{vcov.gam}
\begin{Description}\relax
Extracts the Bayesian posterior covariance matrix of the
parameters or frequentist covariance matrix of the parameter estimators 
from a fitted \code{gam} object.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'gam':
vcov(object, freq = TRUE, dispersion = NULL, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] fitted model object of class \code{gam} as produced by \code{gam()}.
\item[\code{freq}] \code{TRUE} to return the frequentist covariance matrix of the
parameter estimators, \code{FALSE} to return the Bayesian posterior covariance
matrix of the parameters.
\item[\code{dispersion}] a value for the dispersion parameter: not normally used.
\item[\code{...}] other arguments, currently ignored.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Basically, just extracts \code{object\$Ve} or \code{object\$Vp} from a \code{\LinkA{gamObject}{gamObject}}.
\end{Details}
\begin{Value}
A matrix corresponding to the estimated frequentist covariance matrix
of the model parameter estimators/coefficients, or the estimated posterior
covariance matrix of the parameters, depending on the argument \code{freq}.
\end{Value}
\begin{Author}\relax
Henric Nilsson. 
Maintained by Simon N. Wood \email{simon.wood@r-project.org}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{gam}{gam}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode} 
n <- 100
x <- runif(n)
y <- sin(x*2*pi) + rnorm(n)*.2
mod <- gam(y~s(x,bs="cc",k=10),knots=list(x=seq(0,1,length=10)))
diag(vcov(mod))
\end{ExampleCode}
\end{Examples}

