Metadata-Version: 2.4
Name: tsqn-python
Version: 0.1.0
Summary: Robust time-series estimators based on the Qn scale estimator
Author: Valderio Reisen, Pascal Bondon
Author-email: Higor Cotta <cotta.higor@gmail.com>
Maintainer-email: Higor Cotta <cotta.higor@gmail.com>
License: GPL-2.0-or-later
Project-URL: Homepage, https://github.com/rogih/tsqn-python
Project-URL: Repository, https://github.com/rogih/tsqn-python
Project-URL: Issues, https://github.com/rogih/tsqn-python/issues
Keywords: time-series,robust-statistics,periodogram,long-memory,qn
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: matplotlib>=3.7
Requires-Dist: statsmodels>=0.14
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Dynamic: license-file

# tsqn (Python)

Python port of the original R package `tsqn`, providing robust time-series
estimators based on the Qn scale estimator.

## Features

- Robust covariance and correlation:
  - `covQn`, `corQn`
  - `covMatQn`, `corMatQn`
- Robust autocorrelation/autocovariance:
  - `robacf`
  - `plot_robacf`
- Robust periodograms:
  - `PerQn`
  - `PerioMrob`
- Long-memory estimation:
  - `GPH_estimate`

## Install

```bash
pip install tsqn-python
```

## Quick start

```python
import numpy as np
from tsqn import covQn, corQn, robacf, GPH_estimate

rng = np.random.default_rng(42)
x = rng.normal(size=500)
y = 0.5 * x + rng.normal(size=500)

print(covQn(x, y))
print(corQn(x, y))

acf_out = robacf(np.column_stack([x, y]), lag_max=20, type="correlation", plot=False)
print(acf_out.acf.shape)  # (20, 2, 2)

print(GPH_estimate(x, method="GPH"))
```
