\Header{magic.post.proc}{Auxilliary information from magic fit}
\keyword{models}{magic.post.proc}
\keyword{smooth}{magic.post.proc}
\keyword{regression}{magic.post.proc}
\begin{Description}\relax
Obtains parameter covariance matrix, estimated degrees of 
freedom for each parameter and leading diagonal of influence/hat matrix, 
for a penalized regression estimated by \code{magic}.
\end{Description}
\begin{Usage}
\begin{verbatim}
magic.post.proc(X,object,w)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{X}] is the model matrix.
\item[\code{object}] is the list returned by \code{magic} after fitting the 
model with model matrix \code{X}.
\item[\code{w}] is the weight vector used in fitting, or the weight matrix used 
in fitting (i.e. supplied to \code{magic}, if one was.) \code{t(w)\%*\%w} should typically give
the inverse of the covariance matrix of the response data supplied to \code{magic}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{object} contains \code{rV} (\eqn{ {\bf V}}{V}, say), and 
\code{scale} (\eqn{ \phi}{s}, say) which can be 
used to obtain the require quantities as follows. The covariance matrix of 
the parameters is \eqn{ {\bf VV}^\prime \phi}{VV's}. The vector of 
estimated degrees of freedom for each parameter is the leading diagonal of 
\eqn{ {\bf VV}^\prime {\bf X}^\prime {\bf W}^\prime {\bf W}{\bf X}}{VV'X'W'WX} 
where \eqn{\bf{W}}{W} is either the 
weight matrix \code{w} or the matrix \code{diag(w)}. The 
hat/influence  matrix is given by 
\eqn{ {\bf WX}{\bf VV}^\prime {\bf X}^\prime {\bf W}^\prime }{WXVV'X'W'} 
.
\end{Details}
\begin{Value}
A list with three items:
\begin{ldescription}
\item[\code{Vb}] the covariance matrix of the model parameters.
\item[\code{hat}] the leading diagonal of the hat (influence) matrix.
\item[\code{edf}] the array giving the estimated degrees of freedom associated 
with each parameter.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Simon N. Wood \email{simon@stats.gla.ac.uk}
\end{Author}
\begin{SeeAlso}\relax
\code{\Link{magic}}
\end{SeeAlso}

