Learn R Programming

mgcv (version 0.9-6)

magic.post.proc: Auxilliary information from magic fit

Description

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.

Usage

magic.post.proc(X,object,w)

Arguments

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.)

Value

  • A list with three items:
  • Vbthe covariance matrix of the model parameters.
  • hatthe leading diagonal of the hat (influence) matrix.
  • edfthe array giving the estimated degrees of freedom associated with each parameter.

Details

object contains rV (${\bf V}$, say), and scale ($\phi$, say) which can be used to obtain the require quantities as follows. The covariance matrix of the parameters is ${\bf VV}^\prime \phi$. The vector of estimated degrees of freedom for each parameter is the leading diagonal of ${\bf VV}^\prime {\bf X}^\prime {\bf W}^\prime {\bf W}{\bf X}$ where $\bf{W}$ is either the weight matrix w or the matrix diag(w). The hat/influence matrix is given by ${\bf WX}{\bf VV}^\prime {\bf X}^\prime {\bf W}^\prime$ .

See Also

magic