magic.post.proc {mgcv} | R Documentation |
Obtains parameter covariance matrix, estimated degrees of
freedom for each parameter and leading diagonal of influence/hat matrix,
for a penalized regression estimated by magic
.
magic.post.proc(X,object,w)
X |
is the model matrix. |
object |
is the list returned by magic after fitting the
model with model matrix X . |
w |
is the weight vector used in fitting, or the weight matrix used
in fitting (i.e. supplied to magic , if one was.) t(w)%*%w should typically give
the inverse of the covariance matrix of the response data supplied to magic . |
object
contains rV
(V, say), and
scale
(s, say) which can be
used to obtain the require quantities as follows. The covariance matrix of
the parameters is VV's. The vector of
estimated degrees of freedom for each parameter is the leading diagonal of
VV'X'W'WX
where W is either the
weight matrix w
or the matrix diag(w)
. The
hat/influence matrix is given by
WXVV'X'W'
.
A list with three items:
Vb |
the covariance matrix of the model parameters. |
hat |
the leading diagonal of the hat (influence) matrix. |
edf |
the array giving the estimated degrees of freedom associated with each parameter. |
Simon N. Wood simon@stats.gla.ac.uk