Diagonal of hat matrix
VahidTehrani opened this issue · comments
VahidTehrani commented
It looks something is not right with the calculation of hat matrix.
Qdiag <- lm.influence(lm(y ~ X - 1, weights = W), do.coef = FALSE)$hat / W
as far as I know, the intercept column should be dropped but it looks it is not happening and the sum of elements in the diagonal of hat matrix is equal to the number of features + 1 and I think is wrong. Please check!