IQSS / Zelig

A statistical framework that serves as a common interface to a large range of models
http://zeligproject.org
109 stars 43 forks source link

Diagonal of hat matrix #322

Open VahidTehrani opened 6 years ago

VahidTehrani commented 6 years ago

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!