Library: | xplore |
See also: | xdiag diag |
Quantlet: | xdiagp | |
Description: | Calculates the diagonal elements of a projection matrix. |
Usage: | d = xdiagp (x) | |
Input: | ||
x | n x p matrix | |
w | optional, scalar or n x 1 weight vector | |
Output: | ||
d | n x 1 vector of diagonal elements of X(X'WX)^(-1) X' or W'^(1/2)X(X'WX)^(-1) X'W^(1/2) |
library("xplore") n=10 x=(1:n)~matrix(n) xdiagp(x)
Contents of d [ 1,] 0.34545 [ 2,] 0.24848 [ 3,] 0.17576 [ 4,] 0.12727 [ 5,] 0.10303 [ 6,] 0.10303 [ 7,] 0.12727 [ 8,] 0.17576 [ 9,] 0.24848 [10,] 0.34545
Library: | xplore |
See also: | xdiag diag |