sacfpy
sacfpy is a small scientific Python package for reproducing two diagnostics
associated with the sample autocorrelation identity discussed by Hassani (2009):
- The sum of the sample autocorrelations over all positive lags.
- The raw periodogram / sample spectral density at frequency zero.
The implementation uses the same fixed-divisor sample autocovariance convention described in the paper.
Installation for development
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e ".[test]"
On Windows PowerShell, activate the environment with:
.venv\Scripts\Activate.ps1
Example
from sacfpy import analyze
x = [1, 2, 3, 5, 4, 7]
result = analyze(x)
print(result)
Typical output contains:
acf_sum: approximately -0.5
periodogram_zero: approximately 0.0
Main functions
sample_acf(x, max_lag=None)sample_acf_sum(x)periodogram_zero(x)analyze(x)
Run tests
pytest
Build the package
python -m pip install build
python -m build
The wheel and source distribution will be created in dist/.
Reference
Hassani, H. (2009). Sum of the sample autocorrelation function. Random Operators / Stochastic Equations, 17, 125–130.
Metadata
Release files for sacfpy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sacfpy-0.1.0.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sacfpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.3 kB
Release files / sacfpy-0.1.0.tar.gz
| Download URL | sacfpy-0.1.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb9cc1f532f8ec14880a79aad00951cbfa71f3c5d65593a32ae1b45164235b0c
|
|
BLAKE2b-256 checksum How to use checksums |
b11b7cdb2ed37b1ea4cd45ad4e0ace386777a68ca1d0cbbadd7908079ad0e704
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.2
|
Release files / sacfpy-0.1.0-py3-none-any.whl
| Download URL | sacfpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25e7c574b3e9c0ce0fc7001e63ac3b74b5d143a14d3ed895ef5d412706a57d6b
|
|
BLAKE2b-256 checksum How to use checksums |
3de52862bb37d0a329d876f0a93693b18135ffecb5042cd916fe166407e1586d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.2
|