Derive the Hat Matrix to map actual response to estimated resposne

102 Views Asked by At

In order to measure the quality of a regression we can calculate the Hat Matrix. Using it we can estimate the response variable as if we used the predictor variables to regress them.

For linear regression we can use $\hat{Y} = X \hat{\beta} = X(X^TX)^{-1}X^TY = P Y $

In order to calculate the Hat Matrix for the Nadaraya-Watson kernel regression regress we used following procedure in the lecture. Each column of the Hat Matrix is the predicted values for predictors x = (1, 2, ... n) and responses y = (0, ... 0, 1, 0, ... 0). Where 1 is at the position of the column index.

I cannot connect these two methods to find the Hat Matrix. Is it correct that the Hat Matrix of the second case corresponds to the Hat Matrix of the first case, if the rows of X are x = (1, 2, ... n) like in the second case?