Because Sweepy was taken
Sweepystats is a python package for performing the statistical sweep operation on numpy matrices.
The sweep operator is perhaps the most versatile tool of all statistical operators that not only afford solutions to the normal equation and a gamut of additional statistics, but also allow complete insight into the nature of least squares. Once mastered, the general concepts of the sweep operator allow the whole least squares process to be visualized. -- James H. Goodnight (1979)
Although there are faster and numerically more stable algorithms for inverting a matrix or solving a least-squares problem, no algorithm matches the conceptual simplicity and utility of sweeping. -- Kenneth Lange (2010)
pip install sweepystatsVisit https://biona001.github.io/sweepystats
The following operations are supported in-place and allocation-free:
- Matrix inversions
- Computation of determinants
- Checking of (strict) positive-definiteness
- Computation of matrix rank
- Linear regression (ordinary and weighted least squares)
- Stepwise regression
- ANOVA
- ... etc. See the documentation for full list of features
- Git clone the repo
- Install
pytestviapip3 install pytestif you haven't already - Execute
pytest testsin the top level directory ofsweepystats
- SweepOperator.jl in Julia
- sweep.operator in R
Know another package that supports sweeping? PRs are welcomed!
- Biostats M280 lecture notes at UCLA
- Section 7.4-7.6 of Numerical Analysis for Statisticians by Kenneth Lange (2010). Probably the best place to read about sweep operator.
- Blog post by SAS
- James Goodnight's awesome paper from 1978
- 2-stage and 3-stage least squares
- Partial correlation
- GLMs
- Generalized (pseudo-) inverses
- Cholesky decomposition
- Benchmarks, e.g. timing comparison with
np.inv()andnp.linalg.lstsq() - Recursive tiling, see joshday/SweepOperator.jl#9
- Blog post