hatMatrix: Function determines the Hat matrix or projection matrix for given X
Description
Function hatMatrix determines the projection matrix for X from the form yhat=Hy. The projection matrix defines the influce of each variable on fitted value
The diagonal elements of the projection matrix are the leverages or influence each sample has on the fitted value for that same observation.
The projection matrix is evaluated with I.I.D assumtion ~N(0, 1)
Usage
hatMatrix(X, covmat = NULL)
Arguments
X
: Input Matrix
covmat
: covariance matrix for error, if the error are correlated for I.I.D covmat will be NULL matrix