\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 = FALSE, 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{References}\relax
Wood, S.N. (2006) On confidence intervals for generalized additive models based on penalized regression splines. Australian and New Zealand Journal of Statistics. 48(4): 445-464.
\end{References}
\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}

