powered by
Create the "hat matrix" for weighted least squares regression
wls_hat_matrix(X, w)
An \(n \times n\) matrix. This is the "hat matrix" for a WLS regression.
Matrix of predictor variables, with n rows
n
Vector of weights (should all be nonnegative), of length n