Metadata-Version: 2.5
Name: sacfpy
Version: 0.1.0
Summary: Sample ACF sum and zero-frequency periodogram diagnostics for time series.
Author: Leila Marvian Mashhad
Requires-Python: >=3.10
Requires-Dist: numpy>=1.26
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# 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

```bash
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:

```powershell
.venv\Scripts\Activate.ps1
```

## Example

```python
from sacfpy import analyze

x = [1, 2, 3, 5, 4, 7]

result = analyze(x)
print(result)
```

Typical output contains:

```text
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

```bash
pytest
```

## Build the package

```bash
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.
