The symmetric sweep operator is a powerful tool in computational statistics with uses in
- (stepwise) linear regression
- conditional multivariate normal distributions
- MANOVA
- and more
Pkg.add("SweepOperator")
sweep!(A, k)
For matrix A
and integer k
, perform the symmetric sweep in place on A
. Only the upper triangle is read and swept. The inverse sweep is performed with sweep!(A, k, true)
.
sweep!(A, range)
Sweep over every index in range
.
Thank you to great notes provided by @Hua-Zhou