\HeaderA{formXtViX}{Form component of GAMM covariance matrix}{formXtViX}
\keyword{models}{formXtViX}
\keyword{smooth}{formXtViX}
\keyword{regression}{formXtViX}
\begin{Description}\relax
This is a service routine for \code{\LinkA{gamm}{gamm}}. Given,
\eqn{V}{V}, an estimated covariance matrix obtained using \code{\LinkA{extract.lme.cov2}{extract.lme.cov2}} this
routine forms \eqn{ X^TV^{-1}X}{X'inv(V)X} as efficiently as possible, given
the structure of \eqn{V}{V} (usually sparse).
\end{Description}
\begin{Usage}
\begin{verbatim}
formXtViX(V,X)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{V}] A data covariance matrix list returned from \code{\LinkA{extract.lme.cov2}{extract.lme.cov2}}
\item[\code{X}] A model matrix.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The covariance matrix returned by \code{\LinkA{extract.lme.cov2}{extract.lme.cov2}} may
be in a packed and re-ordered format, since it is usually sparse. Hence a
special service routine is required to form the required products involving
this matrix.
\end{Details}
\begin{Value}
A matrix.
\end{Value}
\begin{Author}\relax
Simon N. Wood \email{simon.wood@r-project.org}
\end{Author}
\begin{References}\relax
For \code{lme} see:

Pinheiro J.C. and Bates, D.M. (2000) Mixed effects Models in S and S-PLUS. Springer

For details of how GAMMs are set up here for estimation using \code{lme} see:

Wood, S.N. (2006) Low rank scale invariant tensor product smooths for
Generalized Additive Mixed Models. Biometrics

\url{http://www.maths.bath.ac.uk/~sw283/}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{gamm}{gamm}}, \code{\LinkA{extract.lme.cov2}{extract.lme.cov2}}
\end{SeeAlso}

