Metadata-Version: 2.4
Name: LogPSplinePSD
Version: 0.1.0
Summary: LogPsplines in JAX
Author-email: Avi Vajpeyi <avi.vajpeyi@gmail.com>
Project-URL: Homepage, https://starccato.github.io/log_psplines/
Project-URL: Bug Reports, https://github.com/starccato/log_psplines/issues
Project-URL: Source, https://github.com/starccato/log_psplines/
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: jax
Requires-Dist: optax
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: tqdm
Requires-Dist: numpyro
Requires-Dist: h5py
Requires-Dist: arviz-base[netcdf4,zarr]
Requires-Dist: arviz-stats
Requires-Dist: arviz-plots[matplotlib]
Requires-Dist: xarray[accel,io]
Requires-Dist: click
Requires-Dist: ipywidgets
Requires-Dist: plotly
Requires-Dist: morphz
Requires-Dist: loguru
Requires-Dist: scikit-fda
Provides-Extra: typecheck
Requires-Dist: jaxtyping>=0.2.36; extra == "typecheck"
Requires-Dist: beartype>=0.18.5; extra == "typecheck"
Provides-Extra: dev
Requires-Dist: LogPSplinePSD[typecheck]; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-memray; extra == "dev"
Requires-Dist: pytest-durations; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: jupyter-book<2.0; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: GitPython; extra == "dev"
Requires-Dist: vulture; extra == "dev"
Dynamic: license-file

LogPSplinePSD
=============

``LogPSplinePSD`` estimates power spectral densities (PSDs) with Bayesian
log-P-splines. It supports univariate and multivariate time series, fits smooth
spectral matrices with NumPyro/JAX, and returns ArviZ-compatible
``xarray.DataTree`` outputs for diagnostics and plotting.

Highlights
----------

- Log-domain P-spline models for positive PSDs.
- Multivariate Wishart likelihoods for spectral matrices.
- VI warm starts and factorised multivariate NUTS.
- Optional frequency-domain coarse graining.
- Posterior PSD quantiles, coherence summaries, and diagnostic plots.

Install
-------

For development, use the repository virtual environment:

.. code-block:: bash

   source .venv/bin/activate
   python -m pip install -e '.[dev]'

For package use:

.. code-block:: bash

   python -m pip install LogPSplinePSD

Quick Example
-------------

.. code-block:: python

   from log_psplines.example_datasets.varma_data import VARMAData
   from log_psplines.mcmc import run_mcmc
   from log_psplines.pipeline.config import PipelineConfig

   data = VARMAData(n_samples=256, fs=64.0, seed=7)

   idata = run_mcmc(
       data.ts,
       PipelineConfig(
           n_knots=6,
           n_warmup=50,
           n_samples=100,
           vi_steps=200,
           outdir="runs/varma_quickstart",
       ),
   )

Documentation
-------------

Build the docs locally with:

.. code-block:: bash

   source .venv/bin/activate
   .venv/bin/jupyter-book build docs

The public docs focus on package usage, configuration, outputs, API reference,
and implementation notes. Domain-specific examples are intentionally kept out of
the main docs for now and can be added later as separate studies.

References
----------

Eilers, P. H. C., & Marx, B. D. (1996). *Flexible smoothing with B-splines and
penalties*. Statistical Science, 11(2), 89-121.

Maturana-Russel, J., & Meyer, R. (2021). *P-spline spectral density estimation
with a discrete penalty*. arXiv:1905.01832.
