Skip to main content

sacfpy

sacfpy is a small scientific Python package for reproducing two diagnostics associated with the sample autocorrelation identity discussed by Hassani (2009):

  1. The sum of the sample autocorrelations over all positive lags.
  2. 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 Hassani.SACF 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Hassani.SACF 0.1.0
File Size Uploaded
hassani_sacf-0.1.0.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Hassani.SACF 0.1.0
File Interpreter ABI Platform
hassani_sacf-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / hassani_sacf-0.1.0.tar.gz

Download URL hassani_sacf-0.1.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6361882574ec6e125ef893a0e572b76588681b3d6017e9f6272a7914318b326f
BLAKE2b-256 checksum
How to use checksums
cc188e18a275f30b974e1e7fd592d794ca11320823b22cf653c136409e19b662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.2

Release files / hassani_sacf-0.1.0-py3-none-any.whl

Download URL hassani_sacf-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcd188e6b7e86fd9ebd0cbce5db136b7e65d732dc295db143cd6631906e29771
BLAKE2b-256 checksum
How to use checksums
04a7879436f26d73dec27d453f517bc3f6cdcf9f46f37a314341017601d360e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page