Sweeping

The sweeping transformation of matrices is commonly used to efficiently perform stepwise multiple regression (see Dempster, 1969, Jennrich, 1977) or similar analyses; a modified version of this transformation is also used to compute the g2 generalized inverse. The forward sweeping transformation for a column k can be summarized in the following four steps (where the e's refer to the elements of a symmetric matrix):

1. eij = eij - ejk * ekj / ekk for i¹k, j¹k

2. ekj = ekj / ekk

3. eik = eik / ekk

4. ekk = -1 / ekk

The reverse sweeping operation reverses the changes effected by these transformations. The sweeping operator is used extensively in General Linear Models (GLM), Multiple Regression, and similar modules.