wls_hat_matrix: Create the "hat matrix" for weighted least squares regression

View source: R/quadratic_forms.R

wls_hat_matrixR Documentation

Create the "hat matrix" for weighted least squares regression

Description

Create the "hat matrix" for weighted least squares regression

Usage

wls_hat_matrix(X, w)

Arguments

X

Matrix of predictor variables, with n rows

w

Vector of weights (should all be nonnegative), of length n

Value

An n \times n matrix. This is the "hat matrix" for a WLS regression.


bschneidr/svrep documentation built on Feb. 11, 2025, 4:24 a.m.