A Tutorial on the SWEEP Operator

James H Goodnight

The American Statistician, Vol. 33, pp. 149-158, 1979


Abstract

The importance of the SWEEP operator in statistical computing is not so much that it is an inversion technique, but rather that it is a conceptual tool for understanding the least squares process. The SWEEP operator can be programmed to produce generalized inverses and create, as by-products, such items as the Forward Doolittle matrix, the Cholesky decomposition matrix, the Hermite canonical form matrix, the determinant of the original matrix, Type I sums of squares, the error sum of squares, a solution to the normal equations, and the general form of estimable functions. First, this tutorial describes the use of Gauss-Jordan elimination for least squares and continues with a description of a completely generalized sweep operator that computes and stores (X'X)-, (X'X)-X'X, (X'X)-X'Y, and Y'Y - Y'X(X'X)-X'Y, all in the space of a single upper triangular matrix.