IQSS / Zelig

A statistical framework that serves as a common interface to a large range of models

Home Page:http://zeligproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diagonal of hat matrix

VahidTehrani opened this issue · comments

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!