Skip to main content

LogPsplines in JAX

Project description

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:

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

For package use:

python -m pip install LogPSplinePSD

Quick Example

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:

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logpsplinepsd-0.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logpsplinepsd-0.1.0-py3-none-any.whl (136.5 kB view details)

Uploaded Python 3

File details

Details for the file logpsplinepsd-0.1.0.tar.gz.

File metadata

  • Download URL: logpsplinepsd-0.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for logpsplinepsd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8deda6b3606ea4254b16f49c1e3f4e8fef435a0d1b7ef67fb696daf337075ba9
MD5 b152198df372604e6ba8819868ad13ab
BLAKE2b-256 200b5c56f9e54b5853364b61f3f01d6b358824f5cf00e0c18a0015ee86d98164

See more details on using hashes here.

Provenance

The following attestation bundles were made for logpsplinepsd-0.1.0.tar.gz:

Publisher: pypi.yml on nz-gravity/LogPSplinePSD

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file logpsplinepsd-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: logpsplinepsd-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 136.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for logpsplinepsd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14bee41b80fe50f3a3f5f4b843a39774e050fca61bedcd51f9cf0e2f71553b67
MD5 d7fb2cac01d2fdb547138fdfa554eb57
BLAKE2b-256 8453be15f2de76865731aa51d5831c804db07fa9da1d30d899ff5005d951f5b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for logpsplinepsd-0.1.0-py3-none-any.whl:

Publisher: pypi.yml on nz-gravity/LogPSplinePSD

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page