Python package to perform the statistical sweep operation on symmetric numpy matrices
Project description
Sweepystats
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)
Installation
pip install sweepystats
Documentation
Visit https://biona001.github.io/sweepystats
Features
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
- Stepwise regression
- ANOVA
- ... etc. See the documentation for full list of features
Running tests
- Git clone the repo
- Install
pytestviapip3 install pytestif you haven't already - Execute
pytest testsin the top level directory ofsweepystats
Related packages
- SweepOperator.jl in Julia
- sweep.operator in R
Know another package that supports sweeping? PRs are welcomed!
References
- 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
TODO
- 2-stage and 3-stage least squares
- Weighted least squares
- Partial correlation
- GLMs
- Generalized (pseudo-) inverses
- Cholesky decomposition
- Benchmarks, e.g. timing comparison with
np.inv()andnp.linalg.lstsq() - Recursive tiling, see https://github.com/joshday/SweepOperator.jl/issues/9
- Blog post
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sweepystats-0.0.10.tar.gz.
File metadata
- Download URL: sweepystats-0.0.10.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dacbf62a2ecbb167fae8505d9fe4412be5b668b008870d66b48dceac70f4ff9f
|
|
| MD5 |
caa6b9ac237ca3124a2a02a38353248f
|
|
| BLAKE2b-256 |
b1debc97fb5b3331993a984ecc38f3d6d3b787171d83bfd2736a4ea0febe3aee
|
File details
Details for the file sweepystats-0.0.10-py3-none-any.whl.
File metadata
- Download URL: sweepystats-0.0.10-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0366a5335ab5da0b244afbd5f2594e50f50e38d2bfdb996f879a548664882086
|
|
| MD5 |
7ff01d919064c4ef071da2edd85e876a
|
|
| BLAKE2b-256 |
88768dfd6a4f9fa65af5681f1fabd95c0632e685c83d426cfe182a9ad94cb8b8
|